Feeds for YouTube (YouTube video, channel, and gallery plugin) - Version 1.1.1

Version Description

  • Tested with upcoming WordPress 5.4 update.
  • New: Added setting for using custom templates for feed HTML.
  • Tweak: Added CSS to help feeds work better with certain themes.
  • Tweak: Used a higher resolution image file if optimum resolution was not available from the API.
  • Fix: "include=" shortcode setting would cause play icon to never show.
  • Fix: Fast response from YouTube player API would cause the players to load along with the page when not necessary.
  • Fix: Background caching was not updating feed caches.
Download this release

Release Info

Developer smashballoon
Plugin Icon 128x128 Feeds for YouTube (YouTube video, channel, and gallery plugin)
Version 1.1.1
Comparing to
See all releases

Code changes from version 1.1 to 1.1.1

README.txt CHANGED
@@ -4,8 +4,8 @@ Contributors: smashballoon, craig-at-smash-balloon
4
  Support Website: http://smashballoon/youtube-feed/
5
  Tags: YouTube, YouTube feed, YouTube widget, YouTube channel, YouTube gallery
6
  Requires at least: 3.4
7
- Tested up to: 5.3
8
- Stable tag: 1.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -192,6 +192,15 @@ By default, the plugin retrieves new YouTube videos for your YouTube gallery onc
192
  7. To display a YouTube feed just copy and paste the [youtube-feed] shortcode into a widget or page
193
 
194
  == Changelog ==
 
 
 
 
 
 
 
 
 
195
  = 1.1 =
196
  * New: Several improvements to the lightbox for YouTube grid feeds were made including a video index indicator, navigation arrows moved to the outside of the YouTube video, and a close button.
197
  * New: Added play button icon that displays on top of YouTube video thumbnails. Disable this on the "Customize" tab.
4
  Support Website: http://smashballoon/youtube-feed/
5
  Tags: YouTube, YouTube feed, YouTube widget, YouTube channel, YouTube gallery
6
  Requires at least: 3.4
7
+ Tested up to: 5.4
8
+ Stable tag: 1.1.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
192
  7. To display a YouTube feed just copy and paste the [youtube-feed] shortcode into a widget or page
193
 
194
  == Changelog ==
195
+ = 1.1.1 =
196
+ * Tested with upcoming WordPress 5.4 update.
197
+ * New: Added setting for using custom templates for feed HTML.
198
+ * Tweak: Added CSS to help feeds work better with certain themes.
199
+ * Tweak: Used a higher resolution image file if optimum resolution was not available from the API.
200
+ * Fix: "include=" shortcode setting would cause play icon to never show.
201
+ * Fix: Fast response from YouTube player API would cause the players to load along with the page when not necessary.
202
+ * Fix: Background caching was not updating feed caches.
203
+
204
  = 1.1 =
205
  * New: Several improvements to the lightbox for YouTube grid feeds were made including a video index indicator, navigation arrows moved to the outside of the YouTube video, and a close button.
206
  * New: Added play button icon that displays on top of YouTube video thumbnails. Disable this on the "Customize" tab.
css/admin.css CHANGED
@@ -80,7 +80,8 @@
80
  display: block;
81
  float: left;
82
  clear: both;
83
- min-width: 808px;
 
84
  margin: 15px 0 0 0;
85
  padding: 15px 20px;
86
 
@@ -122,6 +123,7 @@
122
  clear: both;
123
  margin: 20px 0 0 0;
124
  overflow: hidden;
 
125
 
126
  -moz-border-radius: 4px;
127
  -webkit-border-radius: 4px;
@@ -167,6 +169,30 @@
167
  width: 100%;
168
  max-width: 700px;
169
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
  /* Types */
171
  #sbspf_admin .sbspf_row{
172
  width: 100%;
@@ -580,11 +606,12 @@
580
  margin-left: 0;
581
  }
582
  .sbspf_layout_setting,
583
- .sbspf_box_setting{
584
  margin-bottom: 20px;
585
  }
586
  .sbspf_layout_setting:last-child,
587
- .sbspf_box_setting:last-child {
 
588
  margin-bottom: 0;
589
  }
590
  .sbspf_layout_setting label,
@@ -605,13 +632,15 @@
605
  float: none;
606
  top: -4px
607
  }
608
- .sbspf_layout_cell {
 
609
  padding: 0;
610
  display: inline-block;
611
  float: left;
612
  width: 155px;
613
  padding: 15px 15px 10px 15px;
614
  margin-right: 10px;
 
615
  background: #f6f6f6;
616
  border: 1px solid #ddd;
617
  -moz-border-radius: 5px;
@@ -623,14 +652,19 @@
623
  margin-right: 0;
624
  }
625
  @media all and (max-width: 1200px){
626
- .sbspf_layout_cell{
 
627
  width: 21%;
628
  padding: 1%;
629
  margin-right: 1%;
630
  }
 
 
 
631
  }
632
  @media all and (max-width: 480px){
633
- .sbspf_layout_cell{
 
634
  width: 98%;
635
  padding: 1%;
636
  margin: 5px 0;
@@ -642,31 +676,37 @@
642
  padding-left: 2px;
643
  }
644
  .sbspf_layout_cell:hover,
645
- .sbspf_layout_cell:focus{
 
 
646
  background: #fcfcfc;
647
  cursor: pointer;
648
  }
649
- .sbspf_layout_cell.sbspf_layout_selected{
 
650
  background: #f7faf1;
651
  border: 1px solid #7ad03a;
652
  }
653
- .sbspf_layout_cell h3{
 
654
  font-size: 15px;
655
  margin-top: 0;
656
  }
657
- .sbspf_layout_cell img{
 
658
  width: 100%;
659
  border: 1px solid #ddd;
660
  margin-top: 5px;
661
  }
662
- #sbspf_admin .sbspf_layout_settings{
 
663
  float: left;
664
  clear: both;
665
  width: 96%;
666
  max-width: 700px;
667
 
668
  padding: 20px 2%;
669
- margin: 10px 0;
670
  font-size: 13px;
671
  background: #f9f9f9;
672
  background: rgba(255,255,255,0.8);
@@ -675,11 +715,13 @@
675
  -webkit-border-radius: 8px;
676
  border-radius: 8px;
677
  }
678
- .sbspf_layout_setting {
 
679
  clear:left;
680
- margin-bottom: 10px;
681
  }
682
- #sbspf_admin .sbspf_layout_options_wrap .sbspf-tooltip{
 
683
  width: 98%;
684
  padding: 10px 1%;
685
  background: #eee;
@@ -689,6 +731,7 @@
689
  width: auto;
690
  }
691
 
 
692
  /* Display Tab */
693
  #sbspf_admin table.sbspf_shortcode_table{
694
  border-collapse: collapse;
@@ -710,6 +753,175 @@
710
  font-weight: bold;
711
  }
712
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
713
 
714
  /* SBY Specific */
715
  #sbspf_admin .sby_mode_option {
@@ -740,7 +952,95 @@
740
  opacity: 1;
741
  }
742
 
743
- /* Temp Pro */
744
- .sbspf_multi_checkbox_option.sbspf_pro_only {
745
- display: none;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
746
  }
80
  display: block;
81
  float: left;
82
  clear: both;
83
+ width: 808px;
84
+ max-width: 100%;
85
  margin: 15px 0 0 0;
86
  padding: 15px 20px;
87
 
123
  clear: both;
124
  margin: 20px 0 0 0;
125
  overflow: hidden;
126
+ max-width: 100%;
127
 
128
  -moz-border-radius: 4px;
129
  -webkit-border-radius: 4px;
169
  width: 100%;
170
  max-width: 700px;
171
  }
172
+
173
+ /* Lock floating on top */
174
+ .sbspf_lock {
175
+ position: absolute;
176
+ top: 50%;
177
+ right: 50%;
178
+ height: 18px;
179
+ padding: 4px 10px;
180
+ background: rgba(255,255,255,1);
181
+ border-radius: 5px;
182
+ box-shadow: 0 0 5px 0 rgba(0,0,0,0.1);
183
+ color: #333;
184
+ z-index: 99;
185
+ font-size: 14px;
186
+ font-weight: 700;
187
+ text-decoration: none;
188
+ border: 1px solid #333;
189
+ }
190
+
191
+ .sbspf_lock svg {
192
+ height: 11px;
193
+ margin-right: 4px;
194
+ }
195
+
196
  /* Types */
197
  #sbspf_admin .sbspf_row{
198
  width: 100%;
606
  margin-left: 0;
607
  }
608
  .sbspf_layout_setting,
609
+ .sbspf_sub_option_setting{
610
  margin-bottom: 20px;
611
  }
612
  .sbspf_layout_setting:last-child,
613
+ .sbspf_box_setting:last-child,
614
+ .sbspf_sub_option_setting:last-child{
615
  margin-bottom: 0;
616
  }
617
  .sbspf_layout_setting label,
632
  float: none;
633
  top: -4px
634
  }
635
+ .sbspf_layout_cell,
636
+ .sbspf_sub_option_cell{
637
  padding: 0;
638
  display: inline-block;
639
  float: left;
640
  width: 155px;
641
  padding: 15px 15px 10px 15px;
642
  margin-right: 10px;
643
+ margin-bottom: 10px;
644
  background: #f6f6f6;
645
  border: 1px solid #ddd;
646
  -moz-border-radius: 5px;
652
  margin-right: 0;
653
  }
654
  @media all and (max-width: 1200px){
655
+ .sbspf_layout_cell,
656
+ .sbspf_sub_option_cell{
657
  width: 21%;
658
  padding: 1%;
659
  margin-right: 1%;
660
  }
661
+ .sbspf_sub_option_cell {
662
+ width: 30%;
663
+ }
664
  }
665
  @media all and (max-width: 480px){
666
+ .sbspf_layout_cell,
667
+ .sbspf_sub_option_cell{
668
  width: 98%;
669
  padding: 1%;
670
  margin: 5px 0;
676
  padding-left: 2px;
677
  }
678
  .sbspf_layout_cell:hover,
679
+ .sbspf_layout_cell:focus,
680
+ .sbspf_sub_option_cell:hover,
681
+ .sbspf_sub_option_cell:focus{
682
  background: #fcfcfc;
683
  cursor: pointer;
684
  }
685
+ .sbspf_layout_cell.sbspf_layout_selected,
686
+ .sbspf_sub_option_cell.sbspf_sub_option_selected{
687
  background: #f7faf1;
688
  border: 1px solid #7ad03a;
689
  }
690
+ .sbspf_layout_cell h3
691
+ .sbspf_sub_option_cell h3 {
692
  font-size: 15px;
693
  margin-top: 0;
694
  }
695
+ .sbspf_layout_cell img,
696
+ .sbspf_sub_option_cell img {
697
  width: 100%;
698
  border: 1px solid #ddd;
699
  margin-top: 5px;
700
  }
701
+ #sbspf_admin .sbspf_layout_settings,
702
+ #sbspf_admin .sbspf_sub_option_settings{
703
  float: left;
704
  clear: both;
705
  width: 96%;
706
  max-width: 700px;
707
 
708
  padding: 20px 2%;
709
+ margin: 0 0 10px 0;
710
  font-size: 13px;
711
  background: #f9f9f9;
712
  background: rgba(255,255,255,0.8);
715
  -webkit-border-radius: 8px;
716
  border-radius: 8px;
717
  }
718
+ .sbspf_layout_setting,
719
+ .sbspf_sub_option_setting{
720
  clear:left;
721
+ margin-bottom: 20px;
722
  }
723
+ #sbspf_admin .sbspf_layout_options_wrap .sbspf-tooltip,
724
+ #sbspf_admin .sbspf_box_setting .sbspf-tooltip{
725
  width: 98%;
726
  padding: 10px 1%;
727
  background: #eee;
731
  width: auto;
732
  }
733
 
734
+
735
  /* Display Tab */
736
  #sbspf_admin table.sbspf_shortcode_table{
737
  border-collapse: collapse;
753
  font-weight: bold;
754
  }
755
 
756
+ /* Modal */
757
+
758
+ #sbspf_modal_overlay{
759
+ position: fixed;
760
+ z-index: 999;
761
+ width: 100%;
762
+ top: 0;
763
+ right: 0;
764
+ bottom: 0;
765
+ left: 0;
766
+
767
+ background: rgba(0,0,0,0.3);
768
+ }
769
+ #sbspf_modal_overlay .sbspf_modal{
770
+ position: absolute;
771
+ top: 160px;
772
+ left: 50%;
773
+ width: 450px;
774
+
775
+ margin: 0 0 0 -230px;
776
+ padding: 20px;
777
+ background: #fff;
778
+
779
+ -webkit-box-shadow: 0 1px 20px rgba(0,0,0,0.2);
780
+ box-shadow: 0 1px 20px rgba(0,0,0,0.2);
781
+
782
+ -moz-border-radius: 3px;
783
+ -webkit-border-radius: 3px;
784
+ border-radius: 3px;
785
+ }
786
+ @media all and (max-width: 480px){
787
+ #sbspf_modal_overlay .sbspf_modal{
788
+ max-width: 100%;
789
+ margin: 0 0 0 -50%;
790
+ box-sizing: border-box;
791
+ }
792
+ }
793
+ .sbspf_emphasis {
794
+ display: block;
795
+ font-size: 16px;
796
+ text-align: center;
797
+ margin-bottom: 20px;
798
+ }
799
+ .sbspf_emphasis svg {
800
+ height: 14px;
801
+ }
802
+ .sbspf_modal_message h3 {
803
+ font-size: 14px;
804
+ }
805
+ .sbspf_modal .sbspf_modal_close{
806
+ position: absolute;
807
+ top: 0;
808
+ right: 0;
809
+ padding: 10px;
810
+ font-size: 14px;
811
+ color: #ccc;
812
+ margin: 0;
813
+ }
814
+ .sbspf_modal .sbspf_modal_close:focus,
815
+ .sbspf_modal .sbspf_modal_close:hover{
816
+ color: #333;
817
+ }
818
+ /* Pro only notices */
819
+ #sbspf_admin .sbspf_sub_options,
820
+ #sbspf_admin .sbspf_layout_cell,
821
+ #sbspf_admin .sbspf_layout_settings,
822
+ #sbspf_admin .sbspf_disabled_wrap{
823
+ position: relative;
824
+ }
825
+ #sbspf_admin .sbspf_sub_options:after,
826
+ #sbspf_admin .sbspf_disabled_wrap{
827
+ clear: both;
828
+ display: table;
829
+ content: ""
830
+ }
831
+ #sbspf_admin .sbspf_disabled_wrap{
832
+ width: 100%;
833
+ max-width: 520px;
834
+ }
835
+ #sbspf_admin .sby_includes_pro_only .sbspf_pro_tooltip {
836
+ top: 50%;
837
+ left: 30px;
838
+ bottom: auto;
839
+ margin-top: -96px;
840
+ }
841
+ #sbspf_admin .sbspf-show-pro{
842
+ margin-top: 10px;
843
+ text-align: center;
844
+ }
845
+ .sbspf_layout_cell.sbspf_pro_only .sbspf_lock{
846
+ margin-top: -4px;
847
+ }
848
+ #sbspf_admin .sbspf_layout_cell.sbspf_pro_only .sbspf_pro_tooltip {
849
+ margin-top: -38px;
850
+ left: 54px;
851
+ }
852
+ #sbspf_admin .sbspf_pro_only,
853
+ #sbspf_admin .sbspf_pro_only label,
854
+ #sbspf_admin .sbspf_pro_only input,
855
+ #sbspf_admin .sbspf_pro_only select,
856
+ #sbspf_admin .sbspf_pro_only_row,
857
+ #sbspf_admin .sbspf_pro_only_row label,
858
+ #sbspf_admin .sbspf_pro_only_row input,
859
+ #sbspf_admin .sbspf_pro_only_row select{
860
+ color: #999 !important;
861
+ }
862
+ #sbspf_admin tr.sbspf_pro_only{
863
+ background: #eacccc;
864
+ }
865
+ .sbspf_lock.sbspf_pro_lock {
866
+ background: rgba(255,255,255,0.8);
867
+ color: #666;
868
+ border: 1px solid #ccc;
869
+ margin-right: -34px;
870
+ }
871
+ .sbspf_lock.sbspf_pro_lock i {
872
+ margin-right: 8px;
873
+ }
874
+ #sbspf_admin .sbspf_pro_lock:hover,
875
+ #sbspf_admin .sbspf_pro_lock:hover{
876
+ background: #fff;
877
+ border: 1px solid #ccc;
878
+ color: #333;
879
+ box-shadow: 0 0 8px 0 rgba(0,0,0,0.15);
880
+ }
881
+ #sbspf_admin .sbspf_pro_tooltip{
882
+ text-align: center;
883
+ z-index:99;
884
+ display: none;
885
+ position: absolute;
886
+ bottom: 22px;
887
+ left: -8px;
888
+
889
+ background: #333;
890
+ color: #eee;
891
+ width: 90%;
892
+ padding: 8px 10px 10px 10px;
893
+ border-radius: 3px;
894
+ line-height: 1.3;
895
+ font-size: 12px;
896
+ width: 190px;
897
+ }
898
+ #sbspf_admin .sbspf_pro_tooltip .fa-caret-down {
899
+ position: absolute;
900
+ bottom: -12px;
901
+ font-size: 20px;
902
+ left: 49%;
903
+ color: #333;
904
+ }
905
+ #sbspf_admin .sbspf_layouts .sbspf_pro_tooltip,
906
+ #sbspf_admin .sbspf_sub_options .sbspf_pro_tooltip{
907
+ left: 284px;
908
+ top: -21px;
909
+ bottom: auto;
910
+ margin-left: -101px;
911
+ }
912
+ #sbspf_admin .sbspf_layouts .sbspf_layout_cell .sbspf_pro_tooltip{
913
+ left: 84px;
914
+ top: 32px;
915
+ }
916
+ #sbspf_admin .sbspf_table_key{
917
+ display: block;
918
+ float: left;
919
+ width: 11px;
920
+ height: 11px;
921
+ border: 1px solid #999;
922
+ background: #eacccc;
923
+ margin: 3px 6px 0 0;
924
+ }
925
 
926
  /* SBY Specific */
927
  #sbspf_admin .sby_mode_option {
952
  opacity: 1;
953
  }
954
 
955
+ /* Notices */
956
+ .sby_includes_pro_only .sbspf_lock {
957
+ left: 100px;
958
+ right: auto;
959
+ margin-top: -40px;
960
+ }
961
+ .sbspf_sub_options .sbspf_lock {
962
+ top: 38px;
963
+ left: 260px;
964
+ right: auto;
965
+ }
966
+ .sby_types_disabled_wrap .sbspf_lock {
967
+ margin-top: -20px;
968
+ }
969
+ #sbspf_admin .sby_types_disabled_wrap .sbspf_pro_tooltip {
970
+ top: 50%;
971
+ margin-left: -112px;
972
+ margin-top: -78px;
973
+ bottom: auto;
974
+ left: 50%;
975
+ }
976
+ @media screen and (max-width: 480px) {
977
+ .sbspf_sub_options .sbspf_lock {
978
+ top: 60px;
979
+ left: 50%;
980
+ margin-left: -40px;
981
+ right: auto;
982
+ }
983
+ #sbspf_admin .sbspf_sub_options .sbspf_pro_tooltip {
984
+ top: 0px;
985
+ left: 50%;
986
+ margin-left: -112px;
987
+ }
988
+ }
989
+
990
+ /* Lite Notice */
991
+ @media screen and (max-width: 600px) {
992
+ #sbspf-notice-bar {
993
+ display:none !important
994
+ }
995
+ }
996
+
997
+ #sbspf-notice-bar {
998
+ background-color: #DDDDDD;
999
+ color: #777777;
1000
+ text-align: center;
1001
+ position: relative;
1002
+ padding: 7px;
1003
+ margin-bottom: 0;
1004
+ opacity: 1;
1005
+ transition: all .3s ease-in-out;
1006
+ max-height: 100px;
1007
+ overflow: hidden
1008
+ }
1009
+
1010
+ #sbspf-notice-bar.out {
1011
+ opacity: .5;
1012
+ max-height: 0
1013
+ }
1014
+
1015
+ #sbspf-notice-bar a {
1016
+ color: #e34f0e;
1017
+ }
1018
+
1019
+ #sbspf-notice-bar a:hover {
1020
+ color: #b85a1b
1021
+ }
1022
+
1023
+ #sbspf-notice-bar .dismiss {
1024
+ position: absolute;
1025
+ top: 0;
1026
+ right: 0;
1027
+ border: none;
1028
+ padding: 5px;
1029
+ margin-top: 1px;
1030
+ background: 0 0;
1031
+ color: #72777c;
1032
+ cursor: pointer
1033
+ }
1034
+
1035
+ #sbspf-notice-bar .dismiss:before {
1036
+ background: 0 0;
1037
+ color: #72777c;
1038
+ content: "\f335";
1039
+ display: block;
1040
+ font: normal 20px/20px dashicons;
1041
+ speak: none;
1042
+ height: 20px;
1043
+ text-align: center;
1044
+ width: 20px;
1045
+ -webkit-font-smoothing: antialiased
1046
  }
css/sb-youtube.css CHANGED
@@ -11,11 +11,20 @@
11
  -moz-box-sizing: border-box;
12
  box-sizing: border-box;
13
  }
 
 
 
 
 
14
  [id^=sb_youtube_].sb_youtube:after{
15
  content: "";
16
  display: table;
17
  clear: both;
18
  }
 
 
 
 
19
 
20
  /*********************/
21
  /*** STYLE OPTIONS ***/
11
  -moz-box-sizing: border-box;
12
  box-sizing: border-box;
13
  }
14
+ [id^=sb_youtube_].sb_youtube * {
15
+ -webkit-box-sizing: border-box;
16
+ -moz-box-sizing: border-box;
17
+ box-sizing: border-box
18
+ }
19
  [id^=sb_youtube_].sb_youtube:after{
20
  content: "";
21
  display: table;
22
  clear: both;
23
  }
24
+ [id^=sb_youtube_].sb_youtube iframe,
25
+ #sby_lightbox iframe{
26
+ pointer-events: all !important;
27
+ }
28
 
29
  /*********************/
30
  /*** STYLE OPTIONS ***/
