forked from syndiate/Reconstruct-Classic-Watch8-Layout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
watch8reconstruct_1.0.2.1.js
1588 lines (1329 loc) · 136 KB
/
watch8reconstruct_1.0.2.1.js
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
// ==UserScript==
// @name Reconstruct Classic Watch8 YouTube Layout Fixed
// @version 1.0.2.1
// @description A revised and (almost) fixed version of the "simple script that seeks to reconstruct the classic watch7 layout on YouTube." (though it's actually watch8)
// @author syndiate
// @require https://unpkg.com/vue@2.6.12/dist/vue.js
// @require https://unpkg.com/xfetch-js@0.5.0/dist/xfetch.min.js
// @match *://*.youtube.com/*
// @match *://*.youtu.be/*
// @grant GM_addStyle
// @grant GM_getValue
// @grant GM.getValue
// @grant GM.setValue
// @grant GM_setValue
// @grant GM_registerMenuCommand
// @grant unsafeWindow
// @run-at document-start
// @license MIT
// ==/UserScript==
//original script by daylin (aka theundeadwolf0)
function reconstruct() {
try {
// Define watch template (we inject information into this later):
let watchTemplate = [ `<div id="watch-header" class="yt-card yt-card-has-padding">
<div id="watch7-headline" class="clearfix">
<span class="standalone-collection-badge-renderer-text">
<a href="https://www.youtube.com/feed/trending" class=" yt-uix-sessionlink spf-link " id="trending-indicator" data-sessionlink="ei=e408W9SXItaT-gOTs5D4Dg">numberplaceholder on Trending for Gaming</a>
<a href="hashtagoneurlplaceholder" class=" yt-uix-sessionlink " id="hashtag-one" data-url="hashtagoneurlplaceholder" data-sessionlink="ei=cYMsXIz9F5SNkgb1grH4Cg">hashtagoneplaceholder</a>
<a href="hashtagtwourlplaceholder" class=" yt-uix-sessionlink " id="hashtag-two" data-url="hashtagtwourlplaceholder" data-sessionlink="ei=cYMsXIz9F5SNkgb1grH4Cg">hashtagtwoplaceholder</a>
<a href="hashtagthreeurlplaceholder" class=" yt-uix-sessionlink " id="hashtag-three" data-url="hashtagthreeurlplaceholder" data-sessionlink="ei=cYMsXIz9F5SNkgb1grH4Cg">hashtagthreeplaceholder</a>
</span>
<div id="watch-headline-title">
<h1 class="watch-title-container">
<span id="watch-privacy-icon" class="yt-uix-tooltip yt-uix-tooltip-reverse unlisted" title="This video is unlisted. Only those with the link can see it." tabindex="0">
<span class="privacy-icon yt-sprite"></span>
</span>
<span id="eow-title" class="watch-title" dir="ltr" title="videotitleplaceholder">
videotitleplaceholder
</span>
</h1>
</div>
</div>
<div id="watch7-user-header" class=" spf-link "> <a class="yt-user-photo g-hovercard yt-uix-sessionlink spf-link " data-ytid="UC38IQsAvIsxxjztdMZQtwHA" data-sessionlink="itct=CDQQ4TkiEwjbqYnt7c_TAhWE1X4KHRV5BiEo-B0" href="channellinkiniconplaceholder">
<span class="video-thumb yt-thumb yt-thumb-48 g-hovercard" data-ytid="UC38IQsAvIsxxjztdMZQtwHA">
<span class="yt-thumb-square">
<span class="yt-thumb-clip">
<img data-ytimg="1" onload=";window.__ytRIL && __ytRIL(this)" data-thumb="channeliconplaceholder" alt="channelnameplaceholder" id="youtube-channel-icon" width="48" height="48" src="https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif">
<span class="vertical-align"></span>
</span>
</span>
</span>
</a>
<div class="yt-user-info" id="yt-user-info-stuff">
<a class="g-hovercard yt-uix-sessionlink spf-link " data-ytid="UC38IQsAvIsxxjztdMZQtwHA" data-sessionlink="itct=CDQQ4TkiEwjbqYnt7c_TAhWE1X4KHRV5BiEo-B0" id="channel-name-stuff" href="channellinkplaceholder">channelnameplaceholder</a>
<span aria-label="Verified" class="yt-channel-title-icon-verified yt-uix-tooltip yt-sprite" data-tooltip-text="Verified"></span>
</div>
<span id="watch7-subscription-container"><span class=" yt-uix-button-subscription-container"><span class="unsubscribe-confirmation-overlay-container">
<div class="yt-uix-overlay " data-overlay-style="primary" data-overlay-shape="tiny">
<div class="yt-dialog hid ">
<div class="yt-dialog-base">
<span class="yt-dialog-align"></span>
<div class="yt-dialog-fg" role="dialog">
<div class="yt-dialog-fg-content">
<div class="yt-dialog-loading">
<div class="yt-dialog-waiting-content">
<p class="yt-spinner ">
<span class="yt-spinner-img yt-sprite" title="Loading icon"></span>
<span class="yt-spinner-message">
Loading...
</span>
</p>
</div>
</div>
<div class="yt-dialog-content">
<div class="unsubscribe-confirmation-overlay-content-container">
<div class="unsubscribe-confirmation-overlay-content">
<div class="unsubscribe-confirmation-message">
Unsubscribe from RickAstleyVEVO?
</div>
</div>
<div class="yt-uix-overlay-actions">
<button class="yt-uix-button yt-uix-button-size-default yt-uix-button-default yt-uix-overlay-close" type="button" onclick=";return false;"><span class="yt-uix-button-content">Cancel</span></button>
<button class="yt-uix-button yt-uix-button-size-default yt-uix-button-primary overlay-confirmation-unsubscribe-button yt-uix-overlay-close" type="button" onclick=";return false;"><span class="yt-uix-button-content">Unsubscribe</span></button>
</div>
</div>
</div>
<div class="yt-dialog-working">
<div class="yt-dialog-working-overlay"></div>
<div class="yt-dialog-working-bubble">
<div class="yt-dialog-waiting-content">
<p class="yt-spinner ">
<span class="yt-spinner-img yt-sprite" title="Loading icon"></span>
<span class="yt-spinner-message">
Working...
</span>
</p>
</div>
</div>
</div>
</div>
<div class="yt-dialog-focus-trap" tabindex="0"></div>
</div>
</div>
</div>
</div>
</span><button class="yt-uix-button yt-uix-button-size-default yt-uix-button-subscribe-branded yt-uix-button-has-icon no-icon-markup yt-uix-subscription-button yt-can-buffer" type="button" onclick=";return false;" aria-busy="false" aria-live="polite" data-subscribed-timestamp="0" data-show-unsub-confirm-dialog="true" data-clicktracking="itct=CDUQmysiEwjbqYnt7c_TAhWE1X4KHRV5BiEo-B0yBXdhdGNo" data-href="https://accounts.google.com/ServiceLogin?uilel=3&service=youtube&passive=true&hl=en&continue=http%3A%2F%2Fwww.youtube.com%2Fsignin%3Fcontinue_action%3DQUFFLUhqbTA2MXc1eFBLdTE2Z1dSTWROMzJOQW5wQXB2Z3xBQ3Jtc0ttWEdOOEx0QWc0QkZPcjQ4SzRRNVRkMjBKNXo3OXBaNnVkY0YtZUR1SlI0U1BuaFZQQXdmdVN4ZmRuV3BqTHhEUTR6bzdNalF3bDNYRlZxOU9kdHVicTkzb2hELXZrTUVPVGhYd1FKYzFwVkpxWWU3ZzRTOFl3MWVQVENELXdQOUxGX2w4aHA0U3JpcjB2RmwyUDRON3BaempkUTN6Y05feGZ6ZS1IbGtUXzc2Y1NUdi1NS3FSTE51SERaNFBpTlRnaDF4N0dZUXRvaThYc1pCcnAxenRHd19UUXN3%26feature%3Dsubscribe%26app%3Ddesktop%26next%3D%252Fchannel%252FUC38IQsAvIsxxjztdMZQtwHA%26hl%3Den%26action_handle_signin%3Dtrue" data-channel-external-id="UC38IQsAvIsxxjztdMZQtwHA" data-show-unsub-confirm-time-frame="always" data-style-type="branded"><span class="yt-uix-button-content"><span class="subscribe-label" aria-label="Subscribe">Subscribe</span><span class="subscribed-label" aria-label="Unsubscribe">Subscribed</span><span class="unsubscribe-label" aria-label="Unsubscribe">Unsubscribe</span></span></button><button class="yt-uix-button yt-uix-button-size-default yt-uix-button-default yt-uix-button-empty yt-uix-button-has-icon yt-uix-subscription-preferences-button" type="button" onclick=";return false;" aria-role="button" aria-busy="false" aria-label="Subscription preferences" aria-live="polite" data-channel-external-id="UC38IQsAvIsxxjztdMZQtwHA"><span class="yt-uix-button-icon-wrapper"><span class="yt-uix-button-icon yt-uix-button-icon-subscription-preferences yt-sprite"></span></span></button><span class="yt-subscription-button-subscriber-count-branded-horizontal yt-subscriber-count" id="subscriber-watch-count" tabindex="0" title="subscribecountplaceholder" aria-label="subscribecountplaceholder">subscribecountplaceholder</span><span class="yt-subscription-button-subscriber-count-branded-horizontal yt-short-subscriber-count" tabindex="0" title="subscribecountplaceholder" aria-label="subscribecountplaceholder">subscribecountplaceholder</span> <span class="subscription-preferences-overlay-container">
<div class="yt-uix-overlay " data-overlay-style="primary" data-overlay-shape="tiny">
<div class="yt-dialog hid ">
<div class="yt-dialog-base">
<span class="yt-dialog-align"></span>
<div class="yt-dialog-fg" role="dialog">
<div class="yt-dialog-fg-content">
<div class="yt-dialog-loading">
<div class="yt-dialog-waiting-content">
<p class="yt-spinner ">
<span class="yt-spinner-img yt-sprite" title="Loading icon"></span>
<span class="yt-spinner-message">
Loading...
</span>
</p>
</div>
</div>
<div class="yt-dialog-content">
<div class="subscription-preferences-overlay-content-container">
<div class="subscription-preferences-overlay-loading ">
<p class="yt-spinner ">
<span class="yt-spinner-img yt-sprite" title="Loading icon"></span>
<span class="yt-spinner-message">
Loading...
</span>
</p>
</div>
<div class="subscription-preferences-overlay-content">
</div>
</div>
</div>
<div class="yt-dialog-working">
<div class="yt-dialog-working-overlay"></div>
<div class="yt-dialog-working-bubble">
<div class="yt-dialog-waiting-content">
<p class="yt-spinner ">
<span class="yt-spinner-img yt-sprite" title="Loading icon"></span>
<span class="yt-spinner-message">
Working...
</span>
</p>
</div>
</div>
</div>
</div>
<div class="yt-dialog-focus-trap" tabindex="0"></div>
</div>
</div>
</div>
</div>
</span>
</span></span></div>
<div id="watch8-action-buttons" class="watch-action-buttons clearfix"><div id="watch8-secondary-actions" class="watch-secondary-actions yt-uix-button-group" data-button-toggle-group="optional"> <span class="yt-uix-clickcard">
<button class="yt-uix-button yt-uix-button-size-default yt-uix-button-opacity yt-uix-button-has-icon no-icon-markup yt-uix-clickcard-target addto-button pause-resume-autoplay yt-uix-tooltip" type="button" onclick=";return false;" title="Add to" data-position="bottomleft" data-orientation="vertical"><span class="yt-uix-button-content">Add to</span></button>
<div class="signin-clickcard yt-uix-clickcard-content">
<h3 class="signin-clickcard-header">Want to watch this again later?</h3>
<div class="signin-clickcard-message">
Sign in to add this video to a playlist.
</div>
<a href="https://accounts.google.com/ServiceLogin?uilel=3&service=youtube&passive=true&hl=en&continue=https%3A%2F%2Fwww.youtube.com%2Fsignin%3Faction_handle_signin%3Dtrue%26feature%3D__FEATURE__%26app%3Ddesktop%26hl%3Den%26next%3D%252Fwatch%253Fv%253DdQw4w9WgXcQ" class="yt-uix-button signin-button yt-uix-sessionlink yt-uix-button-primary yt-uix-button-size-default" data-sessionlink="ei=CsYHWdv8MISr-wOV8pmIAg"><span class="yt-uix-button-content">Sign in</span></a>
</div>
</span>
<button class="yt-uix-button yt-uix-button-size-default yt-uix-button-opacity yt-uix-button-has-icon no-icon-markup pause-resume-autoplay action-panel-trigger action-panel-trigger-share yt-uix-tooltip" type="button" onclick=";return false;" title="Share
" data-trigger-for="action-panel-share" data-button-toggle="true"><span class="yt-uix-button-content">Share
</span></button>
<div class="yt-uix-menu "> <button class="yt-uix-button yt-uix-button-size-default yt-uix-button-opacity yt-uix-button-has-icon no-icon-markup pause-resume-autoplay yt-uix-menu-trigger yt-uix-tooltip" type="button" onclick=";return false;" role="button" aria-pressed="false" aria-label="Action menu." title="More actions" id="action-panel-overflow-button" aria-haspopup="true"><span class="yt-uix-button-content">More</span></button>
<div class="yt-uix-menu-content yt-ui-menu-content yt-uix-menu-content-hidden" role="menu"><ul id="action-panel-overflow-menu"> <li>
<span class="yt-uix-clickcard" data-card-class="report-card">
<button type="button" class="yt-ui-menu-item has-icon action-panel-trigger action-panel-trigger-report report-button yt-uix-clickcard-target" data-position="topright" data-orientation="horizontal">
<span class="yt-ui-menu-item-label">Report</span>
</button>
<div class="signin-clickcard yt-uix-clickcard-content">
<h3 class="signin-clickcard-header">Need to report the video?</h3>
<div class="signin-clickcard-message">
Sign in to report inappropriate content.
</div>
<a href="https://accounts.google.com/ServiceLogin?uilel=3&service=youtube&passive=true&hl=en&continue=https%3A%2F%2Fwww.youtube.com%2Fsignin%3Faction_handle_signin%3Dtrue%26feature%3D__FEATURE__%26app%3Ddesktop%26hl%3Den%26next%3D%252Fwatch%253Fv%253DdQw4w9WgXcQ" class="yt-uix-button signin-button yt-uix-sessionlink yt-uix-button-primary yt-uix-button-size-default" data-sessionlink="ei=CsYHWdv8MISr-wOV8pmIAg"><span class="yt-uix-button-content">Sign in</span></a>
</div>
</span>
</li>
<li>
<button type="button" class="yt-ui-menu-item has-icon yt-uix-menu-close-on-select action-panel-trigger action-panel-trigger-stats" data-trigger-for="action-panel-stats">
<span class="yt-ui-menu-item-label">Statistics</span>
</button>
</li>
<a href="https://www.youtube.com/timedtext_video?bl=watch&v=dQw4w9WgXcQ&ref=wt&auto=yes" class="yt-ui-menu-item has-icon action-panel-trigger-translate" rel="nofollow">
<span class="yt-ui-menu-item-label">Add translations</span>
</a>
</ul></div></div></div><div id="watch8-sentiment-actions"><div id="watch7-views-info"><div class="watch-view-count">viewcountplaceholder</div>
<div class="video-extras-sparkbars">
<div class="video-extras-sparkbar-likes" style="width: 0%"></div>
<div class="video-extras-sparkbar-dislikes" style="width: 100%"></div>
</div>
</div>
<span class="like-button-renderer " data-button-toggle-group="optional">
<span class="yt-uix-clickcard">
<button class="yt-uix-button yt-uix-button-size-default yt-uix-button-opacity yt-uix-button-has-icon no-icon-markup like-button-renderer-like-button like-button-renderer-like-button-unclicked yt-uix-clickcard-target yt-uix-tooltip" type="button" onclick=";return false;" aria-label="like this video along with 1,924,213 other people" title="I like this" data-position="bottomright" data-force-position="true" data-orientation="vertical"><span class="yt-uix-button-content" id="like-count">likecountplaceholder</span></button>
<div class="signin-clickcard yt-uix-clickcard-content">
<h3 class="signin-clickcard-header">Like this video?</h3>
<div class="signin-clickcard-message">
Sign in to make your opinion count.
</div>
<a href="https://accounts.google.com/ServiceLogin?uilel=3&service=youtube&passive=true&hl=en&continue=https%3A%2F%2Fwww.youtube.com%2Fsignin%3Faction_handle_signin%3Dtrue%26feature%3D__FEATURE__%26app%3Ddesktop%26hl%3Den%26next%3D%252Fwatch%253Fv%253DdQw4w9WgXcQ" class="yt-uix-button signin-button yt-uix-sessionlink yt-uix-button-primary yt-uix-button-size-default" data-sessionlink="ei=CsYHWdv8MISr-wOV8pmIAg"><span class="yt-uix-button-content">Sign in</span></a>
</div>
</span>
<span class="yt-uix-clickcard">
<button class="yt-uix-button yt-uix-button-size-default yt-uix-button-opacity yt-uix-button-has-icon no-icon-markup like-button-renderer-like-button like-button-renderer-like-button-clicked yt-uix-button-toggled hid yt-uix-tooltip" type="button" onclick=";return false;" aria-label="like this video along with 1,924,213 other people" title="Unlike" data-position="bottomright" data-force-position="true" data-orientation="vertical"><span class="yt-uix-button-content">1,924,214</span></button>
</span>
<span class="yt-uix-clickcard">
<button class="yt-uix-button yt-uix-button-size-default yt-uix-button-opacity yt-uix-button-has-icon no-icon-markup like-button-renderer-dislike-button like-button-renderer-dislike-button-unclicked yt-uix-clickcard-target yt-uix-tooltip" type="button" onclick=";return false;" aria-label="dislike this video along with 92,738 other people" title="I dislike this" data-position="bottomright" data-force-position="true" data-orientation="vertical"><span class="yt-uix-button-content" id="dislike-count">dislikecountplaceholder</span></button>
<div class="signin-clickcard yt-uix-clickcard-content">
<h3 class="signin-clickcard-header">Don't like this video?</h3>
<div class="signin-clickcard-message">
Sign in to make your opinion count.
</div>
<a href="https://accounts.google.com/ServiceLogin?uilel=3&service=youtube&passive=true&hl=en&continue=https%3A%2F%2Fwww.youtube.com%2Fsignin%3Faction_handle_signin%3Dtrue%26feature%3D__FEATURE__%26app%3Ddesktop%26hl%3Den%26next%3D%252Fwatch%253Fv%253DdQw4w9WgXcQ" class="yt-uix-button signin-button yt-uix-sessionlink yt-uix-button-primary yt-uix-button-size-default" data-sessionlink="ei=CsYHWdv8MISr-wOV8pmIAg"><span class="yt-uix-button-content">Sign in</span></a>
</div>
</span>
<span class="yt-uix-clickcard">
<button class="yt-uix-button yt-uix-button-size-default yt-uix-button-opacity yt-uix-button-has-icon no-icon-markup like-button-renderer-dislike-button like-button-renderer-dislike-button-clicked yt-uix-button-toggled hid yt-uix-tooltip" type="button" onclick=";return false;" aria-label="dislike this video along with 92,738 other people" title="I dislike this" data-position="bottomright" data-force-position="true" data-orientation="vertical"><span class="yt-uix-button-content">92,739</span></button>
</span>
</span>
</div></div>
</div>`, /* --------DESCRIPTION BOX------- */
`<div id="action-panel-details" class="action-panel-content yt-uix-expander yt-card yt-card-has-padding yt-uix-expander-collapsed"><div id="watch-description" class="yt-uix-button-panel"><div id="watch-description-content"><div id="watch-description-clip"><div id="watch-uploader-info"><strong class="watch-time-text">uploadtype uploaddateplaceholder</strong></div><div id="watch-description-text" class=""><p id="eow-description" class="">descriptionplaceholder</p></div> <div id="watch-description-extras">
<ul class="watch-extras-section">
<li class="watch-meta-item yt-uix-expander-body">
<h4 class="title">
Category
</h4>
<ul class="content watch-info-tag-list">
<li><a class="g-hovercard yt-uix-sessionlink spf-link " data-ytid="UC-9-kyTW8ZkZNDHQJ6FgpwQ" data-sessionlink="ei=CsYHWdv8MISr-wOV8pmIAg" href="categorylinkplaceholder">categorynameplaceholder</a></li>
</ul>
</li>
<li class="watch-meta-item yt-uix-expander-body">
<h4 class="title">
License
</h4>
<ul class="content watch-info-tag-list">
<li>licenseplaceholder</li>
</ul>
</li>
</ul>
</div>
</div></div></div> <button class="yt-uix-button yt-uix-button-size-default yt-uix-button-expander yt-uix-expander-head yt-uix-expander-collapsed-body yt-uix-gen204" type="button" onclick=";return false;" data-gen204="feature=watch-show-more-metadata"><span class="yt-uix-button-content">Show more</span></button>
<button class="yt-uix-button yt-uix-button-size-default yt-uix-button-expander yt-uix-expander-head yt-uix-expander-body" type="button" onclick=";return false;"><span class="yt-uix-button-content">Show less</span></button>
</div>`];
//Inject template
function injectTemplate() {
document.getElementById("clarify-box").outerHTML = document.getElementById("clarify-box").outerHTML + watchTemplate[0];
document.getElementById("watch-header").outerHTML = document.getElementById("watch-header").outerHTML + watchTemplate[1];
injectInfo();
}
var checkExist = setInterval(function() {
if (document.getElementById('owner-sub-count')) {
clearInterval(checkExist);
injectTemplate();
}
}, 400);
function injectInfo() {
// For some reason, this doesn't work correctly if only ran once, hence the loop.
var i;
for (i = 0; i < 1; i++) {
document.getElementById("watch-header").innerHTML = document.getElementById("watch-header").innerHTML.replace("viewcountplaceholder", document.getElementsByClassName("view-count style-scope ytd-video-view-count-renderer")[0].innerHTML); // viewcount
document.getElementById("watch-header").innerHTML = document.getElementById("watch-header").innerHTML.replace("videotitleplaceholder", document.getElementsByClassName('title style-scope ytd-video-primary-info-renderer')[0].innerText ); // video name
document.getElementById("eow-title").innerHTML = document.getElementById("eow-title").innerHTML.replace("videotitleplaceholder", document.getElementsByClassName('title style-scope ytd-video-primary-info-renderer')[0].innerText); //title fix
document.getElementById("action-panel-details").innerHTML = document.getElementById("action-panel-details").innerHTML.replace("uploaddateplaceholder", document.querySelector('#info-text #info-strings yt-formatted-string').innerHTML); //publication date
if (window.location.href.search("youtube.com/watch?") != "-1") {
document.getElementById("channel-name-stuff").innerHTML = document.getElementById("channel-name-stuff").innerHTML.replace("channelnameplaceholder", document.getElementsByClassName("style-scope ytd-video-owner-renderer")[2].children[0].children[0].children[0].children[0].children[0].innerHTML); //channel name
}
document.getElementById("subscriber-watch-count").innerHTML = document.getElementById("subscriber-watch-count").innerHTML.replace("subscribecountplaceholder", document.getElementById("owner-sub-count").innerHTML.replace(" subscribers", "")); //subscriber count
document.getElementById("action-panel-details").innerHTML = document.getElementById("action-panel-details").innerHTML.replace("descriptionplaceholder", document.getElementsByClassName("content style-scope ytd-video-secondary-info-renderer")[0].innerHTML); //description
document.getElementById("eow-description").innerHTML = document.getElementById("eow-description").innerHTML.replace(new RegExp('\r?\n','g'), '<br />'); //description fix
if (document.getElementById("menu-container").children[0].children[0].children[0].children[0].children[0].children[1].ariaLabel == undefined) {
document.getElementById("like-count").innerHTML = document.getElementById("like-count").innerHTML.replace("likecountplaceholder", "");
document.getElementById("dislike-count").innerHTML = document.getElementById("dislike-count").innerHTML.replace("dislikecountplaceholder", "");
} else {
document.getElementById("like-count").innerHTML = document.getElementById("like-count").innerHTML.replace("likecountplaceholder", document.getElementById("menu-container").children[0].children[0].children[0].children[0].children[0].children[1].ariaLabel.replace(" likes", "")); //like count
document.getElementById("dislike-count").innerHTML = document.getElementById("dislike-count").innerHTML.replace("dislikecountplaceholder", document.getElementById("menu-container").children[0].children[0].children[0].children[1].children[0].children[1].ariaLabel.replace(" dislikes", "")); //dislike count
}
// minor i18n fixes
document.getElementById("subscriber-watch-count").innerHTML = document.getElementById("subscriber-watch-count").innerHTML.replace("1 subscriber", "1"); // subscriber count
document.getElementById("subscriber-watch-count").innerHTML = document.getElementById("subscriber-watch-count").innerHTML.replace("No subscribers", "0");
document.getElementById("like-count").innerHTML = document.getElementById("like-count").innerHTML.replace("1 like", "1");
document.getElementById("like-count").innerHTML = document.getElementById("like-count").innerHTML.replace("No", "0");
document.getElementById("dislike-count").innerHTML = document.getElementById("dislike-count").innerHTML.replace("1 dislike", "1");
document.getElementById("dislike-count").innerHTML = document.getElementById("dislike-count").innerHTML.replace("No", "0");
var uploadType;
// description box
if (document.querySelector('#info-text #info-strings yt-formatted-string').innerHTML.search("Premiered ") != "-1") {
if (document.querySelector('#info-text #info-strings yt-formatted-string').innerHTML.search(" hours ago") != "-1") {
uploadType = "7";
} else if (document.querySelector('#info-text #info-strings yt-formatted-string').innerHTML.search(" minutes ago") != "-1") {
uploadType = "7";
} else {
uploadType = "2";
}
} else if (document.querySelector('#info-text #info-strings yt-formatted-string').innerHTML.search("Started streaming") != "-1") {
if (document.querySelector('#info-text #info-strings yt-formatted-string').innerHTML.search("minutes ago") != "-1") {
uploadType = "6";
} else if (document.querySelector('#info-text #info-strings yt-formatted-string').innerHTML.search("hours ago") != "-1") {
uploadType = "6";
} else {
uploadType = "3";
}
} else if (document.querySelector('#info-text #info-strings yt-formatted-string').innerHTML.search("Streamed live on") != "-1") {
uploadType = "4";
} else if (document.getElementById("info-contents").children[0].children[0].children[4].children[0] != undefined) {
uploadType = "5";
} else if (document.querySelector('#info-text #info-strings yt-formatted-string').innerHTML.search("Scheduled for") != "-1") {
uploadType = "8";
} else {
uploadType = "0";
}
if (uploadType == "2") {
document.getElementById("action-panel-details").innerHTML = document.getElementById("action-panel-details").innerHTML.replace("uploadtype", "Premiered on "); // upload type
document.getElementById("action-panel-details").innerHTML = document.getElementById("action-panel-details").innerHTML.replace("uploaddateplaceholder", document.querySelector('#info-text #info-strings yt-formatted-string').innerHTML.replace("Premiered ", ""));
}
if (uploadType == "0") {
document.getElementById("action-panel-details").innerHTML = document.getElementById("action-panel-details").innerHTML.replace("uploaddateplaceholder", document.querySelector('#info-text #info-strings yt-formatted-string').innerHTML); // upload date
document.getElementById("action-panel-details").innerHTML = document.getElementById("action-panel-details").innerHTML.replace("uploadtype", "Published on "); // upload type
}
if (uploadType == "3") {
document.getElementById("action-panel-details").innerHTML = document.getElementById("action-panel-details").innerHTML.replace("uploaddateplaceholder", document.querySelector('#info-text #info-strings yt-formatted-string').innerHTML.replace("Started streaming ", "")); // upload date
document.getElementById("action-panel-details").innerHTML = document.getElementById("action-panel-details").innerHTML.replace("uploadtype", "Started streaming on "); // upload type
}
if (uploadType == "4") {
document.getElementById("action-panel-details").innerHTML = document.getElementById("action-panel-details").innerHTML.replace("uploaddateplaceholder", document.querySelector('#info-text #info-strings yt-formatted-string').innerHTML.replace("Streamed live on ", "")); // upload date
document.getElementById("action-panel-details").innerHTML = document.getElementById("action-panel-details").innerHTML.replace("uploadtype", "Streamed live on "); // upload type
}
if (uploadType == "5") {
document.getElementById("action-panel-details").innerHTML = document.getElementById("action-panel-details").innerHTML.replace("uploaddateplaceholder", document.querySelector('#info-text #info-strings yt-formatted-string').innerHTML); // upload date
document.getElementById("action-panel-details").innerHTML = document.getElementById("action-panel-details").innerHTML.replace("uploadtype", "Uploaded on "); // upload type
}
if (uploadType == "6") {
document.getElementById("action-panel-details").innerHTML = document.getElementById("action-panel-details").innerHTML.replace("uploaddateplaceholder", document.querySelector('#info-text #info-strings yt-formatted-string').innerHTML.replace("Started streaming ", "")); // upload date
document.getElementById("action-panel-details").innerHTML = document.getElementById("action-panel-details").innerHTML.replace("uploadtype", "Started streaming "); // upload type
}
if (uploadType == "7") {
document.getElementById("action-panel-details").innerHTML = document.getElementById("action-panel-details").innerHTML.replace("uploaddateplaceholder", document.querySelector('#info-text #info-strings yt-formatted-string').innerHTML.replace("Premiered ", "")); // upload date
document.getElementById("action-panel-details").innerHTML = document.getElementById("action-panel-details").innerHTML.replace("uploadtype", "Premiered "); // upload type
}
if (uploadType == "8") {
document.getElementById("action-panel-details").innerHTML = document.getElementById("action-panel-details").innerHTML.replace("uploaddateplaceholder", document.querySelector('#info-text #info-strings yt-formatted-string').innerHTML.replace("Scheduled for ", "")); // upload date
document.getElementById("action-panel-details").innerHTML = document.getElementById("action-panel-details").innerHTML.replace("uploadtype", "Scheduled for "); // upload type
}
if (document.getElementsByClassName("watch-time-text")[0].innerHTML.search("Uploaded on Streamed live") != "-1") {
document.getElementsByClassName("watch-time-text")[0].innerHTML = document.getElementsByClassName("watch-time-text")[0].innerHTML.replace("Uploaded on Streamed live", "Streamed live ");
}
if (document.getElementsByClassName("watch-time-text")[0].innerHTML.search("Uploaded on Started streaming") != "-1") {
document.getElementsByClassName("watch-time-text")[0].innerHTML = document.getElementsByClassName("watch-time-text")[0].innerHTML.replace("Uploaded on Started streaming", "Started streaming ");
}
if (document.getElementsByClassName("watch-time-text")[0].innerHTML.search("Uploaded on Streamed live on") != "-1") {
document.getElementsByClassName("watch-time-text")[0].innerHTML = document.getElementsByClassName("watch-time-text")[0].innerHTML.replace("Uploaded on Streamed live on", "Streamed live on ");
}
}
if (document.getElementById("subscriber-watch-count").innerHTML == "<!--css-build:shady-->") {
document.getElementById("subscriber-watch-count").remove();
document.getElementsByClassName("yt-subscription-button-subscriber-count-branded-horizontal yt-short-subscriber-count")[0].remove();
}
//var corejs = document.createElement("script");
//corejs.src = "https://s.ytimg.com/yts/jsbin/www-core-vflsvjhLF/www-core.js";
//document.getElementById("watch-header").appendChild(corejs);
var trending;
// trending indicator
if (document.getElementsByClassName("super-title style-scope ytd-video-primary-info-renderer")[0].innerHTML.search("ON TRENDING") != "-1") {
trending = "1";
} else {
trending = "0";
}
if (trending == "1") {
document.getElementById("trending-indicator").innerHTML = document.getElementById("trending-indicator").innerHTML.replace("numberplaceholder", document.getElementsByClassName("super-title style-scope ytd-video-primary-info-renderer")[0].children[0].innerHTML.replace(" ON TRENDING", "")); //trending thingy
document.getElementById("trending-indicator").innerHTML = document.getElementById("trending-indicator").innerHTML.replace(" for Gaming", ""); //gaming removal
document.getElementById("hashtag-one").remove(); //remove the first hashtag, since trending overrides hashtags showing
document.getElementById("hashtag-two").remove(); //remove second hashtag
document.getElementById("hashtag-three").remove(); //remove third hashtag
if (document.getElementById("trending-indicator").innerHTML.search("FOR GAMING") != "-1") {
document.getElementById("trending-indicator").innerHTML = document.getElementById("trending-indicator").innerHTML.replace(" FOR GAMING", "");
document.getElementById("trending-indicator").innerHTML += " for Gaming";
document.getElementById("trending-indicator").setAttribute("href", "https://www.youtube.com/gaming");
}
}
if (trending == "0") {
document.getElementById("trending-indicator").remove();
// this adds or removes hashtags depending on whether they exist or not
if (document.getElementsByClassName("super-title style-scope ytd-video-primary-info-renderer")[0].innerHTML.search("/hashtag/") == "-1") {
document.getElementById("hashtag-one").remove(); //remove first hashtag
document.getElementById("hashtag-two").remove(); //remove second hashtag
document.getElementById("hashtag-three").remove(); //remove third hashtag
} else {
document.getElementById("hashtag-one").innerHTML = document.getElementById("hashtag-one").innerHTML.replace("hashtagoneplaceholder", document.getElementsByClassName("super-title style-scope ytd-video-primary-info-renderer")[0].children[0].innerHTML);
document.getElementById("hashtag-one").setAttribute("href", document.getElementsByClassName("super-title style-scope ytd-video-primary-info-renderer")[0].children[0].getAttribute("href"));
if (document.getElementsByClassName("super-title style-scope ytd-video-primary-info-renderer")[0].children[2] == undefined) {
document.getElementById("hashtag-two").remove();
} else {
document.getElementById("hashtag-two").innerHTML = document.getElementById("hashtag-two").innerHTML.replace("hashtagtwoplaceholder", document.getElementsByClassName("super-title style-scope ytd-video-primary-info-renderer")[0].children[2].innerHTML);
document.getElementById("hashtag-two").setAttribute("href", document.getElementsByClassName("super-title style-scope ytd-video-primary-info-renderer")[0].children[2].getAttribute("href"));
}
if (document.getElementsByClassName("super-title style-scope ytd-video-primary-info-renderer")[0].children[4] == undefined) {
document.getElementById("hashtag-three").remove();
} else {
document.getElementById("hashtag-three").innerHTML = document.getElementById("hashtag-three").innerHTML.replace("hashtagthreeplaceholder", document.getElementsByClassName("super-title style-scope ytd-video-primary-info-renderer")[0].children[4].innerHTML);
document.getElementById("hashtag-three").setAttribute("href", document.getElementsByClassName("super-title style-scope ytd-video-primary-info-renderer")[0].children[4].getAttribute("href"));
}
}
}
// Remove verification icon if the channel isn't verified
if (document.getElementsByClassName("style-scope ytd-video-owner-renderer")[3].children[1].getAttribute("hidden") == "") {
document.getElementsByClassName("yt-user-info")[0].children[1].outerHTML = "";
}
// Calculate likebar ratio
if (document.getElementById("menu-container").children[0].children[0].children[0].children[0].children[0].children[1].ariaLabel == undefined) {
document.getElementsByClassName("video-extras-sparkbars")[0].remove();
} else {
document.getElementsByClassName("video-extras-sparkbar-likes")[0].setAttribute("style", document.getElementById("like-bar").getAttribute("style"));
document.getElementsByClassName("video-extras-sparkbar-dislikes")[0].setAttribute("style", ("width: " + (100 - document.getElementById("like-bar").getAttribute("style").replace("width: ", "").replace("%;", "")) + "%;"));
}
// For some reason, the channel icon fails to load unless it is first loaded on the new layout; wait for that
var ceci = setInterval(function() {
if (document.querySelector("ytd-video-owner-renderer.ytd-video-secondary-info-renderer > a:nth-child(1) > yt-img-shadow:nth-child(1) > img:nth-child(1)").src) {
clearInterval(ceci);
loadChannelIcon();
}
}, 100);
var ceci2 = setInterval(function() {
if (document.getElementsByClassName("style-scope ytd-video-owner-renderer")[2].children[0].children[0].children[0].children[0].children[0].getAttribute("href")) {
clearInterval(ceci2);
loadChannelLinkOnName();
}
}, 100);
function doNothing() {}
function getLikeButtonStatus() {
if (document.getElementById("menu-container").children[0].children[0].children[0].children[0].getAttribute("class").search("style-default-active") == -1) {
document.getElementsByClassName("like-button-renderer-like-button")[0].setAttribute("class", (document.getElementsByClassName("like-button-renderer-like-button")[0].getAttribute("class").replace("yt-uix-button-toggled", "")))
} else {
document.getElementsByClassName("like-button-renderer-like-button")[0].setAttribute("class", (document.getElementsByClassName("like-button-renderer-like-button")[0].getAttribute("class") + " yt-uix-button-toggled"))
}
if (document.getElementById("menu-container").children[0].children[0].children[0].children[1].getAttribute("class").search("style-default-active") == -1) {
document.getElementsByClassName("like-button-renderer-dislike-button")[0].setAttribute("class", (document.getElementsByClassName("like-button-renderer-dislike-button")[0].getAttribute("class").replace("yt-uix-button-toggled", "")))
} else {
document.getElementsByClassName("like-button-renderer-dislike-button")[0].setAttribute("class", (document.getElementsByClassName("like-button-renderer-dislike-button")[0].getAttribute("class") + " yt-uix-button-toggled"))
}
}
function loadChannelIcon() {
console.log("Called loadChannelIcon()");
document.getElementById("youtube-channel-icon").setAttribute("src", document.querySelector("ytd-video-owner-renderer.ytd-video-secondary-info-renderer > a:nth-child(1) > yt-img-shadow:nth-child(1) > img:nth-child(1)").src);
document.getElementsByClassName("yt-user-photo g-hovercard yt-uix-sessionlink spf-link ")[0].setAttribute("href", document.querySelector("ytd-video-owner-renderer.ytd-video-secondary-info-renderer > a:nth-child(1)").href);
}
function loadChannelLinkOnName() {
document.getElementById("channel-name-stuff").setAttribute("href", document.getElementsByClassName("style-scope ytd-video-owner-renderer")[2].children[0].children[0].children[0].children[0].children[0].getAttribute("href"));
}
// Get subscribe status
function getButtonStatus() {
// subscribe button
if (document.getElementsByClassName("style-scope ytd-subscribe-button-renderer")[0].getAttribute("subscribed") == "") {
document.getElementsByClassName("yt-uix-button-subscription-container")[0].children[1].setAttribute("class", document.getElementsByClassName("yt-uix-button-subscription-container")[0].children[1].getAttribute("class").replace("yt-uix-button-subscribe-branded", "yt-uix-button-subscribed-branded"));
}
if (document.getElementsByClassName("style-scope ytd-subscribe-button-renderer")[0].children[0].innerText.toLowerCase() == "subscribe") {
document.getElementsByClassName("yt-uix-button-subscription-container")[0].children[1].setAttribute("class", document.getElementsByClassName("yt-uix-button-subscription-container")[0].children[1].getAttribute("class").replace("yt-uix-button-subscribed-branded", "yt-uix-button-subscribe-branded"));
}
// like buttons
getLikeButtonStatus();
}
getButtonStatus();
window.setInterval(function() {
getButtonStatus();
}, 5);
function getLikeButtonCountAfterButtonClick() {
if (document.querySelector('#info-text #info-strings yt-formatted-string').innerHTML.search("Started streaming") == "-1") {
document.getElementById("like-count").innerHTML = document.getElementById("menu-container").children[0].children[0].children[0].children[0].children[0].children[1].ariaLabel.replace(" likes", "");
document.getElementById("like-count").innerHTML = document.getElementById("like-count").innerHTML.replace("1 like", "1");
} else {
document.getElementById("like-count").innerHTML = document.getElementById("menu-container").children[0].children[0].children[0].children[0].children[0].children[1].innerHTML;
}
}
function getDislikeButtonCountAfterButtonClick() {
if (document.querySelector('#info-text #info-strings yt-formatted-string').innerHTML.search("Started streaming") == "-1") {
document.getElementById("dislike-count").innerHTML = document.getElementById("menu-container").children[0].children[0].children[0].children[1].children[0].children[1].ariaLabel.replace(" dislikes", "");
document.getElementById("dislike-count").innerHTML = document.getElementById("dislike-count").innerHTML.replace("1 dislike", "1");
} else {
document.getElementById("dislike-count").inenrHTML = document.getElementById("menu-container").children[0].children[0].children[0].children[1].children[0].children[1].innerHTML;
}
}
// Working buttons
document.getElementsByClassName("yt-uix-subscription-button")[0].onclick = function() {
document.getElementsByClassName("yt-uix-subscription-button")[0].blur();
document.getElementsByClassName("ytd-subscribe-button-renderer")[0].click();
}
document.getElementsByClassName("like-button-renderer-like-button")[0].onclick = function() {
document.getElementsByClassName("like-button-renderer-like-button")[0].blur();
document.getElementById("menu-container").children[0].children[0].children[0].children[0].click();
getLikeButtonStatus();
getLikeButtonCountAfterButtonClick();
}
document.getElementsByClassName("like-button-renderer-dislike-button")[0].onclick = function() {
document.getElementsByClassName("like-button-renderer-dislike-button")[0].blur();
document.getElementById("menu-container").children[0].children[0].children[0].children[1].click();
getLikeButtonStatus();
getDislikeButtonCountAfterButtonClick();
}
document.getElementsByClassName("addto-button")[0].onclick = function() {
document.getElementsByClassName("addto-button")[0].blur();
for (var k = 0; k < document.getElementById("menu-container").querySelector("div#top-level-buttons-computed.top-level-buttons").children.length; k++) {
if (document.getElementById("menu-container").children[0].children[0].children[0].children[k].innerText == "Save") {
document.getElementById("menu-container").children[0].children[0].children[0].children[k].click();
break;
}
}
}
document.getElementsByClassName("action-panel-trigger-share")[0].onclick = function() {
if (document.getElementsByClassName("action-panel-trigger-share")[0].getAttribute("class").search("yt-uix-menu-trigger-selected yt-uix-button-toggled") == "-1") {
document.getElementsByClassName("action-panel-trigger-share")[0].blur();
document.getElementsByClassName("action-panel-trigger-share")[0].setAttribute("class", document.getElementsByClassName("action-panel-trigger-share")[0].getAttribute("class") + " yt-uix-menu-trigger-selected yt-uix-button-toggled")
let shareBox = [ `<div id="watch-action-panels" class="watch-action-panels yt-uix-button-panel yt-card yt-card-has-padding">
<div id="action-panel-share" class="action-panel-content" data-panel-loaded="true">
<div id="watch-actions-share-loading">
<div class="share-panel">
<div class="yt-uix-tabs"> <span class="yt-uix-button-group" data-button-toggle-group="share-panels"><button class="yt-uix-button yt-uix-button-size-default yt-uix-button-text share-panel-services yt-uix-button-toggled yt-card-title" type="button" onclick=";return false;" data-button-toggle="true"><span class="yt-uix-button-content">Share</span></button><button class="yt-uix-button yt-uix-button-size-default yt-uix-button-text share-panel-embed yt-card-title" type="button" onclick=";return false;" data-button-toggle="true"><span class="yt-uix-button-content">Embed</span></button><button class="yt-uix-button yt-uix-button-size-default yt-uix-button-text share-panel-email yt-card-title" type="button" onclick=";return false;" data-button-toggle="true"><span class="yt-uix-button-content">Email</span></button> </span>
</div>
<div class="share-panel-show-loading hid">
<p class="yt-spinner "> <span class="yt-spinner-img yt-sprite" title="Loading icon"></span> <span class="yt-spinner-message">Loading... </span> </p>
</div>
<div class="share-panel-services-container">
<div id="share-services-container" class="clearfix">
<div class="share-panel-services ">
<ul class="share-group ytg-box">
<li> <button title="Share to Facebook. Opens in a new window." data-toolttip-text="Share to Facebook. Opens in a new window." onclick="yt.window.popup(" http:="" www.facebook.com="" dialog="" share?app_id="87741124305\\&href=https%3A//www.youtube.com/watch%3Fv%3DnchHcCWWtkk%26feature%3Dshare\\&display=popup\\&redirect_uri=https://www.youtube.com/facebook_redirect" ",="" {\'height\':="" 560,\'width\':="" 530,\'scrollbars\':="" true});yt.net.ping.send("="" sharing_services?relative_url="%2Fwatch%3Fv%3DnchHcCWWtkk%26feature%3Dshare\\&v=nchHcCWWtkk\\&name=FACEBOOK\\&share_source=watch\\&id=10\\&feature=share\\&vertical=1" ");return="" false;"="" data-service-name="FACEBOOK" class="yt-uix-tooltip share-service-button share-facebook-icon" data-tooltip-text="Share to Facebook. Opens in a new window." aria-labelledby="yt-uix-tooltip58-arialabel"> <span class="share-service-icon share-service-icon-facebook yt-sprite"></span> <span class="share-service-checkmark yt-sprite"></span> </button> </li>
<li> <button title="Share to Twitter. Opens in a new window." data-toolttip-text="Share to Twitter. Opens in a new window." onclick="yt.window.popup(" http:="" twitter.com="" intent="" tweet?url="https%3A//youtu.be/nchHcCWWtkk\\&text=Olympic%20athletes%20return%20to%20Canada\\&via=YouTube\\&related=YouTube,YouTubeTrends,YTCreators" ",="" {\'height\':="" 420,\'width\':="" 550,\'scrollbars\':="" true});yt.net.ping.send("="" sharing_services?relative_url="%2Fwatch%3Fv%3DnchHcCWWtkk%26feature%3Dshare\\&v=nchHcCWWtkk\\&name=TWITTER\\&share_source=watch\\&id=31\\&feature=share\\&vertical=1" ");return="" false;"="" data-service-name="TWITTER" class="yt-uix-tooltip share-service-button share-twitter-icon" data-tooltip-text="Share to Twitter. Opens in a new window." aria-labelledby="yt-uix-tooltip57-arialabel"> <span class="share-service-icon share-service-icon-twitter yt-sprite"></span> <span class="share-service-checkmark yt-sprite"></span> </button> </li>
<li> <button title="Share to Google+. Opens in a new window." data-toolttip-text="Share to Google+. Opens in a new window." onclick="yt.window.popup(" https:="" plus.google.com="" share?url="https%3A//www.youtube.com/watch%3Fv%3DnchHcCWWtkk%26feature%3Dshare\\&source=yt\\&hl=en\\&soc-platform=1\\&soc-app=130" ",="" {\'height\':="" 620,\'width\':="" 400,\'scrollbars\':="" true});yt.net.ping.send("="" sharing_services?relative_url="%2Fwatch%3Fv%3DnchHcCWWtkk%26feature%3Dshare\\&v=nchHcCWWtkk\\&name=GOOGLEPLUS\\&share_source=watch\\&id=43\\&feature=share\\&vertical=1" ");return="" false;"="" data-service-name="GOOGLEPLUS" class="yt-uix-tooltip share-service-button share-googleplus-icon" data-tooltip-text="Share to Google+. Opens in a new window." aria-labelledby="yt-uix-tooltip56-arialabel"> <span class="share-service-icon share-service-icon-googleplus yt-sprite"></span> <span class="share-service-checkmark yt-sprite"></span> </button> </li>
<li> <button title="Share to Blogger. Opens in a new window." data-toolttip-text="Share to Blogger. Opens in a new window." onclick="yt.window.popup(" http:="" www.blogger.com="" blog-this.g?n="Olympic%20athletes%20return%20to%20Canada\\&source=youtube\\&b=%3Ciframe%20width%3D%22480%22%20height%3D%22270%22%20src%3D%22https%3A//www.youtube.com/embed/nchHcCWWtkk%22%20frameborder%3D%220%22%20allowfullscreen%3E%3C/iframe%3E\\&eurl=https%3A//i.ytimg.com/vi/nchHcCWWtkk/hqdefault.jpg" ",="" {\'height\':="" 468,\'width\':="" 768,\'scrollbars\':="" true});yt.net.ping.send("="" sharing_services?relative_url="%2Fwatch%3Fv%3DnchHcCWWtkk%26feature%3Dshare\\&v=nchHcCWWtkk\\&name=BLOGGER\\&share_source=watch\\&id=34\\&feature=share\\&vertical=1" ");return="" false;"="" data-service-name="BLOGGER" class="yt-uix-tooltip share-service-button share-blogger-icon" data-tooltip-text="Share to Blogger. Opens in a new window." aria-labelledby="yt-uix-tooltip55-arialabel"> <span class="share-service-icon share-service-icon-blogger yt-sprite"></span> <span class="share-service-checkmark yt-sprite"></span> </button> </li>
<li> <button title="Share to reddit. Opens in a new window." data-toolttip-text="Share to reddit. Opens in a new window." onclick="yt.window.popup(" http:="" reddit.com="" submit?url="https%3A//www.youtube.com/watch%3Fv%3DnchHcCWWtkk%26feature%3Dshare\\&title=Olympic%20athletes%20return%20to%20Canada" ",="" {\'height\':="" 650,\'width\':="" 1024,\'scrollbars\':="" true});yt.net.ping.send("="" sharing_services?relative_url="%2Fwatch%3Fv%3DnchHcCWWtkk%26feature%3Dshare\\&v=nchHcCWWtkk\\&name=REDDIT\\&share_source=watch\\&id=4\\&feature=share\\&vertical=1" ");return="" false;"="" data-service-name="REDDIT" class="yt-uix-tooltip share-service-button share-reddit-icon" data-tooltip-text="Share to reddit. Opens in a new window." aria-labelledby="yt-uix-tooltip54-arialabel"> <span class="share-service-icon share-service-icon-reddit yt-sprite"></span> <span class="share-service-checkmark yt-sprite"></span> </button> </li>
<li> <button title="Share to Tumblr. Opens in a new window." data-toolttip-text="Share to Tumblr. Opens in a new window." onclick="yt.window.popup(" http:="" www.tumblr.com="" share="" video?embed="https%3A//www.youtube.com/watch%3Fv%3DnchHcCWWtkk%26feature%3Dshare\\&caption=Olympic%20athletes%20return%20to%20Canada" ",="" {\'height\':="" 650,\'width\':="" 1024,\'scrollbars\':="" true});yt.net.ping.send("="" sharing_services?relative_url="%2Fwatch%3Fv%3DnchHcCWWtkk%26feature%3Dshare\\&v=nchHcCWWtkk\\&name=TUMBLR\\&share_source=watch\\&id=40\\&feature=share\\&vertical=1" ");return="" false;"="" data-service-name="TUMBLR" class="yt-uix-tooltip share-service-button share-tumblr-icon" data-tooltip-text="Share to Tumblr. Opens in a new window." aria-labelledby="yt-uix-tooltip53-arialabel"> <span class="share-service-icon share-service-icon-tumblr yt-sprite"></span> <span class="share-service-checkmark yt-sprite"></span> </button> </li>
<li> <button title="Share to Pinterest. Opens in a new window." data-toolttip-text="Share to Pinterest. Opens in a new window." onclick="yt.window.popup(" http:="" pinterest.com="" pin="" create="" button="" ?url="https%3A//www.youtube.com/watch%3Fv%3DnchHcCWWtkk%26feature%3Dshare\\&description=Olympic%20athletes%20return%20to%20Canada\\&is_video=true\\&media=https%3A//i.ytimg.com/vi/nchHcCWWtkk/hqdefault.jpg" ",="" {\'height\':="" 650,\'width\':="" 1024,\'scrollbars\':="" true});yt.net.ping.send("="" sharing_services?relative_url="%2Fwatch%3Fv%3DnchHcCWWtkk%26feature%3Dshare\\&v=nchHcCWWtkk\\&name=PINTEREST\\&share_source=watch\\&id=45\\&feature=share\\&vertical=1" ");return="" false;"="" data-service-name="PINTEREST" class="yt-uix-tooltip share-service-button share-pinterest-icon" data-tooltip-text="Share to Pinterest. Opens in a new window." aria-labelledby="yt-uix-tooltip52-arialabel"> <span class="share-service-icon share-service-icon-pinterest yt-sprite"></span> <span class="share-service-checkmark yt-sprite"></span> </button> </li>
<li> <button title="Share to ВКонтакте. Opens in a new window." data-toolttip-text="Share to ВКонтакте. Opens in a new window." onclick="yt.window.popup(" http:="" vkontakte.ru="" share.php?url="https%3A//www.youtube.com/watch%3Fv%3DnchHcCWWtkk%26feature%3Dshare" ",="" {\'height\':="" 650,\'width\':="" 1024,\'scrollbars\':="" true});yt.net.ping.send("="" sharing_services?relative_url="%2Fwatch%3Fv%3DnchHcCWWtkk%26feature%3Dshare\\&v=nchHcCWWtkk\\&name=VKONTAKTE\\&share_source=watch\\&id=36\\&feature=share\\&vertical=1" ");return="" false;"="" data-service-name="VKONTAKTE" class="yt-uix-tooltip share-service-button share-vkontakte-icon" data-tooltip-text="Share to ВКонтакте. Opens in a new window." aria-labelledby="yt-uix-tooltip51-arialabel"> <span class="share-service-icon share-service-icon-vkontakte yt-sprite"></span> <span class="share-service-checkmark yt-sprite"></span> </button> </li>
<li> <button title="Share to LinkedIn. Opens in a new window." data-toolttip-text="Share to LinkedIn. Opens in a new window." onclick="yt.window.popup(" http:="" www.linkedin.com="" sharearticle?url="https%3A//www.youtube.com/watch%3Fv%3DnchHcCWWtkk%26feature%3Dshare\\&title=Olympic%20athletes%20return%20to%20Canada\\&summary=Canada%27s%20Olympians%20were%20met%20by%20media%20and%20fans%20when%20they%20stepped%20into%20the%20arrivals%20hall%20at%20Toronto%27s%20Pearson%20airport%2C%20after%20a%20long%20flight%20from%20Rio.%20%0AClick%20here%20for%20the%20full%20story%3A%20http%3A//www.cbc.ca/news/canada/olympic-team-arrives-1.3731883%0A%C2%BB%C2%BB%C2%BB%20Subscribe%20to%20The%20National%20to%20watch%20more%20videos%20here%3A%20%20%20https%3A//www.youtube.com/user/CBCTheNational%3Fsub_...\\&source=Youtube" ",="" {\'height\':="" 650,\'width\':="" 1024,\'scrollbars\':="" true});yt.net.ping.send("="" sharing_services?relative_url="%2Fwatch%3Fv%3DnchHcCWWtkk%26feature%3Dshare\\&v=nchHcCWWtkk\\&name=LINKEDIN\\&share_source=watch\\&id=42\\&feature=share\\&vertical=1" ");return="" false;"="" data-service-name="LINKEDIN" class="yt-uix-tooltip share-service-button share-linkedin-icon" data-tooltip-text="Share to LinkedIn. Opens in a new window." aria-labelledby="yt-uix-tooltip47-arialabel"> <span class="share-service-icon share-service-icon-linkedin yt-sprite"></span> <span class="share-service-checkmark yt-sprite"></span> </button> </li>
<li> <button title="Share to StumbleUpon. Opens in a new window." data-toolttip-text="Share to StumbleUpon. Opens in a new window." onclick="yt.window.popup(" http:="" www.stumbleupon.com="" submit?url="https%3A//www.youtube.com/watch%3Fv%3DnchHcCWWtkk%26feature%3Dshare\\&title=Olympic%20athletes%20return%20to%20Canada" ",="" {\'height\':="" 650,\'width\':="" 1024,\'scrollbars\':="" true});yt.net.ping.send("="" sharing_services?relative_url="%2Fwatch%3Fv%3DnchHcCWWtkk%26feature%3Dshare\\&v=nchHcCWWtkk\\&name=STUMBLEUPON\\&share_source=watch\\&id=5\\&feature=share\\&vertical=1" ");return="" false;"="" data-service-name="STUMBLEUPON" class="yt-uix-tooltip share-service-button share-stumbleupon-icon" data-tooltip-text="Share to StumbleUpon. Opens in a new window." aria-labelledby="yt-uix-tooltip46-arialabel"> <span class="share-service-icon share-service-icon-stumbleupon yt-sprite"></span> <span class="share-service-checkmark yt-sprite"></span> </button> </li>
<li> <button title="Share to Одноклассники. Opens in a new window." data-toolttip-text="Share to Одноклассники. Opens in a new window." onclick="yt.window.popup(" http:="" www.odnoklassniki.ru="" dk?st.cmd="addShare\\&st.noresize=on\\&st._surl=https%3A//www.youtube.com/watch%3Fv%3DnchHcCWWtkk%26feature%3Dshare" ",="" {\'height\':="" 650,\'width\':="" 1024,\'scrollbars\':="" true});yt.net.ping.send("="" sharing_services?relative_url="%2Fwatch%3Fv%3DnchHcCWWtkk%26feature%3Dshare\\&v=nchHcCWWtkk\\&name=ODNOKLASSNIKI\\&share_source=watch\\&id=39\\&feature=share\\&vertical=1" ");return="" false;"="" data-service-name="ODNOKLASSNIKI" class="yt-uix-tooltip share-service-button share-odnoklassniki-icon" data-tooltip-text="Share to Одноклассники. Opens in a new window." aria-labelledby="yt-uix-tooltip50-arialabel"> <span class="share-service-icon share-service-icon-odnoklassniki yt-sprite"></span> <span class="share-service-checkmark yt-sprite"></span> </button> </li>
<li> <button title="Share to LiveJournal. Opens in a new window." data-toolttip-text="Share to LiveJournal. Opens in a new window." onclick="yt.window.popup(" http:="" www.livejournal.com="" update.bml?url="https%3A//www.youtube.com/watch%3Fv%3DnchHcCWWtkk%26feature%3Dshare\\&subject=Olympic%20athletes%20return%20to%20Canada" ",="" {\'height\':="" 650,\'width\':="" 1024,\'scrollbars\':="" true});yt.net.ping.send("="" sharing_services?relative_url="%2Fwatch%3Fv%3DnchHcCWWtkk%26feature%3Dshare\\&v=nchHcCWWtkk\\&name=LIVEJOURNAL\\&share_source=watch\\&id=38\\&feature=share\\&vertical=1" ");return="" false;"="" data-service-name="LIVEJOURNAL" class="yt-uix-tooltip share-service-button share-livejournal-icon" data-tooltip-text="Share to LiveJournal. Opens in a new window." aria-labelledby="yt-uix-tooltip49-arialabel"> <span class="share-service-icon share-service-icon-livejournal yt-sprite"></span> <span class="share-service-checkmark yt-sprite"></span> </button> </li>
<li> <button title="Share to Digg. Opens in a new window." data-toolttip-text="Share to Digg. Opens in a new window." onclick="yt.window.popup(" http:="" digg.com="" submit?url="https%3A//www.youtube.com/watch%3Fv%3DnchHcCWWtkk%26feature%3Dshare" ",="" {\'height\':="" 650,\'width\':="" 1024,\'scrollbars\':="" true});yt.net.ping.send("="" sharing_services?relative_url="%2Fwatch%3Fv%3DnchHcCWWtkk%26feature%3Dshare\\&v=nchHcCWWtkk\\&name=DIGG\\&share_source=watch\\&id=1\\&feature=share\\&vertical=1" ");return="" false;"="" data-service-name="DIGG" class="yt-uix-tooltip share-service-button share-digg-icon" data-tooltip-text="Share to Digg. Opens in a new window." aria-labelledby="yt-uix-tooltip48-arialabel"> <span class="share-service-icon share-service-icon-digg yt-sprite"></span> <span class="share-service-checkmark yt-sprite"></span> </button> </li>
</ul>
</div>
</div>
<div class="share-panel-url-container share-panel-reverse"> <span class="share-panel-url-input-container yt-uix-form-input-container yt-uix-form-input-text-container yt-uix-form-input-non-empty"><input class="yt-uix-form-input-text share-panel-url" name="share_url" value="https://youtu.be/videoidplaceholder" data-video-id="videoidplaceholder" title="Share link"></span> <span class="share-panel-start-at-container "> <label> <span class="yt-uix-form-input-checkbox-container"> <input class="share-panel-start-at" type="checkbox"> <span class="yt-uix-form-input-checkbox-element"></span> </span>Start at: </label> <input type="text" value="0:00" title="Video start time" class="yt-uix-form-input-text share-panel-start-at-time"> </span>
</div>
</div>
<div class="share-panel-embed-container hid">
<div class="action-panel-loading">Loading... </div>
</div>
<div class="share-panel-email-container hid" data-disabled="true"> <strong><a href="https://accounts.google.com\/ServiceLogin?uilel=3\&hl=en\&passive=true\&service=youtube\&continue=http%3A%2F%2Fwww.youtube.com%2Fsignin%3Ffeature%3Demail%26hl%3Den%26next%3Dhttps%253A%252F%252Fwww.youtube.com%252Fwatch%253Fv%253DnchHcCWWtkk%2526feature%253Dshare_email%26action_handle_signin%3Dtrue%26app%3Ddesktop">Sign in</a> now!</strong> </div>
</div>
</div>
<div id="watch-actions-share-panel"></div>
</div>
<div id="action-panel-transcript" class="action-panel-content hid">
<div id="watch-actions-transcript-loading">
<div class="action-panel-loading">
<p class="yt-spinner ">
<span title="Loading icon" class="yt-spinner-img yt-sprite"></span>
<span class="yt-spinner-message">
Loading...
</span>
</p>
</div>
</div>
<div id="watch-actions-transcript" class="hid">
<h2 class="yt-card-title">
Transcript
</h2>
<div id="caption-line-template" class="hid">
<!--
<div class="caption-line-time">
<div class="caption-line-start">__start__</div>
</div>
<div class="editable-line-text">
<span class="editable-line-text-original">__original__</span>
<label class="editable-line-text-current hid">__current__</label>
<textarea class="editable-line-text-input hid">__input__</textarea>
</div>
-->
</div>
<div id="watch-transcript-container" class="yt-scrollbar">
<div id="watch-transcript-not-found" class="hid">
The interactive transcript could not be loaded.
</div>
</div>
</div>
</div>
<div id="action-panel-stats" class="action-panel-content hid">
<div class="action-panel-loading">
<p class="yt-spinner ">
<span title="Loading icon" class="yt-spinner-img yt-sprite"></span>
<span class="yt-spinner-message">
Loading...
</span>
</p>
</div>
</div>
<div id="action-panel-report" class="action-panel-content hid" data-auth-required="true">
<div class="action-panel-loading">
<p class="yt-spinner ">
<span title="Loading icon" class="yt-spinner-img yt-sprite"></span>
<span class="yt-spinner-message">
Loading...
</span>
</p>
</div>
</div>
<div id="action-panel-rental-required" class="action-panel-content hid">
<div id="watch-actions-rental-required">
<strong>Rating is available when the video has been rented.</strong>
</div>
</div>
<div id="action-panel-error" class="action-panel-content hid">
<div class="action-panel-error">
This feature is not available right now. Please try again later.
</div>
</div>
<button class="yt-uix-button yt-uix-button-size-default yt-uix-button-default yt-uix-button-empty yt-uix-button-has-icon no-icon-markup yt-uix-button-opacity yt-uix-close" type="button" onclick=";return false;" aria-label="Close" id="action-panel-dismiss" data-close-parent-id="watch8-action-panels"></button>
</div>` ];
var descriptionelement = document.getElementById("action-panel-details");
descriptionelement.insertAdjacentHTML('beforebegin', shareBox);
var locationhref = location.href;
document.getElementsByClassName("share-panel-services-container")[0].innerHTML = document.getElementsByClassName("share-panel-services-container")[0].innerHTML.replace("videoidplaceholder", locationhref.replace("https://www.youtube.com/watch?v=", ""))
document.getElementsByClassName("share-group ytg-box")[0].children[0].children[0].onclick = function() {
var facebookshare = "http://www.facebook.com/dialog/share?app_id=87741124305&href=https%3A//www.youtube.com/watch%3Fv%3Dvideoidplaceholder%26feature%3Dshare&display=popup&redirect_uri=https://www.youtube.com/facebook_redirect";
var facebooksharefix = facebookshare.replace("videoidplaceholder", locationhref.replace("https://www.youtube.com/watch?v=", ""));
var facebookpopup = window.open(facebooksharefix, "_blank");
facebookpopup.focus();
}
document.getElementsByClassName("share-group ytg-box")[0].children[1].children[0].onclick = function() {
var twittershare = "http://twitter.com/intent/tweet?url=https%3A//youtu.be/videoidplaceholder&text=titleplaceholder&via=YouTube&related=YouTube,YouTubeTrends,YTCreators";
var twittersharefix = twittershare.replace("videoidplaceholder", locationhref.replace("https://www.youtube.com/watch?v=", ""));
var twittersharefixtwo = twittersharefix.replace("titleplaceholder", document.getElementById("eow-title").innerText);
var twittersharepopup = window.open(twittersharefixtwo, "_blank");
twittersharepopup.focus();
}
document.getElementsByClassName("share-group ytg-box")[0].children[2].children[0].onclick = function() {
var googleplusshare = "https://plus.google.com/share?url=https%3A//www.youtube.com/watch%3Fv%3Dvideoidplaceholder%26feature%3Dshare&source=yt&hl=en&soc-platform=1&soc-app=130";
var googleplussharefix = googleplusshare.replace("videoidplaceholder", locationhref.replace("https://www.youtube.com/watch?v=", ""));
var googlepluspopup = window.open(googleplussharefix, "_blank");
googlepluspopup.focus();
}
document.getElementsByClassName("share-group ytg-box")[0].children[3].children[0].onclick = function() {
var bloggershare = "http://www.blogger.com/blog-this.g?n=titleplaceholder&source=youtube&b=%3Ciframe%20width%3D%22480%22%20height%3D%22270%22%20src%3D%22https%3A//www.youtube.com/embed/videoidplaceholder%22%20frameborder%3D%220%22%20allowfullscreen%3E%3C/iframe%3E&eurl=https%3A//i.ytimg.com/vi/videothumbnailidplaceholder/hqdefault.jpg";
var bloggersharefix = bloggershare.replace("videoidplaceholder", locationhref.replace("https://www.youtube.com/watch?v=", ""));
var bloggersharefixtwo = bloggersharefix.replace("videothumbnailidplaceholder", locationhref.replace("https://www.youtube.com/watch?v=", ""));
var bloggersharefixthree = bloggersharefixtwo.replace("titleplaceholder", document.getElementById("eow-title").innerText);
var bloggerpopup = window.open(bloggersharefixthree, "_blank");
bloggerpopup.focus();
}
document.getElementsByClassName("share-group ytg-box")[0].children[4].children[0].onclick = function() {
var redditshare = "http://reddit.com/submit?url=https%3A//www.youtube.com/watch%3Fv%3Dvideoidplaceholder%26feature%3Dshare&title=titleplaceholder";
var redditsharefix = redditshare.replace("videoidplaceholder", locationhref.replace("https://www.youtube.com/watch?v=", ""));
var redditsharefixtwo = redditsharefix.replace("titleplaceholder", document.getElementById("eow-title").innerText);
var redditpopup = window.open(redditsharefixtwo, "_blank");
redditpopup.focus();
}
document.getElementsByClassName("share-group ytg-box")[0].children[5].children[0].onclick = function() {
var tumblrshare = "http://www.tumblr.com/share/video?embed=https%3A//www.youtube.com/watch%3Fv%3Dvideoidplaceholder%26feature%3Dshare&caption=titleplaceholder";
var tumblrsharefix = tumblrshare.replace("videoidplaceholder", locationhref.replace("https://www.youtube.com/watch?v=", ""));
var tumblrsharefixtwo = tumblrsharefix.replace("titleplaceholder", document.getElementById("eow-title").innerText);
var tumblrpopup = window.open(tumblrsharefixtwo, "_blank");
tumblrpopup.focus();
}
document.getElementsByClassName("share-group ytg-box")[0].children[6].children[0].onclick = function() {
var pinterestshare = "http://pinterest.com/pin/create/button/?url=https%3A//www.youtube.com/watch%3Fv%3Dvideoidplaceholder%26feature%3Dshare&description=titleplaceholder&is_video=true&media=https%3A//i.ytimg.com/vi/videothumbnailidplaceholder/hqdefault.jpg";
var pinterestsharefix = pinterestshare.replace("videoidplaceholder", locationhref.replace("https://www.youtube.com/watch?v=", ""));
var pinterestsharefixtwo = pinterestsharefix.replace("titleplaceholder", document.getElementById("eow-title").innerText);
var pinterestsharefixthree = pinterestsharefixtwo.replace("videothumbnailidplaceholder", locationhref.replace("https://www.youtube.com/watch?v=", ""));
var pinterestpopup = window.open(pinterestsharefixthree, "_blank");
pinterestpopup.focus();
}
document.getElementsByClassName("share-group ytg-box")[0].children[7].children[0].onclick = function() {
var vkontakteshare = "http://vkontakte.ru/share.php?url=https%3A//www.youtube.com/watch%3Fv%3Dvideoidplaceholder%26feature%3Dshare";
var vkontaktesharefix = vkontakteshare.replace("videoidplaceholder", locationhref.replace("https://www.youtube.com/watch?v=", ""));
var vkontaktesharepopup = window.open(vkontakteshare, "_blank");
vkontaktesharepopup.focus();
}
document.getElementsByClassName("share-group ytg-box")[0].children[8].children[0].onclick = function() {
var linkedinshare = "http://www.linkedin.com/shareArticle?url=https%3A//www.youtube.com/watch%3Fv%3Dvideoidplaceholder%26feature%3Dshare&title=titleplaceholder&summary=descriptionplaceholder&source=Youtube";
var linkedinsharefix = linkedinshare.replace("videoidplaceholder", locationhref.replace("https://www.youtube.com/watch?v=", ""));
var linkedinsharefixtwo = linkedinsharefix.replace("titleplaceholder", document.getElementById("eow-title").innerText);
var linkedinsharefixthree = linkedinsharefixtwo.replace("descriptionplaceholder", document.getElementById("eow-description").innerText);
var linkedinpopup = window.open(linkedinsharefixthree, "_blank");
linkedinpopup.focus();
}
document.getElementsByClassName("share-group ytg-box")[0].children[9].children[0].onclick = function() {
var stumbleupon = "http://www.stumbleupon.com/submit?url=https%3A//www.youtube.com/watch%3Fv%3Dvideoidplaceholder%26feature%3Dshare&title=titleplaceholder";
var stumbleuponfix = stumbleupon.replace("videoidplaceholder", locationhref.replace("https://www.youtube.com/watch?v=", ""));
var stumbleuponfixtwo = stumbleuponfix.replace("titleplaceholder", document.getElementById("eow-title").innerText);
var stumbleuponpopup = window.open(stumbleuponfixtwo, "_blank");
stumbleuponpopup.focus();
}
document.getElementsByClassName("share-group ytg-box")[0].children[10].children[0].onclick = function() {
var russianplatformthatnooneevenknowsorcaresabout = "http://www.odnoklassniki.ru/dk?st.cmd=addShare&st.noresize=on&st._surl=https%3A//www.youtube.com/watch%3Fv%3Dvideoidplaceholder%26feature%3Dshare";
var russianplatformthatnooneevenknowsorcaresaboutfix = russianplatformthatnooneevenknowsorcaresabout.replace("videoidplaceholder", locationhref.replace("https://www.youtube.com/watch?v=", ""));
var russianplatformthatnooneevenknowsorcaresaboutpopup = window.open(russianplatformthatnooneevenknowsorcaresaboutfix, "_blank");
russianplatformthatnooneevenknowsorcaresaboutpopup.focus();
}
document.getElementsByClassName("share-group ytg-box")[0].children[11].children[0].onclick = function() {
var livejournalshare = "http://www.livejournal.com/update.bml?url=https%3A//www.youtube.com/watch%3Fv%3Dvideoidplaceholder%26feature%3Dshare&subject=titleplaceholder";
var livejournalsharefix = livejournalshare.replace("videoidplaceholder", locationhref.replace("https://www.youtube.com/watch?v=", ""));
var livejournalsharefixtwo = livejournalsharefix.replace("titleplaceholder", document.getElementById("eow-title").innerText);
var livejournalpopup = window.open(livejournalsharefixtwo, "_blank");
livejournalpopup.focus();
}
document.getElementsByClassName("share-group ytg-box")[0].children[12].children[0].onclick = function() {
var diggshare = "http://digg.com/submit?url=https%3A//www.youtube.com/watch%3Fv%3Dvideoidplaceholder%26feature%3Dshare";
var diggsharefix = diggshare.replace("videoidplaceholder", locationhref.replace("https://www.youtube.com/watch?v=", ""));
var diggsharepopup = window.open(diggsharefix, "_blank");
diggsharepopup.focus();
}
document.getElementById("action-panel-dismiss").onclick = function() {
document.getElementById("action-panel-dismiss").blur();
document.getElementsByClassName("action-panel-trigger-share")[0].setAttribute("class", document.getElementsByClassName("action-panel-trigger-share")[0].getAttribute("class").replace(" yt-uix-menu-trigger-selected yt-uix-button-toggled"))
document.getElementById("watch-action-panels").remove();
}
document.getElementById("watch-actions-share-loading").children[0].children[0].children[0].children[1].onclick = function() {
if (document.getElementById("watch-actions-share-loading").children[0].children[0].children[0].children[1].getAttribute("class").search("yt-uix-button-toggled") == "-1") {
document.getElementById("watch-actions-share-loading").children[0].children[0].children[0].children[1].blur();
document.getElementById("watch-action-panels").remove();
let shareBoxEmbed = [ `<div id="watch-action-panels" class="watch-action-panels yt-uix-button-panel yt-card yt-card-has-padding">
<div id="action-panel-share" class="action-panel-content" data-panel-loaded="true">
<div id="watch-actions-share-loading">
<div class="share-panel">
<div class="yt-uix-tabs"> <span class="yt-uix-button-group" data-button-toggle-group="share-panels"><button class="yt-uix-button yt-uix-button-size-default yt-uix-button-text share-panel-services yt-card-title" type="button" onclick=";return false;" data-button-toggle="true"><span class="yt-uix-button-content">Share</span></button><button class="yt-uix-button yt-uix-button-size-default yt-uix-button-text share-panel-embed yt-uix-button-toggled yt-card-title" type="button" onclick=";return false;" data-button-toggle="true"><span class="yt-uix-button-content">Embed</span></button><button class="yt-uix-button yt-uix-button-size-default yt-uix-button-text share-panel-email yt-card-title" type="button" onclick=";return false;" data-button-toggle="true"><span class="yt-uix-button-content">Email</span></button> </span>
</div>
<div class="share-panel-show-loading hid">
<p class="yt-spinner "> <span class="yt-spinner-img yt-sprite" title="Loading icon"></span> <span class="yt-spinner-message">Loading... </span> </p>
</div>
<div class="yt-uix-expander" tabindex="0"> <span class=" yt-uix-form-input-container yt-uix-form-input-text-container "><input class="yt-uix-form-input-text share-embed-code" title="Embed code" dir="ltr"></span>
<div class="yt-uix-expander-body">
<div id="share-preview" class="share-embed-options"> <span>Preview:</span>
<div id="video-preview"></div>
<iframe src="https://www.youtube.com/embed/videoidplaceholder" allowfullscreen="" width="__width__" height="__height__" frameborder="0"></iframe>
</div>
<div class="share-embed-options"> <label for="embed-layout-options">Video size:</label> <span class="yt-uix-form-input-select "><span class="yt-uix-form-input-select-content"><span class="yt-uix-form-input-select-arrow yt-sprite"></span><span class="yt-uix-form-input-select-value"></span></span><select class="yt-uix-form-input-select-element " id="embed-layout-options"> <option value="default" data-width="560" data-height="315">560 × 315</option> <option value="hd720" data-width="1280" data-height="720">1280 × 720</option> <option value="large" data-width="853" data-height="480">853 × 480</option> <option value="medium" data-width="640" data-height="360">640 × 360</option> <option value="custom">Custom size</option></select></span> <span id="share-embed-customize" class="hid"> <input type="text" class="yt-uix-form-input-text share-embed-size-custom-width" maxlength="4"> × <input type="text" class="yt-uix-form-input-text share-embed-size-custom-height" maxlength="4"> </span> </div>
<ul class="share-embed-options">
<li> <label> <input type="checkbox" class="share-embed-option" name="show-related" checked="">Show suggested videos when the video finishes </label> </li>
<li> <label> <input type="checkbox" class="share-embed-option" name="show-controls" checked="">Show player controls </label> </li>
<li> <label> <input type="checkbox" class="share-embed-option" name="show-info" checked="">Show video title and player actions </label> </li>
<li> <label> <input type="checkbox" class="share-embed-option" name="delayed-cookies">Enable privacy-enhanced mode [<a href="http://www.google.com/support/youtube/bin/answer.py?answer=171780&expand=PrivacyEnhancedMode#privacy" target="_blank">?</a>] </label> </li>
<li>
<p class="share-panel-embed-legal">By displaying YouTube videos on your site, you are agreeing to the <a href="https://developers.google.com/youtube/terms">YouTube API terms of service.</a></p>
</li>
</ul>
</div> <button class="yt-uix-button yt-uix-button-size-default yt-uix-button-expander yt-uix-expander-head yt-uix-expander-collapsed-body yt-uix-gen204" type="button" onclick=";return false;"><span class="yt-uix-button-content">Show more</span></button> <button class="yt-uix-button yt-uix-button-size-default yt-uix-button-expander yt-uix-expander-head yt-uix-expander-body" type="button" onclick=";return false;"><span class="yt-uix-button-content">Show less</span></button> </div>
</div></div></div></div>`];
var videoid = locationhref.replace("https://www.youtube.com/watch?v=", "");
descriptionelement.insertAdjacentHTML('beforebegin', shareBoxEmbed);
document.getElementsByTagName("iframe")[0].setAttribute("src", document.getElementsByTagName("iframe")[0].getAttribute("src").replace("videoidplaceholder", location.href.replace("https://www.youtube.com/watch?v=", "")));
document.getElementsByClassName('yt-uix-form-input-text share-embed-code')[0].value += '<iframe src="https://www.youtube.com/embed/videoidplaceholder" allowfullscreen="" width="__width__" height="__height__" frameborder="0"></iframe>';
document.getElementById("embed-layout-options").children[0].onclick = function() {
}
} else if (document.getElementById("watch-actions-share-loading").children[0].children[0].children[0].children[1].getAttribute("class").search("yt-uix-button-toggled") != "-1") {
doNothing();
}
}
} else if (document.getElementsByClassName("action-panel-trigger-share")[0].getAttribute("class").search("yt-uix-menu-trigger-selected yt-uix-button-toggled") != "-1") {
document.getElementsByClassName("action-panel-trigger-share")[0].blur();
document.getElementsByClassName("action-panel-trigger-share")[0].setAttribute("class", document.getElementsByClassName("action-panel-trigger-share")[0].getAttribute("class").replace(" yt-uix-menu-trigger-selected yt-uix-button-toggled"))
document.getElementById("watch-action-panels").remove();
}
getLikeButtonStatus();
}
// - description "show more"
document.getElementsByClassName("yt-uix-expander-collapsed-body")[0].onclick = function() {
document.getElementsByClassName("yt-uix-expander-collapsed-body")[0].blur();
document.getElementById("action-panel-details").setAttribute("class", document.getElementById("action-panel-details").getAttribute("class").replace(" yt-uix-expander-collapsed", ""))
}
document.getElementsByClassName("yt-uix-expander-body")[2].onclick = function() {
document.getElementsByClassName("yt-uix-expander-body")[2].blur();
document.getElementById("action-panel-details").setAttribute("class", document.getElementById("action-panel-details").getAttribute("class") + " yt-uix-expander-collapsed")
}
// More button
//document.getElementsByClassName("yt-uix-button-content")[6].onclick = function() {
document.getElementById("action-panel-overflow-button").onclick = function() {
if (document.getElementById("action-panel-overflow-button").getAttribute("class").search("yt-uix-menu-trigger-selected yt-uix-button-toggled yt-uix-more-button-context-menu-open-opened") == "-1") {
document.getElementById("action-panel-overflow-button").blur();
document.getElementById("action-panel-overflow-button").setAttribute("class", document.getElementById("action-panel-overflow-button").getAttribute("class") + " yt-uix-menu-trigger-selected yt-uix-button-toggled yt-uix-more-button-context-menu-open-opened")
document.getElementsByClassName("yt-uix-menu-content yt-ui-menu-content yt-uix-menu-content-hidden")[0].setAttribute("class", document.getElementsByClassName("yt-uix-menu-content yt-ui-menu-content yt-uix-menu-content-hidden")[0].getAttribute("class").replace("-hidden", ""))
} else if (document.getElementById("action-panel-overflow-button").getAttribute("class").search("yt-uix-menu-trigger-selected yt-uix-button-toggled yt-uix-more-button-context-menu-open-opened") != "-1") {
//document.getElementsByClassName("yt-uix-more-button-context-menu-open-opened")[0].onclick = function() {
document.getElementById("action-panel-overflow-button").blur();
document.getElementById("action-panel-overflow-button").setAttribute("class", document.getElementById("action-panel-overflow-button").getAttribute("class").replace(" yt-uix-menu-trigger-selected yt-uix-button-toggled yt-uix-more-button-context-menu-open-opened"))
document.getElementsByClassName("yt-uix-menu-content yt-ui-menu-content yt-uix-menu-content")[0].setAttribute("class", "yt-uix-menu-content yt-ui-menu-content yt-uix-menu-content-hidden")
}
}
// Notifications
document.getElementsByClassName("yt-uix-button yt-uix-button-size-default yt-uix-button-default yt-uix-button-empty yt-uix-button-has-icon yt-uix-subscription-preferences-button")[0].onclick = function() {
document.getElementsByClassName("yt-uix-button yt-uix-button-size-default yt-uix-button-default yt-uix-button-empty yt-uix-button-has-icon yt-uix-subscription-preferences-button")[0].blur();
document.getElementById("notification-preference-button").children[0].children[0].children[0].children[0].click();
}
if (document.getElementById("info-contents").children[0].children[0].children[4].children[0] != undefined) {
if (document.getElementById("info-contents").children[0].children[0].children[4].children[0].innerHTML.search("Unlisted") != "-1") {
document.getElementById("watch-privacy-icon").setAttribute("class", "yt-uix-tooltip yt-uix-tooltip-reverse unlisted");
} else if (document.getElementById("info-contents").children[0].children[0].children[4].children[0].innerHTML.search("Private") != "-1") {
document.getElementById("watch-privacy-icon").setAttribute("class", "yt-uix-tooltip yt-uix-tooltip-reverse private");
document.getElementById("watch-privacy-icon").setAttribute("title", "This video is private. Only you can see it.");
} else {
document.getElementById("watch-privacy-icon").remove();
}
} else if (document.getElementById("info-contents").children[0].children[0].children[4].children[0] == undefined) {
document.getElementById("watch-privacy-icon").remove();
}
}
}
catch(err) {
var uselessVariable = 0;
}
}
// check if URL changes; reset if so.
window.addEventListener('load', function () {
console.log('load');
});
window.addEventListener('yt-page-data-updated', function () {
resetWatch7();
});
reconstruct();
function resetWatch7() {
var i;
for (i = 0; i < 200; i++) {
document.getElementById("watch-header").outerHTML = "";
document.getElementById("action-panel-details").outerHTML = "";
reconstruct();
}
}
// check if URL changes; reset if so.
window.addEventListener('load', function () {
var checkLoadState;
checkLoadState++;
if (checkLoadState == 1) {
window.location.reload();
checkLoadState = 0;
}
console.log('load');
});
window.addEventListener('yt-page-data-updated', function () {
resetWatch7();
});
function addStyle(styleString) {
const style = document.createElement('style');
style.textContent = styleString;
document.head.append(style);
}
var storedText;
fetch('https://raw.githubusercontent.com/randomperson189/Reconstruct-Classic-Watch8-Layout/main/watch_page.css')
.then(function(response) {
response.text().then(function(text) {
storedText = text;
done();
});
});
function done() {
addStyle(storedText);
console.log(storedText);
}