css/sb-youtube.min.css CHANGED
@@ -1 +1 @@
1
- [id^=sb_youtube_].sb_youtube{width:100%;margin:0 auto;padding:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}[id^=sb_youtube_].sb_youtube:after{content:"";display:table;clear:both}[id^=sb_youtube_].sb_youtube.sby_fixed_height{overflow:hidden;overflow-y:auto;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}[id^=sb_youtube_].sb_youtube .sby_items_wrap{width:100%;float:left;line-height:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}[id^=sb_youtube_].sb_youtube .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube .sby_player_outer_wrap .sby_video_thumbnail_wrap,[id^=sb_youtube_].sb_youtube .sby_player_wrap{display:-moz-inline-stack;display:inline-block;vertical-align:top;zoom:1;max-height:1000px;padding:inherit!important;text-decoration:none;opacity:1;overflow:hidden;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:all .5s ease;-moz-transition:all .5s ease;-o-transition:all .5s ease;-ms-transition:all .5s ease;transition:all .5s ease}[id^=sb_youtube_].sb_youtube .sby_items_wrap .sby_item.sby_no_margin{margin:0!important}[id^=sb_youtube_].sb_youtube .sby_items_wrap .sby_item{float:left}[id^=sb_youtube_].sb_youtube .sby_items_wrap .sby_item.sby_transition{opacity:0;max-height:0}[id^=sb_youtube_].sb_youtube.sby_col_0 .sby_items_wrap .sby_item{width:100%}[id^=sb_youtube_].sb_youtube.sby_col_1 .sby_items_wrap .sby_item{width:100%}[id^=sb_youtube_].sb_youtube.sby_col_2 .sby_items_wrap .sby_item{width:50%}[id^=sb_youtube_].sb_youtube.sby_col_3 .sby_items_wrap .sby_item{width:33.33%}[id^=sb_youtube_].sb_youtube.sby_col_4 .sby_items_wrap .sby_item{width:25%}[id^=sb_youtube_].sb_youtube.sby_col_5 .sby_items_wrap .sby_item{width:20%}[id^=sb_youtube_].sb_youtube.sby_col_6 .sby_items_wrap .sby_item{width:16.66%}[id^=sb_youtube_].sb_youtube.sby_col_7 .sby_items_wrap .sby_item{width:14.28%}[id^=sb_youtube_].sb_youtube.sby_col_8 .sby_items_wrap .sby_item{width:12.5%}[id^=sb_youtube_].sb_youtube.sby_col_9 .sby_items_wrap .sby_item{width:11.11%}[id^=sb_youtube_].sb_youtube.sby_col_10 .sby_items_wrap .sby_item{width:10%}.sby-screenreader{text-indent:-9999px!important;display:block!important;width:0!important;height:0!important;line-height:0!important}[id^=sb_youtube_].sb_youtube .sby_player_outer_wrap,[id^=sb_youtube_].sb_youtube .sby_video_thumbnail_wrap{width:100%;position:relative;float:left}[id^=sb_youtube_].sb_youtube .sby_video_thumbnail{display:block;position:relative;text-decoration:none;line-height:0;z-index:5}[id^=sb_youtube_].sb_youtube .sby_video_thumbnail img{width:100%;height:auto;border-radius:0}[id^=sb_youtube_].sb_youtube .sby_link{display:none;position:absolute;z-index:1;top:0;right:0;bottom:0;left:0;width:100%;padding:0;background:#333;background:rgba(0,0,0,.6);text-align:center;color:#fff;font-size:12px;line-height:1.1;overflow:hidden}[id^=sb_youtube_].sb_youtube .sby_link.sby_default a,[id^=sb_youtube_].sb_youtube .sby_link.sby_default p,[id^=sb_youtube_].sb_youtube .sby_link.sby_default span{text-shadow:0 0 10px #000}[id^=sb_youtube_].sb_youtube .sby_link .sby_hover_bottom,[id^=sb_youtube_].sb_youtube .sby_link .sby_lightbox_link,[id^=sb_youtube_].sb_youtube .sby_link .sby_playbtn,[id^=sb_youtube_].sb_youtube .sby_link .sby_username a,[id^=sb_youtube_].sb_youtube .sby_link .sby_youtube_link,[id^=sb_youtube_].sb_youtube .sby_link .svg-inline--fa.fa-play{opacity:.9}[id^=sb_youtube_].sb_youtube .sby_link .sby_lightbox_link:hover,[id^=sb_youtube_].sb_youtube .sby_link .sby_playbtn:hover,[id^=sb_youtube_].sb_youtube .sby_link .sby_username a:hover,[id^=sb_youtube_].sb_youtube .sby_link .sby_youtube_link:hover,[id^=sb_youtube_].sb_youtube .sby_link .svg-inline--fa.fa-play:hover{opacity:1}[id^=sb_youtube_].sb_youtube .sby_link_area{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1}[id^=sb_youtube_].sb_youtube .sby_link a{padding:0;text-decoration:none;color:#ddd;color:rgba(255,255,255,.7);line-height:1.1;background:0 0;display:-moz-inline-stack;display:inline-block;vertical-align:top;zoom:1}[id^=sb_youtube_].sb_youtube .sby_link a:active,[id^=sb_youtube_].sb_youtube .sby_link a:hover{color:#fff}[id^=sb_youtube_].sb_youtube .sby_link .sby_lightbox_link{display:block;position:absolute;z-index:2;top:50%;left:50%;margin-top:-24px;margin-left:-21px;padding:0;font-size:49px;font-style:normal!important}[id^=sb_youtube_].sb_youtube .sby_carousel_vid_first .sby_lightbox_link,[id^=sb_youtube_].sb_youtube .sby_type_video .sby_lightbox_link{display:none}[id^=sb_youtube_].sb_youtube .sby_link .sby_youtube_link{font-size:30px;position:absolute;z-index:100;bottom:0;right:2px;padding:8px}[id^=sb_youtube_].sb_youtube .sby_link a:focus,[id^=sb_youtube_].sb_youtube .sby_link a:hover{text-decoration:underline}[id^=sb_youtube_].sb_youtube .sby_player_wrap{z-index:1;width:100%!important;height:100%!important;position:absolute;top:0;left:0}[id^=sb_youtube_].sb_youtube .sby_player_wrap iframe{width:100%!important;height:100%!important}[id^=sb_youtube_].sb_youtube .sby_thumbnail_hover{opacity:0;display:block;position:absolute;top:0;right:0;bottom:0;left:0;z-index:10;color:#fff;background:#333;background:rgba(0,0,0,.6);transition:opacity .6s ease-in-out;-moz-transition:opacity .6s ease-in-out;-webkit-transition:opacity .6s ease-in-out}[id^=sb_youtube_].sb_youtube.sby_layout_list .sby_thumbnail_hover{display:none}.sby_video_title{display:inline-block;height:100%;padding:10px;overflow:hidden;font-size:13px;line-height:1.2}[id^=sb_youtube_].sb_youtube .sby_video_thumbnail:hover .sby_thumbnail_hover{opacity:1;display:block;transition:opacity .2s ease-in-out;-moz-transition:opacity .2s ease-in-out;-webkit-transition:opacity .2s ease-in-out}[id^=sb_youtube_].sb_youtube.sby_layout_list .sby_video_thumbnail:hover .sby_thumbnail_hover{opacity:0;display:none;transition:none;-moz-transition:none;-webkit-transition:none}[id^=sb_youtube_].sb_youtube .sby_video_thumbnail:hover .sby_play_btn{opacity:.5}[id^=sb_youtube_].sb_youtube .sby_play_btn{position:absolute;left:50%;bottom:50%;top:50%;right:50%;margin-top:-24px;margin-left:-24px;color:#fff;width:48px;opacity:1;transition:opacity .2s ease-in-out;-moz-transition:opacity .2s ease-in-out;-webkit-transition:opacity .2s ease-in-out}[id^=sb_youtube_].sb_youtube .sby_play_btn svg:not(:root).svg-inline--fa{width:48px;height:auto}[id^=sb_youtube_].sb_youtube .sby_play_btn i,[id^=sb_youtube_].sb_youtube .sby_play_btn svg{-webkit-filter:drop-shadow( 0 0 2px rgba(0,0,0,.4) );filter:drop-shadow( 0 0 2px rgba(0,0,0,.4) )}[id^=sb_youtube_].sb_youtube.sby_medium .sby_play_btn{margin-top:-12px;margin-left:-10px;width:23px}[id^=sb_youtube_].sb_youtube.sby_medium .sby_play_btn svg.svg-inline--fa.fa-play{width:23px}[id^=sb_youtube_].sb_youtube.sby_small .sby_play_btn{margin-top:-9px;margin-left:-7px;width:18px}[id^=sb_youtube_].sb_youtube.sby_small .sby_play_btn svg.svg-inline--fa.fa-play{width:18px}[id^=sb_youtube_].sb_youtube .sby_loader{width:20px;height:20px;position:relative;top:50%;left:50%;margin:-10px 0 0 -10px;background-color:#000;background-color:rgba(0,0,0,.5);border-radius:100%;-webkit-animation:sby-sk-scaleout 1s infinite ease-in-out;animation:sby-sk-scaleout 1s infinite ease-in-out}[id^=sb_youtube_].sb_youtube br{display:none}.sby_footer p{display:inline;padding:0;margin:0}[id^=sb_youtube_].sb_youtube .sby_footer .sby_loader,[id^=sb_youtube_].sb_youtube .sby_item .sby_loader,[id^=sb_youtube_].sb_youtube .sby_player_outer_wrap .sby_loader{position:absolute;margin-top:-11px;background-color:#fff}[id^=sb_youtube_].sb_youtube .sby_item.sby_player_loading,[id^=sb_youtube_].sb_youtube .sby_player_outer_wrap.sby_player_loading{opacity:.8}@-webkit-keyframes sby-sk-scaleout{0%{-webkit-transform:scale(0)}100%{-webkit-transform:scale(1);opacity:0}}@keyframes sby-sk-scaleout{0%{-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}100%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);opacity:0}}#sby_lightbox .fa-spin,[id^=sb_youtube_].sb_youtube .fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}#sby_lightbox .fa-pulse,[id^=sb_youtube_].sb_youtube .fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}[id^=sb_youtube_].sb_youtube .sb_youtube_header{float:left;clear:both;margin:0 0 15px 0;padding:0;line-height:1.2;width:100%}[id^=sb_youtube_].sb_youtube .sb_youtube_header a{float:left;display:block;text-decoration:none;transition:color .5s ease}@media all and (min-width:480px){[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_medium .sby_header_img{width:80px;height:80px;border-radius:40px}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_medium .sby_header_img img{width:80px;height:80px;border-radius:40px}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_medium .sby_header_text h3{font-size:20px}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_medium .sby_header_text .sby_bio,[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_medium .sby_header_text .sby_bio_info{font-size:14px}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_medium .sby_header_text .sby_bio,[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_medium .sby_header_text .sby_bio_info,[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_medium .sby_header_text h3{margin-left:95px!important;line-height:1.4}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_medium .sby_header_text h3{margin-right:-85px!important}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_medium .sby_header_text .sby_bio_info{margin-top:4px!important}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_medium .sby_header_text.sby_no_bio h3{padding-top:20px!important}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_large .sby_header_img{width:120px;height:120px;border-radius:60px}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_large .sby_header_img img{width:120px;height:120px;border-radius:60px}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_large .sby_header_text h3{font-size:28px}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_large .sby_header_text .sby_bio,[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_large .sby_header_text .sby_bio_info{font-size:16px}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_large .sby_header_text .sby_bio,[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_large .sby_header_text .sby_bio_info,[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_large .sby_header_text h3{margin-left:140px!important;line-height:1.5}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_large .sby_header_text h3{margin-right:-120px!important}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_large .sby_header_text .sby_bio_info{margin-top:12px!important}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_large .sby_header_text.sby_no_bio h3{padding-top:32px!important}}[id^=sb_youtube_].sb_youtube .sb_youtube_header .sby_header_img{float:left;position:relative;width:50px;margin:0 0 0 -100%!important;overflow:hidden;-moz-border-radius:40px;-webkit-border-radius:40px;border-radius:40px}[id^=sb_youtube_].sb_youtube .sb_youtube_header .sby_header_img img{float:left;margin:0!important;padding:0!important;border:none!important;-moz-border-radius:40px;-webkit-border-radius:40px;border-radius:40px}[id^=sb_youtube_].sb_youtube .sb_youtube_header .sby_header_img_hover{opacity:0;position:absolute;width:100%;top:0;bottom:0;left:0;text-align:center;color:#fff;background:rgba(0,0,0,.75)}[id^=sb_youtube_].sb_youtube .sb_youtube_header .sby_header_img_hover .sby_new_logo{position:absolute;top:50%;left:50%;margin-top:-12px;margin-left:-12px;width:24px;height:24px;font-size:24px}[id^=sb_youtube_].sb_youtube .sb_youtube_header .sby_header_img_hover i{overflow:hidden;background:url(../img/small-logo.png) no-repeat 0 0}[id^=sb_youtube_].sb_youtube .sb_youtube_header .sby_header_img_hover{z-index:2;transition:opacity .4s ease-in-out}[id^=sb_youtube_].sb_youtube .sb_youtube_header .sby_fade_in{opacity:1;transition:opacity .2s ease-in-out}[id^=sb_youtube_].sb_youtube .sb_youtube_header .sby_header_img_hover{position:absolute;width:100%;top:0;bottom:0;left:0;text-align:center;color:#fff;background:rgba(0,0,0,.75);-moz-opacity:0;-khtml-opacity:0;opacity:0;border-radius:40px;transition:opacity .2s}[id^=sb_youtube_].sb_youtube .sb_youtube_header a:focus .sby_header_img_hover,[id^=sb_youtube_].sb_youtube .sb_youtube_header a:hover .sby_header_img_hover{opacity:1}[id^=sb_youtube_].sb_youtube .sb_youtube_header .sby_header_text{float:left;width:100%;padding-top:5px}[id^=sb_youtube_].sb_youtube .sb_youtube_header a{text-decoration:none}[id^=sb_youtube_].sb_youtube .sb_youtube_header .sby_header_text .sby_bio,[id^=sb_youtube_].sb_youtube .sb_youtube_header .sby_header_text h3{float:left;clear:both;width:auto;margin:0 0 0 60px!important;padding:0!important}[id^=sb_youtube_].sb_youtube .sb_youtube_header h3{font-size:16px;line-height:1.3}[id^=sb_youtube_].sb_youtube .sb_youtube_header p{font-size:13px;line-height:1.3;margin:0;padding:0}[id^=sb_youtube_].sb_youtube p:empty{display:none}[id^=sb_youtube_].sb_youtube .sb_youtube_header .sby_header_text img.emoji{margin-right:3px!important}[id^=sb_youtube_].sb_youtube .sb_youtube_header .sby_header_text.sby_no_bio h3{padding-top:9px!important}[id^=sb_youtube_].sb_youtube .sb_youtube_header .sby_header_text.sby_no_bio .sby_bio_info{clear:both}[id^=sb_youtube_].sb_youtube .sby_footer{float:left;clear:both;width:100%;text-align:center}[id^=sb_youtube_].sb_youtube .sby_footer .fa-spinner{display:none;position:absolute;top:50%;left:50%;margin:-8px 0 0 -7px;font-size:15px}[id^=sb_youtube_].sb_youtube .sby_footer{opacity:1;transition:all .5s ease-in}[id^=sb_youtube_].sb_youtube .sby_load_btn .sby_btn_text,[id^=sb_youtube_].sb_youtube .sby_load_btn .sby_loader{opacity:1;transition:all .1s ease-in}[id^=sb_youtube_].sb_youtube .sby_hidden{opacity:0!important}[id^=sb_youtube_].sb_youtube .sby_follow_btn a,[id^=sb_youtube_].sb_youtube .sby_footer .sby_load_btn{display:-moz-inline-stack;display:inline-block;vertical-align:top;zoom:1;padding:7px 14px;margin:5px auto 0 auto;background:#333;color:#eee;border:none;color:#fff;text-decoration:none;font-size:13px;line-height:1.5;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}[id^=sb_youtube_].sb_youtube .sby_footer .sby_load_btn{position:relative}[id^=sb_youtube_].sb_youtube .sby_follow_btn{display:-moz-inline-stack;display:inline-block;vertical-align:top;zoom:1;text-align:center}[id^=sb_youtube_].sb_youtube .sby_follow_btn.sby_top{display:block;margin-bottom:5px}[id^=sb_youtube_].sb_youtube .sby_follow_btn a{background:#408bd1;color:#fff}[id^=sb_youtube_].sb_youtube .sby_follow_btn a,[id^=sb_youtube_].sb_youtube .sby_footer .sby_load_btn{transition:all .1s ease-in}[id^=sb_youtube_].sb_youtube .sby_footer .sby_load_btn:hover{outline:0;box-shadow:inset 0 0 20px 20px rgba(255,255,255,.25)}[id^=sb_youtube_].sb_youtube .sby_follow_btn a:focus,[id^=sb_youtube_].sb_youtube .sby_follow_btn a:hover{outline:0;box-shadow:inset 0 0 10px 20px #359dff}[id^=sb_youtube_].sb_youtube .sby_follow_btn.sby_custom a:focus,[id^=sb_youtube_].sb_youtube .sby_follow_btn.sby_custom a:hover,[id^=sb_youtube_].sb_youtube .sby_footer .sby_load_btn.sby_custom:hover{box-shadow:inset 0 0 20px 20px rgba(255,255,255,.15)}[id^=sb_youtube_].sb_youtube .sby_follow_btn a:active,[id^=sb_youtube_].sb_youtube .sby_footer .sby_load_btn:active{box-shadow:inset 0 0 10px 20px rgba(0,0,0,.3)}[id^=sb_youtube_].sb_youtube .sby_follow_btn .fa,[id^=sb_youtube_].sb_youtube .sby_follow_btn svg{margin-bottom:-1px;margin-right:7px;font-size:15px}[id^=sb_youtube_].sb_youtube .sby_follow_btn svg{vertical-align:-.125em}[id^=sb_youtube_].sb_youtube .sby_footer .sby_follow_btn{margin-left:5px}@media all and (max-width:640px){[id^=sb_youtube_].sb_youtube.sby_col_3.sby_mob_col_auto .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_4.sby_mob_col_auto .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_5.sby_mob_col_auto .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_6.sby_mob_col_auto .sby_items_wrap .sby_item{width:50%}[id^=sb_youtube_].sb_youtube.sby_col_10 .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_10.sby_mob_col_auto .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_7 .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_7.sby_mob_col_auto .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_8 .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_8.sby_mob_col_auto .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_9 .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_9.sby_mob_col_auto .sby_items_wrap .sby_item{width:25%}[id^=sb_youtube_].sb_youtube.sby_col_2 .sby_items_wrap .sby_item{width:50%}[id^=sb_youtube_].sb_youtube.sby_col_3 .sby_items_wrap .sby_item{width:33.33%}[id^=sb_youtube_].sb_youtube.sby_col_4 .sby_items_wrap .sby_item{width:25%}[id^=sb_youtube_].sb_youtube.sby_col_5 .sby_items_wrap .sby_item{width:20%}[id^=sb_youtube_].sb_youtube.sby_col_6 .sby_items_wrap .sby_item{width:16.66%}[id^=sb_youtube_].sb_youtube.sby_col_7 .sby_items_wrap .sby_item{width:14.28%}[id^=sb_youtube_].sb_youtube.sby_col_8 .sby_items_wrap .sby_item{width:12.5%}[id^=sb_youtube_].sb_youtube.sby_col_9 .sby_items_wrap .sby_item{width:11.11%}[id^=sb_youtube_].sb_youtube.sby_col_10 .sby_items_wrap .sby_item{width:10%}[id^=sb_youtube_].sb_youtube.sby_width_resp{width:100%!important}}@media all and (max-width:480px){[id^=sb_youtube_].sb_youtube.sby_col_10.sby_mob_col_auto .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_3.sby_mob_col_auto .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_4.sby_mob_col_auto .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_5.sby_mob_col_auto .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_6.sby_mob_col_auto .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_7.sby_mob_col_auto .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_8.sby_mob_col_auto .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_9.sby_mob_col_auto .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_mob_col_1 .sby_items_wrap .sby_item{width:100%}[id^=sb_youtube_].sb_youtube.sby_mob_col_2 .sby_items_wrap .sby_item{width:50%}[id^=sb_youtube_].sb_youtube.sby_mob_col_3 .sby_items_wrap .sby_item{width:33.33%}[id^=sb_youtube_].sb_youtube.sby_mob_col_4 .sby_items_wrap .sby_item{width:25%}[id^=sb_youtube_].sb_youtube.sby_mob_col_5 .sby_items_wrap .sby_item{width:20%}[id^=sb_youtube_].sb_youtube.sby_mob_col_6 .sby_items_wrap .sby_item{width:16.66%}[id^=sb_youtube_].sb_youtube.sby_mob_col_7 .sby_items_wrap .sby_item{width:14.28%}}.sby_lightboxOverlay{position:absolute;top:0;left:0;z-index:9999;background-color:#000;opacity:.9;display:none}.sby_lightbox{position:absolute;left:0;width:100%;z-index:10000;line-height:0;font-weight:400}.sby_lightbox .sby_lb-image{display:block;height:auto;max-width:inherit;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px}.sby_lightbox a:active,.sby_lightbox a:focus,.sby_lightbox a:hover{outline:0}.sby_lightbox a img{border:none}.sby_lb-outerContainer{position:relative;background-color:#000;width:250px;height:250px;margin:0 auto 5px auto;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px}.sby_lb-outerContainer:after{content:"";display:table;clear:both}.sby_lb-container{position:relative;padding:4px;top:0;left:0;width:100%;height:100%;bottom:0;right:0;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px}.sby_lb-loader{position:absolute;top:43%;left:0;height:25%;width:100%;text-align:center;line-height:0}.sby_lb-cancel{display:block;width:32px;height:32px;margin:0 auto;background-color:#666;background-color:rgba(255,255,255,.5);border-radius:100%;-webkit-animation:ctf-sk-scaleout 1s infinite ease-in-out;animation:ctf-sk-scaleout 1s infinite ease-in-out}.sby_lb-nav{top:0;left:0;width:100%;z-index:10}.sby_lb-container>.nav{left:0}.sby_lb-nav a{position:absolute;z-index:100;top:0;height:90%;outline:0;background-image:url(data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)}.sby_lb-next,.sby_lb-prev{height:100%;cursor:pointer;display:block}.sby_lb-nav a.sby_lb-prev{width:50px;left:-70px;padding-left:10px;padding-right:10px;float:left;opacity:.5;-webkit-transition:opacity .2s;-moz-transition:opacity .2;-o-transition:opacity .2s;transition:opacity .2s}.sby_lb-nav a.sby_lb-prev:hover{opacity:1}.sby_lb-nav a.sby_lb-next{width:50px;right:-70px;padding-left:10px;padding-right:10px;float:right;opacity:.5;-webkit-transition:opacity .2s;-moz-transition:opacity .2s;-o-transition:opacity .2s;transition:opacity .2s}.sby_lb-nav a.sby_lb-next:hover{opacity:1}.sby_lb-nav span{display:block;top:55%;position:absolute;left:20px;width:34px;height:45px;margin:-25px 0 0 0;background:url(../img/sby-sprite.png) no-repeat}.sby_lb-nav a.sby_lb-prev span{background-position:-53px 0}.sby_lb-nav a.sby_lb-next span{left:auto;right:20px;background-position:-18px 0}.sby_lb-dataContainer{margin:0 auto;padding-top:5px;width:100%;font-family:"Open Sans",Helvetica,Arial,sans-serif;-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px}.sby_lb-dataContainer:after{content:"";display:table;clear:both}.sby_lb-data{padding:0 4px;color:#ccc}.sby_lb-data .sby_lb-details{width:85%;float:left;text-align:left;line-height:1.1}.sby_lb-data .sby_lb-caption{float:left;font-size:13px;font-weight:400;line-height:1.3;padding-bottom:3px;color:#ccc;word-wrap:break-word;-webkit-hyphens:auto;-moz-hyphens:auto;hyphens:auto}.sby_lb-data .sby_lb-caption .ctf-screename-sep,.sby_lb-data .sby_lb-caption a{color:#ccc;font-weight:700;text-decoration:none}.sby_lb-data .sby_lb-caption a:hover{color:#fff;text-decoration:underline}.sby_lb-data .sby_lb-caption .sby_lightbox_username{float:left;width:100%;color:#ccc;padding-bottom:0;display:block;margin:0 0 5px 0}.sby_lb-data .sby_lb-caption .sby_lightbox_username{color:#ccc}.sby_lb-data .sby_lb-caption .sby_lightbox_username:hover p{color:#fff;text-decoration:underline}.sby_lightbox .sby_lightbox_username img{float:left;border:none;width:48px;height:48px;margin-right:10px;background:#666;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sby_lightbox_username p{float:left;margin:0;padding:0;color:#ccc;line-height:32px;font-weight:700;font-size:13px;text-align:left}.sby_lb-data .ctf-caption-text{width:100%;margin-left:58px;padding-top:3px}.sby_lb-data .sby_lb-caption .ctf-author-screenname,.sby_lb-data .sby_lb-caption .ctf-tweet-date{font-weight:400}.sby_lb-data .sby_lb-info{width:100%;float:left;clear:both}.sby_lb-data .sby_lb-number{display:block;float:left;clear:both;padding:5px 0 15px 0;font-size:12px;color:#999}.sby_lb-data .sby_lb-close{display:block;float:right;width:30px;height:30px;background:url(../img/close.png) top right no-repeat;text-align:right;outline:0;opacity:.7;-webkit-transition:opacity .2s;-moz-transition:opacity .2s;-o-transition:opacity .2s;transition:opacity .2s}.sby_lb-data .sby_lb-close:hover{cursor:pointer;opacity:1}.sby_lb-nav{height:auto}.sby_lb-container{padding:0}.sby_lb-container iframe{position:absolute;top:0;left:0;width:100%;height:100%;z-index:1}#sby_lightbox .sby_lightbox_action{float:left;position:relative;padding:0 0 0 10px;margin:5px 0 0 10px;border-left:1px solid #666;font-size:12px}#sby_lightbox .sby_lightbox_action a{display:block;float:left;color:#999;text-decoration:none}#sby_lightbox .sby_lightbox_action a:focus,#sby_lightbox .sby_lightbox_action a:hover{color:#fff}#sby_lightbox .sby_lightbox_action .fa,#sby_lightbox .sby_lightbox_action svg{margin-right:5px}#sby_lightbox .sby_lightbox_action.sby_youtube .fa{font-size:13px}#sby_lightbox .sby_tooltip_social a svg{font-size:19px;padding:3px 4px;margin:auto}#sby_lightbox .sby_lightbox_tooltip{display:none;position:absolute;width:100px;bottom:22px;left:0;padding:5px 10px;margin:0;background:rgba(255,255,255,.9);color:#222;font-size:12px;line-height:1.3;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;box-shadow:0 0 10px rgba(0,0,0,.4);-moz-box-shadow:0 0 10px rgba(0,0,0,.4);-webkit-box-shadow:0 0 10px rgba(0,0,0,.4);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#sby_lightbox .sby_lightbox_tooltip .fa-play{position:absolute;font-size:8px;bottom:-6px;left:36px;color:rgba(255,255,255,.9)}#sby_lightbox .sby_tooltip_social a .fa{font-size:16px;margin:0;padding:5px}#sby_lightbox .sby_tooltip_social a#sby_facebook_icon .fa,#sby_lightbox .sby_tooltip_social a#sby_pinterest_icon .fa,#sby_lightbox .sby_tooltip_social a#sby_twitter_icon .fa{padding-top:4px;font-size:18px}#sby_lightbox #sby_mod_box{width:280px;padding:5px 10px 7px 10px}#sby_lightbox .sby_tooltip_social{width:172px;padding:5px 5px 4px 5px}#sby_lightbox .sby_tooltip_social a{color:#333;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}#sby_lightbox .sby_lightbox_action #sby_facebook_icon:hover{background:#3b5998}#sby_lightbox .sby_lightbox_action #sby_twitter_icon:hover{background:#00aced}#sby_lightbox .sby_lightbox_action #sby_google_icon:hover{background:#dd4b39}#sby_lightbox .sby_lightbox_action #sby_linkedin_icon:hover{background:#007bb6}#sby_lightbox .sby_lightbox_action #sby_pinterest_icon:hover{background:#cb2027}#sby_lightbox .sby_lightbox_action #sby_email_icon:hover{background:#333}.sby_lb-dataContainer,.sby_lb-outerContainer{min-width:450px}@media all and (max-width:450px){.sby_lb-dataContainer,.sby_lb-outerContainer{min-width:0}}.sby_lightbox .sby_lb-image{display:block;height:auto;max-width:inherit;margin:0 auto;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0}#sby_mod_error{display:none;border:1px solid #ddd;background:#eee;color:#333;margin:10px 0 0;padding:10px 15px;font-size:13px;text-align:center;clear:both;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}#sby_mod_error p{padding:5px 0!important;margin:0!important;line-height:1.3!important}#sby_mod_error ol,#sby_mod_error ul{padding:5px 0 5px 20px!important;margin:0!important}#sby_mod_error li{padding:1px 0!important;margin:0!important}#sby_mod_error span{font-size:12px}[id^=sb_youtube_].sb_youtube svg:not(:root).svg-inline--fa,[id^=sb_youtube_].sb_youtube_lightbox svg:not(:root).svg-inline--fa{box-sizing:unset;overflow:visible;width:1em}[id^=sb_youtube_].sb_youtube .svg-inline--fa.fa-w-16{width:16px}[id^=sb_youtube_].sb_youtube .svg-inline--fa,[id^=sb_youtube_].sb_youtube_lightbox .svg-inline--fa{display:inline-block;font-size:inherit;height:1em;overflow:visible;vertical-align:-.125em}[id^=sb_youtube_].sb_youtube.sby_player_loaded .sby_player_outer_wrap .sby_video_thumbnail,[id^=sb_youtube_].sb_youtube.sby_player_loaded.sby_layout_list .sby_video_thumbnail{z-index:-1!important}
1
+ [id^=sb_youtube_].sb_youtube{width:100%;margin:0 auto;padding:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}[id^=sb_youtube_].sb_youtube *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}[id^=sb_youtube_].sb_youtube:after{content:"";display:table;clear:both}#sby_lightbox iframe,[id^=sb_youtube_].sb_youtube iframe{pointer-events:all!important}[id^=sb_youtube_].sb_youtube.sby_fixed_height{overflow:hidden;overflow-y:auto;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}[id^=sb_youtube_].sb_youtube .sby_items_wrap{width:100%;float:left;line-height:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}[id^=sb_youtube_].sb_youtube .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube .sby_player_outer_wrap .sby_video_thumbnail_wrap,[id^=sb_youtube_].sb_youtube .sby_player_wrap{display:-moz-inline-stack;display:inline-block;vertical-align:top;zoom:1;max-height:1000px;padding:inherit!important;text-decoration:none;opacity:1;overflow:hidden;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:all .5s ease;-moz-transition:all .5s ease;-o-transition:all .5s ease;-ms-transition:all .5s ease;transition:all .5s ease}[id^=sb_youtube_].sb_youtube .sby_items_wrap .sby_item.sby_no_margin{margin:0!important}[id^=sb_youtube_].sb_youtube .sby_items_wrap .sby_item{float:left}[id^=sb_youtube_].sb_youtube .sby_items_wrap .sby_item.sby_transition{opacity:0;max-height:0}[id^=sb_youtube_].sb_youtube.sby_col_0 .sby_items_wrap .sby_item{width:100%}[id^=sb_youtube_].sb_youtube.sby_col_1 .sby_items_wrap .sby_item{width:100%}[id^=sb_youtube_].sb_youtube.sby_col_2 .sby_items_wrap .sby_item{width:50%}[id^=sb_youtube_].sb_youtube.sby_col_3 .sby_items_wrap .sby_item{width:33.33%}[id^=sb_youtube_].sb_youtube.sby_col_4 .sby_items_wrap .sby_item{width:25%}[id^=sb_youtube_].sb_youtube.sby_col_5 .sby_items_wrap .sby_item{width:20%}[id^=sb_youtube_].sb_youtube.sby_col_6 .sby_items_wrap .sby_item{width:16.66%}[id^=sb_youtube_].sb_youtube.sby_col_7 .sby_items_wrap .sby_item{width:14.28%}[id^=sb_youtube_].sb_youtube.sby_col_8 .sby_items_wrap .sby_item{width:12.5%}[id^=sb_youtube_].sb_youtube.sby_col_9 .sby_items_wrap .sby_item{width:11.11%}[id^=sb_youtube_].sb_youtube.sby_col_10 .sby_items_wrap .sby_item{width:10%}.sby-screenreader{text-indent:-9999px!important;display:block!important;width:0!important;height:0!important;line-height:0!important}[id^=sb_youtube_].sb_youtube .sby_player_outer_wrap,[id^=sb_youtube_].sb_youtube .sby_video_thumbnail_wrap{width:100%;position:relative;float:left}[id^=sb_youtube_].sb_youtube .sby_video_thumbnail{display:block;position:relative;text-decoration:none;line-height:0;z-index:5}[id^=sb_youtube_].sb_youtube .sby_video_thumbnail img{width:100%;height:auto;border-radius:0}[id^=sb_youtube_].sb_youtube .sby_link{display:none;position:absolute;z-index:1;top:0;right:0;bottom:0;left:0;width:100%;padding:0;background:#333;background:rgba(0,0,0,.6);text-align:center;color:#fff;font-size:12px;line-height:1.1;overflow:hidden}[id^=sb_youtube_].sb_youtube .sby_link.sby_default a,[id^=sb_youtube_].sb_youtube .sby_link.sby_default p,[id^=sb_youtube_].sb_youtube .sby_link.sby_default span{text-shadow:0 0 10px #000}[id^=sb_youtube_].sb_youtube .sby_link .sby_hover_bottom,[id^=sb_youtube_].sb_youtube .sby_link .sby_lightbox_link,[id^=sb_youtube_].sb_youtube .sby_link .sby_playbtn,[id^=sb_youtube_].sb_youtube .sby_link .sby_username a,[id^=sb_youtube_].sb_youtube .sby_link .sby_youtube_link,[id^=sb_youtube_].sb_youtube .sby_link .svg-inline--fa.fa-play{opacity:.9}[id^=sb_youtube_].sb_youtube .sby_link .sby_lightbox_link:hover,[id^=sb_youtube_].sb_youtube .sby_link .sby_playbtn:hover,[id^=sb_youtube_].sb_youtube .sby_link .sby_username a:hover,[id^=sb_youtube_].sb_youtube .sby_link .sby_youtube_link:hover,[id^=sb_youtube_].sb_youtube .sby_link .svg-inline--fa.fa-play:hover{opacity:1}[id^=sb_youtube_].sb_youtube .sby_link_area{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1}[id^=sb_youtube_].sb_youtube .sby_link a{padding:0;text-decoration:none;color:#ddd;color:rgba(255,255,255,.7);line-height:1.1;background:0 0;display:-moz-inline-stack;display:inline-block;vertical-align:top;zoom:1}[id^=sb_youtube_].sb_youtube .sby_link a:active,[id^=sb_youtube_].sb_youtube .sby_link a:hover{color:#fff}[id^=sb_youtube_].sb_youtube .sby_link .sby_lightbox_link{display:block;position:absolute;z-index:2;top:50%;left:50%;margin-top:-24px;margin-left:-21px;padding:0;font-size:49px;font-style:normal!important}[id^=sb_youtube_].sb_youtube .sby_carousel_vid_first .sby_lightbox_link,[id^=sb_youtube_].sb_youtube .sby_type_video .sby_lightbox_link{display:none}[id^=sb_youtube_].sb_youtube .sby_link .sby_youtube_link{font-size:30px;position:absolute;z-index:100;bottom:0;right:2px;padding:8px}[id^=sb_youtube_].sb_youtube .sby_link a:focus,[id^=sb_youtube_].sb_youtube .sby_link a:hover{text-decoration:underline}[id^=sb_youtube_].sb_youtube .sby_player_wrap{z-index:1;width:100%!important;height:100%!important;position:absolute;top:0;left:0}[id^=sb_youtube_].sb_youtube .sby_player_wrap iframe{width:100%!important;height:100%!important}[id^=sb_youtube_].sb_youtube .sby_thumbnail_hover{opacity:0;display:block;position:absolute;top:0;right:0;bottom:0;left:0;z-index:10;color:#fff;background:#333;background:rgba(0,0,0,.6);transition:opacity .6s ease-in-out;-moz-transition:opacity .6s ease-in-out;-webkit-transition:opacity .6s ease-in-out}[id^=sb_youtube_].sb_youtube.sby_layout_list .sby_thumbnail_hover{display:none}.sby_video_title{display:inline-block;height:100%;padding:10px;overflow:hidden;font-size:13px;line-height:1.2}[id^=sb_youtube_].sb_youtube .sby_video_thumbnail:hover .sby_thumbnail_hover{opacity:1;display:block;transition:opacity .2s ease-in-out;-moz-transition:opacity .2s ease-in-out;-webkit-transition:opacity .2s ease-in-out}[id^=sb_youtube_].sb_youtube.sby_layout_list .sby_video_thumbnail:hover .sby_thumbnail_hover{opacity:0;display:none;transition:none;-moz-transition:none;-webkit-transition:none}[id^=sb_youtube_].sb_youtube .sby_video_thumbnail:hover .sby_play_btn{opacity:.5}[id^=sb_youtube_].sb_youtube .sby_play_btn{position:absolute;left:50%;bottom:50%;top:50%;right:50%;margin-top:-24px;margin-left:-24px;color:#fff;width:48px;opacity:1;transition:opacity .2s ease-in-out;-moz-transition:opacity .2s ease-in-out;-webkit-transition:opacity .2s ease-in-out}[id^=sb_youtube_].sb_youtube .sby_play_btn svg:not(:root).svg-inline--fa{width:48px;height:auto}[id^=sb_youtube_].sb_youtube .sby_play_btn i,[id^=sb_youtube_].sb_youtube .sby_play_btn svg{-webkit-filter:drop-shadow( 0 0 2px rgba(0,0,0,.4) );filter:drop-shadow( 0 0 2px rgba(0,0,0,.4) )}[id^=sb_youtube_].sb_youtube.sby_medium .sby_play_btn{margin-top:-12px;margin-left:-10px;width:23px}[id^=sb_youtube_].sb_youtube.sby_medium .sby_play_btn svg.svg-inline--fa.fa-play{width:23px}[id^=sb_youtube_].sb_youtube.sby_small .sby_play_btn{margin-top:-9px;margin-left:-7px;width:18px}[id^=sb_youtube_].sb_youtube.sby_small .sby_play_btn svg.svg-inline--fa.fa-play{width:18px}[id^=sb_youtube_].sb_youtube .sby_loader{width:20px;height:20px;position:relative;top:50%;left:50%;margin:-10px 0 0 -10px;background-color:#000;background-color:rgba(0,0,0,.5);border-radius:100%;-webkit-animation:sby-sk-scaleout 1s infinite ease-in-out;animation:sby-sk-scaleout 1s infinite ease-in-out}[id^=sb_youtube_].sb_youtube br{display:none}.sby_footer p{display:inline;padding:0;margin:0}[id^=sb_youtube_].sb_youtube .sby_footer .sby_loader,[id^=sb_youtube_].sb_youtube .sby_item .sby_loader,[id^=sb_youtube_].sb_youtube .sby_player_outer_wrap .sby_loader{position:absolute;margin-top:-11px;background-color:#fff}[id^=sb_youtube_].sb_youtube .sby_item.sby_player_loading,[id^=sb_youtube_].sb_youtube .sby_player_outer_wrap.sby_player_loading{opacity:.8}@-webkit-keyframes sby-sk-scaleout{0%{-webkit-transform:scale(0)}100%{-webkit-transform:scale(1);opacity:0}}@keyframes sby-sk-scaleout{0%{-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}100%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);opacity:0}}#sby_lightbox .fa-spin,[id^=sb_youtube_].sb_youtube .fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}#sby_lightbox .fa-pulse,[id^=sb_youtube_].sb_youtube .fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}[id^=sb_youtube_].sb_youtube .sb_youtube_header{float:left;clear:both;margin:0 0 15px 0;padding:0;line-height:1.2;width:100%}[id^=sb_youtube_].sb_youtube .sb_youtube_header a{float:left;display:block;text-decoration:none;transition:color .5s ease}@media all and (min-width:480px){[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_medium .sby_header_img{width:80px;height:80px;border-radius:40px}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_medium .sby_header_img img{width:80px;height:80px;border-radius:40px}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_medium .sby_header_text h3{font-size:20px}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_medium .sby_header_text .sby_bio,[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_medium .sby_header_text .sby_bio_info{font-size:14px}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_medium .sby_header_text .sby_bio,[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_medium .sby_header_text .sby_bio_info,[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_medium .sby_header_text h3{margin-left:95px!important;line-height:1.4}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_medium .sby_header_text h3{margin-right:-85px!important}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_medium .sby_header_text .sby_bio_info{margin-top:4px!important}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_medium .sby_header_text.sby_no_bio h3{padding-top:20px!important}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_large .sby_header_img{width:120px;height:120px;border-radius:60px}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_large .sby_header_img img{width:120px;height:120px;border-radius:60px}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_large .sby_header_text h3{font-size:28px}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_large .sby_header_text .sby_bio,[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_large .sby_header_text .sby_bio_info{font-size:16px}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_large .sby_header_text .sby_bio,[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_large .sby_header_text .sby_bio_info,[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_large .sby_header_text h3{margin-left:140px!important;line-height:1.5}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_large .sby_header_text h3{margin-right:-120px!important}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_large .sby_header_text .sby_bio_info{margin-top:12px!important}[id^=sb_youtube_].sb_youtube .sb_youtube_header.sby_large .sby_header_text.sby_no_bio h3{padding-top:32px!important}}[id^=sb_youtube_].sb_youtube .sb_youtube_header .sby_header_img{float:left;position:relative;width:50px;margin:0 0 0 -100%!important;overflow:hidden;-moz-border-radius:40px;-webkit-border-radius:40px;border-radius:40px}[id^=sb_youtube_].sb_youtube .sb_youtube_header .sby_header_img img{float:left;margin:0!important;padding:0!important;border:none!important;-moz-border-radius:40px;-webkit-border-radius:40px;border-radius:40px}[id^=sb_youtube_].sb_youtube .sb_youtube_header .sby_header_img_hover{opacity:0;position:absolute;width:100%;top:0;bottom:0;left:0;text-align:center;color:#fff;background:rgba(0,0,0,.75)}[id^=sb_youtube_].sb_youtube .sb_youtube_header .sby_header_img_hover .sby_new_logo{position:absolute;top:50%;left:50%;margin-top:-12px;margin-left:-12px;width:24px;height:24px;font-size:24px}[id^=sb_youtube_].sb_youtube .sb_youtube_header .sby_header_img_hover i{overflow:hidden;background:url(../img/small-logo.png) no-repeat 0 0}[id^=sb_youtube_].sb_youtube .sb_youtube_header .sby_header_img_hover{z-index:2;transition:opacity .4s ease-in-out}[id^=sb_youtube_].sb_youtube .sb_youtube_header .sby_fade_in{opacity:1;transition:opacity .2s ease-in-out}[id^=sb_youtube_].sb_youtube .sb_youtube_header .sby_header_img_hover{position:absolute;width:100%;top:0;bottom:0;left:0;text-align:center;color:#fff;background:rgba(0,0,0,.75);-moz-opacity:0;-khtml-opacity:0;opacity:0;border-radius:40px;transition:opacity .2s}[id^=sb_youtube_].sb_youtube .sb_youtube_header a:focus .sby_header_img_hover,[id^=sb_youtube_].sb_youtube .sb_youtube_header a:hover .sby_header_img_hover{opacity:1}[id^=sb_youtube_].sb_youtube .sb_youtube_header .sby_header_text{float:left;width:100%;padding-top:5px}[id^=sb_youtube_].sb_youtube .sb_youtube_header a{text-decoration:none}[id^=sb_youtube_].sb_youtube .sb_youtube_header .sby_header_text .sby_bio,[id^=sb_youtube_].sb_youtube .sb_youtube_header .sby_header_text h3{float:left;clear:both;width:auto;margin:0 0 0 60px!important;padding:0!important}[id^=sb_youtube_].sb_youtube .sb_youtube_header h3{font-size:16px;line-height:1.3}[id^=sb_youtube_].sb_youtube .sb_youtube_header p{font-size:13px;line-height:1.3;margin:0;padding:0}[id^=sb_youtube_].sb_youtube p:empty{display:none}[id^=sb_youtube_].sb_youtube .sb_youtube_header .sby_header_text img.emoji{margin-right:3px!important}[id^=sb_youtube_].sb_youtube .sb_youtube_header .sby_header_text.sby_no_bio h3{padding-top:9px!important}[id^=sb_youtube_].sb_youtube .sb_youtube_header .sby_header_text.sby_no_bio .sby_bio_info{clear:both}[id^=sb_youtube_].sb_youtube .sby_footer{float:left;clear:both;width:100%;text-align:center}[id^=sb_youtube_].sb_youtube .sby_footer .fa-spinner{display:none;position:absolute;top:50%;left:50%;margin:-8px 0 0 -7px;font-size:15px}[id^=sb_youtube_].sb_youtube .sby_footer{opacity:1;transition:all .5s ease-in}[id^=sb_youtube_].sb_youtube .sby_load_btn .sby_btn_text,[id^=sb_youtube_].sb_youtube .sby_load_btn .sby_loader{opacity:1;transition:all .1s ease-in}[id^=sb_youtube_].sb_youtube .sby_hidden{opacity:0!important}[id^=sb_youtube_].sb_youtube .sby_follow_btn a,[id^=sb_youtube_].sb_youtube .sby_footer .sby_load_btn{display:-moz-inline-stack;display:inline-block;vertical-align:top;zoom:1;padding:7px 14px;margin:5px auto 0 auto;background:#333;color:#eee;border:none;color:#fff;text-decoration:none;font-size:13px;line-height:1.5;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}[id^=sb_youtube_].sb_youtube .sby_footer .sby_load_btn{position:relative}[id^=sb_youtube_].sb_youtube .sby_follow_btn{display:-moz-inline-stack;display:inline-block;vertical-align:top;zoom:1;text-align:center}[id^=sb_youtube_].sb_youtube .sby_follow_btn.sby_top{display:block;margin-bottom:5px}[id^=sb_youtube_].sb_youtube .sby_follow_btn a{background:#408bd1;color:#fff}[id^=sb_youtube_].sb_youtube .sby_follow_btn a,[id^=sb_youtube_].sb_youtube .sby_footer .sby_load_btn{transition:all .1s ease-in}[id^=sb_youtube_].sb_youtube .sby_footer .sby_load_btn:hover{outline:0;box-shadow:inset 0 0 20px 20px rgba(255,255,255,.25)}[id^=sb_youtube_].sb_youtube .sby_follow_btn a:focus,[id^=sb_youtube_].sb_youtube .sby_follow_btn a:hover{outline:0;box-shadow:inset 0 0 10px 20px #359dff}[id^=sb_youtube_].sb_youtube .sby_follow_btn.sby_custom a:focus,[id^=sb_youtube_].sb_youtube .sby_follow_btn.sby_custom a:hover,[id^=sb_youtube_].sb_youtube .sby_footer .sby_load_btn.sby_custom:hover{box-shadow:inset 0 0 20px 20px rgba(255,255,255,.15)}[id^=sb_youtube_].sb_youtube .sby_follow_btn a:active,[id^=sb_youtube_].sb_youtube .sby_footer .sby_load_btn:active{box-shadow:inset 0 0 10px 20px rgba(0,0,0,.3)}[id^=sb_youtube_].sb_youtube .sby_follow_btn .fa,[id^=sb_youtube_].sb_youtube .sby_follow_btn svg{margin-bottom:-1px;margin-right:7px;font-size:15px}[id^=sb_youtube_].sb_youtube .sby_follow_btn svg{vertical-align:-.125em}[id^=sb_youtube_].sb_youtube .sby_footer .sby_follow_btn{margin-left:5px}@media all and (max-width:640px){[id^=sb_youtube_].sb_youtube.sby_col_3.sby_mob_col_auto .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_4.sby_mob_col_auto .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_5.sby_mob_col_auto .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_6.sby_mob_col_auto .sby_items_wrap .sby_item{width:50%}[id^=sb_youtube_].sb_youtube.sby_col_10 .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_10.sby_mob_col_auto .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_7 .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_7.sby_mob_col_auto .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_8 .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_8.sby_mob_col_auto .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_9 .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_9.sby_mob_col_auto .sby_items_wrap .sby_item{width:25%}[id^=sb_youtube_].sb_youtube.sby_col_2 .sby_items_wrap .sby_item{width:50%}[id^=sb_youtube_].sb_youtube.sby_col_3 .sby_items_wrap .sby_item{width:33.33%}[id^=sb_youtube_].sb_youtube.sby_col_4 .sby_items_wrap .sby_item{width:25%}[id^=sb_youtube_].sb_youtube.sby_col_5 .sby_items_wrap .sby_item{width:20%}[id^=sb_youtube_].sb_youtube.sby_col_6 .sby_items_wrap .sby_item{width:16.66%}[id^=sb_youtube_].sb_youtube.sby_col_7 .sby_items_wrap .sby_item{width:14.28%}[id^=sb_youtube_].sb_youtube.sby_col_8 .sby_items_wrap .sby_item{width:12.5%}[id^=sb_youtube_].sb_youtube.sby_col_9 .sby_items_wrap .sby_item{width:11.11%}[id^=sb_youtube_].sb_youtube.sby_col_10 .sby_items_wrap .sby_item{width:10%}[id^=sb_youtube_].sb_youtube.sby_width_resp{width:100%!important}}@media all and (max-width:480px){[id^=sb_youtube_].sb_youtube.sby_col_10.sby_mob_col_auto .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_3.sby_mob_col_auto .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_4.sby_mob_col_auto .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_5.sby_mob_col_auto .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_6.sby_mob_col_auto .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_7.sby_mob_col_auto .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_8.sby_mob_col_auto .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_col_9.sby_mob_col_auto .sby_items_wrap .sby_item,[id^=sb_youtube_].sb_youtube.sby_mob_col_1 .sby_items_wrap .sby_item{width:100%}[id^=sb_youtube_].sb_youtube.sby_mob_col_2 .sby_items_wrap .sby_item{width:50%}[id^=sb_youtube_].sb_youtube.sby_mob_col_3 .sby_items_wrap .sby_item{width:33.33%}[id^=sb_youtube_].sb_youtube.sby_mob_col_4 .sby_items_wrap .sby_item{width:25%}[id^=sb_youtube_].sb_youtube.sby_mob_col_5 .sby_items_wrap .sby_item{width:20%}[id^=sb_youtube_].sb_youtube.sby_mob_col_6 .sby_items_wrap .sby_item{width:16.66%}[id^=sb_youtube_].sb_youtube.sby_mob_col_7 .sby_items_wrap .sby_item{width:14.28%}}.sby_lightboxOverlay{position:absolute;top:0;left:0;z-index:9999;background-color:#000;opacity:.9;display:none}.sby_lightbox{position:absolute;left:0;width:100%;z-index:10000;line-height:0;font-weight:400}.sby_lightbox .sby_lb-image{display:block;height:auto;max-width:inherit;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px}.sby_lightbox a:active,.sby_lightbox a:focus,.sby_lightbox a:hover{outline:0}.sby_lightbox a img{border:none}.sby_lb-outerContainer{position:relative;background-color:#000;width:250px;height:250px;margin:0 auto 5px auto;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px}.sby_lb-outerContainer:after{content:"";display:table;clear:both}.sby_lb-container{position:relative;padding:4px;top:0;left:0;width:100%;height:100%;bottom:0;right:0;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px}.sby_lb-loader{position:absolute;top:43%;left:0;height:25%;width:100%;text-align:center;line-height:0}.sby_lb-cancel{display:block;width:32px;height:32px;margin:0 auto;background-color:#666;background-color:rgba(255,255,255,.5);border-radius:100%;-webkit-animation:ctf-sk-scaleout 1s infinite ease-in-out;animation:ctf-sk-scaleout 1s infinite ease-in-out}.sby_lb-nav{top:0;left:0;width:100%;z-index:10}.sby_lb-container>.nav{left:0}.sby_lb-nav a{position:absolute;z-index:100;top:0;height:90%;outline:0;background-image:url(data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)}.sby_lb-next,.sby_lb-prev{height:100%;cursor:pointer;display:block}.sby_lb-nav a.sby_lb-prev{width:50px;left:-70px;padding-left:10px;padding-right:10px;float:left;opacity:.5;-webkit-transition:opacity .2s;-moz-transition:opacity .2;-o-transition:opacity .2s;transition:opacity .2s}.sby_lb-nav a.sby_lb-prev:hover{opacity:1}.sby_lb-nav a.sby_lb-next{width:50px;right:-70px;padding-left:10px;padding-right:10px;float:right;opacity:.5;-webkit-transition:opacity .2s;-moz-transition:opacity .2s;-o-transition:opacity .2s;transition:opacity .2s}.sby_lb-nav a.sby_lb-next:hover{opacity:1}.sby_lb-nav span{display:block;top:55%;position:absolute;left:20px;width:34px;height:45px;margin:-25px 0 0 0;background:url(../img/sby-sprite.png) no-repeat}.sby_lb-nav a.sby_lb-prev span{background-position:-53px 0}.sby_lb-nav a.sby_lb-next span{left:auto;right:20px;background-position:-18px 0}.sby_lb-dataContainer{margin:0 auto;padding-top:5px;width:100%;font-family:"Open Sans",Helvetica,Arial,sans-serif;-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px}.sby_lb-dataContainer:after{content:"";display:table;clear:both}.sby_lb-data{padding:0 4px;color:#ccc}.sby_lb-data .sby_lb-details{width:85%;float:left;text-align:left;line-height:1.1}.sby_lb-data .sby_lb-caption{float:left;font-size:13px;font-weight:400;line-height:1.3;padding-bottom:3px;color:#ccc;word-wrap:break-word;-webkit-hyphens:auto;-moz-hyphens:auto;hyphens:auto}.sby_lb-data .sby_lb-caption .ctf-screename-sep,.sby_lb-data .sby_lb-caption a{color:#ccc;font-weight:700;text-decoration:none}.sby_lb-data .sby_lb-caption a:hover{color:#fff;text-decoration:underline}.sby_lb-data .sby_lb-caption .sby_lightbox_username{float:left;width:100%;color:#ccc;padding-bottom:0;display:block;margin:0 0 5px 0}.sby_lb-data .sby_lb-caption .sby_lightbox_username{color:#ccc}.sby_lb-data .sby_lb-caption .sby_lightbox_username:hover p{color:#fff;text-decoration:underline}.sby_lightbox .sby_lightbox_username img{float:left;border:none;width:48px;height:48px;margin-right:10px;background:#666;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sby_lightbox_username p{float:left;margin:0;padding:0;color:#ccc;line-height:32px;font-weight:700;font-size:13px;text-align:left}.sby_lb-data .ctf-caption-text{width:100%;margin-left:58px;padding-top:3px}.sby_lb-data .sby_lb-caption .ctf-author-screenname,.sby_lb-data .sby_lb-caption .ctf-tweet-date{font-weight:400}.sby_lb-data .sby_lb-info{width:100%;float:left;clear:both}.sby_lb-data .sby_lb-number{display:block;float:left;clear:both;padding:5px 0 15px 0;font-size:12px;color:#999}.sby_lb-data .sby_lb-close{display:block;float:right;width:30px;height:30px;background:url(../img/close.png) top right no-repeat;text-align:right;outline:0;opacity:.7;-webkit-transition:opacity .2s;-moz-transition:opacity .2s;-o-transition:opacity .2s;transition:opacity .2s}.sby_lb-data .sby_lb-close:hover{cursor:pointer;opacity:1}.sby_lb-nav{height:auto}.sby_lb-container{padding:0}.sby_lb-container iframe{position:absolute;top:0;left:0;width:100%;height:100%;z-index:1}#sby_lightbox .sby_lightbox_action{float:left;position:relative;padding:0 0 0 10px;margin:5px 0 0 10px;border-left:1px solid #666;font-size:12px}#sby_lightbox .sby_lightbox_action a{display:block;float:left;color:#999;text-decoration:none}#sby_lightbox .sby_lightbox_action a:focus,#sby_lightbox .sby_lightbox_action a:hover{color:#fff}#sby_lightbox .sby_lightbox_action .fa,#sby_lightbox .sby_lightbox_action svg{margin-right:5px}#sby_lightbox .sby_lightbox_action.sby_youtube .fa{font-size:13px}#sby_lightbox .sby_tooltip_social a svg{font-size:19px;padding:3px 4px;margin:auto}#sby_lightbox .sby_lightbox_tooltip{display:none;position:absolute;width:100px;bottom:22px;left:0;padding:5px 10px;margin:0;background:rgba(255,255,255,.9);color:#222;font-size:12px;line-height:1.3;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;box-shadow:0 0 10px rgba(0,0,0,.4);-moz-box-shadow:0 0 10px rgba(0,0,0,.4);-webkit-box-shadow:0 0 10px rgba(0,0,0,.4);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#sby_lightbox .sby_lightbox_tooltip .fa-play{position:absolute;font-size:8px;bottom:-6px;left:36px;color:rgba(255,255,255,.9)}#sby_lightbox .sby_tooltip_social a .fa{font-size:16px;margin:0;padding:5px}#sby_lightbox .sby_tooltip_social a#sby_facebook_icon .fa,#sby_lightbox .sby_tooltip_social a#sby_pinterest_icon .fa,#sby_lightbox .sby_tooltip_social a#sby_twitter_icon .fa{padding-top:4px;font-size:18px}#sby_lightbox #sby_mod_box{width:280px;padding:5px 10px 7px 10px}#sby_lightbox .sby_tooltip_social{width:172px;padding:5px 5px 4px 5px}#sby_lightbox .sby_tooltip_social a{color:#333;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}#sby_lightbox .sby_lightbox_action #sby_facebook_icon:hover{background:#3b5998}#sby_lightbox .sby_lightbox_action #sby_twitter_icon:hover{background:#00aced}#sby_lightbox .sby_lightbox_action #sby_google_icon:hover{background:#dd4b39}#sby_lightbox .sby_lightbox_action #sby_linkedin_icon:hover{background:#007bb6}#sby_lightbox .sby_lightbox_action #sby_pinterest_icon:hover{background:#cb2027}#sby_lightbox .sby_lightbox_action #sby_email_icon:hover{background:#333}.sby_lb-dataContainer,.sby_lb-outerContainer{min-width:450px}@media all and (max-width:450px){.sby_lb-dataContainer,.sby_lb-outerContainer{min-width:0}}.sby_lightbox .sby_lb-image{display:block;height:auto;max-width:inherit;margin:0 auto;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0}#sby_mod_error{display:none;border:1px solid #ddd;background:#eee;color:#333;margin:10px 0 0;padding:10px 15px;font-size:13px;text-align:center;clear:both;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}#sby_mod_error p{padding:5px 0!important;margin:0!important;line-height:1.3!important}#sby_mod_error ol,#sby_mod_error ul{padding:5px 0 5px 20px!important;margin:0!important}#sby_mod_error li{padding:1px 0!important;margin:0!important}#sby_mod_error span{font-size:12px}[id^=sb_youtube_].sb_youtube svg:not(:root).svg-inline--fa,[id^=sb_youtube_].sb_youtube_lightbox svg:not(:root).svg-inline--fa{box-sizing:unset;overflow:visible;width:1em}[id^=sb_youtube_].sb_youtube .svg-inline--fa.fa-w-16{width:16px}[id^=sb_youtube_].sb_youtube .svg-inline--fa,[id^=sb_youtube_].sb_youtube_lightbox .svg-inline--fa{display:inline-block;font-size:inherit;height:1em;overflow:visible;vertical-align:-.125em}[id^=sb_youtube_].sb_youtube.sby_player_loaded .sby_player_outer_wrap .sby_video_thumbnail,[id^=sb_youtube_].sb_youtube.sby_player_loaded.sby_layout_list .sby_video_thumbnail{z-index:-1!important}
img/carousel.png ADDED
Binary file
img/pro.png CHANGED
Binary file
inc/admin/admin-functions.php CHANGED
@@ -62,15 +62,77 @@ function sby_admin_init() {
62
  'input_type' => 'text',
63
  'default' => $first_channel_id,
64
  'note' => __( 'Eg: Channel ID or User Name', SBY_TEXT_DOMAIN ),
65
- 'tooltip' => '<p><ul>
 
 
66
  <li><b>' . __( 'Channel ID or User Name', SBY_TEXT_DOMAIN ).'</b><br>
67
  ' . __( 'You can find the ID or User Name of your YouTube Channel from the URL. In each URL format, the text you need to use is highlighted below:', SBY_TEXT_DOMAIN ).'<br><br>
68
  ' . __( 'URL Format 1:', SBY_TEXT_DOMAIN ).' <code>https://www.youtube.com/channel/<span class="sbspf-highlight">UC1a2b3c4D5F6g7i8j9k</span></code>
69
  <br>
70
  ' . __( 'URL Format 2:', SBY_TEXT_DOMAIN ).' <code>https://www.youtube.com/user/<span class="sbspf-highlight">your_user_name</span></code>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  </li>
72
- </ul>
73
- <span class="sbspf_aside">Note that the "username" example is a legacy feature only available to older accounts.</span></p>'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  )
75
  );
76
  $admin->set_feed_types( $types );
@@ -78,12 +140,6 @@ function sby_admin_init() {
78
  $text_domain = SBY_TEXT_DOMAIN;
79
  /* Layout */
80
  $layouts = array(
81
- array(
82
- 'slug' => 'list',
83
- 'label' => __( 'List', $text_domain ),
84
- 'image' => 'img/list.png',
85
- 'note' => __( 'A single columns of videos that play when clicked.', $text_domain ),
86
- ),
87
  array(
88
  'slug' => 'grid',
89
  'label' => __( 'Grid', $text_domain ),
@@ -96,8 +152,11 @@ function sby_admin_init() {
96
  'label' => __( 'Columns', $text_domain ),
97
  'min' => 1,
98
  'max' => 7,
99
- 'default' => 4,
100
- 'shortcode_example' => 3
 
 
 
101
  ),
102
  array(
103
  'name' => 'colsmobile',
@@ -106,7 +165,10 @@ function sby_admin_init() {
106
  'min' => 1,
107
  'max' => 2,
108
  'default' => 2,
109
- 'shortcode_example' => 2
 
 
 
110
  ),
111
  )
112
  ),
@@ -122,8 +184,50 @@ function sby_admin_init() {
122
  'label' => __( 'Columns', $text_domain ),
123
  'min' => 1,
124
  'max' => 7,
125
- 'default' => 4,
126
- 'shortcode_example' => 3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  ),
128
  array(
129
  'name' => 'colsmobile',
@@ -131,8 +235,82 @@ function sby_admin_init() {
131
  'label' => __( 'Mobile Columns', $text_domain ),
132
  'min' => 1,
133
  'max' => 2,
 
 
 
 
 
 
 
 
 
 
 
134
  'default' => 1,
135
- 'shortcode_example' => 2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
  ),
137
  )
138
  ),
@@ -153,6 +331,10 @@ function sby_admin_init() {
153
  'slug' => 'layout',
154
  'label' => __( 'Layout Options', SBY_TEXT_DOMAIN ),
155
  ),
 
 
 
 
156
  array(
157
  'slug' => 'header',
158
  'label' => __( 'Header Options', SBY_TEXT_DOMAIN ),
@@ -693,6 +875,20 @@ function sby_process_nags() {
693
  }
694
  add_action( 'admin_init', 'sby_process_nags' );
695
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
696
  function sby_get_future_date( $month, $year, $week, $day, $direction ) {
697
  if ( $direction > 0 ) {
698
  $startday = 1;
62
  'input_type' => 'text',
63
  'default' => $first_channel_id,
64
  'note' => __( 'Eg: Channel ID or User Name', SBY_TEXT_DOMAIN ),
65
+ 'example' => 'smashballoon',
66
+ 'description' => __( 'Display videos from a YouTube channel (channel)', SBY_TEXT_DOMAIN ),
67
+ 'tooltip' => '<p>' . __( 'Enter any channel ID or user name to display all of an accounts latest videos starting with the most recently published.', SBY_TEXT_DOMAIN ) . '</p><p><ul>
68
  <li><b>' . __( 'Channel ID or User Name', SBY_TEXT_DOMAIN ).'</b><br>
69
  ' . __( 'You can find the ID or User Name of your YouTube Channel from the URL. In each URL format, the text you need to use is highlighted below:', SBY_TEXT_DOMAIN ).'<br><br>
70
  ' . __( 'URL Format 1:', SBY_TEXT_DOMAIN ).' <code>https://www.youtube.com/channel/<span class="sbspf-highlight">UC1a2b3c4D5F6g7i8j9k</span></code>
71
  <br>
72
  ' . __( 'URL Format 2:', SBY_TEXT_DOMAIN ).' <code>https://www.youtube.com/user/<span class="sbspf-highlight">your_user_name</span></code>
73
+ </li>
74
+ </ul></p>'
75
+ ),
76
+ array(
77
+ 'slug' => 'playlist',
78
+ 'label' => __( 'Playlist', SBY_TEXT_DOMAIN ),
79
+ 'input_type' => 'text',
80
+ 'default' => '',
81
+ 'pro' => true,
82
+ 'note' => __( 'Eg: Playlist ID', SBY_TEXT_DOMAIN ),
83
+ 'example' => 'PLLLm1a2b3c4D6g7i8j9k_1a',
84
+ 'description' => __( 'Display videos from a specific playlist (playlist)', SBY_TEXT_DOMAIN ),
85
+ 'tooltip' => '<p>' . __( 'Enter any playlist ID to display videos from a playlist starting with the most recently published.', SBY_TEXT_DOMAIN ) . '</p><p><ul>
86
+ <li><b>' . __( 'Playlist ID', SBY_TEXT_DOMAIN ).'</b><br>
87
+ ' . __( 'You can find the ID of your YouTube playlist from the URL. The text you need to use is highlighted below:', SBY_TEXT_DOMAIN ).'<br><br>
88
+ <code>https://www.youtube.com/playlist?list=<span class="sbspf-highlight">PLLLm1a2b3c4D6g7i8j9k_1a2b3c4D57i8j9k</span></code>
89
  </li>
90
+ </ul></p>'
91
+ ),
92
+ array(
93
+ 'slug' => 'favorites',
94
+ 'label' => __( 'Favorites', SBY_TEXT_DOMAIN ),
95
+ 'input_type' => 'text',
96
+ 'default' => '',
97
+ 'pro' => true,
98
+ 'note' => __( 'Eg: Channel ID or User Name', SBY_TEXT_DOMAIN ),
99
+ 'example' => 'smashballoon',
100
+ 'description' => __( 'Display the "favorites" playlist for a channel (favorites)', SBY_TEXT_DOMAIN ),
101
+ 'tooltip' => '<p>' . __( 'Displays all videos marked as "favorites" by a YouTube account starting with the most recently published.', SBY_TEXT_DOMAIN ) . '</p><p><ul>
102
+ <li><b>' . __( 'Channel ID or User Name', SBY_TEXT_DOMAIN ).'</b><br>
103
+ ' . __( 'You can find the ID or User Name of your YouTube Channel from the URL. In each URL format, the text you need to use is highlighted below:', SBY_TEXT_DOMAIN ).'<br><br>
104
+ ' . __( 'URL Format 1:', SBY_TEXT_DOMAIN ).' <code>https://www.youtube.com/channel/<span class="sbspf-highlight">UC1a2b3c4D5F6g7i8j9k</span></code>
105
+ <br>
106
+ ' . __( 'URL Format 2:', SBY_TEXT_DOMAIN ).' <code>https://www.youtube.com/user/<span class="sbspf-highlight">your_user_name</span></code>
107
+ </li>
108
+ </ul></p>'
109
+ ),
110
+ array(
111
+ 'slug' => 'search',
112
+ 'label' => __( 'Search', SBY_TEXT_DOMAIN ),
113
+ 'input_type' => 'text',
114
+ 'default' => '',
115
+ 'pro' => true,
116
+ 'note' => __( 'Eg: Search Term', SBY_TEXT_DOMAIN ),
117
+ 'example' => 'cats',
118
+ 'description' => __( 'Display a feed of matching search results (search)', SBY_TEXT_DOMAIN ),
119
+ 'tooltip' => '<p>' . __( 'Enter any search term or phrase. Separate multiple terms with commas. You can add your own additional query vars using the <a href="https://smashballoon.com/youtube-feed/custom-search-guide/" target="_blank" rel="noopener">guide on our website</a> and the input field above.', SBY_TEXT_DOMAIN ) . '</p>',
120
+ ),
121
+ array(
122
+ 'slug' => 'live',
123
+ 'label' => __( 'Live Streams', SBY_TEXT_DOMAIN ),
124
+ 'input_type' => 'text',
125
+ 'default' => '',
126
+ 'pro' => true,
127
+ 'note' => __( 'Eg: Channel ID', SBY_TEXT_DOMAIN ),
128
+ 'example' => 'UC1a2b3c4D5F6g7i8j9k',
129
+ 'description' => __( 'Display upcoming and currently playing live streams (live)', SBY_TEXT_DOMAIN ),
130
+ 'tooltip' => '<p>' . __( 'Displays upcoming and currently playing live streaming videos sorted by soonest scheduled broadcast.', SBY_TEXT_DOMAIN ) . '</p><p><ul>
131
+ <li><b>' . __( 'Channel ID', SBY_TEXT_DOMAIN ).'</b><br>
132
+ ' . __( 'You can find the ID of your YouTube Channel from the URL. The text you need to use is highlighted below:', SBY_TEXT_DOMAIN ).'<br><br>
133
+ <code>https://www.youtube.com/channel/<span class="sbspf-highlight">UC1a2b3c4D5F6g7i8j9k</span></code>
134
+ </li>
135
+ </ul></p>'
136
  )
137
  );
138
  $admin->set_feed_types( $types );
140
  $text_domain = SBY_TEXT_DOMAIN;
141
  /* Layout */
142
  $layouts = array(
 
 
 
 
 
 
143
  array(
144
  'slug' => 'grid',
145
  'label' => __( 'Grid', $text_domain ),
152
  'label' => __( 'Columns', $text_domain ),
153
  'min' => 1,
154
  'max' => 7,
155
+ 'default' => 3,
156
+ 'shortcode' => array(
157
+ 'example' => '3',
158
+ 'description' => __( 'Videos in carousel when 480px screen width or less.', $text_domain ),
159
+ )
160
  ),
161
  array(
162
  'name' => 'colsmobile',
165
  'min' => 1,
166
  'max' => 2,
167
  'default' => 2,
168
+ 'shortcode' => array(
169
+ 'example' => '2',
170
+ 'description' => __( 'Columns when 480px screen width or less.', $text_domain ),
171
+ )
172
  ),
173
  )
174
  ),
184
  'label' => __( 'Columns', $text_domain ),
185
  'min' => 1,
186
  'max' => 7,
187
+ 'default' => 3,
188
+ 'shortcode' => array(
189
+ 'example' => '3',
190
+ 'description' => __( 'Videos in carousel when 480px screen width or less.', $text_domain ),
191
+ )
192
+ ),
193
+ array(
194
+ 'name' => 'colsmobile',
195
+ 'callback' => 'select',
196
+ 'label' => __( 'Mobile Columns', $text_domain ),
197
+ 'min' => 1,
198
+ 'max' => 2,
199
+ 'default' => 2,
200
+ 'shortcode' => array(
201
+ 'example' => '2',
202
+ 'description' => __( 'Columns when 480px screen width or less.', $text_domain ),
203
+ )
204
+ ),
205
+ )
206
+ ),
207
+ array(
208
+ 'slug' => 'list',
209
+ 'label' => __( 'List', $text_domain ),
210
+ 'image' => 'img/list.png',
211
+ 'note' => __( 'A single columns of videos that play when clicked.', $text_domain ),
212
+ ),
213
+ array(
214
+ 'slug' => 'carousel',
215
+ 'label' => __( 'Carousel', $text_domain ),
216
+ 'image' => 'img/carousel.png',
217
+ 'note' => __( 'Posts are displayed in a slideshow carousel.', $text_domain ),
218
+ 'pro' => true,
219
+ 'options' => array(
220
+ array(
221
+ 'name' => 'cols',
222
+ 'callback' => 'select',
223
+ 'label' => __( 'Columns', $text_domain ),
224
+ 'min' => 1,
225
+ 'max' => 7,
226
+ 'default' => 3,
227
+ 'shortcode' => array(
228
+ 'example' => '3',
229
+ 'description' => __( 'Videos in carousel when 480px screen width or less.', $text_domain ),
230
+ )
231
  ),
232
  array(
233
  'name' => 'colsmobile',
235
  'label' => __( 'Mobile Columns', $text_domain ),
236
  'min' => 1,
237
  'max' => 2,
238
+ 'default' => 2,
239
+ 'shortcode' => array(
240
+ 'example' => '2',
241
+ 'description' => __( 'Columns when 480px screen width or less.', $text_domain ),
242
+ ) ),
243
+ array(
244
+ 'name' => 'rows',
245
+ 'callback' => 'select',
246
+ 'label' => __( 'Number of Rows', $text_domain ),
247
+ 'min' => 1,
248
+ 'max' => 2,
249
  'default' => 1,
250
+ 'shortcode' => array(
251
+ 'example' => '2',
252
+ 'description' => __( 'Choose 2 rows to show two posts in a single slide.', $text_domain ),
253
+ )
254
+ ),
255
+ array(
256
+ 'name' => 'loop',
257
+ 'callback' => 'select',
258
+ 'label' => __( 'Loop Type', $text_domain ),
259
+ 'options' => array(
260
+ array(
261
+ 'label' => __( 'Rewind', $text_domain ),
262
+ 'value' => 'rewind'
263
+ ),
264
+ array(
265
+ 'label' => __( 'Infinity', $text_domain ),
266
+ 'value' => 'infinity'
267
+ )
268
+ ),
269
+ 'default' => 'rewind',
270
+ 'shortcode' => array(
271
+ 'example' => 'infinity',
272
+ 'description' => __( 'What happens when the last slide is reached.', $text_domain ),
273
+ )
274
+ ),
275
+ array(
276
+ 'name' => 'arrows',
277
+ 'callback' => 'checkbox',
278
+ 'label' => __( 'Show Navigation Arrows', $text_domain ),
279
+ 'default' => true,
280
+ 'shortcode' => array(
281
+ 'example' => 'false',
282
+ 'description' => __( 'Show arrows on the sides to navigate posts.', $text_domain ),
283
+ )
284
+ ),
285
+ array(
286
+ 'name' => 'pag',
287
+ 'callback' => 'checkbox',
288
+ 'label' => __( 'Show Pagination', $text_domain ),
289
+ 'default' => true,
290
+ 'shortcode' => array(
291
+ 'example' => 'false',
292
+ 'description' => __( 'Show dots below carousel for an ordinal indication of which slide is being shown.', $text_domain ),
293
+ )
294
+ ),
295
+ array(
296
+ 'name' => 'autoplay',
297
+ 'callback' => 'checkbox',
298
+ 'label' => __( 'Enable Autoplay', $text_domain ),
299
+ 'default' => false,
300
+ 'shortcode' => array(
301
+ 'example' => 'true',
302
+ 'description' => __( 'Whether or not to change slides automatically on an interval.', $text_domain ),
303
+ )
304
+ ),
305
+ array(
306
+ 'name' => 'time',
307
+ 'callback' => 'text',
308
+ 'label' => __( 'Interval Time', $text_domain ),
309
+ 'default' => 5000,
310
+ 'shortcode' => array(
311
+ 'example' => '3000',
312
+ 'description' => __( 'Duration in milliseconds before the slide changes.', $text_domain ),
313
+ )
314
  ),
315
  )
316
  ),
331
  'slug' => 'layout',
332
  'label' => __( 'Layout Options', SBY_TEXT_DOMAIN ),
333
  ),
334
+ array(
335
+ 'slug' => 'experience',
336
+ 'label' => __( 'Video Experience Options', SBY_TEXT_DOMAIN ),
337
+ ),
338
  array(
339
  'slug' => 'header',
340
  'label' => __( 'Header Options', SBY_TEXT_DOMAIN ),
875
  }
876
  add_action( 'admin_init', 'sby_process_nags' );
877
 
878
+
879
+ function sby_lite_dismiss() {
880
+ if ( ! isset( $_POST['sbspf_nonce'] ) ) return;
881
+ $nonce = $_POST['sbspf_nonce'];
882
+ if ( ! wp_verify_nonce( $nonce, 'sbspf_nonce' ) ) {
883
+ die ( 'You did not do this the right way!' );
884
+ }
885
+
886
+ set_transient( 'youtube_feed_dismiss_lite', 'dismiss', 1 * WEEK_IN_SECONDS );
887
+
888
+ die();
889
+ }
890
+ add_action( 'wp_ajax_sby_lite_dismiss', 'sby_lite_dismiss' );
891
+
892
  function sby_get_future_date( $month, $year, $week, $day, $direction ) {
893
  if ( $direction > 0 ) {
894
  $startday = 1;
inc/admin/class-sbspf-admin.php CHANGED
@@ -25,6 +25,8 @@ class SB_YOUTUBE_Admin {
25
 
26
  protected $option_name;
27
 
 
 
28
  protected $types;
29
 
30
  protected $layouts;
@@ -51,6 +53,7 @@ class SB_YOUTUBE_Admin {
51
  }
52
  $this->settings = $settings;
53
  $this->option_name = $option_name;
 
54
  $this->false_fields = array();
55
  $this->textarea_fields = array();
56
  $this->display_your_feed_sections = array();
@@ -78,9 +81,166 @@ class SB_YOUTUBE_Admin {
78
  public function init() {
79
  add_action( 'admin_menu', array( $this, 'create_menus' ) );
80
  add_action( 'admin_init', array( $this, 'settings_init' ) );
 
 
81
  }
82
 
83
  public function settings_init() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
 
85
  }
86
 
@@ -123,9 +283,12 @@ class SB_YOUTUBE_Admin {
123
  );
124
 
125
  $save_after = isset( $args['save_after'] ) ? $args['save_after'] : false;
 
126
  $this->settings_sections[ $args['tab'] ][] = array(
127
  'id' => $args['id'],
128
- 'save_after' => $save_after
 
 
129
  );
130
  }
131
 
@@ -136,7 +299,39 @@ class SB_YOUTUBE_Admin {
136
  $title_after = isset( $args['shortcode']['after'] ) ? $args['shortcode']['after'] : '';
137
  $shortcode = $args['shortcode'];
138
  }
139
- $title = $this->format_title( $args['title'], $args['name'], $shortcode, $title_after );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
 
141
  if ( $args['callback'] === 'checkbox' || (isset( $args['falsefield'] ) && $args['falsefield'] === true) ) {
142
  $tab = 'none';
@@ -151,12 +346,40 @@ class SB_YOUTUBE_Admin {
151
  $this->add_false_field( $args['name'], $tab );
152
  }
153
 
154
- if ( $args['callback'] === 'layout' ) {
155
- foreach ( $args['layouts'] as $layout ) {
156
- if ( isset( $layout['options'] ) ) {
157
- foreach( $layout['options'] as $option ) {
158
- if ( $option['callback'] === 'checkbox' ) {
159
- $this->add_false_field( $layout['slug'] . $option['name'], 'customize' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  }
161
  }
162
  }
@@ -185,10 +408,6 @@ class SB_YOUTUBE_Admin {
185
  $args
186
  );
187
 
188
- if ( $shortcode ) {
189
- $this->display_your_feed_sections[ $shortcode['display_section'] ]['settings'][] = $shortcode;
190
- }
191
-
192
  if ( isset( $args['hidden'] ) ) {
193
  if ( $args['hidden']['callback'] === 'checkbox' ) {
194
  $tab = 'none';
@@ -227,9 +446,11 @@ class SB_YOUTUBE_Admin {
227
  $selected = isset( $this->settings[ $args['name'] ] ) ? $this->settings[ $args['name'] ] : $default;
228
  $label = isset( $args['label'] ) ? $args['label'] : __( 'Yes' );
229
  $tooltip_text = isset( $args['tooltip_text'] ) ? $args['label'] : $this->default_tooltip_text();
230
- $has_shortcode = isset( $args['has_shortcode'] ) && $args['has_shortcode'] ? '1' : '';
 
 
231
  ?>
232
- <input name="<?php echo $this->option_name .'['.esc_attr( $args['name'] ).']'; ?>" id="<?php echo $this->option_name . '_' . $args['name']; ?>" type="checkbox"<?php if ( $selected ) echo ' checked'; ?>/>
233
  <label for="<?php echo $this->option_name . '_' . $args['name'] . $has_shortcode; ?>"><?php echo esc_html( $label ); ?></label><?php if ( $has_shortcode === '1' ) : ?><code class="sbspf_shortcode"> <?php echo $args['name'] . "\n"; ?>
234
  Eg: <?php echo $args['name']; ?>=<?php echo $args['shortcode_example']; ?></code><br><?php endif; ?>
235
  <?php if ( isset( $args['tooltip_info'] ) ) : ?>
@@ -248,8 +469,9 @@ class SB_YOUTUBE_Admin {
248
  <?php foreach ( $args['select_options'] as $select_option ) :
249
  $selected = in_array( $select_option['value'], $selection_array, true );
250
  $pro_only = (isset( $select_option['pro'] ) && $select_option['pro']) ? ' sbspf_pro_only' : '';
 
251
  ?>
252
- <div class="sbspf_multi_checkbox_option<?php echo $pro_only; ?>">
253
  <input name="<?php echo $this->option_name .'['.esc_attr( $args['name'] ).'][]'; ?>" id="<?php echo $this->option_name . '_' . $args['name']. '_' . $index; ?>" value="<?php echo esc_attr( $select_option['value'] ); ?>" type="checkbox"<?php if ( $selected ) echo ' checked'; ?>/>
254
  <label for="<?php echo $this->option_name . '_' . $args['name'] . '_' . $index; ?>"><?php echo esc_html( $select_option['label'] ); ?></label>
255
  </div>
@@ -271,6 +493,8 @@ class SB_YOUTUBE_Admin {
271
  $class = isset( $args['class'] ) ? ' class="'. esc_attr( $args['class'] ) . '"' : '';
272
 
273
  $tooltip_text = isset( $args['tooltip_text'] ) ? $args['label'] : $this->default_tooltip_text();
 
 
274
 
275
  if ( isset( $args['min'] ) ) :
276
  $min = ( isset( $args['min'] ) ) ? ' min="'. $args['min'].'"' : '';
@@ -338,8 +562,9 @@ class SB_YOUTUBE_Admin {
338
  }
339
 
340
  $tooltip_text = isset( $args['tooltip_text'] ) ? $args['label'] : $this->default_tooltip_text();
 
341
  ?>
342
- <select name="<?php echo $this->option_name.'['.$args['name'].']'; ?>" id="<?php echo $this->option_name . '_' . $args['name']; ?>">
343
  <?php foreach ( $args['options'] as $select_option ) : ?>
344
  <option value="<?php echo esc_attr( $select_option['value'] ); ?>"<?php if ( (string)$select_option['value'] === (string)$value ) echo ' selected'; ?>><?php echo esc_html( $select_option['label'] ); ?></option>
345
  <?php endforeach; ?>
@@ -358,12 +583,13 @@ class SB_YOUTUBE_Admin {
358
  public function textarea( $args ) {
359
  $default = isset( $args['default'] ) ? $args['default'] : '';
360
  $value = isset( $this->settings[ $args['name'] ] ) ? stripslashes( $this->settings[ $args['name'] ] ) : $default;
 
361
 
362
  if ( isset( $args['tooltip_info'] ) ) : ?>
363
  <span><?php echo $args['tooltip_info']; ?></span><br>
364
  <?php endif; ?>
365
 
366
- <textarea name="<?php echo $this->option_name.'['.$args['name'].']'; ?>" id="<?php echo $this->option_name . '_' . $args['name']; ?>"rows="7"><?php echo $value; ?></textarea>
367
 
368
  <?php if ( isset( $args['note'] ) ) : ?>
369
  <br><span class="sbspf_note"><?php echo $args['note']; ?></span>
@@ -385,8 +611,9 @@ class SB_YOUTUBE_Admin {
385
  $selected = isset( $this->settings[ $type['slug'] . '_ids' ] ) ? $this->settings[ $type['slug'] . '_ids' ] : array();
386
  }
387
  $on_select = isset( $type['onselect'] ) ? $type['onselect'] : false;
 
388
  ?>
389
- <div class="sbspf_row sbspf_type_row" style="min-height: 29px;">
390
  <div class="sbspf_col sbspf_one">
391
  <input type="radio" name="<?php echo $this->option_name.'['.esc_attr( $args['name'] ).']'; ?>" class="sbspf_type_input" id="sbspf_type_<?php echo esc_attr( $type['slug'] ); ?>" value="<?php echo esc_attr( $type['slug'] ); ?>"<?php if ( $type_selected === $type['slug'] ) echo 'checked'; ?>>
392
  <label class="sbspf_radio_label" for="sbspf_type_<?php echo esc_attr( $type['slug'] ); ?>"><?php echo esc_html( $type['label'] ); ?>: <a class="sbspf_type_tooltip_link" href="JavaScript:void(0);"><i class="fa fa-question-circle" aria-hidden="true" style="margin-left: 2px;"></i></a></label>
@@ -432,6 +659,65 @@ class SB_YOUTUBE_Admin {
432
  <?php endforeach;
433
  }
434
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
435
  public function cache( $args ) {
436
  $social_network = $this->vars->social_network();
437
  $type_selected = isset( $this->settings['caching_type'] ) ? $this->settings['caching_type'] : 'page';
@@ -526,37 +812,42 @@ class SB_YOUTUBE_Admin {
526
  $value = isset( $this->settings[ $args['name'] ] ) ? $this->settings[ $args['name'] ] : $default;
527
  ?>
528
  <div class="sbspf_layouts">
529
- <?php foreach ( $args['layouts'] as $layout ) : ?>
530
- <div class="sbspf_layout_cell">
 
 
531
  <input class="sbspf_layout_type" id="sbspf_layout_type_<?php echo esc_attr( $layout['slug'] ); ?>" name="<?php echo $this->option_name.'['.$args['name'].']'; ?>" type="radio" value="<?php echo esc_attr( $layout['slug'] ); ?>"<?php if ( $layout['slug'] === $value ) echo ' checked'?>><label for="sbspf_layout_type_<?php echo esc_attr( $layout['slug'] ); ?>"><span class="sbspf_label"><?php echo $layout['label']; ?></span><img src="<?php echo esc_url( $this->vars->plugin_url() . $layout['image'] ); ?>"></label>
532
  </div>
533
  <?php endforeach; ?>
534
 
535
  <div class="sbspf_layout_options_wrap">
536
- <?php foreach ( $args['layouts'] as $layout ) : ?>
537
- <div class="sbspf_layout_settings sbspf_layout_type_<?php echo esc_attr( $layout['slug'] ); ?>">
 
 
538
 
539
  <div class="sbspf_layout_setting">
540
  <?php echo sby_admin_icon( 'info-circle' ); ?>&nbsp;&nbsp;&nbsp;<span class="sbspf_note" style="margin-left: 0;"><?php echo $layout['note']; ?></span>
541
  </div>
542
  <?php if ( ! empty( $layout['options'] ) ) : ?>
543
- <div class="sbspf_layout_setting">
544
- <?php foreach ( $layout['options'] as $option ) :
545
- $option['name'] = $layout['slug'].$option['name'];
546
- ?>
547
- <div class="ctf_layout_setting">
548
- <?php if ( $option['callback'] !== 'checkbox' ) : ?>
549
- <label title="<?php echo __( 'Click for shortcode option', $this->vars->text_domain() ); ?>"><?php echo $option['label']; ?></label><code class="sbspf_shortcode"> <?php echo $option['name'] . "\n"; ?>
550
- Eg: <?php echo $option['name']; ?>=<?php echo $option['shortcode_example']; ?></code><br>
551
- <?php else:
552
- $option['has_shortcode'] = true;
553
- endif; ?>
554
- <?php call_user_func_array( array( $this, $option['callback'] ), array( $option ) ); ?>
555
 
556
- </div>
 
 
557
 
558
- <?php endforeach; ?>
559
- </div>
 
560
  <?php endif; ?>
561
 
562
  </div>
@@ -567,6 +858,14 @@ class SB_YOUTUBE_Admin {
567
  <?php
568
  }
569
 
 
 
 
 
 
 
 
 
570
  public function format_title( $label, $name, $shortcode_args = false, $after = '' ) {
571
  $formatted_label = '<label for="' . $this->option_name . '_' . $name . '">' . $label .'</label>';
572
  if ( $shortcode_args ) {
@@ -634,23 +933,28 @@ class SB_YOUTUBE_Admin {
634
  );
635
 
636
  foreach ( $this->tabs as $tab ) {
637
- if ( $tab['slug'] !== 'configure' ) {
638
- $title = isset( $tab['title'] ) ? $tab['title'] : '';
639
- $capability = isset( $tab['capability'] ) ? $tab['capability'] : 'manage_options';
640
- $slug = isset( $tab['slug'] ) ? $tab['slug'] : '';
641
- $callback = isset( $tab['callback'] ) ? $tab['callback'] : array( $this, 'create_options_page' );
642
-
643
- add_submenu_page(
644
- $this->slug,
645
- $title,
646
- $title,
647
- $capability,
648
- $this->slug . '_' . $slug,
649
- $callback
650
- );
651
- }
652
  }
653
 
 
 
 
 
 
654
  }
655
 
656
  public function set_active_tab( $active_tab ) {
25
 
26
  protected $option_name;
27
 
28
+ protected $pro_only;
29
+
30
  protected $types;
31
 
32
  protected $layouts;
53
  }
54
  $this->settings = $settings;
55
  $this->option_name = $option_name;
56
+ $this->pro_only = array();
57
  $this->false_fields = array();
58
  $this->textarea_fields = array();
59
  $this->display_your_feed_sections = array();
81
  public function init() {
82
  add_action( 'admin_menu', array( $this, 'create_menus' ) );
83
  add_action( 'admin_init', array( $this, 'settings_init' ) );
84
+ add_action( 'admin_init', array( $this, 'additional_settings_init' ) );
85
+
86
  }
87
 
88
  public function settings_init() {
89
+ $text_domain = $this->vars->text_domain();
90
+ /**
91
+ * Configure Tab
92
+ */
93
+ $args = array(
94
+ 'id' => 'sbspf_types',
95
+ 'tab' => 'configure',
96
+ 'save_after' => 'true'
97
+ );
98
+ $this->add_settings_section( $args );
99
+
100
+ /* Types */
101
+ $args = array(
102
+ 'name' => 'type',
103
+ 'section' => 'sbspf_types',
104
+ 'callback' => 'types',
105
+ 'title' => '<label>' . __( 'Feed Type', $text_domain ) .'</label>',
106
+ 'shortcode' => array(
107
+ 'key' => 'type',
108
+ 'example' => 'channel',
109
+ 'description' => __( 'Type of feed to display', $text_domain ) . ' e.g. channel, playlist, search, favorites, live',
110
+ 'display_section' => 'configure'
111
+ ),
112
+ 'types' => $this->types
113
+ );
114
+ $this->add_settings_field( $args );
115
+
116
+ /* Cache */
117
+ $args = array(
118
+ 'name' => 'cache',
119
+ 'section' => 'sbspf_types',
120
+ 'callback' => 'cache',
121
+ 'title' => __( 'Check for new posts', $text_domain )
122
+ );
123
+ $this->add_settings_field( $args );
124
+
125
+ /**
126
+ * Customize Tab
127
+ */
128
+ $args = array(
129
+ 'title' => __( 'General', $text_domain ),
130
+ 'id' => 'sbspf_general',
131
+ 'tab' => 'customize',
132
+ 'save_after' => 'true'
133
+ );
134
+ $this->add_settings_section( $args );
135
+
136
+ /* Width and Height */
137
+ $select_options = array(
138
+ array(
139
+ 'label' => '%',
140
+ 'value' => '%'
141
+ ),
142
+ array(
143
+ 'label' => 'px',
144
+ 'value' => 'px'
145
+ )
146
+ );
147
+
148
+ $args = array(
149
+ 'name' => 'width',
150
+ 'default' => '100',
151
+ 'section' => 'sbspf_general',
152
+ 'callback' => 'text',
153
+ 'min' => 1,
154
+ 'size' => 4,
155
+ 'title' => __( 'Width of Feed', $text_domain ),
156
+ 'shortcode' => array(
157
+ 'key' => 'width',
158
+ 'example' => '300px',
159
+ 'description' => __( 'The width of your feed. Any number with a unit like "px" or "%".', $text_domain ),
160
+ 'display_section' => 'customize'
161
+ ),
162
+ 'select_name' => 'widthunit',
163
+ 'select_options' => $select_options,
164
+ 'hidden' => array(
165
+ 'callback' => 'checkbox',
166
+ 'name' => 'width_responsive',
167
+ 'label' => __( 'Set to be 100% width on mobile?', $text_domain ),
168
+ 'before' => '<div id="sbspf_width_options">',
169
+ 'after' => '</div>',
170
+ 'tooltip_info' => __( 'If you set a width on the feed then this will be used on mobile as well as desktop. Check this setting to set the feed width to be 100% on mobile so that it is responsive.', $text_domain )
171
+ ),
172
+ );
173
+ $this->add_settings_field( $args );
174
+
175
+ $select_options = array(
176
+ array(
177
+ 'label' => '%',
178
+ 'value' => '%'
179
+ ),
180
+ array(
181
+ 'label' => 'px',
182
+ 'value' => 'px'
183
+ )
184
+ );
185
+ $args = array(
186
+ 'name' => 'height',
187
+ 'default' => '',
188
+ 'section' => 'sbspf_general',
189
+ 'callback' => 'text',
190
+ 'min' => 1,
191
+ 'size' => 4,
192
+ 'title' => __( 'Height of Feed', $text_domain ),
193
+ 'shortcode' => array(
194
+ 'key' => 'height',
195
+ 'example' => '500px',
196
+ 'description' => __( 'The height of your feed. Any number with a unit like "px" or "em".', $text_domain ),
197
+ 'display_section' => 'customize'
198
+ ),
199
+ 'select_name' => 'heightunit',
200
+ 'select_options' => $select_options,
201
+ );
202
+ $this->add_settings_field( $args );
203
+
204
+ $args = array(
205
+ 'name' => 'background',
206
+ 'default' => '',
207
+ 'section' => 'sbspf_general',
208
+ 'callback' => 'color',
209
+ 'title' => __( 'Background Color', $text_domain ),
210
+ 'shortcode' => array(
211
+ 'key' => 'background',
212
+ 'example' => '#f00',
213
+ 'description' => __( 'Background color for the feed. Any hex color code.', $text_domain ),
214
+ 'display_section' => 'customize'
215
+ ),
216
+ );
217
+ $this->add_settings_field( $args );
218
+
219
+ $args = array(
220
+ 'title' => __( 'Layout', $text_domain ),
221
+ 'id' => 'sbspf_layout',
222
+ 'tab' => 'customize',
223
+ 'save_after' => 'true'
224
+ );
225
+ $this->add_settings_section( $args );
226
+
227
+ $args = array(
228
+ 'name' => 'layout',
229
+ 'section' => 'sbspf_layout',
230
+ 'callback' => 'layout',
231
+ 'title' => __( 'Layout Type', $text_domain ),
232
+ 'layouts' => $this->layouts,
233
+ 'shortcode' => array(
234
+ 'key' => 'layout',
235
+ 'example' => 'list',
236
+ 'description' => __( 'How your posts are display visually.', $text_domain ),
237
+ 'display_section' => 'layout'
238
+ )
239
+ );
240
+ $this->add_settings_field( $args );
241
+ }
242
+
243
+ public function additional_settings_init() {
244
 
245
  }
246
 
283
  );
284
 
285
  $save_after = isset( $args['save_after'] ) ? $args['save_after'] : false;
286
+ $pro = isset( $args['pro'] ) && ($args['pro'] !== false) ? $args['pro'] : false;
287
  $this->settings_sections[ $args['tab'] ][] = array(
288
  'id' => $args['id'],
289
+ 'save_after' => $save_after,
290
+ 'pro' => $pro
291
+
292
  );
293
  }
294
 
299
  $title_after = isset( $args['shortcode']['after'] ) ? $args['shortcode']['after'] : '';
300
  $shortcode = $args['shortcode'];
301
  }
302
+
303
+ if ( $shortcode ) {
304
+ $this->display_your_feed_sections[ $shortcode['display_section'] ]['settings'][] = $shortcode;
305
+ if ( isset( $args['pro'] ) ) {
306
+ $this->pro_only[] = $args['name'];
307
+ }
308
+ }
309
+
310
+ if ( $args['callback'] === 'types' ) {
311
+ $formatted_label = '<label for="' . $this->option_name . '_' . $args['name'] . '">' . $args['title'] .'</label>';
312
+ $formatted_label .= '<code class="sbspf_shortcode">type'. "\n";
313
+ foreach ( $args['types'] as $type ) {
314
+ $shortcode = array(
315
+ 'key' => $type['slug'],
316
+ 'example' => $type['example'],
317
+ 'description' => $type['description'],
318
+ 'display_section' => 'configure'
319
+ );
320
+ $this->display_your_feed_sections[ $shortcode['display_section'] ]['settings'][] = $shortcode;
321
+ if ( isset( $type['pro'] ) ) {
322
+ $this->pro_only[] = $type['slug'];
323
+ }
324
+
325
+ $formatted_label .= 'Eg: type=' . $type['slug'] . '<br>';
326
+ $formatted_label .= $type['slug'] . '="' . substr( $type['example'], 0, 14) . '"<br>';
327
+
328
+ }
329
+ $formatted_label .= '</code><br>';
330
+
331
+ $title = $formatted_label;
332
+ } else {
333
+ $title = $this->format_title( $args['title'], $args['name'], $shortcode, $title_after );
334
+ }
335
 
336
  if ( $args['callback'] === 'checkbox' || (isset( $args['falsefield'] ) && $args['falsefield'] === true) ) {
337
  $tab = 'none';
346
  $this->add_false_field( $args['name'], $tab );
347
  }
348
 
349
+ if ( $args['callback'] === 'layout' || $args['callback'] === 'sub_option' ) {
350
+ $tab = 'none';
351
+ foreach ( $this->settings_sections as $key => $settings_sections ) {
352
+ foreach ( $settings_sections as $this_tab_sections ) {
353
+ if ( $this_tab_sections['id'] === $args['section'] ) {
354
+ $tab = $key;
355
+ }
356
+ }
357
+
358
+ }
359
+ $sub_options = isset( $args['layouts'] ) ? $args['layouts'] : $args['sub_options'];
360
+ foreach ( $sub_options as $sub_option ) {
361
+ if ( isset( $sub_option['options'] ) ) {
362
+ foreach( $sub_option['options'] as $sub_sub_option ) {
363
+ if ( ! empty( $sub_sub_option['shortcode'] ) ) {
364
+ $key = ! empty( $sub_sub_option['shortcode']['key'] ) ? $sub_sub_option['shortcode']['key'] : $sub_option['slug'] . $sub_sub_option['name'];
365
+ $example = ! empty( $sub_sub_option['shortcode']['example'] ) ? $sub_sub_option['shortcode']['example'] : '';
366
+ $description = ! empty( $sub_sub_option['shortcode']['description'] ) ? $sub_sub_option['shortcode']['description'] : '';
367
+ $display_section = ! empty( $sub_sub_option['shortcode']['display_section'] ) ? $sub_sub_option['shortcode']['display_section'] : str_replace( 'sbspf_', '', $args['section'] );
368
+ $sub_shortcode = array(
369
+ 'key' => $key,
370
+ 'example' => $example,
371
+ 'description' => $description,
372
+ 'display_section' => $display_section
373
+ );
374
+ if ( isset( $this->display_your_feed_sections[ $display_section ] ) ) {
375
+ $this->display_your_feed_sections[ $display_section ]['settings'][] = $sub_shortcode;
376
+ if ( isset( $sub_sub_option['pro'] ) ) {
377
+ $this->pro_only[] = $key;
378
+ }
379
+ }
380
+ }
381
+ if ( $sub_sub_option['callback'] === 'checkbox' ) {
382
+ $this->add_false_field( $sub_option['slug'] . $sub_sub_option['name'], $tab );
383
  }
384
  }
385
  }
408
  $args
409
  );
410
 
 
 
 
 
411
  if ( isset( $args['hidden'] ) ) {
412
  if ( $args['hidden']['callback'] === 'checkbox' ) {
413
  $tab = 'none';
446
  $selected = isset( $this->settings[ $args['name'] ] ) ? $this->settings[ $args['name'] ] : $default;
447
  $label = isset( $args['label'] ) ? $args['label'] : __( 'Yes' );
448
  $tooltip_text = isset( $args['tooltip_text'] ) ? $args['label'] : $this->default_tooltip_text();
449
+ $has_shortcode = isset( $args['has_shortcode'] ) && $args['has_shortcode'] && isset( $args['shortcode_example'] ) ? '1' : '';
450
+ $pro_flag = isset( $args['pro'] ) ? ' <span class="sbspf_pro_only"></span>' : '';
451
+ echo $pro_flag;
452
  ?>
453
+ <input name="<?php echo $this->option_name .'['.esc_attr( $args['name'] ).']'; ?>" id="<?php echo $this->option_name . '_' . $args['name']; ?>" class="sbspf_single_checkbox" type="checkbox"<?php if ( $selected ) echo ' checked'; ?>/>
454
  <label for="<?php echo $this->option_name . '_' . $args['name'] . $has_shortcode; ?>"><?php echo esc_html( $label ); ?></label><?php if ( $has_shortcode === '1' ) : ?><code class="sbspf_shortcode"> <?php echo $args['name'] . "\n"; ?>
455
  Eg: <?php echo $args['name']; ?>=<?php echo $args['shortcode_example']; ?></code><br><?php endif; ?>
456
  <?php if ( isset( $args['tooltip_info'] ) ) : ?>
469
  <?php foreach ( $args['select_options'] as $select_option ) :
470
  $selected = in_array( $select_option['value'], $selection_array, true );
471
  $pro_only = (isset( $select_option['pro'] ) && $select_option['pro']) ? ' sbspf_pro_only' : '';
472
+ $class = ! empty( $select_option['class'] ) ? ' ' . $select_option['class'] : '';
473
  ?>
474
+ <div class="sbspf_multi_checkbox_option<?php echo $pro_only . $class; ?>">
475
  <input name="<?php echo $this->option_name .'['.esc_attr( $args['name'] ).'][]'; ?>" id="<?php echo $this->option_name . '_' . $args['name']. '_' . $index; ?>" value="<?php echo esc_attr( $select_option['value'] ); ?>" type="checkbox"<?php if ( $selected ) echo ' checked'; ?>/>
476
  <label for="<?php echo $this->option_name . '_' . $args['name'] . '_' . $index; ?>"><?php echo esc_html( $select_option['label'] ); ?></label>
477
  </div>
493
  $class = isset( $args['class'] ) ? ' class="'. esc_attr( $args['class'] ) . '"' : '';
494
 
495
  $tooltip_text = isset( $args['tooltip_text'] ) ? $args['label'] : $this->default_tooltip_text();
496
+ $pro_flag = isset( $args['pro'] ) ? ' <span class="sbspf_pro_only"></span>' : '';
497
+ echo $pro_flag;
498
 
499
  if ( isset( $args['min'] ) ) :
500
  $min = ( isset( $args['min'] ) ) ? ' min="'. $args['min'].'"' : '';
562
  }
563
 
564
  $tooltip_text = isset( $args['tooltip_text'] ) ? $args['label'] : $this->default_tooltip_text();
565
+ $pro_class = isset( $args['pro'] ) ? ' class="sbspf_pro_only"' : '';
566
  ?>
567
+ <select<?php echo $pro_class; ?> name="<?php echo $this->option_name.'['.$args['name'].']'; ?>" id="<?php echo $this->option_name . '_' . $args['name']; ?>">
568
  <?php foreach ( $args['options'] as $select_option ) : ?>
569
  <option value="<?php echo esc_attr( $select_option['value'] ); ?>"<?php if ( (string)$select_option['value'] === (string)$value ) echo ' selected'; ?>><?php echo esc_html( $select_option['label'] ); ?></option>
570
  <?php endforeach; ?>
583
  public function textarea( $args ) {
584
  $default = isset( $args['default'] ) ? $args['default'] : '';
585
  $value = isset( $this->settings[ $args['name'] ] ) ? stripslashes( $this->settings[ $args['name'] ] ) : $default;
586
+ $pro_class = isset( $args['pro'] ) ? ' class="sbspf_pro_only"' : '';
587
 
588
  if ( isset( $args['tooltip_info'] ) ) : ?>
589
  <span><?php echo $args['tooltip_info']; ?></span><br>
590
  <?php endif; ?>
591
 
592
+ <textarea<?php echo $pro_class; ?> name="<?php echo $this->option_name.'['.$args['name'].']'; ?>" id="<?php echo $this->option_name . '_' . $args['name']; ?>"rows="7"><?php echo $value; ?></textarea>
593
 
594
  <?php if ( isset( $args['note'] ) ) : ?>
595
  <br><span class="sbspf_note"><?php echo $args['note']; ?></span>
611
  $selected = isset( $this->settings[ $type['slug'] . '_ids' ] ) ? $this->settings[ $type['slug'] . '_ids' ] : array();
612
  }
613
  $on_select = isset( $type['onselect'] ) ? $type['onselect'] : false;
614
+ $pro_class = isset( $type['pro'] ) ? ' sbspf_pro_only' : '';
615
  ?>
616
+ <div class="sbspf_row sbspf_type_row<?php echo $pro_class; ?>" style="min-height: 29px;">
617
  <div class="sbspf_col sbspf_one">
618
  <input type="radio" name="<?php echo $this->option_name.'['.esc_attr( $args['name'] ).']'; ?>" class="sbspf_type_input" id="sbspf_type_<?php echo esc_attr( $type['slug'] ); ?>" value="<?php echo esc_attr( $type['slug'] ); ?>"<?php if ( $type_selected === $type['slug'] ) echo 'checked'; ?>>
619
  <label class="sbspf_radio_label" for="sbspf_type_<?php echo esc_attr( $type['slug'] ); ?>"><?php echo esc_html( $type['label'] ); ?>: <a class="sbspf_type_tooltip_link" href="JavaScript:void(0);"><i class="fa fa-question-circle" aria-hidden="true" style="margin-left: 2px;"></i></a></label>
659
  <?php endforeach;
660
  }
661
 
662
+ public function sub_option( $args ) {
663
+ $value = isset( $this->settings[ $args['name'] ] ) ? $this->settings[ $args['name'] ] : 'related';
664
+ $pro_flag = isset( $args['pro'] ) ? ' <span class="sbspf_pro_only"></span>' : '';
665
+ echo $pro_flag;
666
+ $cta_options = $args['sub_options'];
667
+ ?>
668
+ <?php if ( ! empty( $args['before'] ) ) {
669
+ echo $args['before'];
670
+ }?>
671
+
672
+ <div class="sbspf_sub_options">
673
+ <?php foreach ( $cta_options as $sub_option ) :
674
+ $pro_class = isset( $sub_option['pro'] ) ? ' sbspf_pro_only' : '';
675
+ ?>
676
+ <div class="sbspf_sub_option_cell<?php echo esc_attr( $pro_class ); ?>">
677
+ <input class="sbspf_sub_option_type" id="sbspf_sub_option_type_<?php echo esc_attr( $sub_option['slug'] ); ?>" name="<?php echo $this->option_name.'['.$args['name'].']'; ?>" type="radio" value="<?php echo esc_attr( $sub_option['slug'] ); ?>"<?php if ( $sub_option['slug'] === $value ) echo ' checked'?>><label for="sbspf_sub_option_type_<?php echo esc_attr( $sub_option['slug'] ); ?>"><span class="sbspf_label"><?php echo $sub_option['label']; ?></span></label>
678
+ </div>
679
+ <?php endforeach; ?>
680
+
681
+ <div class="sbspf_box_setting">
682
+ <?php if ( isset( $cta_options ) ) : foreach ( $cta_options as $sub_option ) :
683
+ $pro_class = isset( $sub_option['pro'] ) ? ' sbspf_pro_only' : '';
684
+ ?>
685
+ <div class="sbspf_sub_option_settings sbspf_sub_option_type_<?php echo esc_attr( $sub_option['slug'] ) . $pro_class; ?>">
686
+
687
+ <div class="sbspf_sub_option_setting">
688
+ <?php echo sby_admin_icon( 'info-circle', 'sbspf_small_svg' ); ?>&nbsp;&nbsp;&nbsp;<span class="sbspf_note" style="margin-left: 0;"><?php echo $sub_option['note']; ?></span>
689
+ </div>
690
+ <?php if ( ! empty( $sub_option['options'] ) ) : ?>
691
+ <?php foreach ( $sub_option['options'] as $option ) :
692
+ $option['name'] = $sub_option['slug'].$option['name'];
693
+ ?>
694
+ <div class="sbspf_sub_option_setting">
695
+ <?php if ( $option['callback'] !== 'checkbox' ) :
696
+ if ( isset( $option['shortcode'] ) ) : ?>
697
+ <label title="<?php echo __( 'Click for shortcode option', $this->vars->text_domain() ); ?>"><?php echo $option['label']; ?></label><code class="sbspf_shortcode"> <?php echo $option['name'] . "\n"; ?>
698
+ Eg: <?php echo $option['name']; ?>=<?php echo $option['shortcode']['example']; ?></code><br>
699
+ <?php else: ?>
700
+ <label><?php echo $option['label']; ?></label><br>
701
+ <?php endif; ?>
702
+ <?php else:
703
+ $option['shortcode_example'] = $option['shortcode']['example'];
704
+ $option['has_shortcode'] = true;
705
+ endif; ?>
706
+ <?php call_user_func_array( array( $this, $option['callback'] ), array( $option ) ); ?>
707
+
708
+ </div>
709
+
710
+ <?php endforeach; ?>
711
+ <?php endif; ?>
712
+
713
+ </div>
714
+
715
+ <?php endforeach; endif; ?>
716
+ </div>
717
+ </div>
718
+ <?php
719
+ }
720
+
721
  public function cache( $args ) {
722
  $social_network = $this->vars->social_network();
723
  $type_selected = isset( $this->settings['caching_type'] ) ? $this->settings['caching_type'] : 'page';
812
  $value = isset( $this->settings[ $args['name'] ] ) ? $this->settings[ $args['name'] ] : $default;
813
  ?>
814
  <div class="sbspf_layouts">
815
+ <?php foreach ( $args['layouts'] as $layout ) :
816
+ $pro_class = isset( $layout['pro'] ) ? ' sbspf_pro_only' : '';
817
+ ?>
818
+ <div class="sbspf_layout_cell<?php echo $pro_class; ?>">
819
  <input class="sbspf_layout_type" id="sbspf_layout_type_<?php echo esc_attr( $layout['slug'] ); ?>" name="<?php echo $this->option_name.'['.$args['name'].']'; ?>" type="radio" value="<?php echo esc_attr( $layout['slug'] ); ?>"<?php if ( $layout['slug'] === $value ) echo ' checked'?>><label for="sbspf_layout_type_<?php echo esc_attr( $layout['slug'] ); ?>"><span class="sbspf_label"><?php echo $layout['label']; ?></span><img src="<?php echo esc_url( $this->vars->plugin_url() . $layout['image'] ); ?>"></label>
820
  </div>
821
  <?php endforeach; ?>
822
 
823
  <div class="sbspf_layout_options_wrap">
824
+ <?php foreach ( $args['layouts'] as $layout ) :
825
+ $pro_class = isset( $layout['pro'] ) ? ' sbspf_pro_only' : '';
826
+ ?>
827
+ <div class="sbspf_layout_settings sbspf_layout_type_<?php echo esc_attr( $layout['slug'] ) . $pro_class; ?>">
828
 
829
  <div class="sbspf_layout_setting">
830
  <?php echo sby_admin_icon( 'info-circle' ); ?>&nbsp;&nbsp;&nbsp;<span class="sbspf_note" style="margin-left: 0;"><?php echo $layout['note']; ?></span>
831
  </div>
832
  <?php if ( ! empty( $layout['options'] ) ) : ?>
833
+ <?php foreach ( $layout['options'] as $option ) :
834
+ $option['name'] = $layout['slug'].$option['name'];
835
+ $option['shortcode']['example'] = isset( $option['shortcode']['example'] ) ? $option['shortcode']['example'] : $option['shortcode_example'];
836
+
837
+ ?>
838
+ <div class="sbspf_layout_setting">
839
+ <?php if ( $option['callback'] !== 'checkbox' ) : ?>
840
+ <label title="<?php echo __( 'Click for shortcode option', $this->vars->text_domain() ); ?>"><?php echo $option['label']; ?></label><code class="sbspf_shortcode"> <?php echo $option['name'] . "\n"; ?>
841
+ Eg: <?php echo $option['name']; ?>=<?php echo $option['shortcode']['example']; ?></code><br>
842
+ <?php else:
 
 
843
 
844
+ $option['has_shortcode'] = true;
845
+ endif; ?>
846
+ <?php call_user_func_array( array( $this, $option['callback'] ), array( $option ) ); ?>
847
 
848
+ </div>
849
+
850
+ <?php endforeach; ?>
851
  <?php endif; ?>
852
 
853
  </div>
858
  <?php
859
  }
860
 
861
+ public function instructions( $args ) {
862
+ ?>
863
+ <div class="sbspf_instructions_wrap">
864
+ <?php echo $args['instructions']?>
865
+ </div>
866
+ <?php
867
+ }
868
+
869
  public function format_title( $label, $name, $shortcode_args = false, $after = '' ) {
870
  $formatted_label = '<label for="' . $this->option_name . '_' . $name . '">' . $label .'</label>';
871
  if ( $shortcode_args ) {
933
  );
934
 
935
  foreach ( $this->tabs as $tab ) {
936
+ if ( $tab['slug'] !== 'configure' ) {
937
+ $title = isset( $tab['title'] ) ? $tab['title'] : '';
938
+ $capability = isset( $tab['capability'] ) ? $tab['capability'] : 'manage_options';
939
+ $slug = isset( $tab['slug'] ) ? $tab['slug'] : '';
940
+ $callback = isset( $tab['callback'] ) ? $tab['callback'] : array( $this, 'create_options_page' );
941
+
942
+ add_submenu_page(
943
+ $this->slug,
944
+ $title,
945
+ $title,
946
+ $capability,
947
+ $this->slug . '_' . $slug,
948
+ $callback
949
+ );
950
+ }
951
  }
952
 
953
+ $this->after_create_menues();
954
+ }
955
+
956
+ public function after_create_menues() {
957
+
958
  }
959
 
960
  public function set_active_tab( $active_tab ) {
inc/admin/class-sby-admin.php CHANGED
@@ -27,15 +27,18 @@ class SBY_Admin extends SB_YOUTUBE_Admin {
27
  'callback' => 'types',
28
  'title' => '<label>' . __( 'Feed Type', $text_domain ) .'</label>',
29
  'shortcode' => array(
30
- 'key' => 'channel',
31
- 'example' => 'smashballoon',
32
- 'description' => __( 'Display videos from a YouTube channel (channel)', $text_domain ),
33
  'display_section' => 'configure'
34
  ),
35
  'types' => $this->types
36
  );
37
  $this->add_settings_field( $args );
38
 
 
 
 
39
  /* Cache */
40
  $args = array(
41
  'name' => 'cache',
@@ -45,15 +48,6 @@ class SBY_Admin extends SB_YOUTUBE_Admin {
45
  );
46
  $this->add_settings_field( $args );
47
 
48
- $args = array(
49
- 'name' => 'preserve_settings',
50
- 'section' => 'sbspf_types',
51
- 'callback' => 'checkbox',
52
- 'title' => __( 'Preserve settings when plugin is removed', $text_domain ),
53
- 'default' => false,
54
- 'tooltip_info' => __( 'When removing the plugin your settings are automatically erased. Checking this box will prevent any settings from being deleted. This means that you can uninstall and reinstall the plugin without losing your settings.', $text_domain )
55
- );
56
- $this->add_settings_field( $args );
57
 
58
  /**
59
  * Customize Tab
@@ -166,12 +160,21 @@ class SBY_Admin extends SB_YOUTUBE_Admin {
166
  'shortcode' => array(
167
  'key' => 'layout',
168
  'example' => 'list',
169
- 'description' => __( 'How your posts are display visually.', $text_domain ),
170
  'display_section' => 'layout'
171
  )
172
  );
173
  $this->add_settings_field( $args );
174
 
 
 
 
 
 
 
 
 
 
175
  $select_options = array(
176
  array(
177
  'label' => 'px',
@@ -252,7 +255,7 @@ class SBY_Admin extends SB_YOUTUBE_Admin {
252
  'shortcode' => array(
253
  'key' => 'include',
254
  'example' => '"icon"',
255
- 'description' => __( 'Comma separated list of what video information (title, description, stats) will display in the feed. eg.', $text_domain ) . ' icon',
256
  'display_section' => 'customize'
257
  ),
258
  'select_options' => $include_options,
@@ -278,6 +281,33 @@ class SBY_Admin extends SB_YOUTUBE_Admin {
278
  );
279
  $this->add_settings_field( $args );
280
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
281
  $args = array(
282
  'title' => __( 'Header', $text_domain ),
283
  'id' => 'sbspf_header',
@@ -315,6 +345,22 @@ class SBY_Admin extends SB_YOUTUBE_Admin {
315
  );
316
  $this->add_settings_field( $args );
317
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
318
  $args = array(
319
  'title' => __( '"Load More" Button', $text_domain ),
320
  'id' => 'sbspf_loadmore',
@@ -485,6 +531,176 @@ class SBY_Admin extends SB_YOUTUBE_Admin {
485
  );
486
  $this->add_settings_field( $args );
487
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
488
  $args = array(
489
  'title' => __( 'Custom Code Snippets', $text_domain ),
490
  'id' => 'sbspf_custom_snippets',
@@ -523,6 +739,16 @@ class SBY_Admin extends SB_YOUTUBE_Admin {
523
  );
524
  $this->add_settings_section( $args );
525
 
 
 
 
 
 
 
 
 
 
 
526
  $select_options = array(
527
  array(
528
  'label' => __( 'Background', $text_domain ),
@@ -560,6 +786,16 @@ class SBY_Admin extends SB_YOUTUBE_Admin {
560
  );
561
  $this->add_settings_field( $args );
562
 
 
 
 
 
 
 
 
 
 
 
563
  }
564
 
565
  public function cache( $args ) {
27
  'callback' => 'types',
28
  'title' => '<label>' . __( 'Feed Type', $text_domain ) .'</label>',
29
  'shortcode' => array(
30
+ 'key' => 'type',
31
+ 'example' => 'channel',
32
+ 'description' => __( 'Type of feed to display', $text_domain ) . ' e.g. channel, playlist, search, favorites, live',
33
  'display_section' => 'configure'
34
  ),
35
  'types' => $this->types
36
  );
37
  $this->add_settings_field( $args );
38
 
39
+ $this->pro_only[] = 'type';
40
+
41
+
42
  /* Cache */
43
  $args = array(
44
  'name' => 'cache',
48
  );
49
  $this->add_settings_field( $args );
50
 
 
 
 
 
 
 
 
 
 
51
 
52
  /**
53
  * Customize Tab
160
  'shortcode' => array(
161
  'key' => 'layout',
162
  'example' => 'list',
163
+ 'description' => __( 'How your posts are displayed visually.', $text_domain ) . ' e.g. list, grid, gallery',
164
  'display_section' => 'layout'
165
  )
166
  );
167
  $this->add_settings_field( $args );
168
 
169
+ $this->pro_only[] = 'carouselcols';
170
+ $this->pro_only[] = 'carouselcolsmobile';
171
+ $this->pro_only[] = 'carouselrows';
172
+ $this->pro_only[] = 'carouselloop';
173
+ $this->pro_only[] = 'carouselarrows';
174
+ $this->pro_only[] = 'carouselpag';
175
+ $this->pro_only[] = 'carouselautoplay';
176
+ $this->pro_only[] = 'carouseltime';
177
+
178
  $select_options = array(
179
  array(
180
  'label' => 'px',
255
  'shortcode' => array(
256
  'key' => 'include',
257
  'example' => '"icon"',
258
+ 'description' => __( 'What video information will display in the feed. eg.', $text_domain ) . ' icon',
259
  'display_section' => 'customize'
260
  ),
261
  'select_options' => $include_options,
281
  );
282
  $this->add_settings_field( $args );
283
 
284
+ $select_options = array(
285
+ array(
286
+ 'label' => __( 'Below video thumbnail', $text_domain ),
287
+ 'value' => 'below'
288
+ ),
289
+ array(
290
+ 'label' => __( 'Next to video thumbnail', $text_domain ),
291
+ 'value' => 'side'
292
+ )
293
+ );
294
+ $args = array(
295
+ 'name' => 'infoposition',
296
+ 'default' => 'below',
297
+ 'section' => 'sbspf_layout',
298
+ 'pro' => true,
299
+ 'callback' => 'select',
300
+ 'title' => __( 'Position', $text_domain ),
301
+ 'shortcode' => array(
302
+ 'key' => 'infoposition',
303
+ 'example' => 'side',
304
+ 'description' => __( 'Where the information (title, description, stats) will display. eg.', $text_domain ) . ' below, side, none',
305
+ 'display_section' => 'customize'
306
+ ),
307
+ 'options' => $select_options,
308
+ );
309
+ $this->add_settings_field( $args );
310
+
311
  $args = array(
312
  'title' => __( 'Header', $text_domain ),
313
  'id' => 'sbspf_header',
345
  );
346
  $this->add_settings_field( $args );
347
 
348
+ $args = array(
349
+ 'name' => 'showsubscribers',
350
+ 'section' => 'sbspf_header',
351
+ 'callback' => 'checkbox',
352
+ 'pro' => true,
353
+ 'title' => __( 'Show Subscribers', $text_domain ),
354
+ 'default' => true,
355
+ 'shortcode' => array(
356
+ 'key' => 'showsubscribers',
357
+ 'example' => 'false',
358
+ 'description' => __( 'Include the number of subscribers in the header.', $text_domain ),
359
+ 'display_section' => 'header'
360
+ )
361
+ );
362
+ $this->add_settings_field( $args );
363
+
364
  $args = array(
365
  'title' => __( '"Load More" Button', $text_domain ),
366
  'id' => 'sbspf_loadmore',
531
  );
532
  $this->add_settings_field( $args );
533
 
534
+ $cta_options = array(
535
+ array(
536
+ 'label' => __( 'Related Videos', SBY_TEXT_DOMAIN ),
537
+ 'slug' => 'related',
538
+ 'pro' => true,
539
+ 'note' => __( 'Display video thumbnails from the feed that play on your site when clicked.', SBY_TEXT_DOMAIN )
540
+ ),
541
+ array(
542
+ 'label' => 'Custom Link',
543
+ 'slug' => 'link',
544
+ 'pro' => true,
545
+ 'note' => __( 'Display a button link to a custom URL.', SBY_TEXT_DOMAIN ),
546
+ 'options' => array(
547
+ array(
548
+ 'name' => 'instructions',
549
+ 'callback' => 'instructions',
550
+ 'instructions' => __( 'To set a link for each video individually, add the link and button text in the video description on YouTube in this format:', SBY_TEXT_DOMAIN ) . '<br><br><code>{Link: Button Text https://my-site.com/buy-now/my-product/}</code>',
551
+ 'label' => __( 'Custom link for each video', SBY_TEXT_DOMAIN ),
552
+ ),
553
+ array(
554
+ 'name' => 'url',
555
+ 'callback' => 'text',
556
+ 'label' => __( 'Default Link', SBY_TEXT_DOMAIN ),
557
+ 'class' => 'large-text',
558
+ 'default' => '',
559
+ 'shortcode' => array(
560
+ 'example' => 'https://my-site.com/buy-now/my-product/',
561
+ 'description' => __( 'URL for viewer to visit for the call to action.', $text_domain ),
562
+ )
563
+ ),
564
+ array(
565
+ 'name' => 'opentype',
566
+ 'callback' => 'select',
567
+ 'options' => array(
568
+ array(
569
+ 'label' => __( 'Same window', SBY_TEXT_DOMAIN ),
570
+ 'value' => 'same'
571
+ ),
572
+ array(
573
+ 'label' => __( 'New window', SBY_TEXT_DOMAIN ),
574
+ 'value' => 'newwindow'
575
+ )
576
+ ),
577
+ 'label' => __( 'Link Open Type', SBY_TEXT_DOMAIN ),
578
+ 'default' => 'same',
579
+ 'shortcode' => array(
580
+ 'example' => 'newwindow',
581
+ 'description' => __( 'Whether to open the page in a new window or the same window.', $text_domain ),
582
+ )
583
+ ),
584
+ array(
585
+ 'name' => 'text',
586
+ 'callback' => 'text',
587
+ 'label' => __( 'Default Button Text', SBY_TEXT_DOMAIN ),
588
+ 'default' => __( 'Learn More', SBY_TEXT_DOMAIN ),
589
+ 'shortcode' => array(
590
+ 'example' => 'Buy Now',
591
+ 'description' => __( 'Text that appears on the call-to-action button.', $text_domain ),
592
+ )
593
+ ),
594
+ array(
595
+ 'name' => 'color',
596
+ 'default' => '',
597
+ 'callback' => 'color',
598
+ 'label' => __( 'Button Background Color', SBY_TEXT_DOMAIN ),
599
+ 'shortcode' => array(
600
+ 'example' => '#0f0',
601
+ 'description' => __( 'Button background. Turns opaque on hover.', $text_domain ),
602
+ )
603
+ ),
604
+ array(
605
+ 'name' => 'textcolor',
606
+ 'default' => '',
607
+ 'callback' => 'color',
608
+ 'label' => __( 'Button Text Color', SBY_TEXT_DOMAIN ),
609
+ 'shortcode' => array(
610
+ 'example' => '#0f0',
611
+ 'description' => __( 'Color of the text on the call-to-action-button', $text_domain ),
612
+ )
613
+ )
614
+ )
615
+ ),
616
+ array(
617
+ 'label' => __( 'YouTube Default', SBY_TEXT_DOMAIN ),
618
+ 'slug' => 'default',
619
+ 'pro' => true,
620
+ 'note' => __( 'YouTube suggested videos from your channel that play on YouTube when clicked.', SBY_TEXT_DOMAIN )
621
+ ),
622
+ );
623
+ $this->pro_only[] = 'linkurl';
624
+ $this->pro_only[] = 'linkopentype';
625
+ $this->pro_only[] = 'linktext';
626
+ $this->pro_only[] = 'linkcolor';
627
+ $this->pro_only[] = 'linktextcolor';
628
+
629
+ $args = array(
630
+ 'name' => 'cta',
631
+ 'default' => 'related',
632
+ 'section' => 'sbspf_experience',
633
+ 'callback' => 'sub_option',
634
+ 'pro' => true,
635
+ 'sub_options' => $cta_options,
636
+ 'title' => __( 'Call to Action', $text_domain ),
637
+ 'before' => '<p style="margin-bottom: 10px">' . __( 'What the user sees when a video pauses or ends.', $text_domain ) . '</p>',
638
+ 'shortcode' => array(
639
+ 'key' => 'cta',
640
+ 'example' => 'link',
641
+ 'description' => __( 'What the user sees when a video pauses or ends. eg.', $text_domain ) . ' related, link',
642
+ 'display_section' => 'experience'
643
+ ),
644
+ 'tooltip_info' => __( 'Choose what will happen after a video is paused or completes.', $text_domain )
645
+ );
646
+ $this->add_settings_field( $args );
647
+
648
+ $args = array(
649
+ 'title' => __( 'Moderation', $text_domain ),
650
+ 'id' => 'sbspf_moderation',
651
+ 'tab' => 'customize',
652
+ 'pro' => __( 'Upgrade to Pro to enable Moderation settings', $text_domain ),
653
+ );
654
+ $this->add_settings_section( $args );
655
+
656
+ $args = array(
657
+ 'name' => 'includewords',
658
+ 'default' => '',
659
+ 'section' => 'sbspf_moderation',
660
+ 'callback' => 'text',
661
+ 'class' => 'large-text',
662
+ 'title' => __( 'Show videos containing these words or hashtags', $text_domain ),
663
+ 'shortcode' => array(
664
+ 'key' => 'includewords',
665
+ 'example' => '#filter',
666
+ 'description' => __( 'Show videos that have specific text in the title or description.', $text_domain ),
667
+ 'display_section' => 'customize'
668
+ ),
669
+ 'additional' => __( '"includewords" separate multiple words with commas, include "#" for hashtags', $text_domain )
670
+ );
671
+ $this->add_settings_field( $args );
672
+
673
+ $args = array(
674
+ 'name' => 'excludewords',
675
+ 'default' => '',
676
+ 'section' => 'sbspf_moderation',
677
+ 'callback' => 'text',
678
+ 'class' => 'large-text',
679
+ 'title' => __( 'Remove videos containing these words or hashtags', $text_domain ),
680
+ 'shortcode' => array(
681
+ 'key' => 'excludewords',
682
+ 'example' => '#filter',
683
+ 'description' => __( 'Remove videos that have specific text in the title or description.', $text_domain ),
684
+ 'display_section' => 'customize'
685
+ ),
686
+ 'additional' => __( '"excludewords" separate multiple words with commas, include "#" for hashtags', $text_domain )
687
+ );
688
+ $this->add_settings_field( $args );
689
+ $this->pro_only[] = 'includewords';
690
+ $this->pro_only[] = 'excludewords';
691
+
692
+ $args = array(
693
+ 'name' => 'hidevideos',
694
+ 'default' => '',
695
+ 'section' => 'sbspf_moderation',
696
+ 'callback' => 'textarea',
697
+ 'title' => __( 'Hide Specific Videos', $text_domain ),
698
+ 'options' => $select_options,
699
+ 'tooltip_info' => __( 'Separate IDs with commas.', $text_domain ) . '<a class="sbspf_tooltip_link" href="JavaScript:void(0);">'.$this->default_tooltip_text().'</a>
700
+ <p class="sbspf_tooltip sbspf_more_info">' . __( 'These are the specific ID numbers associated with a video or with a post. You can find the ID of a video by viewing the video on YouTube and copy/pasting the ID number from the end of the URL. ex. <code>https://www.youtube.com/watch?v=<span class="sbspf-highlight">Ij1KvL8eN</span></code>', $text_domain ) . '</p>'
701
+ );
702
+ $this->add_settings_field( $args );
703
+
704
  $args = array(
705
  'title' => __( 'Custom Code Snippets', $text_domain ),
706
  'id' => 'sbspf_custom_snippets',
739
  );
740
  $this->add_settings_section( $args );
741
 
742
+ $args = array(
743
+ 'name' => 'preserve_settings',
744
+ 'section' => 'sbspf_advanced',
745
+ 'callback' => 'checkbox',
746
+ 'title' => __( 'Preserve settings when plugin is removed', $text_domain ),
747
+ 'default' => false,
748
+ 'tooltip_info' => __( 'When removing the plugin your settings are automatically erased. Checking this box will prevent any settings from being deleted. This means that you can uninstall and reinstall the plugin without losing your settings.', $text_domain )
749
+ );
750
+ $this->add_settings_field( $args );
751
+
752
  $select_options = array(
753
  array(
754
  'label' => __( 'Background', $text_domain ),
786
  );
787
  $this->add_settings_field( $args );
788
 
789
+ $args = array(
790
+ 'name' => 'customtemplates',
791
+ 'section' => 'sbspf_advanced',
792
+ 'callback' => 'checkbox',
793
+ 'title' => __( 'Enable Custom Templates', $text_domain ),
794
+ 'default' => false,
795
+ 'tooltip_info' => __( 'The default HTML for the feed can be replaced with custom templates added to your theme\'s folder. Enable this setting to use these templates. See <a href="https://smashballoon.com/youtube-custom-templates/" target="_blank">this guide</a>', $text_domain )
796
+ );
797
+ $this->add_settings_field( $args );
798
+
799
  }
800
 
801
  public function cache( $args ) {
inc/admin/templates/customize.php CHANGED
@@ -2,9 +2,19 @@
2
  <form method="post" action="">
3
  <?php $this->hidden_fields_for_tab( 'customize' ); ?>
4
 
5
- <?php foreach ( $this->get_sections( 'customize' ) as $section ) : ?>
6
- <?php do_settings_sections( $section['id'] ); // matches the section name ?>
7
- <?php if ( $section['save_after'] ) : ?>
 
 
 
 
 
 
 
 
 
 
8
  <p class="submit"><input class="button-primary" type="submit" name="save" value="<?php esc_attr_e( 'Save Changes' ); ?>" /></p>
9
  <?php endif; ?>
10
  <hr>
2
  <form method="post" action="">
3
  <?php $this->hidden_fields_for_tab( 'customize' ); ?>
4
 
5
+ <?php foreach ( $this->get_sections( 'customize' ) as $section ) :
6
+ if ( $section['pro'] ) : ?>
7
+ <div class="sbspf_pro_section">
8
+ <p style="padding-bottom: 18px;" class="sbspf_pro_reveal">
9
+ <a href="https://smashballoon.com/youtube-feed/?utm_source=plugin-free&amp;utm_campaign=sby" target="_blank"><?php echo esc_html( $section['pro'] ); ?></a><br>
10
+ <a href="javascript:void(0);" class="button button-secondary sbspf-show-pro"><b>+</b> <?php _e( 'Show Pro Options', $text_domain ); ?></a>
11
+ </p>
12
+ <?php endif;
13
+ do_settings_sections( $section['id'] ); // matches the section name
14
+ if ( $section['pro'] ) {
15
+ echo '</div>';
16
+ }
17
+ if ( $section['save_after'] ) : ?>
18
  <p class="submit"><input class="button-primary" type="submit" name="save" value="<?php esc_attr_e( 'Save Changes' ); ?>" /></p>
19
  <?php endif; ?>
20
  <hr>
inc/admin/templates/display.php CHANGED
@@ -4,14 +4,14 @@
4
 
5
  <h3 style="padding-top: 10px;"><?php _e( 'Multiple Feeds', $text_domain ); ?></h3>
6
  <p><?php _e( "If you'd like to display multiple feeds then you can set different settings directly in the shortcode like so:", $text_domain ); ?>
7
- </br><code>[<?php echo $slug; ?> user=gopro num=9]</code></p>
8
  <p><?php _e( "You can display as many different feeds as you like, on either the same page or on different pages, by just using the shortcode options below. For example:", $text_domain ); ?><br />
9
  <code>[<?php echo $slug; ?>]</code><br />
10
- <code>[<?php echo $slug; ?> user="ANOTHER_CHANNEL"]</code><br />
11
  <code>[<?php echo $slug; ?> num=4 showheader=false]</code>
12
  </p>
13
  <p><?php _e( "See the table below for a full list of available shortcode options:", $text_domain ); ?></p>
14
-
15
  <table class="sbspf_shortcode_table">
16
  <tbody>
17
  <tr valign="top">
@@ -22,8 +22,13 @@
22
 
23
  <?php foreach ( $this->display_your_feed_sections as $display_your_feed_section ) : ?>
24
  <tr class="sbspf_table_header"><td colspan=3><?php echo $display_your_feed_section['label'] ?></td></tr>
25
- <?php foreach ( $display_your_feed_section['settings'] as $setting ) : ?>
26
- <tr>
 
 
 
 
 
27
  <td><?php echo $setting['key']; ?></td>
28
  <td><?php echo $setting['description']; ?></td>
29
  <td><code>[<?php echo $slug; ?> <?php echo $setting['key']; ?>="<?php echo str_replace('"', '', $setting['example'] ); ?>"]</code></td>
4
 
5
  <h3 style="padding-top: 10px;"><?php _e( 'Multiple Feeds', $text_domain ); ?></h3>
6
  <p><?php _e( "If you'd like to display multiple feeds then you can set different settings directly in the shortcode like so:", $text_domain ); ?>
7
+ </br><code>[<?php echo $slug; ?> channel=gopro num=9]</code></p>
8
  <p><?php _e( "You can display as many different feeds as you like, on either the same page or on different pages, by just using the shortcode options below. For example:", $text_domain ); ?><br />
9
  <code>[<?php echo $slug; ?>]</code><br />
10
+ <code>[<?php echo $slug; ?> channel="ANOTHER_CHANNEL"]</code><br />
11
  <code>[<?php echo $slug; ?> num=4 showheader=false]</code>
12
  </p>
13
  <p><?php _e( "See the table below for a full list of available shortcode options:", $text_domain ); ?></p>
14
+ <p><span class="sbspf_table_key"></span><?php _e( "Pro version only", $text_domain ); ?></p>
15
  <table class="sbspf_shortcode_table">
16
  <tbody>
17
  <tr valign="top">
22
 
23
  <?php foreach ( $this->display_your_feed_sections as $display_your_feed_section ) : ?>
24
  <tr class="sbspf_table_header"><td colspan=3><?php echo $display_your_feed_section['label'] ?></td></tr>
25
+ <?php foreach ( $display_your_feed_section['settings'] as $setting ) :
26
+ $pro_only_class = '';
27
+ if ( in_array( $setting['key'], $this->pro_only, true ) ) {
28
+ $pro_only_class = ' class="sbspf_pro_only"';
29
+ }
30
+ ?>
31
+ <tr<?php echo $pro_only_class; ?>>
32
  <td><?php echo $setting['key']; ?></td>
33
  <td><?php echo $setting['description']; ?></td>
34
  <td><code>[<?php echo $slug; ?> <?php echo $setting['key']; ?>="<?php echo str_replace('"', '', $setting['example'] ); ?>"]</code></td>
inc/admin/templates/main.php CHANGED
@@ -25,6 +25,18 @@ $tabs = $this->get_tabs();
25
  ?>
26
 
27
  <div id="sbspf_admin" class="wrap sbspf-admin sby_admin" data-sb-plugin="sbspf">
 
 
 
 
 
 
 
 
 
 
 
 
28
  <h1><?php echo esc_html( $plugin_name ); ?></h1>
29
 
30
  <!-- Display the tabs along with styling for the 'active' tab -->
25
  ?>
26
 
27
  <div id="sbspf_admin" class="wrap sbspf-admin sby_admin" data-sb-plugin="sbspf">
28
+ <?php
29
+ $lite_notice_dismissed = get_transient( 'youtube_feed_dismiss_lite' );
30
+
31
+ if ( ! $lite_notice_dismissed ) :
32
+ ?>
33
+ <div id="sbspf-notice-bar" style="display:none">
34
+ <span class="sbspf-notice-bar-message"><?php _e( 'You\'re using Feeds for YouTube Lite. To unlock more features consider <a href="https://smashballoon.com/youtube-feed/?utm_source=WordPress&utm_campaign=youtubeliteplugin&utm_medium=notice-bar" target="_blank" rel="noopener noreferrer">upgrading to Pro</a>.', $text_domain ); ?></span>
35
+ <button type="button" class="dismiss" title="<?php _e( 'Dismiss this message.', $text_domain ); ?>" data-page="overview">
36
+ </button>
37
+ </div>
38
+ <?php endif; ?>
39
+
40
  <h1><?php echo esc_html( $plugin_name ); ?></h1>
41
 
42
  <!-- Display the tabs along with styling for the 'active' tab -->
inc/class-sby-cron-update.php CHANGED
@@ -8,7 +8,7 @@
8
  * function will trigger a single feed update if no transient is found
9
  * for the feed
10
  *
11
- * @since 2.0/5.0
12
  */
13
 
14
  if ( ! defined( 'ABSPATH' ) ) {
@@ -63,9 +63,7 @@ class SBY_Cron_Updater
63
  if ( empty( $database_settings['connected_accounts'] ) && empty( $database_settings['api_key'] ) ) {
64
  $report[ $feed_id ]['did_update'] = 'no - no connected account';
65
  } else {
66
- if ( SBY_Cron_Updater::can_update( $sby_settings_obj, $feed_data, $atts, count( $feed_caches ) ) ) {
67
- SBY_Cron_Updater::do_single_feed_cron_update( $sby_settings_obj, $feed_data, $atts );
68
- }
69
 
70
  $report[ $feed_id ]['did_update'] = 'yes';
71
  }
@@ -87,54 +85,6 @@ class SBY_Cron_Updater
87
  update_option( 'sby_cron_report', $report, false );
88
  }
89
 
90
- public static function can_update( $sby_settings_obj, $feed_data, $atts ) {
91
- $can_update_return = array(
92
- 'can_update' => false,
93
- 'reason' => '',
94
- );
95
-
96
- // if no one has visited the page in the last 2 days, don't update
97
- if ( (int)$feed_data['last_requested'] < (time() - 60*60*24*2) ) {
98
- $can_update_return['reason'] = 'no one viewing feed';
99
- return $can_update_return;
100
- }
101
-
102
- // get what the person said frequency should be
103
-
104
- // use that for the first 3 days
105
-
106
- // get factor, if different use that
107
-
108
- $last_five = array_slice( $feed_data['data'], 0, 5 );
109
- $last_of_sample_index = count( $last_five ) - 1;
110
- //'last_requested' => int 1576097737
111
- //'last_retrieve' => int 1576114290
112
-
113
- // get time of last post
114
- $last_post_time = SBY_Parse::get_timestamp( $last_five[0] ) ;
115
- // get time since last update
116
- $time_since_last_post = time() - $last_post_time;
117
- // get average time between last 5 posts.
118
- $post_frequency = ($last_post_time - SBY_Parse::get_timestamp( $last_five[ $last_of_sample_index ] )) / $last_of_sample_index + 1;
119
-
120
- $delay_factor = 0;
121
-
122
- // how recently was the last video posted
123
- $hours_since_last_post = $time_since_last_post/60/60;
124
- $delay_factor += min( $hours_since_last_post/12, 3 );
125
-
126
- // how often is the typical video posted
127
- $normal_post_frequency = $post_frequency/60/60;
128
- $delay_factor += min( $normal_post_frequency/12, 3 );
129
-
130
- // Minimum 12 hours
131
- // Maximum 1 week if still active
132
- // stop updating and add notice if no new posts found by the plugin for a month
133
- var_dump( $delay_factor, date( 'm-d-Y H:i', $last_post_time ), $time_since_last_post/60/60, $post_frequency/60/60);
134
- die();
135
- return $can_update_return;
136
- }
137
-
138
  /**
139
  * Update a single feed cache based on settings. Local image storing and
140
  * resizing is done in the background here as well unless this is the initial
8
  * function will trigger a single feed update if no transient is found
9
  * for the feed
10
  *
11
+ * @since 1.0/1.0
12
  */
13
 
14
  if ( ! defined( 'ABSPATH' ) ) {
63
  if ( empty( $database_settings['connected_accounts'] ) && empty( $database_settings['api_key'] ) ) {
64
  $report[ $feed_id ]['did_update'] = 'no - no connected account';
65
  } else {
66
+ SBY_Cron_Updater::do_single_feed_cron_update( $sby_settings_obj, $feed_data, $atts );
 
 
67
 
68
  $report[ $feed_id ]['did_update'] = 'yes';
69
  }
85
  update_option( 'sby_cron_report', $report, false );
86
  }
87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  /**
89
  * Update a single feed cache based on settings. Local image storing and
90
  * resizing is done in the background here as well unless this is the initial
inc/class-sby-display-elements.php CHANGED
@@ -371,6 +371,8 @@ class SBY_Display_Elements
371
  $include_array = $settings['include'];
372
  }
373
 
 
 
374
  if ( in_array( $element, $include_array, true ) ) {
375
  return true;
376
  }
371
  $include_array = $settings['include'];
372
  }
373
 
374
+ $include_array = is_array( $include_array ) ? $include_array : explode( ',', str_replace( ' ', '', $include_array ) );
375
+
376
  if ( in_array( $element, $include_array, true ) ) {
377
  return true;
378
  }
inc/class-sby-parse.php CHANGED
@@ -79,10 +79,17 @@ class SBY_Parse
79
  case 'high' :
80
  $thumbnail_key = 'high';
81
  break;
 
 
 
82
  }
83
 
84
  if ( isset( $post['snippet']['thumbnails'][ $thumbnail_key ]['url'] ) ) {
85
  return $post['snippet']['thumbnails'][ $thumbnail_key ]['url'];
 
 
 
 
86
  }
87
 
88
  return '';
79
  case 'high' :
80
  $thumbnail_key = 'high';
81
  break;
82
+ case 'lightbox' :
83
+ $thumbnail_key = 'high';
84
+ break;
85
  }
86
 
87
  if ( isset( $post['snippet']['thumbnails'][ $thumbnail_key ]['url'] ) ) {
88
  return $post['snippet']['thumbnails'][ $thumbnail_key ]['url'];
89
+ } elseif ( isset( $post['snippet']['thumbnails']['high']['url'] ) ) {
90
+ return $post['snippet']['thumbnails']['high']['url'];
91
+ } elseif ( isset( $post['snippet']['thumbnails']['medium']['url'] ) ) {
92
+ return $post['snippet']['thumbnails']['medium']['url'];
93
  }
94
 
95
  return '';
inc/class-sby-wp-post.php CHANGED
@@ -16,7 +16,7 @@ class SBY_WP_Post
16
  $this->feed_id = $feed_id;
17
  }
18
 
19
- public function update_post() {
20
  if ( ! $this->get_wp_post_id() ) {
21
  $postarr = array(
22
  'post_title' => SBY_Parse::get_video_title( $this->youtube_api_data ),
@@ -24,7 +24,7 @@ class SBY_WP_Post
24
  'post_type' => SBY_CPT,
25
  'post_date' => date( 'Y-m-d H:i:s', SBY_Parse::get_timestamp( $this->youtube_api_data ) + sby_get_utc_offset() ),
26
  'post_date_gmt' => date( 'Y-m-d H:i:s', SBY_Parse::get_timestamp( $this->youtube_api_data ) ),
27
- 'post_status' => 'draft'
28
  );
29
  $wp_post_id = wp_insert_post( $postarr );
30
 
@@ -48,10 +48,13 @@ class SBY_WP_Post
48
  update_post_meta( $this->wp_post_id, $prefix . 'feed_id', sby_strip_after_hash( $this->feed_id ) );
49
  update_post_meta( $this->wp_post_id, $prefix . 'channel_id', SBY_Parse::get_channel_id( $this->youtube_api_data ) );
50
  update_post_meta( $this->wp_post_id, $prefix . 'channel_title', SBY_Parse::get_channel_title( $this->youtube_api_data ) );
 
51
  update_post_meta( $this->wp_post_id, $prefix . 'last_updated', date( 'Y-m-d H:i:s' ) );
52
  update_post_meta( $this->wp_post_id, $prefix . 'thumbnails', SBY_Parse::get_media_src_set( $this->youtube_api_data ) );
53
  update_post_meta( $this->wp_post_id, $prefix . 'youtube_publish_date', date( 'Y-m-d H:i:s', SBY_Parse::get_timestamp( $this->youtube_api_data ) ) );
54
-
 
 
55
  $post_array = $this->youtube_api_data;
56
  array_walk_recursive( $post_array, 'sby_replace_double_quotes' );
57
  update_post_meta( $this->wp_post_id, $prefix . 'json', wp_json_encode( $post_array ) );
@@ -59,6 +62,56 @@ class SBY_WP_Post
59
  return true;
60
  }
61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  public static function maybe_get_channel_id_for_channel_title( $title ) {
63
  global $wpdb;
64
 
@@ -97,7 +150,13 @@ class SBY_WP_Post
97
  }
98
  }
99
 
100
- protected function get_post_content() {
101
- return '['.SBY_SLUG.'-single]';
 
 
 
 
 
 
102
  }
103
  }
16
  $this->feed_id = $feed_id;
17
  }
18
 
19
+ public function update_post( $status = 'draft' ) {
20
  if ( ! $this->get_wp_post_id() ) {
21
  $postarr = array(
22
  'post_title' => SBY_Parse::get_video_title( $this->youtube_api_data ),
24
  'post_type' => SBY_CPT,
25
  'post_date' => date( 'Y-m-d H:i:s', SBY_Parse::get_timestamp( $this->youtube_api_data ) + sby_get_utc_offset() ),
26
  'post_date_gmt' => date( 'Y-m-d H:i:s', SBY_Parse::get_timestamp( $this->youtube_api_data ) ),
27
+ 'post_status' => $status
28
  );
29
  $wp_post_id = wp_insert_post( $postarr );
30
 
48
  update_post_meta( $this->wp_post_id, $prefix . 'feed_id', sby_strip_after_hash( $this->feed_id ) );
49
  update_post_meta( $this->wp_post_id, $prefix . 'channel_id', SBY_Parse::get_channel_id( $this->youtube_api_data ) );
50
  update_post_meta( $this->wp_post_id, $prefix . 'channel_title', SBY_Parse::get_channel_title( $this->youtube_api_data ) );
51
+ update_post_meta( $this->wp_post_id, $prefix . 'description', SBY_Parse::get_caption( $this->youtube_api_data ) );
52
  update_post_meta( $this->wp_post_id, $prefix . 'last_updated', date( 'Y-m-d H:i:s' ) );
53
  update_post_meta( $this->wp_post_id, $prefix . 'thumbnails', SBY_Parse::get_media_src_set( $this->youtube_api_data ) );
54
  update_post_meta( $this->wp_post_id, $prefix . 'youtube_publish_date', date( 'Y-m-d H:i:s', SBY_Parse::get_timestamp( $this->youtube_api_data ) ) );
55
+ if ( class_exists( 'SBY_Parse_Pro' ) ) {
56
+ update_post_meta( $this->wp_post_id, $prefix . 'live_broadcast_content', SBY_Parse_Pro::get_live_broadcast_content( $this->youtube_api_data ) );
57
+ }
58
  $post_array = $this->youtube_api_data;
59
  array_walk_recursive( $post_array, 'sby_replace_double_quotes' );
60
  update_post_meta( $this->wp_post_id, $prefix . 'json', wp_json_encode( $post_array ) );
62
  return true;
63
  }
64
 
65
+ public function post_content_description_is_incomplete() {
66
+ $content = get_the_content( '', false, $this->get_wp_post_id() );
67
+
68
+ return (strpos( $content, '<!-- sby:description-incomplete -->' ) !== false);
69
+ }
70
+
71
+ public function update_video_details() {
72
+ if ( empty( $this->youtube_api_data['statistics'] ) ) {
73
+ return false;
74
+ }
75
+
76
+ $post_id = $this->get_wp_post_id();
77
+
78
+ if ( $post_id ) {
79
+ $prefix = 'sby_';
80
+
81
+ if ( class_exists( 'SBY_Parse_Pro' ) ) {
82
+ update_post_meta( $post_id, $prefix . 'comment_count', SBY_Parse_Pro::get_comment_count( $this->youtube_api_data ) );
83
+ update_post_meta( $post_id, $prefix . 'view_count', SBY_Parse_Pro::get_view_count( $this->youtube_api_data ) );
84
+ update_post_meta( $post_id, $prefix . 'like_count', SBY_Parse_Pro::get_like_count( $this->youtube_api_data ) );
85
+ update_post_meta( $post_id, $prefix . 'scheduled_start_time', date( 'Y-m-d H:i:s', SBY_Parse_Pro::get_scheduled_start_timestamp( $this->youtube_api_data ) ) );
86
+ update_post_meta( $post_id, $prefix . 'actual_start_time', date( 'Y-m-d H:i:s', SBY_Parse_Pro::get_actual_start_timestamp( $this->youtube_api_data ) ) );
87
+ update_post_meta( $post_id, $prefix . 'actual_end_time', date( 'Y-m-d H:i:s', SBY_Parse_Pro::get_actual_end_timestamp( $this->youtube_api_data ) ) );
88
+ }
89
+
90
+ update_post_meta( $post_id, $prefix . 'last_details_check_time', date( 'Y-m-d H:i:s' ) );
91
+ $description = SBY_Parse::get_caption( $this->youtube_api_data );
92
+ if ( ! empty( $description ) ) {
93
+ update_post_meta( $post_id, $prefix . 'description', $description );
94
+ if ( $this->post_content_description_is_incomplete() ) {
95
+ $this->update_content();
96
+ }
97
+ }
98
+ return true;
99
+ }
100
+
101
+ return false;
102
+ }
103
+ public function update_content() {
104
+ $my_post = array();
105
+ $my_post['ID'] = $this->get_wp_post_id();
106
+ $my_post['post_content'] = $this->get_post_content( true );
107
+
108
+ wp_update_post( $my_post );
109
+ }
110
+
111
+ public static function maybe_get_channel_id_for_name( $name ) {
112
+
113
+ }
114
+
115
  public static function maybe_get_channel_id_for_channel_title( $title ) {
116
  global $wpdb;
117
 
150
  }
151
  }
152
 
153
+ protected function get_post_content( $override = false ) {
154
+ $description = SBY_Parse::get_caption( $this->youtube_api_data );
155
+ $flag = '';
156
+ if ( ! $override && substr( $description, -3 ) === '...' ) {
157
+ $flag = '<!-- sby:description-incomplete -->';
158
+ }
159
+
160
+ return '['.SBY_SLUG.'-single]<!-- sby:description-start -->' . wp_kses_post( $description ) . '<!-- sby:description-end -->' . $flag;
161
  }
162
  }
js/admin.js CHANGED
@@ -1,6 +1,7 @@
1
  (function($){
2
- function SbspfAdmin(plugin) {
3
  this.plugin = plugin;
 
4
  this.accesstokenSplitter = 'access_token=';
5
  }
6
 
@@ -14,6 +15,10 @@
14
  self.initClickRemove($(this));
15
  self.initInfoToggle($('.'+self.plugin +'_connected_accounts_wrap').last());
16
  });
 
 
 
 
17
 
18
  self.initAppCredToggle();
19
 
@@ -131,6 +136,10 @@
131
  $(cla + '_layout_type').change(function() {
132
  self.updateLayoutOptionsDisplay()
133
  });
 
 
 
 
134
 
135
  // tooltips
136
  $(id +'_admin '+ cla + '_tooltip_link').click(function(){
@@ -153,6 +162,11 @@
153
  });
154
  self.updateFeedWidthDisplay();
155
  }
 
 
 
 
 
156
  },
157
  addAccessTokenListener: function() {
158
  var self = this;
@@ -211,11 +225,11 @@
211
  },
212
  initInfoToggle: function(el) {
213
  var self = this;
214
- el.find('.'+self.plugin +'_ca_show_token').off().click(function() {
215
  $(this).closest('.'+self.plugin +'_ca_info').find('.'+self.plugin +'_ca_accesstoken').slideToggle(200);
216
  });
217
 
218
- el.find('.'+self.plugin +'_ca_token_shortcode').off().click(function() {
219
  $(this).closest('.'+self.plugin +'_ca_info').find('.'+self.plugin +'_ca_shortcode').slideToggle(200);
220
  });
221
  },
@@ -298,7 +312,6 @@
298
  } else {
299
  $('.'+self.plugin +'-waiting').removeClass(self.plugin +'-waiting');
300
  }
301
- console.log($(this).attr('data-sby-action'),$(this).attr('data-sby-confirm'));
302
  });
303
  });
304
  },
@@ -364,6 +377,13 @@
364
  $('.'+self.plugin+'_layout_settings.'+self.plugin+'_layout_type_'+$('.'+self.plugin+'_layout_type:checked').val()).show();
365
  }, 1);
366
  },
 
 
 
 
 
 
 
367
  updateFeedWidthDisplay: function() {
368
  self = this;
369
  var sbspfFeedWidth = $('#'+self.plugin+'_admin '+'#'+self.plugin+'_settings_width').val(),
@@ -376,6 +396,17 @@
376
  $sbspfWidthOptions.slideDown();
377
  }
378
  },
 
 
 
 
 
 
 
 
 
 
 
379
  encodeHTML: function(raw) {
380
  // make sure passed variable is defined
381
  if (typeof raw === 'undefined') {
@@ -392,8 +423,9 @@
392
  };
393
 
394
  window.sbspf_admin_init = function() {
395
- var plugin = typeof $('.sbspf-admin').attr('data-sb-plugin') !== 'undefined' ? $('.sbspf-admin').attr('data-sb-plugin') : 'sbspf';
396
- window.sb = new SbspfAdmin(plugin);
 
397
  window.sb.init();
398
  };
399
 
@@ -406,8 +438,200 @@
406
  });
407
  }
408
 
409
- function SbYoutubeAdmin(plugin) {
410
- SbspfAdmin.call(this, plugin);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
411
 
412
  this.addAccessTokenListener = function () {
413
  var self = this;
@@ -508,8 +732,9 @@
508
 
509
 
510
  window.sby_admin_init = function() {
511
- var plugin = typeof $('.sbspf-admin').attr('data-sb-plugin') !== 'undefined' ? $('.sbspf-admin').attr('data-sb-plugin') : 'sbspf';
512
- window.sb = new SbYoutubeAdmin(plugin);
 
513
  window.sb.init();
514
  };
515
 
1
  (function($){
2
+ function SbspfAdmin(plugin,$adminEl) {
3
  this.plugin = plugin;
4
+ this.$adminEl = $adminEl;
5
  this.accesstokenSplitter = 'access_token=';
6
  }
7
 
15
  self.initClickRemove($(this));
16
  self.initInfoToggle($('.'+self.plugin +'_connected_accounts_wrap').last());
17
  });
18
+ this.$adminEl.find('.sbspf_type_input').change(function() {
19
+ self.updateOnSelect($(this));
20
+ });self.updateOnSelect();
21
+
22
 
23
  self.initAppCredToggle();
24
 
136
  $(cla + '_layout_type').change(function() {
137
  self.updateLayoutOptionsDisplay()
138
  });
139
+ $(cla + '_sub_option_type').change(function() {
140
+ self.updateBoxSelectionDisplay()
141
+ });
142
+ self.updateBoxSelectionDisplay();
143
 
144
  // tooltips
145
  $(id +'_admin '+ cla + '_tooltip_link').click(function(){
162
  });
163
  self.updateFeedWidthDisplay();
164
  }
165
+
166
+ this.afterInit();
167
+ },
168
+ afterInit: function() {
169
+
170
  },
171
  addAccessTokenListener: function() {
172
  var self = this;
225
  },
226
  initInfoToggle: function(el) {
227
  var self = this;
228
+ el.find('.'+self.plugin +'_ca_show_token').click(function() {
229
  $(this).closest('.'+self.plugin +'_ca_info').find('.'+self.plugin +'_ca_accesstoken').slideToggle(200);
230
  });
231
 
232
+ el.find('.'+self.plugin +'_ca_token_shortcode').click(function() {
233
  $(this).closest('.'+self.plugin +'_ca_info').find('.'+self.plugin +'_ca_shortcode').slideToggle(200);
234
  });
235
  },
312
  } else {
313
  $('.'+self.plugin +'-waiting').removeClass(self.plugin +'-waiting');
314
  }
 
315
  });
316
  });
317
  },
377
  $('.'+self.plugin+'_layout_settings.'+self.plugin+'_layout_type_'+$('.'+self.plugin+'_layout_type:checked').val()).show();
378
  }, 1);
379
  },
380
+ updateBoxSelectionDisplay: function() {
381
+ self = this;
382
+ setTimeout(function(){
383
+ $('.'+self.plugin+'_sub_option_settings').hide();
384
+ $('.'+self.plugin+'_sub_option_settings.'+self.plugin+'_sub_option_type_'+$('.'+self.plugin+'_sub_option_type:checked').val()).show();
385
+ }, 1);
386
+ },
387
  updateFeedWidthDisplay: function() {
388
  self = this;
389
  var sbspfFeedWidth = $('#'+self.plugin+'_admin '+'#'+self.plugin+'_settings_width').val(),
396
  $sbspfWidthOptions.slideDown();
397
  }
398
  },
399
+ updateOnSelect: function($changed) {
400
+ this.$adminEl.find('.sbspf_type_input').each(function() {
401
+ if ($(this).is(':checked')) {
402
+ $(this).closest('.sbspf_type_row').find('.sbspf_onselect').show();
403
+ } else {
404
+ $(this).closest('.sbspf_type_row').find('.sbspf_onselect').hide();
405
+ }
406
+ });
407
+ //console.log($changed.is(':checked'),$changed.closest('.sbspf_type_row').find('.sbspf_onselect').length)
408
+
409
+ },
410
  encodeHTML: function(raw) {
411
  // make sure passed variable is defined
412
  if (typeof raw === 'undefined') {
423
  };
424
 
425
  window.sbspf_admin_init = function() {
426
+ var plugin = typeof $('.sbspf-admin').attr('data-sb-plugin') !== 'undefined' ? $('.sbspf-admin').attr('data-sb-plugin') : 'sbspf',
427
+ $adminEl = $('#sbspf_admin.sby_admin');
428
+ window.sb = new SbspfAdmin(plugin,$adminEl);
429
  window.sb.init();
430
  };
431
 
438
  });
439
  }
440
 
441
+ function SbYoutubeAdmin(plugin,$adminEl) {
442
+ SbspfAdmin.call(this, plugin,$adminEl);
443
+ this.afterInit = function() {
444
+ var self = this,
445
+ id = '#'+this.plugin,
446
+ cla = '.'+this.plugin;
447
+
448
+ // notices
449
+
450
+ if (jQuery('#sbspf-notice-bar').length) {
451
+ jQuery('#wpadminbar').after(jQuery('#sbspf-notice-bar'));
452
+ jQuery('#wpcontent').css('padding-left', 0);
453
+ jQuery('#wpbody').css('padding-left', '20px');
454
+ jQuery('#sbspf-notice-bar').show();
455
+ }
456
+
457
+ jQuery('#sbspf-notice-bar .dismiss').click(function(e) {
458
+ e.preventDefault();
459
+ jQuery('#sbspf-notice-bar').remove();
460
+ var submitData = {
461
+ 'action' : 'sby_lite_dismiss',
462
+ 'sbspf_nonce' : sbspf.nonce
463
+ };
464
+ var onSuccess = function (data) {
465
+ };
466
+ sbAjax(submitData,onSuccess);
467
+ });
468
+
469
+ $('#sbspf_usecustomsearch').change(function() {
470
+ if ($(this).is(':checked')) {
471
+ $('#sbspf_usecustomsearch_reveal').show();
472
+ } else {
473
+ $('#sbspf_usecustomsearch_reveal').hide();
474
+ }
475
+ });
476
+
477
+ if ($('#sbspf_usecustomsearch').is(':checked')) {
478
+ $('#sbspf_usecustomsearch_reveal').show();
479
+ } else {
480
+ $('#sbspf_usecustomsearch_reveal').hide();
481
+ }
482
+
483
+
484
+ $('.sbspf_dismiss_button').click(function() {
485
+ event.preventDefault();
486
+ $('#sbspf_modal_overlay').remove();
487
+ var submitData = {
488
+ 'action' : $(this).attr('data-action')
489
+ };
490
+ sbAjax(submitData,function() {});
491
+ });
492
+
493
+ $('.sby_api_key_needed').each(function() {
494
+ $(this).find('label').append('<span class="sby_api_key_needed_message"><svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="key" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="svg-inline--fa fa-key fa-w-16"><path fill="currentColor" d="M512 176.001C512 273.203 433.202 352 336 352c-11.22 0-22.19-1.062-32.827-3.069l-24.012 27.014A23.999 23.999 0 0 1 261.223 384H224v40c0 13.255-10.745 24-24 24h-40v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24v-78.059c0-6.365 2.529-12.47 7.029-16.971l161.802-161.802C163.108 213.814 160 195.271 160 176 160 78.798 238.797.001 335.999 0 433.488-.001 512 78.511 512 176.001zM336 128c0 26.51 21.49 48 48 48s48-21.49 48-48-21.49-48-48-48-48 21.49-48 48z" class=""></path></svg> API Key Needed</span>');
495
+ });
496
+
497
+ var proJustHoverHTML = '<a href="https://smashballoon.com/youtube-feed/?utm_source=plugin-free&amp;utm_campaign=sby" target="_blank" class="sbspf_lock sbspf_pro_lock"><i class="fa fa-rocket"></i>Pro</a>',
498
+ proLockHTML = '<p class="sbspf_pro_tooltip" style="display: none;">Upgrade to the Pro version to unlock this feature<i class="fa fa-caret-down" aria-hidden="true"></i></p>' + proJustHoverHTML,
499
+ proAvailableHTML = '<span class="sbspf_note"> - <a href="https://smashballoon.com/youtube-feed/?utm_source=plugin-free&amp;utm_campaign=sby" target="_blank">Available in Pro version</a></span>';
500
+
501
+ $('.sbspf_pro_only').each(function() {
502
+ if (jQuery(this).closest('td').find('.sbspf_sub_options').length) {
503
+ if (!jQuery(this).closest('td').find('.sbspf_lock').length) {
504
+ jQuery(this).closest('td').find('.sbspf_sub_options').append(proLockHTML);
505
+ }
506
+ jQuery(this).closest('td').find('input,select,textarea').each(function() {
507
+ if (typeof jQuery(this).attr('name') !== 'undefined') {
508
+ jQuery(this).attr('name',jQuery(this).attr('name').replace('sb','demosb'));
509
+ }
510
+ });
511
+ if (jQuery(this).html() === '') {
512
+ jQuery(this).closest('tr').addClass('sbspf_pro_only_row');
513
+ if (jQuery(this).html() === '') {
514
+ jQuery(this).remove();
515
+ }
516
+ }
517
+ } else if (jQuery(this).hasClass('sbspf_layout_cell')) {
518
+ if (!jQuery(this).find('.sbspf_lock').length) {
519
+ jQuery(this).append(proJustHoverHTML);
520
+ jQuery(this).find('img').css('opacity', .4);
521
+ }
522
+ } else if (jQuery(this).hasClass('sbspf_layout_settings')){
523
+ if (!jQuery(this).find('.sbspf_lock').length) {
524
+ jQuery(this).find('.sbspf_layout_setting').first().append('<span class="sbspf_note"><a href="https://smashballoon.com/youtube-feed/?utm_source=plugin-free&amp;utm_campaign=sby" target="_blank">Upgrade to Pro to enable the carousel layout</a></span>');
525
+ jQuery(this).find('input,select,textarea').attr('disabled','true');
526
+ }
527
+ } else {
528
+ if (jQuery(this).closest('td').find('.sbspf_single_checkbox').length
529
+ && ! jQuery(this).closest('td').find('.sbspf_lock').length){
530
+ jQuery(this).closest('tr').addClass('sbspf_pro_only_row');
531
+ jQuery(this).closest('tr').find('.sbspf_single_checkbox').next('label').after(proAvailableHTML);
532
+ if (jQuery(this).html() === '') {
533
+ jQuery(this).remove();
534
+ }
535
+ } else if (jQuery(this).closest('td').find('select.sbspf_pro_only').length
536
+ && ! jQuery(this).closest('td').find('.sbspf_lock').length){
537
+ jQuery(this).closest('tr').addClass('sbspf_pro_only_row');
538
+ jQuery(this).closest('tr').find('select.sbspf_pro_only').after(proAvailableHTML);
539
+ if (jQuery(this).html() === '') {
540
+ jQuery(this).remove();
541
+ }
542
+ }else if (jQuery(this).find('input[type=checkbox]').length) {
543
+ var $closestTD = jQuery(this).closest('td');
544
+ jQuery(this).find('input').attr('disabled','true');
545
+ if (jQuery(this).find('input').is(':checked')) {
546
+ var $clone = jQuery(this).find('input').clone();
547
+ $clone.removeAttr('disabled').removeAttr('checked').attr('type','hidden');
548
+ jQuery(this).append($clone);
549
+ }
550
+ jQuery(this).find('input').removeAttr('checked');
551
+ if (!$closestTD.find('.sbspf_disabled_wrap').length) {
552
+ $closestTD.append('<div class="sbspf_disabled_wrap sby_includes_pro_only"></div>');
553
+ $closestTD.find('.sby_includes_pro_only').append('<span class="sbspf_note"><a href="https://smashballoon.com/youtube-feed/?utm_source=plugin-free&amp;utm_campaign=sby" target="_blank">Upgrade to Pro to display video descriptions, dates, statistics, live streaming information, and more.</a></span>');
554
+ }
555
+ }
556
+
557
+ }
558
+ });
559
+
560
+ var $closestTD = $('.sbspf_row.sbspf_type_row').first().closest('td');
561
+ $closestTD.append('<div class="sbspf_disabled_wrap sby_types_disabled_wrap">'+proLockHTML+'</div>');
562
+
563
+ $('.sbspf_type_row').each(function() {
564
+ if ($(this).find('.sbspf_type_input').attr('value') !== 'channel') {
565
+ $('.sbspf_disabled_wrap').append($(this));
566
+ $(this).find('input').attr('disabled',true);
567
+ } else {
568
+ $(this).find('input').removeAttr('disabled');
569
+ }
570
+ });
571
+
572
+ $('.sbspf_pro_section').each(function() {
573
+ if ($(this).find('.sbspf_pro_reveal').length) {
574
+ $(this).find('h2').first().after($(this).find('.sbspf_pro_reveal'));
575
+ $(this).find('tr').addClass('sbspf_pro_only_row');
576
+ var $table = $(this).find('table');
577
+ $table.hide();
578
+ $(this).find('.sbspf-show-pro').click(function(event){
579
+ event.preventDefault();
580
+ $table.toggle();
581
+ });
582
+ jQuery(this).find('input,select,textarea').each(function() {
583
+ if (typeof jQuery(this).attr('name') !== 'undefined') {
584
+ jQuery(this).attr('name',jQuery(this).attr('name').replace('sb','demosb'));
585
+ }
586
+ });
587
+ }
588
+ });
589
+
590
+ jQuery('.sbspf_pro_lock').hover(function(){
591
+ jQuery(this).siblings('.sbspf_pro_tooltip').show();
592
+ }, function(){
593
+ jQuery('.sbspf_pro_tooltip').hide();
594
+ });
595
+
596
+ };
597
+
598
+ this.toggleCustomDateField = function() {
599
+ if ($('#sby_settings_dateformat').val() === 'custom') {
600
+ $('.sby_customdate_wrap').slideDown();
601
+ } else {
602
+ $('.sby_customdate_wrap').slideUp();
603
+ }
604
+ };
605
+
606
+ this.toggleAPIKeyWarnings = function() {
607
+ if ($('#sby_api_key').val() !== '') {
608
+ if ($('.sby_disabled_wrap').length) {
609
+ var $closestTD = $('.sbspf_row.sbspf_type_row').first().closest('td');
610
+ $('.sbspf_type_row').each(function() {
611
+ if ($(this).find('.sbspf_type_input').attr('value') !== 'channel') {
612
+ $closestTD.append($(this));
613
+ $(this).find('input').removeAttr('disabled');
614
+ }
615
+ });
616
+ $('.sby_disabled_wrap').remove();
617
+ }
618
+
619
+
620
+ } else if (!$('.sby_disabled_wrap').length) {
621
+ var $closestTD = $('.sbspf_row.sbspf_type_row').first().closest('td');
622
+ $closestTD.append('<div class="sby_disabled_wrap sbspf_fade"><div class="sbspf_lock"><svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="key" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="svg-inline--fa fa-key fa-w-16"><path fill="currentColor" d="M512 176.001C512 273.203 433.202 352 336 352c-11.22 0-22.19-1.062-32.827-3.069l-24.012 27.014A23.999 23.999 0 0 1 261.223 384H224v40c0 13.255-10.745 24-24 24h-40v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24v-78.059c0-6.365 2.529-12.47 7.029-16.971l161.802-161.802C163.108 213.814 160 195.271 160 176 160 78.798 238.797.001 335.999 0 433.488-.001 512 78.511 512 176.001zM336 128c0 26.51 21.49 48 48 48s48-21.49 48-48-21.49-48-48-48-48 21.49-48 48z" class=""></path></svg>API Key Needed</div></div>');
623
+
624
+ $('.sbspf_type_row').each(function() {
625
+ if ($(this).find('.sbspf_type_input').attr('value') !== 'channel') {
626
+ $('.sby_disabled_wrap').append($(this));
627
+ $(this).find('input').attr('disabled',true);
628
+ } else {
629
+ $(this).find('input').removeAttr('disabled');
630
+ }
631
+ });
632
+ }
633
+
634
+ };
635
 
636
  this.addAccessTokenListener = function () {
637
  var self = this;
732
 
733
 
734
  window.sby_admin_init = function() {
735
+ var plugin = typeof $('.sbspf-admin').attr('data-sb-plugin') !== 'undefined' ? $('.sbspf-admin').attr('data-sb-plugin') : 'sbspf',
736
+ $adminEl = $('#sbspf_admin.sby_admin');
737
+ window.sb = new SbYoutubeAdmin(plugin,$adminEl);
738
  window.sb.init();
739
  };
740
 
js/sb-youtube.js CHANGED
@@ -371,6 +371,9 @@ if(!sby_js_exists) {
371
  };
372
 
373
  window.sby.feeds[index] = sbyGetNewFeed(this, index, feedOptions);
 
 
 
374
  window.sby.feeds[index].setResizedImages();
375
  window.sby.feeds[index].init();
376
 
@@ -517,14 +520,13 @@ if(!sby_js_exists) {
517
  $self.find('.sby_item').each(function() {
518
  var itemVidID = feed.getVideoID($(this));
519
 
520
- if ($(this).find('iframe').length && $(data.target.a).attr('id') !== $(this).find('iframe').attr('id')) {
521
  if (typeof feed.players[itemVidID] !== 'undefined') {
522
  feed.players[itemVidID].pauseVideo();
523
  }
524
  }
525
  });
526
  }
527
-
528
  },
529
  }
530
  }
@@ -1189,7 +1191,9 @@ if(!sby_js_exists) {
1189
  } else if (typeof window.sbyLightboxPlayer !== 'undefined' && typeof window.sbyLightboxPlayer.loadVideoById !== 'undefined') {
1190
  window.sbyLightboxPlayer.loadVideoById(videoID);
1191
  } else if (typeof playerID !== 'undefined' && typeof this.players !== 'undefined' && typeof this.players[playerID] !== 'undefined') {
1192
- this.players[playerID].loadVideoById(videoID);
 
 
1193
  }
1194
  },
1195
  afterVideoChanged: function() {
@@ -1309,7 +1313,7 @@ if(!sby_js_exists) {
1309
  window.onYouTubeIframeAPIReady = function() {
1310
  var numFeeds = document.getElementsByClassName('sb_youtube').length;
1311
  if (numFeeds > 0) {
1312
- if (window.sbyEagerLoading || typeof window.sby === 'undefined') {
1313
  window.sbyEagerLoading = true;
1314
 
1315
  var flagLightbox = false,
@@ -1384,10 +1388,12 @@ window.onYouTubeIframeAPIReady = function() {
1384
  window.sbyLightboxPlayer = player;
1385
  }
1386
 
1387
- } else {
1388
  for (var i = 0; i < numFeeds; i++) {
1389
  window.sby.feeds[i].playerAPIReady = true;
1390
  }
 
 
1391
  }
1392
  }
1393
  };
371
  };
372
 
373
  window.sby.feeds[index] = sbyGetNewFeed(this, index, feedOptions);
374
+ if (typeof window.sbyAPIReady !== 'undefined') {
375
+ window.sby.feeds[index].playerAPIReady = true;
376
+ }
377
  window.sby.feeds[index].setResizedImages();
378
  window.sby.feeds[index].init();
379
 
520
  $self.find('.sby_item').each(function() {
521
  var itemVidID = feed.getVideoID($(this));
522
 
523
+ if ($(this).find('iframe').length && (itemVidID !== videoID)) {
524
  if (typeof feed.players[itemVidID] !== 'undefined') {
525
  feed.players[itemVidID].pauseVideo();
526
  }
527
  }
528
  });
529
  }
 
530
  },
531
  }
532
  }
1191
  } else if (typeof window.sbyLightboxPlayer !== 'undefined' && typeof window.sbyLightboxPlayer.loadVideoById !== 'undefined') {
1192
  window.sbyLightboxPlayer.loadVideoById(videoID);
1193
  } else if (typeof playerID !== 'undefined' && typeof this.players !== 'undefined' && typeof this.players[playerID] !== 'undefined') {
1194
+ if (typeof this.players[playerID].loadVideoById === 'function') {
1195
+ this.players[playerID].loadVideoById(videoID);
1196
+ }
1197
  }
1198
  },
1199
  afterVideoChanged: function() {
1313
  window.onYouTubeIframeAPIReady = function() {
1314
  var numFeeds = document.getElementsByClassName('sb_youtube').length;
1315
  if (numFeeds > 0) {
1316
+ if (window.sbyEagerLoading) {
1317
  window.sbyEagerLoading = true;
1318
 
1319
  var flagLightbox = false,
1388
  window.sbyLightboxPlayer = player;
1389
  }
1390
 
1391
+ } else if (typeof window.sby !== 'undefined') {
1392
  for (var i = 0; i < numFeeds; i++) {
1393
  window.sby.feeds[i].playerAPIReady = true;
1394
  }
1395
+ } else {
1396
+ window.sbyAPIReady = true;
1397
  }
1398
  }
1399
  };
js/sb-youtube.min.js CHANGED
@@ -1 +1 @@
1
- var sby_js_exists=void 0!==sby_js_exists;if(!sby_js_exists){function sby_supports_video(){return!!document.createElement("video").canPlayType}!function(e){function i(){this.feeds={},this.options=sbyOptions,this.isTouch=function(){if("ontouchstart"in document.documentElement)return!0;return!1}()}function t(e,i,t){this.el=e,this.index=i,this.settings=t,this.playerAPIReady=!1,this.consentGiven=!0,this.players={},this.minImageWidth=0,this.imageResolution=150,this.resizedImages={},this.needsResizing=[],this.outOfPages=!1,this.isInitialized=!1,this.mostRecentlyLoadedPosts=[]}function s(){}function a(i,t){e.ajax({url:sbyOptions.adminAjaxUrl,type:"post",data:i,success:t})}i.prototype={createPage:function(i,t){void 0!==window.sbyajaxurl&&-1!==window.sbyajaxurl.indexOf(window.location.hostname)||(window.sbyajaxurl=window.location.hostname+"/wp-admin/admin-ajax.php"),e(".sby_no_js_error_message").remove(),e(".sby_no_js").removeClass("sby_no_js");if(null===document.getElementById("youtube-api")){var s=document.createElement("script"),a=document.getElementsByTagName("script")[0];s.src="https://www.youtube.com/iframe_api",s.id="youtube-api",a.parentNode.insertBefore(s,a)}i(t)},createLightbox:function(){var i,t=new s,a=(i=0,function(e,t){clearTimeout(i),i=setTimeout(e,t)});jQuery(window).resize(function(){a(function(){t.afterResize()},200)}),function(){var i=jQuery,s=function(){function e(){this.fadeDuration=500,this.fitImagesInViewport=!0,this.resizeDuration=700,this.positionFromTop=50,this.showImageNumberLabel=!0,this.alwaysShowNavOnTouchDevices=!1,this.wrapAround=!1}return e.prototype.albumLabel=function(e,i){return e+" / "+i},e}(),a=function(){function s(e){this.options=e,this.album=[],this.currentImageIndex=void 0,this.init()}return s.prototype.init=function(){this.enable(),this.build()},s.prototype.enable=function(){var e=this;i("body").on("click","a[data-sby-lightbox]",function(t){return e.start(i(t.currentTarget)),!1})},s.prototype.build=function(){var e=this;i(""+t.template()).appendTo(i("body")),this.$lightbox=i("#sby_lightbox"),this.$overlay=i("#sby_lightboxOverlay"),this.$outerContainer=this.$lightbox.find(".sby_lb-outerContainer"),this.$container=this.$lightbox.find(".sby_lb-container"),this.containerTopPadding=parseInt(this.$container.css("padding-top"),10),this.containerRightPadding=parseInt(this.$container.css("padding-right"),10),this.containerBottomPadding=parseInt(this.$container.css("padding-bottom"),10),this.containerLeftPadding=parseInt(this.$container.css("padding-left"),10),this.$overlay.hide().on("click",function(){return e.end(),!1}),jQuery(document).on("click",function(e,i,t){jQuery(e.target).closest(".sby_lb-outerContainer").length||jQuery(e.target).closest(".sby_lb-dataContainer").length||(void 0!==window.sbyLightboxPlayer&&YT.get("sby_lb-player").pauseVideo(),jQuery("#sby_lightboxOverlay, #sby_lightbox").fadeOut())}),this.$lightbox.hide(),jQuery("#sby_lightboxOverlay").on("click",function(t){return void 0!==window.sbyLightboxPlayer&&YT.get("sby_lb-player").pauseVideo(),"sby_lightbox"===i(t.target).attr("id")&&e.end(),!1}),this.$lightbox.find(".sby_lb-prev").on("click",function(){return void 0!==window.sbyLightboxPlayer&&YT.get("sby_lb-player").pauseVideo(),e.changeImage(0===e.currentImageIndex?e.album.length-1:e.currentImageIndex-1),!1}),this.$lightbox.find(".sby_lb-container").on("swiperight",function(){return void 0!==window.sbyLightboxPlayer&&YT.get("sby_lb-player").pauseVideo(),e.changeImage(0===e.currentImageIndex?e.album.length-1:e.currentImageIndex-1),!1}),this.$lightbox.find(".sby_lb-next").on("click",function(){return void 0!==window.sbyLightboxPlayer&&YT.get("sby_lb-player").pauseVideo(),e.changeImage(e.currentImageIndex===e.album.length-1?0:e.currentImageIndex+1),!1}),this.$lightbox.find(".sby_lb-container").on("swipeleft",function(){return void 0!==window.sbyLightboxPlayer&&YT.get("sby_lb-player").pauseVideo(),e.changeImage(e.currentImageIndex===e.album.length-1?0:e.currentImageIndex+1),!1}),this.$lightbox.find(".sby_lb-loader, .sby_lb-close").on("click",function(){return void 0!==window.sbyLightboxPlayer&&YT.get("sby_lb-player").pauseVideo(),e.end(),!1})},s.prototype.start=function(e){function s(e){a.album.push(t.getData(e))}var a=this,n=i(window);n.on("resize",i.proxy(this.sizeOverlay,this)),i("select, object, embed").css({visibility:"hidden"}),this.sizeOverlay(),this.album=[];var o,d=0,r=e.attr("data-sby-lightbox");if(r){o=i(e.prop("tagName")+'[data-sby-lightbox="'+r+'"]');for(var l=0;l<o.length;l=++l)s(i(o[l])),o[l]===e[0]&&(d=l)}else if("lightbox"===e.attr("rel"))s(e);else{o=i(e.prop("tagName")+'[rel="'+e.attr("rel")+'"]');for(var h=0;h<o.length;h=++h)s(i(o[h])),o[h]===e[0]&&(d=h)}var b=n.scrollTop()+this.options.positionFromTop,y=n.scrollLeft();this.$lightbox.css({top:b+"px",left:y+"px"}).fadeIn(this.options.fadeDuration),this.changeImage(d)},s.prototype.changeImage=function(e){var t=this;this.disableKeyboardNav();var s=this.$lightbox.find(".sby_lb-image");this.$overlay.fadeIn(this.options.fadeDuration),i(".sby_lb-loader").fadeIn("slow"),this.$lightbox.find(".sby_lb-image, .sby_lb-nav, .sby_lb-prev, .sby_lb-next, .sby_lb-dataContainer, .sby_lb-numbers, .sby_lb-caption").hide(),this.$outerContainer.addClass("animating");var a=new Image;a.onload=function(){var n,o,d,r,l,h;s.attr("src",t.album[e].link),i(a),s.width(a.width),s.height(a.height),t.options.fitImagesInViewport&&(h=i(window).width(),l=i(window).height(),r=h-t.containerLeftPadding-t.containerRightPadding-20-100,d=l-t.containerTopPadding-t.containerBottomPadding-150,(a.width>r||a.height>d)&&(a.width/r>a.height/d?(o=r,n=parseInt(a.height/(a.width/o),10),s.width(o),s.height(n)):(n=d,o=parseInt(a.width/(a.height/n),10),s.width(o),s.height(n)))),t.sizeContainer(s.width(),s.height())},a.src=this.album[e].link,this.currentImageIndex=e},s.prototype.sizeOverlay=function(){this.$overlay.width(i(window).width()).height(i(document).height())},s.prototype.sizeContainer=function(e,i){function t(){s.$lightbox.find(".sby_lb-dataContainer").width(o),s.$lightbox.find(".sby_lb-prevLink").height(d),s.$lightbox.find(".sby_lb-nextLink").height(d),s.showImage()}var s=this,a=this.$outerContainer.outerWidth(),n=this.$outerContainer.outerHeight(),o=e+this.containerLeftPadding+this.containerRightPadding,d=i+this.containerTopPadding+this.containerBottomPadding;a!==o||n!==d?this.$outerContainer.animate({width:o,height:d},this.options.resizeDuration,"swing",function(){t()}):t()},s.prototype.showImage=function(){this.$lightbox.find(".sby_lb-loader").hide(),this.$lightbox.find(".sby_lb-image").fadeIn("slow"),this.updateNav(),this.updateDetails(),this.preloadNeighboringImages(),this.enableKeyboardNav()},s.prototype.updateNav=function(){var e=!1;try{document.createEvent("TouchEvent"),e=!!this.options.alwaysShowNavOnTouchDevices}catch(e){}this.$lightbox.find(".sby_lb-nav").show(),this.album.length>1&&(this.options.wrapAround?(e&&this.$lightbox.find(".sby_lb-prev, .sby_lb-next").css("opacity","1"),this.$lightbox.find(".sby_lb-prev, .sby_lb-next").show()):(this.currentImageIndex>0&&(this.$lightbox.find(".sby_lb-prev").show(),e&&this.$lightbox.find(".sby_lb-prev").css("opacity","1")),this.currentImageIndex<this.album.length-1&&(this.$lightbox.find(".sby_lb-next").show(),e&&this.$lightbox.find(".sby_lb-next").css("opacity","1"))))},s.prototype.updateDetails=function(){var i=this;jQuery("iframe.sby_lb-player-loaded").length&&(console.log("swapping"),jQuery(".sby_lb-player-placeholder").replaceWith(jQuery("iframe.sby_lb-player-loaded")),jQuery("iframe.sby_lb-player-loaded").removeClass("sby_lb-player-loaded").show());var s=window.sby.feeds[this.album[this.currentImageIndex].feedIndex];if(t.beforePlayerSetup(this.$lightbox,this.album[this.currentImageIndex],this.currentImageIndex,this.album,s),sby_supports_video()&&(jQuery("#sby_lightbox").removeClass("sby_video_lightbox"),this.album[this.currentImageIndex].video.length)){var a="sby_lb-player";jQuery("#sby_lightbox").addClass("sby_video_lightbox");var n=this.album[this.currentImageIndex].video,o=sbyOptions.autoplay;if(void 0===window.sbyLightboxPlayer){var d={host:window.location.protocol+"//www.youtube-nocookie.com",videoId:n,playerVars:{modestbranding:1,rel:0,autoplay:o},events:{onStateChange:function(i){var t=i.target.getVideoData().video_id;s.afterStateChange(a,t,i,e("#"+a).closest(".sby_video_thumbnail_wrap"))}}};s.maybeAddCTA(a),window.sbyLightboxPlayer=new window.YT.Player(a,d)}else window.sbyLightboxPlayer.loadVideoById(n);t.afterPlayerSetup(this.$lightbox,this.album[this.currentImageIndex],this.currentImageIndex,this.album),this.album.length>1&&this.options.showImageNumberLabel?this.$lightbox.find(".sby_lb-number").text(this.options.albumLabel(this.currentImageIndex+1,this.album.length)).fadeIn("fast"):this.$lightbox.find(".sby_lb-number").hide(),this.$outerContainer.removeClass("animating"),this.$lightbox.find(".sby_lb-dataContainer").fadeIn(this.options.resizeDuration,function(){return i.sizeOverlay()}),setTimeout(function(){e("#sby_lightbox .sby_lb-player").css({height:e("#sby_lightbox .sby_lb-outerContainer").height()+"px",width:e("#sby_lightbox .sby_lb-outerContainer").width()+"px",top:0})},400)}},s.prototype.preloadNeighboringImages=function(){this.album.length>this.currentImageIndex+1&&((new Image).src=this.album[this.currentImageIndex+1].link);this.currentImageIndex>0&&((new Image).src=this.album[this.currentImageIndex-1].link)},s.prototype.enableKeyboardNav=function(){i(document).on("keyup.keyboard",i.proxy(this.keyboardAction,this))},s.prototype.disableKeyboardNav=function(){i(document).off(".keyboard")},s.prototype.keyboardAction=function(i){var t=event.keyCode,s=String.fromCharCode(t).toLowerCase();27===t||s.match(/x|o|c/)?(sby_supports_video()&&e("#sby_lightbox video.sby_video")[0].pause(),e("#sby_lightbox iframe").attr("src",""),this.end()):"p"===s||37===t?(0!==this.currentImageIndex?this.changeImage(this.currentImageIndex-1):this.options.wrapAround&&this.album.length>1&&this.changeImage(this.album.length-1),sby_supports_video()&&e("#sby_lightbox video.sby_video")[0].pause(),e("#sby_lightbox iframe").attr("src","")):"n"!==s&&39!==t||(this.currentImageIndex!==this.album.length-1?this.changeImage(this.currentImageIndex+1):this.options.wrapAround&&this.album.length>1&&this.changeImage(0),void 0!==window.sbyLightboxPlayer&&YT.get("sby_lb-player").pauseVideo())},s.prototype.end=function(){this.disableKeyboardNav(),i(window).off("resize",this.sizeOverlay),this.$lightbox.fadeOut(this.options.fadeDuration),this.$overlay.fadeOut(this.options.fadeDuration),i("select, object, embed").css({visibility:"visible"})},s}();i(function(){var i=new s;new a(i),e(".sby_lightbox_action a").unbind().bind("click",function(){e(this).parent().find(".sby_lightbox_tooltip").toggle()})})}.call(this)},createFeeds:function(i){window.sby.createLightbox(),i.whenFeedsCreated(e(".sb_youtube").each(function(i){e(this).attr("data-sby-index",i+1),e(this).find(".sby_player").replaceWith('<div id="sby_player'+i+'"></div>');var s=e(this),n=void 0!==s.attr("data-sby-flags")?s.attr("data-sby-flags").split(","):[],o=void 0!==s.attr("data-options")?JSON.parse(s.attr("data-options")):{};if(n.indexOf("testAjax")>-1){window.sby.triggeredTest=!0;a({action:"sby_on_ajax_test_trigger"},function(e){console.log("did test")})}var d={cols:s.attr("data-cols"),colsmobile:"same"!==s.attr("data-colsmobile")?s.attr("data-colsmobile"):s.attr("data-cols"),num:s.attr("data-num"),imgRes:s.attr("data-res"),feedID:s.attr("data-feedid"),shortCodeAtts:s.attr("data-shortcode-atts"),resizingEnabled:-1===n.indexOf("resizeDisable"),imageLoadEnabled:-1===n.indexOf("imageLoadDisable"),debugEnabled:n.indexOf("debug")>-1,favorLocal:n.indexOf("favorLocal")>-1,ajaxPostLoad:n.indexOf("ajaxPostLoad")>-1,checkWPPosts:n.indexOf("checkWPPosts")>-1,cacheAll:n.indexOf("cacheAll")>-1,lightboxEnabled:void 0!==s.attr("data-sby-supports-lightbox"),autoMinRes:1,general:o};window.sby.feeds[i]=function(e,i,s){return new t(e,i,s)}(this,i,d),window.sby.feeds[i].setResizedImages(),window.sby.feeds[i].init();var r=jQuery.Event("sbyafterfeedcreate");r.feed=window.sby.feeds[i],jQuery(window).trigger(r)}))},afterFeedsCreated:function(){e(".sb_instagram_header").each(function(){var i=e(this);i.find(".sby_header_link").hover(function(){i.find(".sby_header_img_hover").addClass("sby_fade_in")},function(){i.find(".sby_header_img_hover").removeClass("sby_fade_in")})})},encodeHTML:function(e){return void 0===e?"":e.replace(/(>)/g,"&gt;").replace(/(<)/g,"&lt;").replace(/(&lt;br\/&gt;)/g,"<br>").replace(/(&lt;br&gt;)/g,"<br>")},urlDetect:function(e){return e.match(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)/g)}},t.prototype={init:function(){var e=this;this.settings.ajaxPostLoad?this.getNewPostSet():this.afterInitialImagesLoaded();var i,t=(i=0,function(e,t){clearTimeout(i),i=setTimeout(e,t)});jQuery(window).resize(function(){t(function(){e.afterResize()},500)})},initLayout:function(){this.initGalleryLayout()},initGalleryLayout:function(){var i=e(this.el),t=this;i.hasClass("sby_layout_gallery")&&i.find(".sby_player_outer_wrap").length&&(this.maybeRaiseSingleImageResolution(i.find(".sby_player_outer_wrap"),0,!0),i.find(".sby_player_outer_wrap .sby_video_thumbnail").off().click(function(i){i.preventDefault(),t.onThumbnailClick(e(this),!0)}),i.mouseenter(function(){t.canCreatePlayer()&&(i.find(".sby_player_outer_wrap iframe").length?void 0===t.player&&t.playerEagerLoaded()&&t.createPlayer("sby_player"+t.index):(i.addClass("sby_player_added").find(".sby_player_outer_wrap").addClass("sby_player_loading"),i.find(".sby_player_outer_wrap .sby_video_thumbnail").find(".sby_loader").show().removeClass("sby_hidden"),t.createPlayer("sby_player"+t.index)))}))},createPlayer:function(i,t,s,a){var n=e(this.el),o=this;if(t=void 0!==t?t:this.getVideoID(n.find(".sby_item").first()),s=void 0!==s?s:0,void 0===a&&(a={host:window.location.protocol+"//www.youtube-nocookie.com",videoId:t,playerVars:{modestbranding:1,rel:0,autoplay:s}}),void 0===a.events&&(a.events={onReady:function(){n.find(".sby_player_outer_wrap").removeClass("sby_player_loading").find(".sby_video_thumbnail").css("z-index",-1).find(".sby_loader").hide().addClass("sby_hidden"),e("#"+i).length&&e("#"+i).closest(".sby_video_thumbnail_wrap").find(".sby_video_thumbnail").length&&e("#"+i).closest(".sby_video_thumbnail_wrap").find(".sby_video_thumbnail").fadeTo(0,"slow",function(){e(this).css("z-index",-1),e(this).find(".sby_loader").hide().addClass("sby_hidden"),e(this).closest(".sby_item").removeClass("sby_player_loading")})},onStateChange:function(t){n.find(".sby_player_outer_wrap").removeClass("sby_player_loading").find(".sby_video_thumbnail").css("z-index",-1).find(".sby_loader").hide().addClass("sby_hidden");var s=t.target.getVideoData().video_id;o.afterStateChange(i,s,t,e("#"+i).closest(".sby_video_thumbnail_wrap")),1===t.data&&void 0!==o.players&&n.find(".sby_item").each(function(){var i=o.getVideoID(e(this));e(this).find("iframe").length&&e(t.target.a).attr("id")!==e(this).find("iframe").attr("id")&&void 0!==o.players[i]&&o.players[i].pauseVideo()})}}),window.sbyEagerLoading)var d=YT.get(i);else d=new window.YT.Player(i,a);return this.maybeAddCTA(i),n.hasClass("sby_layout_list")&&void 0===this.players[t]?this.players[t]=d:void 0===this.player&&(this.player=d),d},afterStateChange:function(e,i,t,s){},afterInitialImagesLoaded:function(){this.initLayout(),this.loadMoreButtonInit(),this.hideExtraItemsForWidth(),this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed(),this.afterFeedSet()},afterResize:function(){this.setImageHeight(),this.setImageResolution(),this.maybeRaiseImageResolution(),this.setImageSizeClass()},afterLoadMoreClicked:function(e){e.find(".sby_loader").removeClass("sby_hidden"),e.find(".sby_btn_text").addClass("sby_hidden"),e.closest(".sb_youtube").find(".sby_num_diff_hide").addClass("sby_transition").removeClass("sby_num_diff_hide")},afterNewImagesLoaded:function(){var i=e(this.el),t=this;this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed(),setTimeout(function(){i.find(".sby_loader").addClass("sby_hidden"),i.find(".sby_btn_text").removeClass("sby_hidden"),t.maybeRaiseImageResolution()},500)},beforeNewImagesRevealed:function(){this.setImageHeight(),this.maybeRaiseImageResolution(!0),this.setImageSizeClass()},afterFeedSet:function(){},revealNewImages:function(){var i=e(this.el),t=this;"function"==typeof sbyCustomJS&&setTimeout(function(){sbyCustomJS()},100),i.find(".sby_item").each(function(i){var s=jQuery(this);s.find(".sby_video_thumbnail").hover(function(){jQuery(this).fadeTo(200,.85)},function(){jQuery(this).stop().fadeTo(500,1)}),s.find(".sby_video_thumbnail").off().click(function(i){i.preventDefault(),t.onThumbnailClick(e(this),!1)}),s.find(".sby_video_thumbnail").mouseenter(function(){t.onThumbnailEnter(e(this),!1)}),s.find(".sby_player_wrap").mouseleave(function(){t.onThumbnailLeave(e(this),!1)}),t.settings.lightboxEnabled&&(s.find(".sby_video_thumbnail").attr("data-sby-lightbox",t.index),"undefined"!=typeof sbyOptions&&void 0!==sbyOptions.lightboxPlaceholder&&s.find(".sby_video_thumbnail").attr("href",sbyOptions.lightboxPlaceholder)),t.afterItemRevealed(s)}),i.find(".sby_player_item").each(function(e){var i=jQuery(this);t.afterItemRevealed(i)}),setTimeout(function(){i.find(".sby_item.sby_new").removeClass("sby_new");var e=10;i.find(".sby_transition").length;i.find(".sby_transition").each(function(i){var t=jQuery(this);setTimeout(function(){t.removeClass("sby_transition")},e),e+=10})},500)},afterItemRevealed:function(){},afterNewImagesRevealed:function(){this.listenForVisibilityChange(),this.sendNeedsResizingToServer(),this.sendCheckWPPostsToServer(),this.settings.imageLoadEnabled||e(".sby_no_resraise").removeClass("sby_no_resraise");var i=e.Event("sbyafterimagesloaded");i.el=e(this.el),e(window).trigger(i)},setResizedImages:function(){e(this.el).find(".sby_resized_image_data").length&&void 0!==e(this.el).find(".sby_resized_image_data").attr("data-resized")&&0===e(this.el).find(".sby_resized_image_data").attr("data-resized").indexOf('{"')&&(this.resizedImages=JSON.parse(e(this.el).find(".sby_resized_image_data").attr("data-resized")),e(this.el).find(".sby_resized_image_data").remove())},sendNeedsResizingToServer:function(){var i=this;if(i.needsResizing.length>0&&i.settings.resizingEnabled){var t=e(this.el).find(".sby_item").length;a({action:"sby_resized_images_submit",needs_resizing:i.needsResizing,offset:t,feed_id:i.settings.feedID,atts:i.settings.shortCodeAtts},function(e){if(0===e.trim().indexOf("{")){var t=JSON.parse(e);i.settings.debugEnabled&&console.log(t)}})}},sendCheckWPPostsToServer:function(){var i=this;if(i.settings.checkWPPosts||i.settings.cacheAll){a({action:"sby_check_wp_submit",feed_id:i.settings.feedID,atts:i.settings.shortCodeAtts,offset:e(this.el).find(".sby_item").length,cache_all:i.settings.cacheAll},function(e){if(0===e.trim().indexOf("{")){var t=JSON.parse(e);i.settings.debugEnabled&&console.log(t)}})}},afterSendCheckWPPostsToServer:function(e){},loadMoreButtonInit:function(){var i=e(this.el),t=this;i.find(".sby_footer .sby_load_btn").off().on("click",function(){t.afterLoadMoreClicked(jQuery(this)),t.getNewPostSet()})},getNewPostSet:function(){var i=e(this.el),t=this;a({action:"sby_load_more_clicked",offset:i.find(".sby_item").length,feed_id:t.settings.feedID,atts:t.settings.shortCodeAtts,current_resolution:t.imageResolution},function(s){if(0===s.trim().indexOf("{")){var a=JSON.parse(s);t.settings.debugEnabled&&console.log(a),t.appendNewPosts(a.html),t.addResizedImages(a.resizedImages),t.settings.ajaxPostLoad?(t.settings.ajaxPostLoad=!1,t.afterInitialImagesLoaded()):t.afterNewImagesLoaded(),a.feedStatus.shouldPaginate?t.outOfPages=!1:(t.outOfPages=!0,i.find(".sby_load_btn").hide()),e(".sby_no_js").removeClass("sby_no_js")}})},appendNewPosts:function(i){var t=e(this.el);t.find(".sby_items_wrap .sby_item").length?t.find(".sby_items_wrap .sby_item").last().after(i):t.find(".sby_items_wrap").append(i)},addResizedImages:function(e){for(var i in e)this.resizedImages[i]=e[i]},setImageHeight:function(){},maybeRaiseSingleImageResolution:function(i,t,s){var a=this,n=a.getImageUrls(i),o=i.find(".sby_video_thumbnail img").attr("src"),d=150;s=void 0!==s&&s;if(!i.hasClass("sby_no_resraise")){e.each(n,function(e,i){i===o&&(d=parseInt(e),s=!1)});var r=640;switch(a.settings.imgRes){case"thumb":r=120;break;case"medium":r=320;break;case"large":r=480;break;case"full":r=640;break;default:var l=Math.max(a.settings.autoMinRes,i.find(".sby_video_thumbnail").innerWidth());switch(a.getBestResolutionForAuto(l,1,e(this.el).find("sby_item").first())){case 480:r=480;break;case 320:r=320;break;case 120:r=120}}if(r>d||o===window.sby.options.placeholder||s){if(a.settings.debugEnabled){var h=o===window.sby.options.placeholder?"was placeholder":"too small";console.log("rais res for "+o,h)}var b=n[r];i.find(".sby_video_thumbnail img").attr("src",b)}i.find("img").on("error",function(){if(e(this).hasClass("sby_img_error"))console.log("unfixed error "+e(this).attr("src"));else{if(e(this).addClass("sby_img_error"),e(this).attr("src").indexOf("i.ytimg.com")>-1)a.settings.favorLocal=!0,a.getImageUrls(e(this).closest(".sby_item"))[640];else void 0!==e(this).closest(".sby_video_thumbnail").attr("data-full-res")||e(this).closest(".sby_video_thumbnail").attr("href");setTimeout(function(){a.afterResize()},1500)}})}},maybeRaiseImageResolution:function(i){var t=this,s=void 0!==i&&!0===i?".sby_item.sby_new":".sby_item",a=!t.isInitialized;e(t.el).find(s).each(function(i){!e(this).hasClass("sby_num_diff_hide")&&e(this).find(".sby_video_thumbnail").length&&void 0!==e(this).find(".sby_video_thumbnail").attr("data-img-src-set")&&t.maybeRaiseSingleImageResolution(e(this),i,a)}),t.isInitialized=!0},getBestResolutionForAuto:function(i,t,s){(isNaN(t)||t<1)&&(t=1);var a=i*t,n=10*Math.ceil(a/10),o=[120,320,480,640];if(s.hasClass("sby_highlighted")&&(n*=2),-1===o.indexOf(parseInt(n))){var d=!1;e.each(o,function(e,i){i>parseInt(n)&&!d&&(n=i,d=!0)})}return n},hideExtraItemsForWidth:function(){if("carousel"!==this.layout){var i=e(this.el),t=void 0!==i.attr("data-num")&&""!==i.attr("data-num")?parseInt(i.attr("data-num")):1,s=void 0!==i.attr("data-nummobile")&&""!==i.attr("data-nummobile")?parseInt(i.attr("data-nummobile")):t;i.hasClass(".sby_layout_carousel")||(e(window).width()<480?s<i.find(".sby_item").length&&i.find(".sby_item").slice(s-i.find(".sby_item").length).addClass("sby_num_diff_hide"):t<i.find(".sby_item").length&&i.find(".sby_item").slice(t-i.find(".sby_item").length).addClass("sby_num_diff_hide"))}},setImageSizeClass:function(){var i=e(this.el);i.removeClass("sby_small sby_medium");var t=i.innerWidth(),s=parseInt(i.find(".sby_items_wrap").outerWidth()-i.find(".sby_items_wrap").width())/2,a=this.getColumnCount(),n=(t-s*(a+2))/a;n>120&&n<240?i.addClass("sby_medium"):n<=120&&i.addClass("sby_small")},setMinImageWidth:function(){e(this.el).find(".sby_item .sby_video_thumbnail").first().length?this.minImageWidth=e(this.el).find(".sby_item .sby_video_thumbnail").first().innerWidth():this.minImageWidth=150},setImageResolution:function(){if("auto"===this.settings.imgRes)this.imageResolution="auto";else switch(this.settings.imgRes){case"thumb":this.imageResolution=150;break;case"medium":this.imageResolution=320;break;default:this.imageResolution=640}},getImageUrls:function(e){var i=JSON.parse(e.find(".sby_video_thumbnail").attr("data-img-src-set").replace(/\\\//g,"/")),t=e.attr("id").replace("sby_","").replace("player_","");if(void 0!==this.resizedImages[t]&&"video"!==this.resizedImages[t]&&"pending"!==this.resizedImages[t]&&"error"!==this.resizedImages[t].id&&"video"!==this.resizedImages[t].id&&"pending"!==this.resizedImages[t].id){if(void 0!==this.resizedImages[t].sizes){var s=[];void 0!==this.resizedImages[t].sizes.full&&(s.push(640),i[640]=sbyOptions.resized_url+this.resizedImages[t].id+"full.jpg",e.find(".sby_link_area").attr("href",sbyOptions.resized_url+this.resizedImages[t].id+"full.jpg"),e.find(".sby_video_thumbnail").attr("data-full-res",sbyOptions.resized_url+this.resizedImages[t].id+"full.jpg")),void 0!==this.resizedImages[t].sizes.low&&(s.push(320),i[320]=sbyOptions.resized_url+this.resizedImages[t].id+"low.jpg",this.settings.favorLocal&&void 0===this.resizedImages[t].sizes.full&&(e.find(".sby_link_area").attr("href",sbyOptions.resized_url+this.resizedImages[t].id+"low.jpg"),e.find(".sby_video_thumbnail").attr("data-full-res",sbyOptions.resized_url+this.resizedImages[t].id+"low.jpg"))),void 0!==this.resizedImages[t].sizes.thumb&&(s.push(150),i[150]=sbyOptions.resized_url+this.resizedImages[t].id+"thumb.jpg"),this.settings.favorLocal&&(-1===s.indexOf(640)&&s.indexOf(320)>-1&&(i[640]=sbyOptions.resized_url+this.resizedImages[t].id+"low.jpg"),-1===s.indexOf(320)&&(s.indexOf(640)>-1?i[320]=sbyOptions.resized_url+this.resizedImages[t].id+"full.jpg":s.indexOf(150)>-1&&(i[320]=sbyOptions.resized_url+this.resizedImages[t].id+"thumb.jpg")),-1===s.indexOf(150)&&(s.indexOf(320)>-1?i[150]=sbyOptions.resized_url+this.resizedImages[t].id+"low.jpg":s.indexOf(640)>-1&&(i[150]=sbyOptions.resized_url+this.resizedImages[t].id+"full.jpg")))}}else(void 0===this.resizedImages[t]||void 0!==this.resizedImages[t].id&&"pending"!==this.resizedImages[t].id&&"error"!==this.resizedImages[t].id)&&this.addToNeedsResizing(t);return i},getVideoID:function(i){if(i.hasClass("sby_item")||i.hasClass("sby_player_item")){if(void 0!==i.find(".sby_video_thumbnail").attr("data-video-id"))return i.find(".sby_video_thumbnail").attr("data-video-id")}else if(i.closest("sby_item").length||i.closest("sby_player_item").length){var t=i.closest("sby_item").length?i.closest("sby_item"):i.closest("sby_player_item");if(void 0!==t.find(".sby_video_thumbnail").attr("data-video-id"))return t.find(".sby_video_thumbnail").attr("data-video-id")}else{if(i.hasClass("sb_youtube"))return i.find(".sby_item").first().find(".sby_video_thumbnail").attr("data-video-id");if(e(this.el).find(".sby_video_thumbnail").first().length&&void 0!==e(this.el).find(".sby_video_thumbnail").first().attr("data-video-id"))return e(this.el).find(".sby_video_thumbnail").first().attr("data-video-id")}return""},getAvatarUrl:function(e,i){if(""===e)return"";var t=this.settings.general.avatars;return"local"===(i=void 0!==i?i:"local")?void 0!==t["LCL"+e]&&1===parseInt(t["LCL"+e])?sbyOptions.resized_url+e+".jpg":void 0!==t[e]?t[e]:"":void 0!==t[e]?t[e]:void 0!==t["LCL"+e]&&1===parseInt(t["LCL"+e])?sbyOptions.resized_url+e+".jpg":""},addToNeedsResizing:function(e){-1===this.needsResizing.indexOf(e)&&this.needsResizing.push(e)},listenForVisibilityChange:function(){var i,t,s,a=this;i=jQuery,t={callback:function(){},runOnLoad:!0,frequency:100,sbyPreviousVisibility:null},s={sbyCheckVisibility:function(e,i){if(jQuery.contains(document,e[0])){var t=i.sbyPreviousVisibility,a=e.is(":visible");i.sbyPreviousVisibility=a,null==t?i.runOnLoad&&i.callback(e,a):t!==a&&i.callback(e,a),setTimeout(function(){s.sbyCheckVisibility(e,i)},i.frequency)}}},i.fn.sbyVisibilityChanged=function(e){var a=i.extend({},t,e);return this.each(function(){s.sbyCheckVisibility(i(this),a)})},"function"==typeof e(this.el).filter(":hidden").sbyVisibilityChanged&&e(this.el).filter(":hidden").sbyVisibilityChanged({callback:function(e,i){a.afterResize()},runOnLoad:!1})},getColumnCount:function(){var i=e(this.el),t=this.settings.cols,s=this.settings.colsmobile,a=t;return sbyWindowWidth=window.innerWidth,i.hasClass("sby_mob_col_auto")?(sbyWindowWidth<640&&parseInt(t)>2&&parseInt(t)<7&&(a=2),sbyWindowWidth<640&&parseInt(t)>6&&parseInt(t)<11&&(a=4),sbyWindowWidth<=480&&parseInt(t)>2&&(a=1)):sbyWindowWidth<=480&&(a=s),parseInt(a)},onThumbnailClick:function(i,t,s){if(this.canCreatePlayer()){var a=e(this.el);if(a.hasClass("sby_layout_gallery"))if(a.addClass("sby_player_added").find(".sby_player_outer_wrap").addClass("sby_player_loading"),a.find(".sby_player_outer_wrap .sby_video_thumbnail").find(".sby_loader").show().removeClass("sby_hidden"),a.find(".sby_player_outer_wrap iframe").length)if(t){s=void 0===s?this.getVideoID(a.find(".sby_item").first()):s;this.playVideoInPlayer(s)}else{s=void 0===s?this.getVideoID(i.closest(".sby_item")):s;this.changePlayerInfo(i.closest(".sby_item")),this.playVideoInPlayer(s),this.afterVideoChanged()}else if(t)this.createPlayer("sby_player"+this.index);else{var s=void 0===s?this.getVideoID(i.closest(".sby_item")):s;this.createPlayer("sby_player"+this.index,s)}else if(e(this.el).hasClass("sby_layout_grid")||e(this.el).hasClass("sby_layout_carousel")){var n=i.closest(".sby_item");s=void 0===s?this.getVideoID(n):s;this.playVideoInPlayer(s),this.afterVideoChanged()}else if(e(this.el).hasClass("sby_layout_list")){n=i.closest(".sby_item"),s=void 0===s?this.getVideoID(n):s;n.length&&!n.find("iframe").length?(n.find(".sby_loader").show().removeClass("sby_hidden"),n.addClass("sby_player_loading sby_player_loaded"),this.createPlayer("sby_player_"+s,s)):(this.playVideoInPlayer(s,n.attr("data-video-id")),this.afterVideoChanged())}}},onThumbnailEnter:function(i){if(this.canCreatePlayer()&&e(this.el).hasClass("sby_layout_list")){var t=i.closest(".sby_item"),s=this.getVideoID(t);t.find("iframe").length||(t.find(".sby_loader").show().removeClass("sby_hidden"),t.addClass("sby_player_loading sby_player_loaded"),this.createPlayer("sby_player_"+s,s,0))}},onThumbnailLeave:function(e){},changePlayerInfo:function(e){},playerEagerLoaded:function(){if(void 0!==this.player||e(this.el).hasClass("sby_player_loaded"))return!0},canCreatePlayer:function(){return this.playerEagerLoaded()||this.playerAPIReady&&this.consentGiven},playVideoInPlayer:function(e,i){void 0!==this.player&&void 0!==this.player.loadVideoById?this.player.loadVideoById(e):void 0!==window.sbyLightboxPlayer&&void 0!==window.sbyLightboxPlayer.loadVideoById?window.sbyLightboxPlayer.loadVideoById(e):void 0!==i&&void 0!==this.players&&void 0!==this.players[i]&&this.players[i].loadVideoById(e)},afterVideoChanged:function(){e(this.el).hasClass("sby_layout_gallery")&&(e(this.el).find(".sby_player_outer_wrap").removeClass("sby_player_loading"),e(this.el).find(".sby_player_outer_wrap .sby_video_thumbnail").find(".sby_loader").hide().addClass("sby_hidden"),e(window).width()<480&&e("html, body").animate({scrollTop:e(this.el).find(".sby_player_outer_wrap").offset().top},300))},maybeAddCTA:function(){}},s.prototype={getData:function(e){return{feedIndex:parseInt(e.closest(".sb_youtube").attr("data-sby-index")-1),link:e.attr("href"),video:e.attr("data-video-id")}},template:function(){return"<div id='sby_lightboxOverlay' class='sby_lightboxOverlay'></div><div id='sby_lightbox' class='sby_lightbox'><div class='sby_lb-outerContainer'><div class='sby_lb-container'><img class='sby_lb-image' alt='Lightbox image placeholder' src='' /><div class='sby_lb-player sby_lb-player-placeholder' id='sby_lb-player'></div><div class='sby_lb-nav'><a class='sby_lb-prev' href='#' ><p class='sby-screenreader'>Previous Slide</p><span></span></a><a class='sby_lb-next' href='#' ><p class='sby-screenreader'>Next Slide</p><span></span></a></div><div class='sby_lb-loader'><a class='sby_lb-cancel'></a></div></div></div><div class='sby_lb-dataContainer'><div class='sby_lb-data'><div class='sby_lb-details'><div class='sby_lb-caption'></div><div class='sby_lb-info'><div class='sby_lb-number'></div></div></div><div class='sby_lb-closeContainer'><a class='sby_lb-close'></a></div></div></div></div>"},beforePlayerSetup:function(e,i,t,s,a){},afterPlayerSetup:function(e,i,t,s){},afterResize:function(){var i=e("#sby_lightbox .sby_lb-player").height();if(i>100){var t=e("#sby_lightbox .sby_lb-outerContainer").height()-i;t>10&&e("#sby_lightbox .sby_lb-player").css("top",t/2)}}},window.sby_init=function(){window.sby=new i,window.sby.createPage(window.sby.createFeeds,{whenFeedsCreated:window.sby.afterFeedsCreated})}}(jQuery),jQuery(document).ready(function(e){sby_init()}),void 0===window.sbyEagerLoading&&(window.sbyEagerLoading=!1,jQuery("div[data-vc-video-bg]").length&&(window.sbyEagerLoading=!0))}window.onYouTubeIframeAPIReady=function(){var e=document.getElementsByClassName("sb_youtube").length;if(e>0)if(window.sbyEagerLoading||void 0===window.sby){window.sbyEagerLoading=!0;var i=!1;jQuery(".sb_youtube").each(function(e){var t=jQuery(this);t.hasClass("sby_layout_list")?(jQuery(this).addClass("sby_player_loaded"),t.find(".sby_item").each(function(){videoID=jQuery(this).attr("data-video-id"),player=new YT.Player("sby_player_"+videoID,{height:"100",width:"100",videoId:videoID,playerVars:{modestbranding:1,rel:0,autoplay:!1},events:{onStateChange:function(e){e.target.getVideoData().video_id;1===e.data&&t.find(".sby_item").each(function(){var i=jQuery(this).attr("data-video-id");jQuery(this).find("iframe").length&&jQuery(e.target.a).attr("id")!==jQuery(this).find("iframe").attr("id")&&YT.get("sby_player_"+i).pauseVideo()})}}})})):t.hasClass("sby_layout_gallery")?(jQuery(this).addClass("sby_player_loaded"),player=new YT.Player("sby_player"+e,{height:"100",width:"100",videoId:jQuery(this).find(".sby_item").first().attr("data-video-id"),playerVars:{modestbranding:1,rel:0,autoplay:!1}})):i=!0}),i&&(jQuery("#sby_lb-player").length||jQuery(".sb_youtube").first().append('<div class="sby_lb-player-loaded sby_lb-player" id="sby_lb-player" style="display: none;"></div>'),player=new YT.Player("sby_lb-player",{height:"100",width:"100",videoId:jQuery(this).find(".sby_item").first().attr("data-video-id"),playerVars:{modestbranding:1,rel:0,autoplay:!1}}),window.sbyLightboxPlayer=player)}else for(var t=0;t<e;t++)window.sby.feeds[t].playerAPIReady=!0};
1
+ var sby_js_exists=void 0!==sby_js_exists;if(!sby_js_exists){function sby_supports_video(){return!!document.createElement("video").canPlayType}!function(e){function i(){this.feeds={},this.options=sbyOptions,this.isTouch=function(){if("ontouchstart"in document.documentElement)return!0;return!1}()}function t(e,i,t){this.el=e,this.index=i,this.settings=t,this.playerAPIReady=!1,this.consentGiven=!0,this.players={},this.minImageWidth=0,this.imageResolution=150,this.resizedImages={},this.needsResizing=[],this.outOfPages=!1,this.isInitialized=!1,this.mostRecentlyLoadedPosts=[]}function s(){}function a(i,t){e.ajax({url:sbyOptions.adminAjaxUrl,type:"post",data:i,success:t})}i.prototype={createPage:function(i,t){void 0!==window.sbyajaxurl&&-1!==window.sbyajaxurl.indexOf(window.location.hostname)||(window.sbyajaxurl=window.location.hostname+"/wp-admin/admin-ajax.php"),e(".sby_no_js_error_message").remove(),e(".sby_no_js").removeClass("sby_no_js");if(null===document.getElementById("youtube-api")){var s=document.createElement("script"),a=document.getElementsByTagName("script")[0];s.src="https://www.youtube.com/iframe_api",s.id="youtube-api",a.parentNode.insertBefore(s,a)}i(t)},createLightbox:function(){var i,t=new s,a=(i=0,function(e,t){clearTimeout(i),i=setTimeout(e,t)});jQuery(window).resize(function(){a(function(){t.afterResize()},200)}),function(){var i=jQuery,s=function(){function e(){this.fadeDuration=500,this.fitImagesInViewport=!0,this.resizeDuration=700,this.positionFromTop=50,this.showImageNumberLabel=!0,this.alwaysShowNavOnTouchDevices=!1,this.wrapAround=!1}return e.prototype.albumLabel=function(e,i){return e+" / "+i},e}(),a=function(){function s(e){this.options=e,this.album=[],this.currentImageIndex=void 0,this.init()}return s.prototype.init=function(){this.enable(),this.build()},s.prototype.enable=function(){var e=this;i("body").on("click","a[data-sby-lightbox]",function(t){return e.start(i(t.currentTarget)),!1})},s.prototype.build=function(){var e=this;i(""+t.template()).appendTo(i("body")),this.$lightbox=i("#sby_lightbox"),this.$overlay=i("#sby_lightboxOverlay"),this.$outerContainer=this.$lightbox.find(".sby_lb-outerContainer"),this.$container=this.$lightbox.find(".sby_lb-container"),this.containerTopPadding=parseInt(this.$container.css("padding-top"),10),this.containerRightPadding=parseInt(this.$container.css("padding-right"),10),this.containerBottomPadding=parseInt(this.$container.css("padding-bottom"),10),this.containerLeftPadding=parseInt(this.$container.css("padding-left"),10),this.$overlay.hide().on("click",function(){return e.end(),!1}),jQuery(document).on("click",function(e,i,t){jQuery(e.target).closest(".sby_lb-outerContainer").length||jQuery(e.target).closest(".sby_lb-dataContainer").length||(void 0!==window.sbyLightboxPlayer&&YT.get("sby_lb-player").pauseVideo(),jQuery("#sby_lightboxOverlay, #sby_lightbox").fadeOut())}),this.$lightbox.hide(),jQuery("#sby_lightboxOverlay").on("click",function(t){return void 0!==window.sbyLightboxPlayer&&YT.get("sby_lb-player").pauseVideo(),"sby_lightbox"===i(t.target).attr("id")&&e.end(),!1}),this.$lightbox.find(".sby_lb-prev").on("click",function(){return void 0!==window.sbyLightboxPlayer&&YT.get("sby_lb-player").pauseVideo(),e.changeImage(0===e.currentImageIndex?e.album.length-1:e.currentImageIndex-1),!1}),this.$lightbox.find(".sby_lb-container").on("swiperight",function(){return void 0!==window.sbyLightboxPlayer&&YT.get("sby_lb-player").pauseVideo(),e.changeImage(0===e.currentImageIndex?e.album.length-1:e.currentImageIndex-1),!1}),this.$lightbox.find(".sby_lb-next").on("click",function(){return void 0!==window.sbyLightboxPlayer&&YT.get("sby_lb-player").pauseVideo(),e.changeImage(e.currentImageIndex===e.album.length-1?0:e.currentImageIndex+1),!1}),this.$lightbox.find(".sby_lb-container").on("swipeleft",function(){return void 0!==window.sbyLightboxPlayer&&YT.get("sby_lb-player").pauseVideo(),e.changeImage(e.currentImageIndex===e.album.length-1?0:e.currentImageIndex+1),!1}),this.$lightbox.find(".sby_lb-loader, .sby_lb-close").on("click",function(){return void 0!==window.sbyLightboxPlayer&&YT.get("sby_lb-player").pauseVideo(),e.end(),!1})},s.prototype.start=function(e){function s(e){a.album.push(t.getData(e))}var a=this,n=i(window);n.on("resize",i.proxy(this.sizeOverlay,this)),i("select, object, embed").css({visibility:"hidden"}),this.sizeOverlay(),this.album=[];var o,d=0,r=e.attr("data-sby-lightbox");if(r){o=i(e.prop("tagName")+'[data-sby-lightbox="'+r+'"]');for(var l=0;l<o.length;l=++l)s(i(o[l])),o[l]===e[0]&&(d=l)}else if("lightbox"===e.attr("rel"))s(e);else{o=i(e.prop("tagName")+'[rel="'+e.attr("rel")+'"]');for(var h=0;h<o.length;h=++h)s(i(o[h])),o[h]===e[0]&&(d=h)}var b=n.scrollTop()+this.options.positionFromTop,y=n.scrollLeft();this.$lightbox.css({top:b+"px",left:y+"px"}).fadeIn(this.options.fadeDuration),this.changeImage(d)},s.prototype.changeImage=function(e){var t=this;this.disableKeyboardNav();var s=this.$lightbox.find(".sby_lb-image");this.$overlay.fadeIn(this.options.fadeDuration),i(".sby_lb-loader").fadeIn("slow"),this.$lightbox.find(".sby_lb-image, .sby_lb-nav, .sby_lb-prev, .sby_lb-next, .sby_lb-dataContainer, .sby_lb-numbers, .sby_lb-caption").hide(),this.$outerContainer.addClass("animating");var a=new Image;a.onload=function(){var n,o,d,r,l,h;s.attr("src",t.album[e].link),i(a),s.width(a.width),s.height(a.height),t.options.fitImagesInViewport&&(h=i(window).width(),l=i(window).height(),r=h-t.containerLeftPadding-t.containerRightPadding-20-100,d=l-t.containerTopPadding-t.containerBottomPadding-150,(a.width>r||a.height>d)&&(a.width/r>a.height/d?(o=r,n=parseInt(a.height/(a.width/o),10),s.width(o),s.height(n)):(n=d,o=parseInt(a.width/(a.height/n),10),s.width(o),s.height(n)))),t.sizeContainer(s.width(),s.height())},a.src=this.album[e].link,this.currentImageIndex=e},s.prototype.sizeOverlay=function(){this.$overlay.width(i(window).width()).height(i(document).height())},s.prototype.sizeContainer=function(e,i){function t(){s.$lightbox.find(".sby_lb-dataContainer").width(o),s.$lightbox.find(".sby_lb-prevLink").height(d),s.$lightbox.find(".sby_lb-nextLink").height(d),s.showImage()}var s=this,a=this.$outerContainer.outerWidth(),n=this.$outerContainer.outerHeight(),o=e+this.containerLeftPadding+this.containerRightPadding,d=i+this.containerTopPadding+this.containerBottomPadding;a!==o||n!==d?this.$outerContainer.animate({width:o,height:d},this.options.resizeDuration,"swing",function(){t()}):t()},s.prototype.showImage=function(){this.$lightbox.find(".sby_lb-loader").hide(),this.$lightbox.find(".sby_lb-image").fadeIn("slow"),this.updateNav(),this.updateDetails(),this.preloadNeighboringImages(),this.enableKeyboardNav()},s.prototype.updateNav=function(){var e=!1;try{document.createEvent("TouchEvent"),e=!!this.options.alwaysShowNavOnTouchDevices}catch(e){}this.$lightbox.find(".sby_lb-nav").show(),this.album.length>1&&(this.options.wrapAround?(e&&this.$lightbox.find(".sby_lb-prev, .sby_lb-next").css("opacity","1"),this.$lightbox.find(".sby_lb-prev, .sby_lb-next").show()):(this.currentImageIndex>0&&(this.$lightbox.find(".sby_lb-prev").show(),e&&this.$lightbox.find(".sby_lb-prev").css("opacity","1")),this.currentImageIndex<this.album.length-1&&(this.$lightbox.find(".sby_lb-next").show(),e&&this.$lightbox.find(".sby_lb-next").css("opacity","1"))))},s.prototype.updateDetails=function(){var i=this;jQuery("iframe.sby_lb-player-loaded").length&&(console.log("swapping"),jQuery(".sby_lb-player-placeholder").replaceWith(jQuery("iframe.sby_lb-player-loaded")),jQuery("iframe.sby_lb-player-loaded").removeClass("sby_lb-player-loaded").show());var s=window.sby.feeds[this.album[this.currentImageIndex].feedIndex];if(t.beforePlayerSetup(this.$lightbox,this.album[this.currentImageIndex],this.currentImageIndex,this.album,s),sby_supports_video()&&(jQuery("#sby_lightbox").removeClass("sby_video_lightbox"),this.album[this.currentImageIndex].video.length)){var a="sby_lb-player";jQuery("#sby_lightbox").addClass("sby_video_lightbox");var n=this.album[this.currentImageIndex].video,o=sbyOptions.autoplay;if(void 0===window.sbyLightboxPlayer){var d={host:window.location.protocol+"//www.youtube-nocookie.com",videoId:n,playerVars:{modestbranding:1,rel:0,autoplay:o},events:{onStateChange:function(i){var t=i.target.getVideoData().video_id;s.afterStateChange(a,t,i,e("#"+a).closest(".sby_video_thumbnail_wrap"))}}};s.maybeAddCTA(a),window.sbyLightboxPlayer=new window.YT.Player(a,d)}else window.sbyLightboxPlayer.loadVideoById(n);t.afterPlayerSetup(this.$lightbox,this.album[this.currentImageIndex],this.currentImageIndex,this.album),this.album.length>1&&this.options.showImageNumberLabel?this.$lightbox.find(".sby_lb-number").text(this.options.albumLabel(this.currentImageIndex+1,this.album.length)).fadeIn("fast"):this.$lightbox.find(".sby_lb-number").hide(),this.$outerContainer.removeClass("animating"),this.$lightbox.find(".sby_lb-dataContainer").fadeIn(this.options.resizeDuration,function(){return i.sizeOverlay()}),setTimeout(function(){e("#sby_lightbox .sby_lb-player").css({height:e("#sby_lightbox .sby_lb-outerContainer").height()+"px",width:e("#sby_lightbox .sby_lb-outerContainer").width()+"px",top:0})},400)}},s.prototype.preloadNeighboringImages=function(){this.album.length>this.currentImageIndex+1&&((new Image).src=this.album[this.currentImageIndex+1].link);this.currentImageIndex>0&&((new Image).src=this.album[this.currentImageIndex-1].link)},s.prototype.enableKeyboardNav=function(){i(document).on("keyup.keyboard",i.proxy(this.keyboardAction,this))},s.prototype.disableKeyboardNav=function(){i(document).off(".keyboard")},s.prototype.keyboardAction=function(i){var t=event.keyCode,s=String.fromCharCode(t).toLowerCase();27===t||s.match(/x|o|c/)?(sby_supports_video()&&e("#sby_lightbox video.sby_video")[0].pause(),e("#sby_lightbox iframe").attr("src",""),this.end()):"p"===s||37===t?(0!==this.currentImageIndex?this.changeImage(this.currentImageIndex-1):this.options.wrapAround&&this.album.length>1&&this.changeImage(this.album.length-1),sby_supports_video()&&e("#sby_lightbox video.sby_video")[0].pause(),e("#sby_lightbox iframe").attr("src","")):"n"!==s&&39!==t||(this.currentImageIndex!==this.album.length-1?this.changeImage(this.currentImageIndex+1):this.options.wrapAround&&this.album.length>1&&this.changeImage(0),void 0!==window.sbyLightboxPlayer&&YT.get("sby_lb-player").pauseVideo())},s.prototype.end=function(){this.disableKeyboardNav(),i(window).off("resize",this.sizeOverlay),this.$lightbox.fadeOut(this.options.fadeDuration),this.$overlay.fadeOut(this.options.fadeDuration),i("select, object, embed").css({visibility:"visible"})},s}();i(function(){var i=new s;new a(i),e(".sby_lightbox_action a").unbind().bind("click",function(){e(this).parent().find(".sby_lightbox_tooltip").toggle()})})}.call(this)},createFeeds:function(i){window.sby.createLightbox(),i.whenFeedsCreated(e(".sb_youtube").each(function(i){e(this).attr("data-sby-index",i+1),e(this).find(".sby_player").replaceWith('<div id="sby_player'+i+'"></div>');var s=e(this),n=void 0!==s.attr("data-sby-flags")?s.attr("data-sby-flags").split(","):[],o=void 0!==s.attr("data-options")?JSON.parse(s.attr("data-options")):{};if(n.indexOf("testAjax")>-1){window.sby.triggeredTest=!0;a({action:"sby_on_ajax_test_trigger"},function(e){console.log("did test")})}var d={cols:s.attr("data-cols"),colsmobile:"same"!==s.attr("data-colsmobile")?s.attr("data-colsmobile"):s.attr("data-cols"),num:s.attr("data-num"),imgRes:s.attr("data-res"),feedID:s.attr("data-feedid"),shortCodeAtts:s.attr("data-shortcode-atts"),resizingEnabled:-1===n.indexOf("resizeDisable"),imageLoadEnabled:-1===n.indexOf("imageLoadDisable"),debugEnabled:n.indexOf("debug")>-1,favorLocal:n.indexOf("favorLocal")>-1,ajaxPostLoad:n.indexOf("ajaxPostLoad")>-1,checkWPPosts:n.indexOf("checkWPPosts")>-1,cacheAll:n.indexOf("cacheAll")>-1,lightboxEnabled:void 0!==s.attr("data-sby-supports-lightbox"),autoMinRes:1,general:o};window.sby.feeds[i]=function(e,i,s){return new t(e,i,s)}(this,i,d),void 0!==window.sbyAPIReady&&(window.sby.feeds[i].playerAPIReady=!0),window.sby.feeds[i].setResizedImages(),window.sby.feeds[i].init();var r=jQuery.Event("sbyafterfeedcreate");r.feed=window.sby.feeds[i],jQuery(window).trigger(r)}))},afterFeedsCreated:function(){e(".sb_instagram_header").each(function(){var i=e(this);i.find(".sby_header_link").hover(function(){i.find(".sby_header_img_hover").addClass("sby_fade_in")},function(){i.find(".sby_header_img_hover").removeClass("sby_fade_in")})})},encodeHTML:function(e){return void 0===e?"":e.replace(/(>)/g,"&gt;").replace(/(<)/g,"&lt;").replace(/(&lt;br\/&gt;)/g,"<br>").replace(/(&lt;br&gt;)/g,"<br>")},urlDetect:function(e){return e.match(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)/g)}},t.prototype={init:function(){var e=this;this.settings.ajaxPostLoad?this.getNewPostSet():this.afterInitialImagesLoaded();var i,t=(i=0,function(e,t){clearTimeout(i),i=setTimeout(e,t)});jQuery(window).resize(function(){t(function(){e.afterResize()},500)})},initLayout:function(){this.initGalleryLayout()},initGalleryLayout:function(){var i=e(this.el),t=this;i.hasClass("sby_layout_gallery")&&i.find(".sby_player_outer_wrap").length&&(this.maybeRaiseSingleImageResolution(i.find(".sby_player_outer_wrap"),0,!0),i.find(".sby_player_outer_wrap .sby_video_thumbnail").off().click(function(i){i.preventDefault(),t.onThumbnailClick(e(this),!0)}),i.mouseenter(function(){t.canCreatePlayer()&&(i.find(".sby_player_outer_wrap iframe").length?void 0===t.player&&t.playerEagerLoaded()&&t.createPlayer("sby_player"+t.index):(i.addClass("sby_player_added").find(".sby_player_outer_wrap").addClass("sby_player_loading"),i.find(".sby_player_outer_wrap .sby_video_thumbnail").find(".sby_loader").show().removeClass("sby_hidden"),t.createPlayer("sby_player"+t.index)))}))},createPlayer:function(i,t,s,a){var n=e(this.el),o=this;if(t=void 0!==t?t:this.getVideoID(n.find(".sby_item").first()),s=void 0!==s?s:0,void 0===a&&(a={host:window.location.protocol+"//www.youtube-nocookie.com",videoId:t,playerVars:{modestbranding:1,rel:0,autoplay:s}}),void 0===a.events&&(a.events={onReady:function(){n.find(".sby_player_outer_wrap").removeClass("sby_player_loading").find(".sby_video_thumbnail").css("z-index",-1).find(".sby_loader").hide().addClass("sby_hidden"),e("#"+i).length&&e("#"+i).closest(".sby_video_thumbnail_wrap").find(".sby_video_thumbnail").length&&e("#"+i).closest(".sby_video_thumbnail_wrap").find(".sby_video_thumbnail").fadeTo(0,"slow",function(){e(this).css("z-index",-1),e(this).find(".sby_loader").hide().addClass("sby_hidden"),e(this).closest(".sby_item").removeClass("sby_player_loading")})},onStateChange:function(t){n.find(".sby_player_outer_wrap").removeClass("sby_player_loading").find(".sby_video_thumbnail").css("z-index",-1).find(".sby_loader").hide().addClass("sby_hidden");var s=t.target.getVideoData().video_id;o.afterStateChange(i,s,t,e("#"+i).closest(".sby_video_thumbnail_wrap")),1===t.data&&void 0!==o.players&&n.find(".sby_item").each(function(){var i=o.getVideoID(e(this));e(this).find("iframe").length&&i!==s&&void 0!==o.players[i]&&o.players[i].pauseVideo()})}}),window.sbyEagerLoading)var d=YT.get(i);else d=new window.YT.Player(i,a);return this.maybeAddCTA(i),n.hasClass("sby_layout_list")&&void 0===this.players[t]?this.players[t]=d:void 0===this.player&&(this.player=d),d},afterStateChange:function(e,i,t,s){},afterInitialImagesLoaded:function(){this.initLayout(),this.loadMoreButtonInit(),this.hideExtraItemsForWidth(),this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed(),this.afterFeedSet()},afterResize:function(){this.setImageHeight(),this.setImageResolution(),this.maybeRaiseImageResolution(),this.setImageSizeClass()},afterLoadMoreClicked:function(e){e.find(".sby_loader").removeClass("sby_hidden"),e.find(".sby_btn_text").addClass("sby_hidden"),e.closest(".sb_youtube").find(".sby_num_diff_hide").addClass("sby_transition").removeClass("sby_num_diff_hide")},afterNewImagesLoaded:function(){var i=e(this.el),t=this;this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed(),setTimeout(function(){i.find(".sby_loader").addClass("sby_hidden"),i.find(".sby_btn_text").removeClass("sby_hidden"),t.maybeRaiseImageResolution()},500)},beforeNewImagesRevealed:function(){this.setImageHeight(),this.maybeRaiseImageResolution(!0),this.setImageSizeClass()},afterFeedSet:function(){},revealNewImages:function(){var i=e(this.el),t=this;"function"==typeof sbyCustomJS&&setTimeout(function(){sbyCustomJS()},100),i.find(".sby_item").each(function(i){var s=jQuery(this);s.find(".sby_video_thumbnail").hover(function(){jQuery(this).fadeTo(200,.85)},function(){jQuery(this).stop().fadeTo(500,1)}),s.find(".sby_video_thumbnail").off().click(function(i){i.preventDefault(),t.onThumbnailClick(e(this),!1)}),s.find(".sby_video_thumbnail").mouseenter(function(){t.onThumbnailEnter(e(this),!1)}),s.find(".sby_player_wrap").mouseleave(function(){t.onThumbnailLeave(e(this),!1)}),t.settings.lightboxEnabled&&(s.find(".sby_video_thumbnail").attr("data-sby-lightbox",t.index),"undefined"!=typeof sbyOptions&&void 0!==sbyOptions.lightboxPlaceholder&&s.find(".sby_video_thumbnail").attr("href",sbyOptions.lightboxPlaceholder)),t.afterItemRevealed(s)}),i.find(".sby_player_item").each(function(e){var i=jQuery(this);t.afterItemRevealed(i)}),setTimeout(function(){i.find(".sby_item.sby_new").removeClass("sby_new");var e=10;i.find(".sby_transition").length;i.find(".sby_transition").each(function(i){var t=jQuery(this);setTimeout(function(){t.removeClass("sby_transition")},e),e+=10})},500)},afterItemRevealed:function(){},afterNewImagesRevealed:function(){this.listenForVisibilityChange(),this.sendNeedsResizingToServer(),this.sendCheckWPPostsToServer(),this.settings.imageLoadEnabled||e(".sby_no_resraise").removeClass("sby_no_resraise");var i=e.Event("sbyafterimagesloaded");i.el=e(this.el),e(window).trigger(i)},setResizedImages:function(){e(this.el).find(".sby_resized_image_data").length&&void 0!==e(this.el).find(".sby_resized_image_data").attr("data-resized")&&0===e(this.el).find(".sby_resized_image_data").attr("data-resized").indexOf('{"')&&(this.resizedImages=JSON.parse(e(this.el).find(".sby_resized_image_data").attr("data-resized")),e(this.el).find(".sby_resized_image_data").remove())},sendNeedsResizingToServer:function(){var i=this;if(i.needsResizing.length>0&&i.settings.resizingEnabled){var t=e(this.el).find(".sby_item").length;a({action:"sby_resized_images_submit",needs_resizing:i.needsResizing,offset:t,feed_id:i.settings.feedID,atts:i.settings.shortCodeAtts},function(e){if(0===e.trim().indexOf("{")){var t=JSON.parse(e);i.settings.debugEnabled&&console.log(t)}})}},sendCheckWPPostsToServer:function(){var i=this;if(i.settings.checkWPPosts||i.settings.cacheAll){a({action:"sby_check_wp_submit",feed_id:i.settings.feedID,atts:i.settings.shortCodeAtts,offset:e(this.el).find(".sby_item").length,cache_all:i.settings.cacheAll},function(e){if(0===e.trim().indexOf("{")){var t=JSON.parse(e);i.settings.debugEnabled&&console.log(t)}})}},afterSendCheckWPPostsToServer:function(e){},loadMoreButtonInit:function(){var i=e(this.el),t=this;i.find(".sby_footer .sby_load_btn").off().on("click",function(){t.afterLoadMoreClicked(jQuery(this)),t.getNewPostSet()})},getNewPostSet:function(){var i=e(this.el),t=this;a({action:"sby_load_more_clicked",offset:i.find(".sby_item").length,feed_id:t.settings.feedID,atts:t.settings.shortCodeAtts,current_resolution:t.imageResolution},function(s){if(0===s.trim().indexOf("{")){var a=JSON.parse(s);t.settings.debugEnabled&&console.log(a),t.appendNewPosts(a.html),t.addResizedImages(a.resizedImages),t.settings.ajaxPostLoad?(t.settings.ajaxPostLoad=!1,t.afterInitialImagesLoaded()):t.afterNewImagesLoaded(),a.feedStatus.shouldPaginate?t.outOfPages=!1:(t.outOfPages=!0,i.find(".sby_load_btn").hide()),e(".sby_no_js").removeClass("sby_no_js")}})},appendNewPosts:function(i){var t=e(this.el);t.find(".sby_items_wrap .sby_item").length?t.find(".sby_items_wrap .sby_item").last().after(i):t.find(".sby_items_wrap").append(i)},addResizedImages:function(e){for(var i in e)this.resizedImages[i]=e[i]},setImageHeight:function(){},maybeRaiseSingleImageResolution:function(i,t,s){var a=this,n=a.getImageUrls(i),o=i.find(".sby_video_thumbnail img").attr("src"),d=150;s=void 0!==s&&s;if(!i.hasClass("sby_no_resraise")){e.each(n,function(e,i){i===o&&(d=parseInt(e),s=!1)});var r=640;switch(a.settings.imgRes){case"thumb":r=120;break;case"medium":r=320;break;case"large":r=480;break;case"full":r=640;break;default:var l=Math.max(a.settings.autoMinRes,i.find(".sby_video_thumbnail").innerWidth());switch(a.getBestResolutionForAuto(l,1,e(this.el).find("sby_item").first())){case 480:r=480;break;case 320:r=320;break;case 120:r=120}}if(r>d||o===window.sby.options.placeholder||s){if(a.settings.debugEnabled){var h=o===window.sby.options.placeholder?"was placeholder":"too small";console.log("rais res for "+o,h)}var b=n[r];i.find(".sby_video_thumbnail img").attr("src",b)}i.find("img").on("error",function(){if(e(this).hasClass("sby_img_error"))console.log("unfixed error "+e(this).attr("src"));else{if(e(this).addClass("sby_img_error"),e(this).attr("src").indexOf("i.ytimg.com")>-1)a.settings.favorLocal=!0,a.getImageUrls(e(this).closest(".sby_item"))[640];else void 0!==e(this).closest(".sby_video_thumbnail").attr("data-full-res")||e(this).closest(".sby_video_thumbnail").attr("href");setTimeout(function(){a.afterResize()},1500)}})}},maybeRaiseImageResolution:function(i){var t=this,s=void 0!==i&&!0===i?".sby_item.sby_new":".sby_item",a=!t.isInitialized;e(t.el).find(s).each(function(i){!e(this).hasClass("sby_num_diff_hide")&&e(this).find(".sby_video_thumbnail").length&&void 0!==e(this).find(".sby_video_thumbnail").attr("data-img-src-set")&&t.maybeRaiseSingleImageResolution(e(this),i,a)}),t.isInitialized=!0},getBestResolutionForAuto:function(i,t,s){(isNaN(t)||t<1)&&(t=1);var a=i*t,n=10*Math.ceil(a/10),o=[120,320,480,640];if(s.hasClass("sby_highlighted")&&(n*=2),-1===o.indexOf(parseInt(n))){var d=!1;e.each(o,function(e,i){i>parseInt(n)&&!d&&(n=i,d=!0)})}return n},hideExtraItemsForWidth:function(){if("carousel"!==this.layout){var i=e(this.el),t=void 0!==i.attr("data-num")&&""!==i.attr("data-num")?parseInt(i.attr("data-num")):1,s=void 0!==i.attr("data-nummobile")&&""!==i.attr("data-nummobile")?parseInt(i.attr("data-nummobile")):t;i.hasClass(".sby_layout_carousel")||(e(window).width()<480?s<i.find(".sby_item").length&&i.find(".sby_item").slice(s-i.find(".sby_item").length).addClass("sby_num_diff_hide"):t<i.find(".sby_item").length&&i.find(".sby_item").slice(t-i.find(".sby_item").length).addClass("sby_num_diff_hide"))}},setImageSizeClass:function(){var i=e(this.el);i.removeClass("sby_small sby_medium");var t=i.innerWidth(),s=parseInt(i.find(".sby_items_wrap").outerWidth()-i.find(".sby_items_wrap").width())/2,a=this.getColumnCount(),n=(t-s*(a+2))/a;n>120&&n<240?i.addClass("sby_medium"):n<=120&&i.addClass("sby_small")},setMinImageWidth:function(){e(this.el).find(".sby_item .sby_video_thumbnail").first().length?this.minImageWidth=e(this.el).find(".sby_item .sby_video_thumbnail").first().innerWidth():this.minImageWidth=150},setImageResolution:function(){if("auto"===this.settings.imgRes)this.imageResolution="auto";else switch(this.settings.imgRes){case"thumb":this.imageResolution=150;break;case"medium":this.imageResolution=320;break;default:this.imageResolution=640}},getImageUrls:function(e){var i=JSON.parse(e.find(".sby_video_thumbnail").attr("data-img-src-set").replace(/\\\//g,"/")),t=e.attr("id").replace("sby_","").replace("player_","");if(void 0!==this.resizedImages[t]&&"video"!==this.resizedImages[t]&&"pending"!==this.resizedImages[t]&&"error"!==this.resizedImages[t].id&&"video"!==this.resizedImages[t].id&&"pending"!==this.resizedImages[t].id){if(void 0!==this.resizedImages[t].sizes){var s=[];void 0!==this.resizedImages[t].sizes.full&&(s.push(640),i[640]=sbyOptions.resized_url+this.resizedImages[t].id+"full.jpg",e.find(".sby_link_area").attr("href",sbyOptions.resized_url+this.resizedImages[t].id+"full.jpg"),e.find(".sby_video_thumbnail").attr("data-full-res",sbyOptions.resized_url+this.resizedImages[t].id+"full.jpg")),void 0!==this.resizedImages[t].sizes.low&&(s.push(320),i[320]=sbyOptions.resized_url+this.resizedImages[t].id+"low.jpg",this.settings.favorLocal&&void 0===this.resizedImages[t].sizes.full&&(e.find(".sby_link_area").attr("href",sbyOptions.resized_url+this.resizedImages[t].id+"low.jpg"),e.find(".sby_video_thumbnail").attr("data-full-res",sbyOptions.resized_url+this.resizedImages[t].id+"low.jpg"))),void 0!==this.resizedImages[t].sizes.thumb&&(s.push(150),i[150]=sbyOptions.resized_url+this.resizedImages[t].id+"thumb.jpg"),this.settings.favorLocal&&(-1===s.indexOf(640)&&s.indexOf(320)>-1&&(i[640]=sbyOptions.resized_url+this.resizedImages[t].id+"low.jpg"),-1===s.indexOf(320)&&(s.indexOf(640)>-1?i[320]=sbyOptions.resized_url+this.resizedImages[t].id+"full.jpg":s.indexOf(150)>-1&&(i[320]=sbyOptions.resized_url+this.resizedImages[t].id+"thumb.jpg")),-1===s.indexOf(150)&&(s.indexOf(320)>-1?i[150]=sbyOptions.resized_url+this.resizedImages[t].id+"low.jpg":s.indexOf(640)>-1&&(i[150]=sbyOptions.resized_url+this.resizedImages[t].id+"full.jpg")))}}else(void 0===this.resizedImages[t]||void 0!==this.resizedImages[t].id&&"pending"!==this.resizedImages[t].id&&"error"!==this.resizedImages[t].id)&&this.addToNeedsResizing(t);return i},getVideoID:function(i){if(i.hasClass("sby_item")||i.hasClass("sby_player_item")){if(void 0!==i.find(".sby_video_thumbnail").attr("data-video-id"))return i.find(".sby_video_thumbnail").attr("data-video-id")}else if(i.closest("sby_item").length||i.closest("sby_player_item").length){var t=i.closest("sby_item").length?i.closest("sby_item"):i.closest("sby_player_item");if(void 0!==t.find(".sby_video_thumbnail").attr("data-video-id"))return t.find(".sby_video_thumbnail").attr("data-video-id")}else{if(i.hasClass("sb_youtube"))return i.find(".sby_item").first().find(".sby_video_thumbnail").attr("data-video-id");if(e(this.el).find(".sby_video_thumbnail").first().length&&void 0!==e(this.el).find(".sby_video_thumbnail").first().attr("data-video-id"))return e(this.el).find(".sby_video_thumbnail").first().attr("data-video-id")}return""},getAvatarUrl:function(e,i){if(""===e)return"";var t=this.settings.general.avatars;return"local"===(i=void 0!==i?i:"local")?void 0!==t["LCL"+e]&&1===parseInt(t["LCL"+e])?sbyOptions.resized_url+e+".jpg":void 0!==t[e]?t[e]:"":void 0!==t[e]?t[e]:void 0!==t["LCL"+e]&&1===parseInt(t["LCL"+e])?sbyOptions.resized_url+e+".jpg":""},addToNeedsResizing:function(e){-1===this.needsResizing.indexOf(e)&&this.needsResizing.push(e)},listenForVisibilityChange:function(){var i,t,s,a=this;i=jQuery,t={callback:function(){},runOnLoad:!0,frequency:100,sbyPreviousVisibility:null},s={sbyCheckVisibility:function(e,i){if(jQuery.contains(document,e[0])){var t=i.sbyPreviousVisibility,a=e.is(":visible");i.sbyPreviousVisibility=a,null==t?i.runOnLoad&&i.callback(e,a):t!==a&&i.callback(e,a),setTimeout(function(){s.sbyCheckVisibility(e,i)},i.frequency)}}},i.fn.sbyVisibilityChanged=function(e){var a=i.extend({},t,e);return this.each(function(){s.sbyCheckVisibility(i(this),a)})},"function"==typeof e(this.el).filter(":hidden").sbyVisibilityChanged&&e(this.el).filter(":hidden").sbyVisibilityChanged({callback:function(e,i){a.afterResize()},runOnLoad:!1})},getColumnCount:function(){var i=e(this.el),t=this.settings.cols,s=this.settings.colsmobile,a=t;return sbyWindowWidth=window.innerWidth,i.hasClass("sby_mob_col_auto")?(sbyWindowWidth<640&&parseInt(t)>2&&parseInt(t)<7&&(a=2),sbyWindowWidth<640&&parseInt(t)>6&&parseInt(t)<11&&(a=4),sbyWindowWidth<=480&&parseInt(t)>2&&(a=1)):sbyWindowWidth<=480&&(a=s),parseInt(a)},onThumbnailClick:function(i,t,s){if(this.canCreatePlayer()){var a=e(this.el);if(a.hasClass("sby_layout_gallery"))if(a.addClass("sby_player_added").find(".sby_player_outer_wrap").addClass("sby_player_loading"),a.find(".sby_player_outer_wrap .sby_video_thumbnail").find(".sby_loader").show().removeClass("sby_hidden"),a.find(".sby_player_outer_wrap iframe").length)if(t){s=void 0===s?this.getVideoID(a.find(".sby_item").first()):s;this.playVideoInPlayer(s)}else{s=void 0===s?this.getVideoID(i.closest(".sby_item")):s;this.changePlayerInfo(i.closest(".sby_item")),this.playVideoInPlayer(s),this.afterVideoChanged()}else if(t)this.createPlayer("sby_player"+this.index);else{var s=void 0===s?this.getVideoID(i.closest(".sby_item")):s;this.createPlayer("sby_player"+this.index,s)}else if(e(this.el).hasClass("sby_layout_grid")||e(this.el).hasClass("sby_layout_carousel")){var n=i.closest(".sby_item");s=void 0===s?this.getVideoID(n):s;this.playVideoInPlayer(s),this.afterVideoChanged()}else if(e(this.el).hasClass("sby_layout_list")){n=i.closest(".sby_item"),s=void 0===s?this.getVideoID(n):s;n.length&&!n.find("iframe").length?(n.find(".sby_loader").show().removeClass("sby_hidden"),n.addClass("sby_player_loading sby_player_loaded"),this.createPlayer("sby_player_"+s,s)):(this.playVideoInPlayer(s,n.attr("data-video-id")),this.afterVideoChanged())}}},onThumbnailEnter:function(i){if(this.canCreatePlayer()&&e(this.el).hasClass("sby_layout_list")){var t=i.closest(".sby_item"),s=this.getVideoID(t);t.find("iframe").length||(t.find(".sby_loader").show().removeClass("sby_hidden"),t.addClass("sby_player_loading sby_player_loaded"),this.createPlayer("sby_player_"+s,s,0))}},onThumbnailLeave:function(e){},changePlayerInfo:function(e){},playerEagerLoaded:function(){if(void 0!==this.player||e(this.el).hasClass("sby_player_loaded"))return!0},canCreatePlayer:function(){return this.playerEagerLoaded()||this.playerAPIReady&&this.consentGiven},playVideoInPlayer:function(e,i){void 0!==this.player&&void 0!==this.player.loadVideoById?this.player.loadVideoById(e):void 0!==window.sbyLightboxPlayer&&void 0!==window.sbyLightboxPlayer.loadVideoById?window.sbyLightboxPlayer.loadVideoById(e):void 0!==i&&void 0!==this.players&&void 0!==this.players[i]&&"function"==typeof this.players[i].loadVideoById&&this.players[i].loadVideoById(e)},afterVideoChanged:function(){e(this.el).hasClass("sby_layout_gallery")&&(e(this.el).find(".sby_player_outer_wrap").removeClass("sby_player_loading"),e(this.el).find(".sby_player_outer_wrap .sby_video_thumbnail").find(".sby_loader").hide().addClass("sby_hidden"),e(window).width()<480&&e("html, body").animate({scrollTop:e(this.el).find(".sby_player_outer_wrap").offset().top},300))},maybeAddCTA:function(){}},s.prototype={getData:function(e){return{feedIndex:parseInt(e.closest(".sb_youtube").attr("data-sby-index")-1),link:e.attr("href"),video:e.attr("data-video-id")}},template:function(){return"<div id='sby_lightboxOverlay' class='sby_lightboxOverlay'></div><div id='sby_lightbox' class='sby_lightbox'><div class='sby_lb-outerContainer'><div class='sby_lb-container'><img class='sby_lb-image' alt='Lightbox image placeholder' src='' /><div class='sby_lb-player sby_lb-player-placeholder' id='sby_lb-player'></div><div class='sby_lb-nav'><a class='sby_lb-prev' href='#' ><p class='sby-screenreader'>Previous Slide</p><span></span></a><a class='sby_lb-next' href='#' ><p class='sby-screenreader'>Next Slide</p><span></span></a></div><div class='sby_lb-loader'><a class='sby_lb-cancel'></a></div></div></div><div class='sby_lb-dataContainer'><div class='sby_lb-data'><div class='sby_lb-details'><div class='sby_lb-caption'></div><div class='sby_lb-info'><div class='sby_lb-number'></div></div></div><div class='sby_lb-closeContainer'><a class='sby_lb-close'></a></div></div></div></div>"},beforePlayerSetup:function(e,i,t,s,a){},afterPlayerSetup:function(e,i,t,s){},afterResize:function(){var i=e("#sby_lightbox .sby_lb-player").height();if(i>100){var t=e("#sby_lightbox .sby_lb-outerContainer").height()-i;t>10&&e("#sby_lightbox .sby_lb-player").css("top",t/2)}}},window.sby_init=function(){window.sby=new i,window.sby.createPage(window.sby.createFeeds,{whenFeedsCreated:window.sby.afterFeedsCreated})}}(jQuery),jQuery(document).ready(function(e){sby_init()}),void 0===window.sbyEagerLoading&&(window.sbyEagerLoading=!1,jQuery("div[data-vc-video-bg]").length&&(window.sbyEagerLoading=!0))}window.onYouTubeIframeAPIReady=function(){var e=document.getElementsByClassName("sb_youtube").length;if(e>0)if(window.sbyEagerLoading){window.sbyEagerLoading=!0;var i=!1;jQuery(".sb_youtube").each(function(e){var t=jQuery(this);t.hasClass("sby_layout_list")?(jQuery(this).addClass("sby_player_loaded"),t.find(".sby_item").each(function(){videoID=jQuery(this).attr("data-video-id"),player=new YT.Player("sby_player_"+videoID,{height:"100",width:"100",videoId:videoID,playerVars:{modestbranding:1,rel:0,autoplay:!1},events:{onStateChange:function(e){e.target.getVideoData().video_id;1===e.data&&t.find(".sby_item").each(function(){var i=jQuery(this).attr("data-video-id");jQuery(this).find("iframe").length&&jQuery(e.target.a).attr("id")!==jQuery(this).find("iframe").attr("id")&&YT.get("sby_player_"+i).pauseVideo()})}}})})):t.hasClass("sby_layout_gallery")?(jQuery(this).addClass("sby_player_loaded"),player=new YT.Player("sby_player"+e,{height:"100",width:"100",videoId:jQuery(this).find(".sby_item").first().attr("data-video-id"),playerVars:{modestbranding:1,rel:0,autoplay:!1}})):i=!0}),i&&(jQuery("#sby_lb-player").length||jQuery(".sb_youtube").first().append('<div class="sby_lb-player-loaded sby_lb-player" id="sby_lb-player" style="display: none;"></div>'),player=new YT.Player("sby_lb-player",{height:"100",width:"100",videoId:jQuery(this).find(".sby_item").first().attr("data-video-id"),playerVars:{modestbranding:1,rel:0,autoplay:!1}}),window.sbyLightboxPlayer=player)}else if(void 0!==window.sby)for(var t=0;t<e;t++)window.sby.feeds[t].playerAPIReady=!0;else window.sbyAPIReady=!0};
youtube-feed.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Feeds for YouTube
4
  Plugin URI: http://smashballoon.com/youtube-feed
5
  Description: The Feeds for YouTube plugin allows you to display customizable YouTube feeds from any YouTube channel.
6
- Version: 1.1
7
  Author: Smash Balloon YouTube Team
8
  Author URI: http://smashballoon.com/
9
  Text Domain: feeds-for-youtube
@@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
27
 
28
  if ( ! defined( 'SBYVER' ) ) {
29
- define( 'SBYVER', '1.1' );
30
  }
31
  if ( ! defined( 'SBY_DBVERSION' ) ) {
32
  define( 'SBY_DBVERSION', 1.1 );
@@ -308,9 +308,60 @@ if ( function_exists( 'sby_init' ) ) {
308
  update_option( 'sby_db_version', SBY_DBVERSION );
309
  }
310
 
 
 
 
 
 
 
311
  }
312
  add_action( 'wp_loaded', 'sby_check_for_db_updates' );
313
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
314
  /**
315
  * Deletes saved data for the plugin unless setting to preserve
316
  * settings is enabled
@@ -370,6 +421,85 @@ if ( function_exists( 'sby_init' ) ) {
370
  global $wp_roles;
371
  $wp_roles->remove_cap( 'administrator', 'manage_youtube_feed_options' );
372
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
373
  }
374
 
375
  register_uninstall_hook( __FILE__, 'sby_uninstall' );
@@ -422,15 +552,12 @@ if ( function_exists( 'sby_init' ) ) {
422
 
423
  function sby_settings_defaults() {
424
  $defaults = array(
425
- 'have_own_tokens' => 0,
426
- 'app_id' => '',
427
- 'app_secret' => '',
428
  'connected_accounts' => array(),
429
  'type' => 'channel',
430
  'channel' => '',
431
- 'num' => 8,
432
- 'nummobile' => 8,
433
- 'minnum' => 8,
434
  'widthresp' => true,
435
  'class' => '',
436
  'height' => '',
@@ -444,8 +571,8 @@ if ( function_exists( 'sby_init' ) ) {
444
  'subscribetextcolor' => '',
445
  'buttoncolor' => '',
446
  'buttontextcolor' => '',
447
- 'layout' => 'list',
448
- 'playvideo' => 'onclick',
449
  'sortby' => 'none',
450
  'imageres' => 'auto',
451
  'showheader' => true,
@@ -470,12 +597,13 @@ if ( function_exists( 'sby_init' ) ) {
470
  'enqueue_css_in_shortcode' => false,
471
  'font_method' => 'svg',
472
  'customtemplates' => false,
473
- 'gallerycols' => 4,
474
- 'gallerycolsmobile' => 'auto',
475
- 'gridcols' => 4,
476
- 'gridcolsmobile' => 'auto',
477
- 'include' => array( 'title', 'icon', 'user', 'views', 'date', 'countdown', 'description' ),
478
- );
 
479
 
480
  return $defaults;
481
  }
3
  Plugin Name: Feeds for YouTube
4
  Plugin URI: http://smashballoon.com/youtube-feed
5
  Description: The Feeds for YouTube plugin allows you to display customizable YouTube feeds from any YouTube channel.
6
+ Version: 1.1.1
7
  Author: Smash Balloon YouTube Team
8
  Author URI: http://smashballoon.com/
9
  Text Domain: feeds-for-youtube
26
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
27
 
28
  if ( ! defined( 'SBYVER' ) ) {
29
+ define( 'SBYVER', '1.1.1' );
30
  }
31
  if ( ! defined( 'SBY_DBVERSION' ) ) {
32
  define( 'SBY_DBVERSION', 1.1 );
308
  update_option( 'sby_db_version', SBY_DBVERSION );
309
  }
310
 
311
+ if ( (float) $db_ver < 1.2 ) {
312
+ sby_add_caps();
313
+
314
+ update_option( 'sby_db_version', SBY_DBVERSION );
315
+ }
316
+
317
  }
318
  add_action( 'wp_loaded', 'sby_check_for_db_updates' );
319
 
320
+ function sby_add_caps() {
321
+ global $wp_roles;
322
+
323
+ $pto = get_post_type_object( SBY_CPT );
324
+
325
+ $admin_caps = array(
326
+ 'edit_' . SBY_CPT,
327
+ 'read_' . SBY_CPT,
328
+ 'delete_' . SBY_CPT,
329
+ 'edit_' . SBY_CPT,
330
+ 'edit_others_' . SBY_CPT,
331
+ 'publish_' . SBY_CPT,
332
+ 'read_private_' . SBY_CPT,
333
+ 'read',
334
+ 'delete_' . SBY_CPT,
335
+ 'delete_private_' . SBY_CPT,
336
+ 'delete_published_' . SBY_CPT,
337
+ 'delete_others_' . SBY_CPT,
338
+ 'edit_private_' . SBY_CPT,
339
+ 'edit_published_' . SBY_CPT,
340
+ );
341
+ $author_caps = array(
342
+ 'edit_' . SBY_CPT,
343
+ 'read_' . SBY_CPT,
344
+ 'delete_' . SBY_CPT,
345
+ 'edit_' . SBY_CPT,
346
+ 'publish_' . SBY_CPT,
347
+ 'read',
348
+ 'delete_' . SBY_CPT,
349
+ 'delete_published_' . SBY_CPT,
350
+ 'edit_published_' . SBY_CPT,
351
+ );
352
+
353
+ if ( ! empty( $pto ) ) {
354
+ foreach ( array( 'administrator', 'editor' ) as $role_id ) {
355
+ foreach ( $admin_caps as $cap ) {
356
+ $wp_roles->add_cap( $role_id, $cap );
357
+ }
358
+ }
359
+ foreach ( $author_caps as $cap ) {
360
+ $wp_roles->add_cap( 'author', $cap );
361
+ }
362
+ }
363
+ }
364
+
365
  /**
366
  * Deletes saved data for the plugin unless setting to preserve
367
  * settings is enabled
421
  global $wp_roles;
422
  $wp_roles->remove_cap( 'administrator', 'manage_youtube_feed_options' );
423
 
424
+ $pto = get_post_type_object( 'sby_videos' );
425
+
426
+ $admin_caps = array(
427
+ 'edit_sby_videos',
428
+ 'read_sby_videos',
429
+ 'delete_sby_videos',
430
+ 'edit_sby_videos',
431
+ 'edit_others_sby_videos',
432
+ 'publish_sby_videos',
433
+ 'read_private_sby_videos',
434
+ 'read',
435
+ 'delete_sby_videos',
436
+ 'delete_private_sby_videos',
437
+ 'delete_published_sby_videos',
438
+ 'delete_others_sby_videos',
439
+ 'edit_private_sby_videos',
440
+ 'edit_published_sby_videos',
441
+ );
442
+ $author_caps = array(
443
+ 'edit_sby_videos',
444
+ 'read_sby_videos',
445
+ 'delete_sby_videos',
446
+ 'edit_sby_videos',
447
+ 'publish_sby_videos',
448
+ 'read',
449
+ 'delete_sby_videos',
450
+ 'delete_published_sby_videos',
451
+ 'edit_published_sby_videos',
452
+ );
453
+
454
+ if ( ! empty( $pto ) ) {
455
+ foreach ( array( 'administrator', 'editor' ) as $role_id ) {
456
+ foreach ( $admin_caps as $cap ) {
457
+ $wp_roles->remove_cap( $role_id, $cap );
458
+ }
459
+ }
460
+ foreach ( $author_caps as $cap ) {
461
+ $wp_roles->remove_cap( 'author', $cap );
462
+ }
463
+ }
464
+
465
+ $admin_caps = array(
466
+ 'edit_sby_video',
467
+ 'read_sby_video',
468
+ 'delete_sby_video',
469
+ 'edit_sby_video',
470
+ 'edit_others_sby_video',
471
+ 'publish_sby_video',
472
+ 'read_private_sby_video',
473
+ 'read',
474
+ 'delete_sby_video',
475
+ 'delete_private_sby_video',
476
+ 'delete_published_sby_video',
477
+ 'delete_others_sby_video',
478
+ 'edit_private_sby_video',
479
+ 'edit_published_sby_video',
480
+ );
481
+ $author_caps = array(
482
+ 'edit_sby_video',
483
+ 'read_sby_video',
484
+ 'delete_sby_video',
485
+ 'edit_sby_video',
486
+ 'publish_sby_video',
487
+ 'read',
488
+ 'delete_sby_video',
489
+ 'delete_published_sby_video',
490
+ 'edit_published_sby_video',
491
+ );
492
+
493
+ if ( ! empty( $pto ) ) {
494
+ foreach ( array( 'administrator', 'editor' ) as $role_id ) {
495
+ foreach ( $admin_caps as $cap ) {
496
+ $wp_roles->remove_cap( $role_id, $cap );
497
+ }
498
+ }
499
+ foreach ( $author_caps as $cap ) {
500
+ $wp_roles->remove_cap( 'author', $cap );
501
+ }
502
+ }
503
  }
504
 
505
  register_uninstall_hook( __FILE__, 'sby_uninstall' );
552
 
553
  function sby_settings_defaults() {
554
  $defaults = array(
 
 
 
555
  'connected_accounts' => array(),
556
  'type' => 'channel',
557
  'channel' => '',
558
+ 'num' => 9,
559
+ 'nummobile' => 9,
560
+ 'minnum' => 9,
561
  'widthresp' => true,
562
  'class' => '',
563
  'height' => '',
571
  'subscribetextcolor' => '',
572
  'buttoncolor' => '',
573
  'buttontextcolor' => '',
574
+ 'layout' => 'grid',
575
+ 'playvideo' => 'automatically',
576
  'sortby' => 'none',
577
  'imageres' => 'auto',
578
  'showheader' => true,
597
  'enqueue_css_in_shortcode' => false,
598
  'font_method' => 'svg',
599
  'customtemplates' => false,
600
+ 'gallerycols' => 3,
601
+ 'gallerycolsmobile' => 2,
602
+ 'gridcols' => 3,
603
+ 'gridcolsmobile' => 2,
604
+ 'include' => array( 'title', 'icon', 'user', 'views', 'date', 'countdown' ),
605
+ 'hoverinclude' => array( 'description', 'stats' ),
606
+ );
607
 
608
  return $defaults;
609
  }