Custom Facebook Feed - Version 2.11

Version Description

  • New: Added a "Feed Columns" setting to allow you to display your feed in multiple columns. This can be found under the "General" tab on the "Customize" page, or by using the cols and colsmobile shortcode settings.
  • New: Updated to use v4.0 of the Facebook API
Download this release

Release Info

Developer smashballoon
Plugin Icon 128x128 Custom Facebook Feed
Version 2.11
Comparing to
See all releases

Code changes from version 2.10 to 2.11

README.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Smash Balloon Social Post Feed ===
2
  Contributors: smashballoon
3
- Tags: Facebook, Facebook feed, Facebook posts, Facebook wall, Facebook page, facebook likebox, facebook feed, facebook plugin
4
  Requires at least: 3.0
5
  Requires PHP: 5.2
6
  Tested up to: 5.2
7
- Stable tag: 2.10
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -18,7 +18,9 @@ Display Facebook posts on your website. **Completely customizable**, **responsiv
18
 
19
  *"I honestly cannot recommend this plugin enough. The plugin itself is gorgeous and super customizable, and if you run into trouble...support will get you out of it. Five Stars across the board."* - [pamsavoybarnett](http://wordpress.org/support/topic/love-this-plugin-w-awesome-support?facebook)
20
 
21
- = Features =
 
 
22
 
23
  * **Super simple to set up** - 1 minute quick setup with no Facebook Developer App required
24
  * **Display feeds from ANY Facebook page** - even ones you aren't an admin of
@@ -44,14 +46,14 @@ Display Facebook posts on your website. **Completely customizable**, **responsiv
44
  * Create a customizable header with a range of icons for your Custom Facebook Feed
45
  * Localization/i18n support to allow every part of the feed to be displayed in your language
46
 
47
- = Pro Version =
48
 
49
  In order to maintain the free version of the plugin on an ongoing basis, and to provide quick and effective support for free, we offer a Pro version of the plugin. The Pro version allows you to display photos, videos, the number of likes, shares, reactions and comments for each Facebook post, choose from multiple layout options, filter posts by type or #hashtag/string, load more posts into your feed, and more. [Click here](https://smashballoon.com/differences-between-the-free-version-and-pro-version-of-the-custom-facebook-feed-plugin/ "Differences between free and Pro version of Custom Facebook Feed plugin") for a full list of all differences between the free version and Pro version.
50
 
51
  * [Find out more about the Pro version](https://smashballoon.com/custom-facebook-feed/ "Custom Facebook Feed Pro")
52
  * [Try out the Pro demo](https://smashballoon.com/custom-facebook-feed/demo "Custom Facebook Feed Pro Demo").
53
 
54
- = Benefits of the Custom Facebook Feed plugin =
55
 
56
  * **Increase social engagement** between you and your users, customers, or fans
57
  * **Save time** by using the Custom Facebook Feed to generate dynamic, search engine crawlable content on your website
@@ -63,6 +65,30 @@ In order to maintain the free version of the plugin on an ongoing basis, and to
63
  * Support is quick and effective
64
  * We're dedicated to providing the **most customizable**, **robust** and **well supported** Facebook feed plugin in the world!
65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  == Installation ==
67
 
68
  1. Install the Custom Facebook Feed either via the WordPress plugin directory, or by uploading the files to your web server (in the `/wp-content/plugins/` directory).
@@ -209,40 +235,6 @@ Ensure that there aren't any spelling errors in the shortcode options that you'r
209
 
210
  The most common reason for this is that an add-on or extension you have installed in your web browser is blocking the pictures being loaded from Facebook. Try checking to see whether you have any add-ons or extensions installed in your browser and, if so, try disabling them to see whether that solves the problem and displays the pictures from Facebook.
211
 
212
- = How to get a Facebook Access Token =
213
-
214
- **For step-by-step instructions and screenshots on how to get a Facebook Access Token just follow the [Facebook Access Token instructions](https://smashballoon.com/custom-facebook-feed/access-token/ "Facebook Access Token instructions") on the Smash Balloon website.**
215
-
216
- You no longer need your own Access Token to use the Custom Facebook Feed Plugin, but if you'd like to use your own then you will need to obtain one from Facebook. Don't worry though, this is really easy to do. Just follow the steps below:
217
-
218
- **1)** Go to [developers.facebook.com](http://developers.facebook.com "Facebook developers website") and click on Log In in the top right. Log in using your personal Facebook credentials.
219
-
220
- **Note:** The personal Facebook account that you use to register as a Facebook developer does not need to be associated in any way with the Facebook page whose posts you want to display. You can use the Facebook Access Token you receive to display the Facebook posts from any public Facebook page.
221
-
222
- **Note:** You cannot log in to the Facebook Developer site using a Facebook Page or Facebook Business account. You must use the username and password from your personal Facebook profile. Facebook doesn't allow businesses to register as Facebook developers, only individuals.
223
-
224
- **2)** If this is your first time signing in to the Facebook Developer portal then click on Register Now. Registering is a quick an easy process which will take less than a couple of minutes. If you're already registered as a Facebook developer then you can skip ahead to step 9.
225
-
226
- **3)** Accept the Facebook terms and click Continue.
227
-
228
- **4)** Enter your phone number to confirm your account.
229
-
230
- **5)** Facebook will send you an automated text message containing a confirmation code. Enter it in the box and click Confirm.
231
-
232
- **6)** Choose to share your phone number with Only Me (unless you wish to share it with publicly or with Facebook friends).
233
-
234
- **7)** You can skip the next step by clicking Skip.
235
-
236
- **8)** Click Done.
237
-
238
- **9)** Now click on Create New App.
239
-
240
- **10)** Enter your Facebook App Name. This can be anything you like. Click Continue.
241
-
242
- **11)** Fill in Facebook's Security Check and click Continue.
243
-
244
- **12)** Your Facebook App should now be set up. Copy and paste your Facebook App ID and Facebook App Secret into the fields in the last step of the [Access Token instructions](https://smashballoon.com/custom-facebook-feed/access-token/ "How to get a Facebook Access Token") to retrieve your Facebook Access Token.
245
-
246
  == Other Notes ==
247
 
248
  = At Smash Balloon we have two goals: =
@@ -263,6 +255,10 @@ You no longer need your own Access Token to use the Custom Facebook Feed Plugin,
263
  9. It's super easy to display your Facebook feed in any page or post
264
 
265
  == Changelog ==
 
 
 
 
266
  = 2.10 =
267
  * New: Facebook Groups are making their long-awaited return to the plugin! Just click the 'Log in and get my Access Token' button on the plugin's Settings page and select 'Facebook Group'. Follow the prompts to connect your Group and display your feed.
268
  * Fix: Fixed an issue where a lists of groups or pages wouldn't be displayed when retrieving an Access Token due to a server configuration issue
1
  === Smash Balloon Social Post Feed ===
2
  Contributors: smashballoon
3
+ Tags: Facebook, Facebook feed, Facebook posts, Facebook wall, Facebook page
4
  Requires at least: 3.0
5
  Requires PHP: 5.2
6
  Tested up to: 5.2
7
+ Stable tag: 2.11
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
18
 
19
  *"I honestly cannot recommend this plugin enough. The plugin itself is gorgeous and super customizable, and if you run into trouble...support will get you out of it. Five Stars across the board."* - [pamsavoybarnett](http://wordpress.org/support/topic/love-this-plugin-w-awesome-support?facebook)
20
 
21
+ **Please note:** This free plugin allows you to display text and links from Facebook posts. To display **photos, videos, comments,** and more, we offer a Pro version of the plugin. See the Pro Version section below for more information.
22
+
23
+ ### Facebook Feed Features
24
 
25
  * **Super simple to set up** - 1 minute quick setup with no Facebook Developer App required
26
  * **Display feeds from ANY Facebook page** - even ones you aren't an admin of
46
  * Create a customizable header with a range of icons for your Custom Facebook Feed
47
  * Localization/i18n support to allow every part of the feed to be displayed in your language
48
 
49
+ ### Pro Version (Custom Facebook Feed Pro)
50
 
51
  In order to maintain the free version of the plugin on an ongoing basis, and to provide quick and effective support for free, we offer a Pro version of the plugin. The Pro version allows you to display photos, videos, the number of likes, shares, reactions and comments for each Facebook post, choose from multiple layout options, filter posts by type or #hashtag/string, load more posts into your feed, and more. [Click here](https://smashballoon.com/differences-between-the-free-version-and-pro-version-of-the-custom-facebook-feed-plugin/ "Differences between free and Pro version of Custom Facebook Feed plugin") for a full list of all differences between the free version and Pro version.
52
 
53
  * [Find out more about the Pro version](https://smashballoon.com/custom-facebook-feed/ "Custom Facebook Feed Pro")
54
  * [Try out the Pro demo](https://smashballoon.com/custom-facebook-feed/demo "Custom Facebook Feed Pro Demo").
55
 
56
+ ### Benefits
57
 
58
  * **Increase social engagement** between you and your users, customers, or fans
59
  * **Save time** by using the Custom Facebook Feed to generate dynamic, search engine crawlable content on your website
65
  * Support is quick and effective
66
  * We're dedicated to providing the **most customizable**, **robust** and **well supported** Facebook feed plugin in the world!
67
 
68
+ ### How to use the plugin
69
+
70
+ One of our main priorities has always been to make our plugins as easy as possible to setup and use. Once you've installed the plugin there are only a few steps to get up and running:
71
+
72
+ * 1) Click the "Log in and get my Access Token" button on the plugin settings page. This will prompt you to log into your Facebook account to authorize the plugin.
73
+ * 2) Once you've connected your account, save the plugin settings.
74
+ * 3) Then simply copy and paste the `[custom-facebook-feed]` shortcode onto any page, post, or widget where you want the feed to be displayed.
75
+
76
+ That's it! You can then customize the feed as needed using the settings on the plugin "Customize" page.
77
+
78
+ For full step-by-step setup directions with screenshots, see [here](https://smashballoon.com/custom-facebook-feed/docs/free/ "Custom Facebook Feed Free Setup Doc").
79
+
80
+ ### Requesting support
81
+
82
+ Customer support is a huge deal to us. We pride ourselves on always providing quick, effective, and courteous support to all of our users. If you're having an issue then just let us know and we'll be there to help as soon as possible. You can either open a ticket on the support forum on [WordPress.org](https://wordpress.org/support/plugin/custom-facebook-feed/ "Custom Facebook Feed Free support forum"), or directly on [our website](https://smashballoon.com/custom-facebook-feed/support/ "Custom Facebook Feed website support form"). We also have a large collection of help documentation and FAQs [on our website](https://smashballoon.com/custom-facebook-feed/faq/ "Custom Facebook Feed support FAQs") for all common issues.
83
+
84
+ ### Who's behind this plugin?
85
+
86
+ We're Smash Balloon; a fun-loving WordPress plugin development company birthed into existence in early 2013. We specialize in creating plugins that are not only intuitive and simple to use, but also designed to integrate seamlessly into your website and allow you to display your social media content in powerful and unique ways. Over 1 million awesome people have decided to actively use our free plugins, which is an incredible honor that we don't take lightly. This compels us to try to provide the quickest and most effective customer support that we can, blowing users away with the best customer service they've ever experienced.
87
+
88
+ To find out more about the team, see [here](https://smashballoon.com/about/ "Team Smash Balloon").
89
+
90
+ Check out our other free plugins for both [Instagram](https://wordpress.org/plugins/instagram-feed "Instagram Feed free plugin") and [Twitter](https://wordpress.org/plugins/custom-twitter-feeds/ "Custom Twitter Feeds free plugin").
91
+
92
  == Installation ==
93
 
94
  1. Install the Custom Facebook Feed either via the WordPress plugin directory, or by uploading the files to your web server (in the `/wp-content/plugins/` directory).
235
 
236
  The most common reason for this is that an add-on or extension you have installed in your web browser is blocking the pictures being loaded from Facebook. Try checking to see whether you have any add-ons or extensions installed in your browser and, if so, try disabling them to see whether that solves the problem and displays the pictures from Facebook.
237
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238
  == Other Notes ==
239
 
240
  = At Smash Balloon we have two goals: =
255
  9. It's super easy to display your Facebook feed in any page or post
256
 
257
  == Changelog ==
258
+ = 2.11 =
259
+ * New: Added a "Feed Columns" setting to allow you to display your feed in multiple columns. This can be found under the "General" tab on the "Customize" page, or by using the `cols` and `colsmobile` shortcode settings.
260
+ * New: Updated to use v4.0 of the Facebook API
261
+
262
  = 2.10 =
263
  * New: Facebook Groups are making their long-awaited return to the plugin! Just click the 'Log in and get my Access Token' button on the plugin's Settings page and select 'Facebook Group'. Follow the prompts to connect your Group and display your feed.
264
  * Fix: Fixed an issue where a lists of groups or pages wouldn't be displayed when retrieving an Access Token due to a server configuration issue
css/cff-admin-style.css CHANGED
@@ -441,6 +441,7 @@
441
  display: inline-block;
442
  margin: 15px 0 0 0;
443
  padding: 15px 20px;
 
444
 
445
  border: 1px solid #ddd;
446
  background: #eee;
@@ -814,7 +815,9 @@
814
  margin: 0 0 0 92px !important;
815
  padding: 4px 0 0 0;
816
  }
817
- .cff_review_notice .cff_notice_close{
 
 
818
  position: absolute;
819
  top: 0;
820
  right: 0;
@@ -826,6 +829,26 @@
826
  color: #a34100;
827
  }
828
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
829
 
830
  /* Support page */
831
  #cff-admin .cff_support{
@@ -1233,4 +1256,35 @@
1233
  }
1234
  #cff-admin #twitter-widget-0 {
1235
  width: 65px !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1236
  }
441
  display: inline-block;
442
  margin: 15px 0 0 0;
443
  padding: 15px 20px;
444
+ min-width: 808px;
445
 
446
  border: 1px solid #ddd;
447
  background: #eee;
815
  margin: 0 0 0 92px !important;
816
  padding: 4px 0 0 0;
817
  }
818
+ .cff_review_notice .cff_notice_close,
819
+ .cff_review_notice .cff_bfcm_sale_notice_close,
820
+ .cff_review_notice .cff_new_user_sale_notice_close {
821
  position: absolute;
822
  top: 0;
823
  right: 0;
829
  color: #a34100;
830
  }
831
 
832
+ /* Notice CTA btn */
833
+ .cff_review_notice .cff_offer_btn{
834
+ padding: 4px 12px 6px 12px;
835
+ background: green;
836
+ color: #fff;
837
+ border-radius: 4px;
838
+ display: inline-block;
839
+ text-decoration: none;
840
+ margin-left: 0;
841
+ }
842
+ .cff_review_notice .cff_offer_btn:hover,
843
+ .cff_review_notice .cff_offer_btn:focus{
844
+ background: #049404;
845
+ color: #fff;
846
+ }
847
+ .cff_review_notice .cff_other_notice{
848
+ font-size: 13px;
849
+ font-style: italic;
850
+ margin-top: 5px !important;
851
+ }
852
 
853
  /* Support page */
854
  #cff-admin .cff_support{
1256
  }
1257
  #cff-admin #twitter-widget-0 {
1258
  width: 65px !important;
1259
+ }
1260
+
1261
+ #cff-admin #header{
1262
+ padding: 0 0 10px 0;
1263
+ }
1264
+
1265
+ #cff-admin .cff_plugins_promo{
1266
+ width: 100%;
1267
+ float: left;
1268
+ clear: both;
1269
+ }
1270
+ #cff-admin .cff_plugins_promo a{
1271
+ color: #e34f0e;
1272
+ }
1273
+ #cff-admin .cff-share-plugin h3 {
1274
+ padding: 15px 0 0 0;
1275
+ }
1276
+ #cff-admin .cff-mobile-col-settings .cff-row {
1277
+ width: auto;
1278
+ padding: 10px 15px;
1279
+ margin: 10px 0;
1280
+ font-size: 13px;
1281
+ background: #f9f9f9;
1282
+ background: rgba(255,255,255,0.8);
1283
+ -moz-border-radius: 8px;
1284
+ -webkit-border-radius: 8px;
1285
+ border-radius: 8px;
1286
+ }
1287
+ #cff-admin .cff-mobile-col-settings label {
1288
+ font-weight: 600;
1289
+ margin: 0 5px 0 0;
1290
  }
css/cff-style.css CHANGED
@@ -542,4 +542,173 @@
542
  #cff .cff-linebreak{
543
  display: block;
544
  height: 5px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
545
  }
542
  #cff .cff-linebreak{
543
  display: block;
544
  height: 5px;
545
+ }
546
+
547
+ /* Masonry */
548
+ #cff.cff-masonry .cff-item.cff-box{
549
+ margin-left: 1.5%;
550
+ margin-right: 1.5%;
551
+ }
552
+ #cff.cff-masonry {
553
+ box-sizing: border-box;
554
+ }
555
+ #cff.cff-masonry .cff-item:first-child,
556
+ #cff.cff-masonry .cff-item {
557
+ padding-top: 20px;
558
+ margin-top: 0;
559
+ }
560
+ #cff.cff-masonry .cff-item,
561
+ #cff.cff-masonry .cff-likebox{
562
+ float: none;
563
+ display: inline-block;
564
+ width: 30.3%;
565
+ margin: 0 1.5%;
566
+ margin-bottom: 20px;
567
+ }
568
+ #cff.cff-masonry.cff-opaque-comments .cff-item{
569
+ z-index: 1;
570
+ }
571
+ #cff.cff-masonry.masonry-2-desktop .cff-item{
572
+ width: 47%;
573
+ margin: 0 1.5%;
574
+ }
575
+ #cff.cff-masonry.masonry-4-desktop .cff-item{
576
+ width: 22%;
577
+ margin: 0 1.5%;
578
+ }
579
+ #cff.cff-masonry.masonry-5-desktop .cff-item{
580
+ width: 17%;
581
+ margin: 0 1.5%;
582
+ }
583
+ #cff.cff-masonry.masonry-6-desktop .cff-item{
584
+ width: 13.516%;
585
+ margin: 0 1.5%;
586
+ }
587
+ #cff.cff-masonry .cff-comments-box {
588
+ position: relative;
589
+ z-index: 999;
590
+ }
591
+ #cff.cff-masonry .cff-comment-attachment,
592
+ #cff.cff-masonry .cff-comment-replies-box {
593
+ max-width: 100%;
594
+ }
595
+ /* Load more button */
596
+ #cff.cff-masonry .cff-load-more{
597
+ display: block;
598
+ float: left;
599
+ clear: both;
600
+ /*position: absolute;
601
+ bottom: -40px;*/
602
+ }
603
+ @media (max-width: 780px){
604
+ #cff.cff-masonry .cff-item, /* 3 cols */
605
+ #cff.cff-masonry.masonry-2-desktop .cff-item,
606
+ #cff.cff-masonry.masonry-4-desktop .cff-item,
607
+ #cff.cff-masonry.masonry-5-desktop .cff-item,
608
+ #cff.cff-masonry.masonry-6-desktop .cff-item,
609
+ #cff.cff-masonry .cff-likebox{
610
+ width: 100%;
611
+ margin: 0;
612
+ }
613
+ #cff.cff-masonry.masonry-2-mobile .cff-item{
614
+ width: 47%;
615
+ margin-left: 1.5%;
616
+ margin-right: 1.5%;
617
+ }
618
+ }
619
+
620
+ /* --- Begin Pure CSS Masonry Columns Layout --- */
621
+ #cff.cff-masonry.cff-masonry-css {
622
+ width: 100%;
623
+ overflow: hidden;
624
+ margin-bottom: 20px;
625
+ }
626
+ #cff.cff-masonry.cff-masonry-css {
627
+ -webkit-column-gap: 20px;
628
+ -moz-column-gap: 20px;
629
+ column-gap: 20px;
630
+ -webkit-column-fill: auto;
631
+ column-fill: unset;
632
+
633
+ -webkit-column-count: 3;
634
+ -moz-column-count: 3;
635
+ column-count: 3;
636
+ margin: 0;
637
+ }
638
+ /* --- Widths & Media --- */
639
+ #cff.cff-masonry.cff-masonry-css.masonry-2-desktop {
640
+ -webkit-column-count: 2;
641
+ -moz-column-count: 2;
642
+ column-count: 2;
643
+ margin: 0;
644
+ }
645
+ #cff.cff-masonry.cff-masonry-css.masonry-4-desktop {
646
+ -webkit-column-count: 4;
647
+ -moz-column-count: 4;
648
+ column-count: 4;
649
+ margin: 0;
650
+ }
651
+ #cff.cff-masonry.cff-masonry-css.masonry-5-desktop {
652
+ -webkit-column-count: 5;
653
+ -moz-column-count: 5;
654
+ column-count: 5;
655
+ margin: 0;
656
+ }
657
+ #cff.cff-masonry.cff-masonry-css.masonry-6-desktop {
658
+ -webkit-column-count: 6;
659
+ -moz-column-count: 6;
660
+ column-count: 6;
661
+ margin: 0;
662
+ }
663
+ #cff.cff-masonry.cff-masonry-css .cff-item,
664
+ #cff.cff-masonry.cff-masonry-css.masonry-2-desktop .cff-item,
665
+ #cff.cff-masonry.cff-masonry-css.masonry-4-desktop .cff-item,
666
+ #cff.cff-masonry.cff-masonry-css.masonry-5-desktop .cff-item,
667
+ #cff.cff-masonry.cff-masonry-css.masonry-6-desktop .cff-item,
668
+ #cff.cff-masonry.cff-masonry-css .cff-likebox {
669
+ float: none;
670
+ display: inline-block;
671
+ width: 100%;
672
+ margin: 0 0 12px 0;
673
+ }
674
+ #cff.cff-masonry.cff-masonry-css .cff-likebox {
675
+ width: 99.5%;
676
+ }
677
+ /* Load more button */
678
+ #cff.cff-masonry.cff-masonry-css .cff-load-more{
679
+ margin: 0 0 10px 0;
680
+ position: relative;
681
+ bottom: 0;
682
+ }
683
+ @media only screen and ( max-width: 780px ) {
684
+ #cff.cff-masonry.cff-masonry-css,
685
+ #cff.cff-masonry.cff-masonry-css.masonry-2-desktop,
686
+ #cff.cff-masonry.cff-masonry-css.masonry-4-desktop,
687
+ #cff.cff-masonry.cff-masonry-css.masonry-5-desktop,
688
+ #cff.cff-masonry.cff-masonry-css.masonry-6-desktop {
689
+ -webkit-column-count: 1;
690
+ -moz-column-count: 1;
691
+ column-count: 1;
692
+ }
693
+ #cff.cff-masonry.cff-masonry-css.masonry-2-mobile {
694
+ -webkit-column-count: 2;
695
+ -moz-column-count: 2;
696
+ column-count: 2;
697
+ margin: 0;
698
+ }
699
+ #cff.cff-masonry.cff-masonry-css.masonry-2-mobile .cff-item,
700
+ #cff.cff-masonry.cff-masonry-css.masonry-2-mobile {
701
+ width: 100%;
702
+ }
703
+ }
704
+ /* --- End Pure CSS Masonry Columns Layout --- */
705
+
706
+ /* Disable masonry layout in 1 col mobile */
707
+ #cff.cff-disable-masonry{
708
+ height: auto !important;
709
+ }
710
+ #cff.cff-disable-masonry .cff-item,
711
+ #cff.cff-disable-masonry .cff-likebox{
712
+ position: relative !important;
713
+ top: auto !important;
714
  }
custom-facebook-feed-admin.php CHANGED
@@ -111,7 +111,7 @@ function cff_settings_page() {
111
 
112
  <div id="cff-admin" class="wrap">
113
  <div id="header">
114
- <h2><?php _e('Custom Facebook Feed Settings', 'custom-facebook-feed'); ?></h2>
115
  </div>
116
 
117
  <?php
@@ -671,7 +671,9 @@ function cff_settings_page() {
671
  <p>Find out how to display <a href="https://smashballoon.com/using-shortcode-options-customize-facebook-feeds/?utm_source=plugin-free&utm_campaign=cff" target="_blank"><b>multiple feeds</b></a>.</p>
672
  </div>
673
 
674
- <a href="https://smashballoon.com/custom-facebook-feed/demo/?utm_source=plugin-free&utm_campaign=cff" target="_blank" class="cff-pro-notice"><img src="<?php echo plugins_url( 'img/pro.png' , __FILE__ ) ?>" /></a>
 
 
675
 
676
  <div class="cff-share-plugin">
677
  <h3><?php _e('Like the plugin? Help spread the word!', 'custom-facebook-feed'); ?></h3>
@@ -779,6 +781,8 @@ Feed Height => <?php echo $options[ 'cff_feed_height' ] ."\n"; ?>
779
  Feed Padding => <?php echo $options[ 'cff_feed_padding' ] ."\n"; ?>
780
  Feed BG Color => <?php echo $options[ 'cff_bg_color' ] ."\n"; ?>
781
  CSS Class => <?php echo $options[ 'cff_class' ] ."\n"; ?>
 
 
782
 
783
  ## HEADER: ##
784
  Show Header => <?php echo $options[ 'cff_show_header' ] ."\n"; ?>
@@ -1098,6 +1102,8 @@ function cff_style_page() {
1098
  'cff_disable_styles' => false,
1099
  'cff_format_issue' => false,
1100
  'cff_restricted_page' => false,
 
 
1101
 
1102
  //New
1103
  'cff_custom_css' => '',
@@ -1321,6 +1327,8 @@ function cff_style_page() {
1321
  $cff_format_issue = $options[ 'cff_format_issue' ];
1322
  $cff_restricted_page = $options[ 'cff_restricted_page' ];
1323
  $cff_minify = $options[ 'cff_minify' ];
 
 
1324
 
1325
  //Page Header
1326
  $cff_show_header = $options[ 'cff_show_header' ];
@@ -1377,6 +1385,8 @@ function cff_style_page() {
1377
  if (isset($_POST[ 'cff_feed_padding' ]) ) $cff_feed_padding = sanitize_text_field( $_POST[ 'cff_feed_padding' ] );
1378
  if (isset($_POST[ 'cff_bg_color' ]) ) $cff_bg_color = sanitize_text_field( $_POST[ 'cff_bg_color' ] );
1379
  if (isset($_POST[ 'cff_class' ]) ) $cff_class = sanitize_text_field( $_POST[ 'cff_class' ] );
 
 
1380
 
1381
  //Page Header
1382
  (isset($_POST[ 'cff_show_header' ])) ? $cff_show_header = sanitize_text_field( $_POST[ 'cff_show_header' ] ) : $cff_show_header = '';
@@ -1418,6 +1428,8 @@ function cff_style_page() {
1418
  $options[ 'cff_feed_padding' ] = $cff_feed_padding;
1419
  $options[ 'cff_bg_color' ] = $cff_bg_color;
1420
  $options[ 'cff_class' ] = $cff_class;
 
 
1421
 
1422
  //Page Header
1423
  $options[ 'cff_show_header' ] = $cff_show_header;
@@ -1838,7 +1850,7 @@ function cff_style_page() {
1838
 
1839
  <div id="cff-admin" class="wrap">
1840
  <div id="header">
1841
- <h2><?php _e('Custom Facebook Feed Settings', 'custom-facebook-feed'); ?></h2>
1842
  </div>
1843
 
1844
  <form name="form1" method="post" action="">
@@ -1924,6 +1936,35 @@ function cff_style_page() {
1924
  <p class="cff-tooltip cff-more-info"><?php _e("You can add your own CSS classes to the feed here. To add multiple classes separate each with a space, Eg. classone classtwo classthree"); ?></p>
1925
  </td>
1926
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1927
  </tbody>
1928
  </table>
1929
 
@@ -2336,7 +2377,7 @@ function cff_style_page() {
2336
  </div>
2337
 
2338
 
2339
- <a href="https://smashballoon.com/custom-facebook-feed/demo/?utm_source=plugin-free&utm_campaign=cff" target="_blank" class="cff-pro-notice"><img src="<?php echo plugins_url( 'img/pro.png' , __FILE__ ) ?>" /></a>
2340
 
2341
  <?php } //End General tab ?>
2342
  <?php if( $cff_active_tab == 'post_layout' ) { //Start Post Layout tab ?>
@@ -4037,81 +4078,278 @@ function cff_cron_clear_cache() {
4037
 
4038
 
4039
 
4040
- //REVIEW REQUEST NOTICE
 
 
4041
 
4042
- // checks $_GET to see if the nag variable is set and what it's value is
4043
- function cff_check_nag_get( $get, $nag, $option, $transient ) {
4044
- if ( isset( $_GET[$nag] ) && $get[$nag] == 1 ) {
4045
- update_option( $option, 'dismissed' );
4046
- } elseif ( isset( $_GET[$nag] ) && $get[$nag] == 'later' ) {
4047
- $time = 2 * WEEK_IN_SECONDS;
4048
- set_transient( $transient, 'waiting', $time );
4049
- update_option( $option, 'pending' );
4050
- }
4051
  }
4052
 
4053
- // will set a transient if the notice hasn't been dismissed or hasn't been set yet
4054
- function cff_maybe_set_transient( $transient, $option ) {
4055
- $cff_rating_notice_waiting = get_transient( $transient );
4056
- $notice_status = get_option( $option, false );
4057
 
4058
- if ( ! $cff_rating_notice_waiting && !( $notice_status === 'dismissed' || $notice_status === 'pending' ) ) {
4059
- $time = 2 * WEEK_IN_SECONDS;
4060
- set_transient( $transient, 'waiting', $time );
4061
- update_option( $option, 'pending' );
4062
  }
4063
- }
4064
-
4065
- // generates the html for the admin notice
4066
- function cff_rating_notice_html() {
4067
 
4068
  //Only show to admins
4069
- if ( current_user_can( 'manage_options' ) ){
 
 
 
 
 
 
4070
 
 
 
4071
  global $current_user;
4072
  $user_id = $current_user->ID;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4073
 
4074
  /* Check that the user hasn't already clicked to ignore the message */
4075
- if ( ! get_user_meta( $user_id, 'cff_ignore_rating_notice') ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4076
 
4077
- _e("
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4078
  <div class='cff_notice cff_review_notice'>
4079
- <img src='". plugins_url( 'custom-facebook-feed/img/cff-icon.png' ) ."' alt='Custom Facebook Feed'>
4080
  <div class='cff-notice-text'>
4081
- <p>It's great to see that you've been using the <strong>Custom Facebook Feed</strong> plugin for a while now. Hopefully you're happy with it!&nbsp; If so, would you consider leaving a positive review? It really helps to support the plugin and helps others to discover it too!</p>
4082
- <p class='cff-links'>
4083
- <a class='cff_notice_dismiss' href='https://wordpress.org/support/plugin/custom-facebook-feed/reviews/' target='_blank'>Sure, I'd love to!</a>
4084
  &middot;
4085
- <a class='cff_notice_dismiss' href='" .esc_url( add_query_arg( 'cff_ignore_rating_notice_nag', '1' ) ). "'>No thanks</a>
4086
  &middot;
4087
- <a class='cff_notice_dismiss' href='" .esc_url( add_query_arg( 'cff_ignore_rating_notice_nag', '1' ) ). "'>I've already given a review</a>
4088
  &middot;
4089
- <a class='cff_notice_dismiss' href='" .esc_url( add_query_arg( 'cff_ignore_rating_notice_nag', 'later' ) ). "'>Ask Me Later</a>
4090
- </p>
4091
- </div>
4092
- <a class='cff_notice_close' href='" .esc_url( add_query_arg( 'cff_ignore_rating_notice_nag', '1' ) ). "'><i class='fa fa-close'></i></a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4093
  </div>
4094
- ");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4095
 
4096
  }
 
4097
 
 
 
 
 
 
 
 
 
4098
  }
 
4099
  }
 
 
 
 
 
 
 
 
4100
 
4101
- // variables to define certain terms
4102
- $transient = 'custom_facebook_rating_notice_waiting';
4103
- $option = 'cff_rating_notice';
4104
- $nag = 'cff_ignore_rating_notice_nag';
4105
 
4106
- cff_check_nag_get( $_GET, $nag, $option, $transient );
4107
- cff_maybe_set_transient( $transient, $option );
4108
- $notice_status = get_option( $option, false );
 
4109
 
4110
- // only display the notice if the time offset has passed and the user hasn't already dismissed it
4111
- if ( get_transient( $transient ) !== 'waiting' && $notice_status !== 'dismissed' ) {
4112
- add_action( 'admin_notices', 'cff_rating_notice_html' );
4113
  }
4114
- //Uncomment below to show notice
4115
- // add_action( 'admin_notices', 'cff_rating_notice_html' );
 
4116
 
4117
  ?>
111
 
112
  <div id="cff-admin" class="wrap">
113
  <div id="header">
114
+ <h1><?php _e('Custom Facebook Feed', 'custom-facebook-feed'); ?></h1>
115
  </div>
116
 
117
  <?php
671
  <p>Find out how to display <a href="https://smashballoon.com/using-shortcode-options-customize-facebook-feeds/?utm_source=plugin-free&utm_campaign=cff" target="_blank"><b>multiple feeds</b></a>.</p>
672
  </div>
673
 
674
+ <a href="https://smashballoon.com/custom-facebook-feed/demo/?utm_source=plugin-free&utm_campaign=cff" target="_blank" class="cff-pro-notice"><img src="<?php echo plugins_url( 'img/pro.png?2019' , __FILE__ ) ?>" /></a>
675
+
676
+ <p class="cff_plugins_promo dashicons-before dashicons-admin-plugins"> <?php _e('Check out our other free plugins: <a href="https://wordpress.org/plugins/instagram-feed/" target="_blank">Instagram</a> and <a href="https://wordpress.org/plugins/custom-twitter-feeds/" target="_blank">Twitter</a>.', 'instagram-feed' ); ?></p>
677
 
678
  <div class="cff-share-plugin">
679
  <h3><?php _e('Like the plugin? Help spread the word!', 'custom-facebook-feed'); ?></h3>
781
  Feed Padding => <?php echo $options[ 'cff_feed_padding' ] ."\n"; ?>
782
  Feed BG Color => <?php echo $options[ 'cff_bg_color' ] ."\n"; ?>
783
  CSS Class => <?php echo $options[ 'cff_class' ] ."\n"; ?>
784
+ Feed Columns => <?php echo $options['cff_cols'] ."\n"; ?>
785
+ Mobile Columns => <?php echo $options['cff_cols_mobile'] ."\n"; ?>
786
 
787
  ## HEADER: ##
788
  Show Header => <?php echo $options[ 'cff_show_header' ] ."\n"; ?>
1102
  'cff_disable_styles' => false,
1103
  'cff_format_issue' => false,
1104
  'cff_restricted_page' => false,
1105
+ 'cff_cols' => 1,
1106
+ 'cff_cols_mobile' => 1,
1107
 
1108
  //New
1109
  'cff_custom_css' => '',
1327
  $cff_format_issue = $options[ 'cff_format_issue' ];
1328
  $cff_restricted_page = $options[ 'cff_restricted_page' ];
1329
  $cff_minify = $options[ 'cff_minify' ];
1330
+ $cff_cols = $options[ 'cff_cols' ];
1331
+ $cff_cols_mobile = $options[ 'cff_cols_mobile' ];
1332
 
1333
  //Page Header
1334
  $cff_show_header = $options[ 'cff_show_header' ];
1385
  if (isset($_POST[ 'cff_feed_padding' ]) ) $cff_feed_padding = sanitize_text_field( $_POST[ 'cff_feed_padding' ] );
1386
  if (isset($_POST[ 'cff_bg_color' ]) ) $cff_bg_color = sanitize_text_field( $_POST[ 'cff_bg_color' ] );
1387
  if (isset($_POST[ 'cff_class' ]) ) $cff_class = sanitize_text_field( $_POST[ 'cff_class' ] );
1388
+ if (isset($_POST[ 'cff_cols' ])) $cff_cols = sanitize_text_field( $_POST[ 'cff_cols' ] );
1389
+ if (isset($_POST[ 'cff_cols_mobile' ])) $cff_cols_mobile = sanitize_text_field( $_POST[ 'cff_cols_mobile' ] );
1390
 
1391
  //Page Header
1392
  (isset($_POST[ 'cff_show_header' ])) ? $cff_show_header = sanitize_text_field( $_POST[ 'cff_show_header' ] ) : $cff_show_header = '';
1428
  $options[ 'cff_feed_padding' ] = $cff_feed_padding;
1429
  $options[ 'cff_bg_color' ] = $cff_bg_color;
1430
  $options[ 'cff_class' ] = $cff_class;
1431
+ $options[ 'cff_cols' ] = $cff_cols;
1432
+ $options[ 'cff_cols_mobile' ] = $cff_cols_mobile;
1433
 
1434
  //Page Header
1435
  $options[ 'cff_show_header' ] = $cff_show_header;
1850
 
1851
  <div id="cff-admin" class="wrap">
1852
  <div id="header">
1853
+ <h1><?php _e('Custom Facebook Feed', 'custom-facebook-feed'); ?></h1>
1854
  </div>
1855
 
1856
  <form name="form1" method="post" action="">
1936
  <p class="cff-tooltip cff-more-info"><?php _e("You can add your own CSS classes to the feed here. To add multiple classes separate each with a space, Eg. classone classtwo classthree"); ?></p>
1937
  </td>
1938
  </tr>
1939
+
1940
+ <tr valign="top">
1941
+ <th class="bump-left" scope="row"><label for="cff_cols">Feed Columns</label><code class="cff_shortcode"> cols
1942
+ Eg: cols=3</code></th>
1943
+ <td class="cff-short">
1944
+ <select name="cff_cols" id="cff_cols">
1945
+ <option value="1" <?php if( $cff_cols == 1 ) { echo 'selected'; } ?>>1</option>
1946
+ <option value="2" <?php if( $cff_cols == 2 ) { echo 'selected'; } ?>>2</option>
1947
+ <option value="3" <?php if( $cff_cols == 3 ) { echo 'selected'; } ?>>3</option>
1948
+ <option value="4" <?php if( $cff_cols == 4 ) { echo 'selected'; } ?>>4</option>
1949
+ <option value="5" <?php if( $cff_cols == 5 ) { echo 'selected'; } ?>>5</option>
1950
+ <option value="6" <?php if( $cff_cols == 6 ) { echo 'selected'; } ?>>6</option>
1951
+ </select>
1952
+
1953
+ <br />
1954
+ <div class="cff-mobile-col-settings" <?php if( intval($cff_cols) > 1 ) echo 'style="display:block;"' ?>>
1955
+ <div class="cff-row">
1956
+ <label title="Click for shortcode option">Mobile Columns:</label><code class="cff_shortcode"> colsmobile
1957
+ Eg: colsmobile=2</code>
1958
+ <select name="cff_cols_mobile" id="cff_cols_mobile">
1959
+ <option value="1" <?php if( $cff_cols_mobile == 1 ) { echo 'selected'; } ?>>1</option>
1960
+ <option value="2" <?php if( $cff_cols_mobile == 2 ) { echo 'selected'; } ?>>2</option>
1961
+ </select>
1962
+ </div>
1963
+ </div>
1964
+
1965
+ </td>
1966
+ </tr>
1967
+
1968
  </tbody>
1969
  </table>
1970
 
2377
  </div>
2378
 
2379
 
2380
+ <a href="https://smashballoon.com/custom-facebook-feed/demo/?utm_source=plugin-free&utm_campaign=cff" target="_blank" class="cff-pro-notice"><img src="<?php echo plugins_url( 'img/pro.png?2019' , __FILE__ ) ?>" /></a>
2381
 
2382
  <?php } //End General tab ?>
2383
  <?php if( $cff_active_tab == 'post_layout' ) { //Start Post Layout tab ?>
4078
 
4079
 
4080
 
4081
+ //NOTICES
4082
+ function cff_get_current_time() {
4083
+ $current_time = time();
4084
 
4085
+ // where to do tests
4086
+ // $current_time = strtotime( 'November 25, 2020' );
4087
+
4088
+ return $current_time;
 
 
 
 
 
4089
  }
4090
 
4091
+ // generates the html for the admin notices
4092
+ function cff_notices_html() {
 
 
4093
 
4094
+ //Don't show notices if Instagram notices are being shown
4095
+ if ( function_exists( 'sbi_notices_html' ) ) {
4096
+ return;
 
4097
  }
 
 
 
 
4098
 
4099
  //Only show to admins
4100
+ if ( ! current_user_can( 'manage_options' ) ) {
4101
+ return;
4102
+ }
4103
+
4104
+ $cff_statuses_option = get_option( 'cff_statuses', array() );
4105
+ $current_time = cff_get_current_time();
4106
+ $cff_bfcm_discount_code = 'happysmashgiving' . date('Y', $current_time );
4107
 
4108
+ // reset everything for testing
4109
+ if ( false ) {
4110
  global $current_user;
4111
  $user_id = $current_user->ID;
4112
+ // delete_user_meta( $user_id, 'cff_ignore_bfcm_sale_notice' );
4113
+ //delete_user_meta( $user_id, 'cff_ignore_new_user_sale_notice' );
4114
+ // $cff_statuses_option = array( 'first_install' => strtotime( 'December 8, 2017' ) );
4115
+ //$cff_statuses_option = array( 'first_install' => time() );
4116
+
4117
+ //update_option( 'cff_statuses', $cff_statuses_option, false );
4118
+ //delete_option( 'cff_rating_notice');
4119
+ //delete_transient( 'custom_facebook_rating_notice_waiting' );
4120
+
4121
+ // set_transient( 'custom_facebook_rating_notice_waiting', 'waiting', 2 * WEEK_IN_SECONDS );
4122
+ delete_transient('custom_facebook_rating_notice_waiting');
4123
+ update_option( 'cff_rating_notice', 'pending', false );
4124
+ }
4125
+
4126
+ //$cff_statuses_option['rating_notice_dismissed'] = time();
4127
+ //update_option( 'cff_statuses', $cff_statuses_option, false );
4128
+ // rating notice logic
4129
+ $cff_rating_notice_option = get_option( 'cff_rating_notice', false );
4130
+ $cff_rating_notice_waiting = get_transient( 'custom_facebook_rating_notice_waiting' );
4131
+ $should_show_rating_notice = ($cff_rating_notice_waiting !== 'waiting' && $cff_rating_notice_option !== 'dismissed');
4132
+
4133
+ // black friday cyber monday logic
4134
+ $thanksgiving_this_year = cff_get_future_date( 11, date('Y', $current_time ), 4, 4, 1 );
4135
+ $one_week_before_black_friday_this_year = $thanksgiving_this_year - 7*24*60*60;
4136
+ $one_day_after_cyber_monday_this_year = $thanksgiving_this_year + 5*24*60*60;
4137
+ $has_been_two_days_since_rating_dismissal = isset( $cff_statuses_option['rating_notice_dismissed'] ) ? ((int)$cff_statuses_option['rating_notice_dismissed'] + 2*24*60*60) < $current_time : true;
4138
+
4139
+ $could_show_bfcm_discount = ($current_time > $one_week_before_black_friday_this_year && $current_time < $one_day_after_cyber_monday_this_year);
4140
+ $should_show_bfcm_discount = false;
4141
+ if ( $could_show_bfcm_discount && $has_been_two_days_since_rating_dismissal ) {
4142
+ global $current_user;
4143
+ $user_id = $current_user->ID;
4144
+
4145
+ $ignore_bfcm_sale_notice_meta = get_user_meta( $user_id, 'cff_ignore_bfcm_sale_notice' );
4146
+ $ignore_bfcm_sale_notice_meta = isset( $ignore_bfcm_sale_notice_meta[0] ) ? $ignore_bfcm_sale_notice_meta[0] : '';
4147
 
4148
  /* Check that the user hasn't already clicked to ignore the message */
4149
+ $should_show_bfcm_discount = ($ignore_bfcm_sale_notice_meta !== 'always' && $ignore_bfcm_sale_notice_meta !== date( 'Y', $current_time ));
4150
+ }
4151
+
4152
+ // new user discount logic
4153
+ $in_new_user_month_range = true;
4154
+ $should_show_new_user_discount = false;
4155
+ $has_been_one_month_since_rating_dismissal = isset( $cff_statuses_option['rating_notice_dismissed'] ) ? ((int)$cff_statuses_option['rating_notice_dismissed'] + 30*24*60*60) < $current_time + 1: true;
4156
+
4157
+ if ( isset( $cff_statuses_option['first_install'] ) && $cff_statuses_option['first_install'] === 'from_update' ) {
4158
+ global $current_user;
4159
+ $user_id = $current_user->ID;
4160
+ $ignore_new_user_sale_notice_meta = get_user_meta( $user_id, 'cff_ignore_new_user_sale_notice' );
4161
+ $ignore_new_user_sale_notice_meta = isset( $ignore_new_user_sale_notice_meta[0] ) ? $ignore_new_user_sale_notice_meta[0] : '';
4162
+
4163
+ if ( $ignore_new_user_sale_notice_meta !== 'always' ) {
4164
+ $should_show_new_user_discount = true;
4165
+ }
4166
+ } elseif ( $in_new_user_month_range && $has_been_one_month_since_rating_dismissal ) {
4167
+ global $current_user;
4168
+ $user_id = $current_user->ID;
4169
+ $ignore_new_user_sale_notice_meta = get_user_meta( $user_id, 'cff_ignore_new_user_sale_notice' );
4170
+ $ignore_new_user_sale_notice_meta = isset( $ignore_new_user_sale_notice_meta[0] ) ? $ignore_new_user_sale_notice_meta[0] : '';
4171
+
4172
+ if ( $ignore_new_user_sale_notice_meta !== 'always'
4173
+ && isset( $cff_statuses_option['first_install'] )
4174
+ && $current_time > (int)$cff_statuses_option['first_install'] + 60*60*24*30 ) {
4175
+ $should_show_new_user_discount = true;
4176
+ }
4177
+ }
4178
+
4179
+ // for debugging
4180
+ if ( false ) {
4181
+ global $current_user;
4182
+ $user_id = $current_user->ID;
4183
+ $ignore_bfcm_sale_notice_meta = get_user_meta( $user_id, 'cff_ignore_bfcm_sale_notice' );
4184
+ $ignore_new_user_sale_notice_meta = get_user_meta( $user_id, 'cff_ignore_new_user_sale_notice' );
4185
+
4186
+ var_dump( 'new user rating option', $cff_rating_notice_option );
4187
+ var_dump( 'new user rating transient', $cff_rating_notice_waiting );
4188
+
4189
+ var_dump( 'should show new user rating notice?', $should_show_rating_notice );
4190
 
4191
+ var_dump( 'new user discount month range?', $in_new_user_month_range );
4192
+ var_dump( 'should show new user discount?', $should_show_new_user_discount );
4193
+
4194
+ var_dump( 'Thanksgiving this year?', date('m/d/Y', $thanksgiving_this_year ) );
4195
+
4196
+ var_dump( 'could show bfcm discount?', $could_show_bfcm_discount );
4197
+ var_dump( 'should show bfcm discount?', $should_show_bfcm_discount );
4198
+
4199
+ var_dump( 'ignore_bfcm_sale_notice_meta', $ignore_bfcm_sale_notice_meta );
4200
+ var_dump( 'ignore_new_user_sale_notice_meta', $ignore_new_user_sale_notice_meta );
4201
+
4202
+ var_dump( $cff_statuses_option );
4203
+ }
4204
+
4205
+
4206
+ if ( $should_show_rating_notice ) {
4207
+ $other_notice_html = '';
4208
+ $dismiss_url = add_query_arg( 'cff_ignore_rating_notice_nag', '1' );
4209
+ $later_url = add_query_arg( 'cff_ignore_rating_notice_nag', 'later' );
4210
+ if ( $should_show_bfcm_discount ) {
4211
+ $other_notice_html = '<p class="cff_other_notice">' . __( 'PS. We currently have a Black Friday/Cyber Monday deal going on for <b>20% off</b> the Pro version of the plugin.', 'custom-facebook-feed' ) . '<a href="https://smashballoon.com/custom-facebook-feed/?utm_source=plugin-free&utm_campaign=cff&discount='.$cff_bfcm_discount_code.'" target="_blank" class="cff_offer_btn">' . __( 'Get this deal!', 'custom-facebook-feed' ) . '</a></p>';
4212
+
4213
+ $dismiss_url = add_query_arg( array(
4214
+ 'cff_ignore_rating_notice_nag' => '1',
4215
+ 'cff_ignore_bfcm_sale_notice' => date( 'Y', $current_time )
4216
+ )
4217
+ );
4218
+ $later_url = add_query_arg( array(
4219
+ 'cff_ignore_rating_notice_nag' => 'later',
4220
+ 'cff_ignore_bfcm_sale_notice' => date( 'Y', $current_time )
4221
+ )
4222
+ );
4223
+ }
4224
+
4225
+ echo"
4226
  <div class='cff_notice cff_review_notice'>
4227
+ <img src='" . plugins_url( 'img/cff-icon.png' , __FILE__ ) . "' alt='" . __( 'Custom Facebook Feed', 'custom-facebook-feed' ) . "'>
4228
  <div class='cff-notice-text'>
4229
+ <p>" . __( "It's great to see that you've been using the <strong>Smash Balloon Custom Facebook Feed</strong> plugin for a while now. Hopefully you like it! If so, would you consider leaving a positive review? It really helps support the plugin and helps others to discover it too!", 'custom-facebook-feed' ) . "</p>
4230
+ <p class='links'>
4231
+ <a class='cff_notice_dismiss' style='margin-left:-8px;' href='https://wordpress.org/support/plugin/custom-facebook-feed/reviews/' target='_blank'>" . __( 'Sure, I\'d love to!', 'custom-facebook-feed' ) . "</a>
4232
  &middot;
4233
+ <a class='cff_notice_dismiss' href='" .esc_url( $dismiss_url ). "'>" . __( 'No thanks', 'custom-facebook-feed' ) . "</a>
4234
  &middot;
4235
+ <a class='cff_notice_dismiss' href='" .esc_url( $dismiss_url ). "'>" . __( 'I\'ve already given a review', 'custom-facebook-feed' ) . "</a>
4236
  &middot;
4237
+ <a class='cff_notice_dismiss' href='" .esc_url( $later_url ). "'>" . __( 'Ask Me Later', 'custom-facebook-feed' ) . "</a>
4238
+ </p>"
4239
+ . $other_notice_html .
4240
+ "</div>
4241
+ <a class='cff_notice_close' href='" .esc_url( $dismiss_url ). "'><i class='fa fa-close'></i></a>
4242
+ </div>";
4243
+
4244
+ } elseif ( $should_show_new_user_discount ) {
4245
+ global $current_user;
4246
+ $user_id = $current_user->ID;
4247
+ $ignore_new_user_sale_notice_meta = get_user_meta( $user_id, 'cff_ignore_new_user_sale_notice' );
4248
+ if ( $ignore_new_user_sale_notice_meta !== 'always' ) {
4249
+
4250
+ echo "
4251
+ <div class='cff_notice cff_review_notice cff_new_user_sale_notice'>
4252
+ <img src='" . plugins_url( 'img/cff-icon-offer.png' , __FILE__ ) . "' alt='Facebook Feed'>
4253
+ <div class='cff-notice-text'>
4254
+ <p>" . __( '<b style="font-weight: 700;">Exclusive offer!</b> We don\'t run promotions very often, but for a limited time we\'re offering <b style="font-weight: 700;">20% off</b> our Pro version to all users of our free Smash Balloon Custom Facebook Feed plugin.', 'custom-facebook-feed' ) . "</p>
4255
+ <p class='links'>
4256
+ <a class='cff_notice_dismiss cff_offer_btn' href='https://smashballoon.com/custom-facebook-feed/?utm_source=plugin-free&utm_campaign=cff&discount=facebookthankyou' target='_blank'><b>" . __( 'Get this offer', 'custom-facebook-feed' ) . "</b></a>
4257
+ <a class='cff_notice_dismiss' style='margin-left: 5px;' href='" . esc_url( add_query_arg( 'cff_ignore_new_user_sale_notice', 'always' ) ) . "'>" . __( 'I\'m not interested', 'custom-facebook-feed' ) . "</a>
4258
+
4259
+ </p>
4260
+ </div>
4261
+ <a class='cff_new_user_sale_notice_close' href='" . esc_url( add_query_arg( 'cff_ignore_new_user_sale_notice', 'always' ) ) . "'><i class='fa fa-close'></i></a>
4262
+ </div>
4263
+ ";
4264
+ }
4265
+
4266
+ } elseif ( $should_show_bfcm_discount ) {
4267
+
4268
+ echo "
4269
+ <div class='cff_notice cff_review_notice cff_bfcm_sale_notice'>
4270
+ <img src='". plugins_url( 'img/cff-icon-offer.png' , __FILE__ ) ."' alt='Facebook Feed'>
4271
+ <div class='cff-notice-text'>
4272
+ <p>" . __( '<b style="font-weight: 700;">Black Friday/Cyber Monday Deal!</b> Thank you for using the free Smash Balloon Custom Facebook Feed plugin. For a limited time, we\'re offering <b style="font-weight: 700;">20% off</b> the Pro version for all of our users.', 'custom-facebook-feed' ) . "</p>
4273
+ <p class='links'>
4274
+ <a class='cff_notice_dismiss cff_offer_btn' href='https://smashballoon.com/custom-facebook-feed/?utm_source=plugin-free&utm_campaign=cff&discount=".$cff_bfcm_discount_code."' target='_blank'><b>" . __( 'Get this offer', 'custom-facebook-feed' ) . "</b></a>
4275
+ <a class='cff_notice_dismiss' style='margin-left: 5px;' href='" .esc_url( add_query_arg( 'cff_ignore_bfcm_sale_notice', date( 'Y', $current_time ) ) ). "'>" . __( 'I\'m not interested', 'custom-facebook-feed' ) . "</a>
4276
+ </p>
4277
  </div>
4278
+ <a class='cff_bfcm_sale_notice_close' href='" .esc_url( add_query_arg( 'cff_ignore_bfcm_sale_notice', date( 'Y', $current_time ) ) ). "'><i class='fa fa-close'></i></a>
4279
+ </div>
4280
+ ";
4281
+
4282
+ }
4283
+
4284
+ }
4285
+ add_action( 'admin_notices', 'cff_notices_html', 10 );
4286
+
4287
+ function cff_process_nags() {
4288
+
4289
+ global $current_user;
4290
+ $user_id = $current_user->ID;
4291
+ $cff_statuses_option = get_option( 'cff_statuses', array() );
4292
+
4293
+ if ( isset( $_GET['cff_ignore_rating_notice_nag'] ) ) {
4294
+ if ( (int)$_GET['cff_ignore_rating_notice_nag'] === 1 ) {
4295
+ update_option( 'cff_rating_notice', 'dismissed', false );
4296
+ $cff_statuses_option['rating_notice_dismissed'] = cff_get_current_time();
4297
+ update_option( 'cff_statuses', $cff_statuses_option, false );
4298
+
4299
+ } elseif ( $_GET['cff_ignore_rating_notice_nag'] === 'later' ) {
4300
+ set_transient( 'custom_facebook_rating_notice_waiting', 'waiting', 2 * WEEK_IN_SECONDS );
4301
+ update_option( 'cff_rating_notice', 'pending', false );
4302
+ }
4303
+ }
4304
+
4305
+ if ( isset( $_GET['cff_ignore_new_user_sale_notice'] ) ) {
4306
+ $response = sanitize_text_field( $_GET['cff_ignore_new_user_sale_notice'] );
4307
+ if ( $response === 'always' ) {
4308
+ update_user_meta( $user_id, 'cff_ignore_new_user_sale_notice', 'always' );
4309
+
4310
+ $current_month_number = (int)date('n', cff_get_current_time() );
4311
+ $not_early_in_the_year = ($current_month_number > 5);
4312
+
4313
+ if ( $not_early_in_the_year ) {
4314
+ update_user_meta( $user_id, 'cff_ignore_bfcm_sale_notice', date( 'Y', cff_get_current_time() ) );
4315
+ }
4316
 
4317
  }
4318
+ }
4319
 
4320
+ if ( isset( $_GET['cff_ignore_bfcm_sale_notice'] ) ) {
4321
+ $response = sanitize_text_field( $_GET['cff_ignore_bfcm_sale_notice'] );
4322
+ if ( $response === 'always' ) {
4323
+ update_user_meta( $user_id, 'cff_ignore_bfcm_sale_notice', 'always' );
4324
+ } elseif ( $response === date( 'Y', cff_get_current_time() ) ) {
4325
+ update_user_meta( $user_id, 'cff_ignore_bfcm_sale_notice', date( 'Y', cff_get_current_time() ) );
4326
+ }
4327
+ update_user_meta( $user_id, 'cff_ignore_new_user_sale_notice', 'always' );
4328
  }
4329
+
4330
  }
4331
+ add_action( 'admin_init', 'cff_process_nags' );
4332
+
4333
+ function cff_get_future_date( $month, $year, $week, $day, $direction ) {
4334
+ if ( $direction > 0 ) {
4335
+ $startday = 1;
4336
+ } else {
4337
+ $startday = date( 't', mktime(0, 0, 0, $month, 1, $year ) );
4338
+ }
4339
 
4340
+ $start = mktime( 0, 0, 0, $month, $startday, $year );
4341
+ $weekday = date( 'N', $start );
 
 
4342
 
4343
+ $offset = 0;
4344
+ if ( $direction * $day >= $direction * $weekday ) {
4345
+ $offset = -$direction * 7;
4346
+ }
4347
 
4348
+ $offset += $direction * ($week * 7) + ($day - $weekday);
4349
+ return mktime( 0, 0, 0, $month, $startday + $offset, $year );
 
4350
  }
4351
+
4352
+
4353
+
4354
 
4355
  ?>
custom-facebook-feed.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  /*
3
- Plugin Name: Custom Facebook Feed
4
  Plugin URI: https://smashballoon.com/custom-facebook-feed
5
  Description: Add completely customizable Facebook feeds to your WordPress site
6
- Version: 2.10
7
  Author: Smash Balloon
8
  Author URI: http://smashballoon.com/
9
  License: GPLv2 or later
@@ -24,12 +24,49 @@ along with this program; if not, write to the Free Software
24
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  */
26
 
27
- define('CFFVER', '2.10');
 
 
 
 
 
28
 
29
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
30
  //Include admin
31
  include dirname( __FILE__ ) .'/custom-facebook-feed-admin.php';
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  // Add shortcodes
34
  add_shortcode('custom-facebook-feed', 'display_cff');
35
  function display_cff($atts) {
@@ -82,6 +119,12 @@ function display_cff($atts) {
82
  'layout' => isset($options[ 'cff_preset_layout' ]) ? $options[ 'cff_preset_layout' ] : '',
83
  'include' => $include_string,
84
  'exclude' => '',
 
 
 
 
 
 
85
  //Post Style
86
  'poststyle' => isset($options[ 'cff_post_style' ]) ? $options[ 'cff_post_style' ] : '',
87
  'postbgcolor' => isset($options[ 'cff_post_bg_color' ]) ? $options[ 'cff_post_bg_color' ] : '',
@@ -682,6 +725,42 @@ function display_cff($atts) {
682
  $page_id = substr( $page_id, strrpos( $page_id, '/' )+1 );
683
  }
684
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
685
  //If the Page ID contains a query string at the end then remove it
686
  if ( stripos( $page_id, '?') !== false ) $page_id = substr($page_id, 0, strrpos($page_id, '?'));
687
 
@@ -858,11 +937,12 @@ function display_cff($atts) {
858
  if( $atts[ 'disablestyles' ] === 'false' ) $cff_disable_styles = false;
859
 
860
  //If there's a class then add it here
861
- if( !empty($cff_class) || !empty($cff_feed_height) || !$cff_disable_styles || $cff_feed_width_resp ) $cff_content .= ' class="';
862
  if( !empty($cff_class) ) $cff_content .= $cff_class . ' ';
863
- if ( !empty($cff_feed_height) ) $cff_content .= 'cff-fixed-height ';
864
- if ( $cff_feed_width_resp ) $cff_content .= 'cff-width-resp ';
865
- if ( !$cff_disable_styles ) $cff_content .= 'cff-default-styles';
 
866
  if( !empty($cff_class) || !empty($cff_feed_height) || !$cff_disable_styles || $cff_feed_width_resp ) $cff_content .= '"';
867
 
868
  $cff_content .= ' ' . $cff_feed_styles . '>';
1
  <?php
2
  /*
3
+ Plugin Name: Smash Balloon Custom Facebook Feed
4
  Plugin URI: https://smashballoon.com/custom-facebook-feed
5
  Description: Add completely customizable Facebook feeds to your WordPress site
6
+ Version: 2.11
7
  Author: Smash Balloon
8
  Author URI: http://smashballoon.com/
9
  License: GPLv2 or later
24
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  */
26
 
27
+ define('CFFVER', '2.11');
28
+
29
+ // Db version.
30
+ if ( ! defined( 'CFF_DBVERSION' ) ) {
31
+ define( 'CFF_DBVERSION', '1.0' );
32
+ }
33
 
34
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
35
  //Include admin
36
  include dirname( __FILE__ ) .'/custom-facebook-feed-admin.php';
37
 
38
+ function cff_check_for_db_updates() {
39
+ $db_ver = get_option( 'cff_db_version', 0 );
40
+ if ( (float) $db_ver < 1.0 ) {
41
+ global $wp_roles;
42
+ $wp_roles->add_cap( 'administrator', 'manage_custom_facebook_feed_options' );
43
+ $cff_statuses_option = get_option( 'cff_statuses', array() );
44
+ if ( ! isset( $cff_statuses_option['first_install'] ) ) {
45
+ $options_set = get_option( 'cff_page_id', false );
46
+ if ( $options_set ) {
47
+ $cff_statuses_option['first_install'] = 'from_update';
48
+ } else {
49
+ $cff_statuses_option['first_install'] = time();
50
+ }
51
+ $cff_rating_notice_option = get_option( 'cff_rating_notice', false );
52
+ if ( $cff_rating_notice_option === 'dismissed' ) {
53
+ $cff_statuses_option['rating_notice_dismissed'] = time();
54
+ }
55
+ $cff_rating_notice_waiting = get_transient( 'custom_facebook_rating_notice_waiting' );
56
+ if ( $cff_rating_notice_waiting === false
57
+ && $cff_rating_notice_option === false ) {
58
+ $time = 2 * WEEK_IN_SECONDS;
59
+ set_transient( 'custom_facebook_rating_notice_waiting', 'waiting', $time );
60
+ update_option( 'cff_rating_notice', 'pending', false );
61
+ }
62
+ update_option( 'cff_statuses', $cff_statuses_option, false );
63
+ }
64
+ update_option( 'cff_db_version', CFF_DBVERSION );
65
+ }
66
+ }
67
+ add_action( 'wp_loaded', 'cff_check_for_db_updates' );
68
+
69
+
70
  // Add shortcodes
71
  add_shortcode('custom-facebook-feed', 'display_cff');
72
  function display_cff($atts) {
119
  'layout' => isset($options[ 'cff_preset_layout' ]) ? $options[ 'cff_preset_layout' ] : '',
120
  'include' => $include_string,
121
  'exclude' => '',
122
+
123
+ //Cols
124
+ 'cols' => isset($options[ 'cff_cols' ]) ? $options[ 'cff_cols' ] : '',
125
+ 'colsmobile' => isset($options[ 'cff_cols_mobile' ]) ? $options[ 'cff_cols_mobile' ] : '',
126
+ 'colsjs' => true,
127
+
128
  //Post Style
129
  'poststyle' => isset($options[ 'cff_post_style' ]) ? $options[ 'cff_post_style' ] : '',
130
  'postbgcolor' => isset($options[ 'cff_post_bg_color' ]) ? $options[ 'cff_post_bg_color' ] : '',
725
  $page_id = substr( $page_id, strrpos( $page_id, '/' )+1 );
726
  }
727
 
728
+
729
+
730
+ //Masonry
731
+ $masonry = false;
732
+ $cff_cols = $atts['cols'];
733
+ $cff_cols_mobile = $atts['colsmobile'];
734
+ $cff_cols_js = $atts['colsjs'];
735
+
736
+ if( intval($cff_cols) > 1 ) $masonry = true;
737
+ $js_only = isset( $cff_cols_js ) ? $cff_cols_js : false;
738
+ if( $js_only === 'false' ) $js_only = false;
739
+
740
+ if( $masonry || $masonry == 'true' ) $atts['headeroutside'] = true;
741
+
742
+ $masonry_classes = '';
743
+ if( isset($masonry) ) {
744
+ if( $masonry === 'on' || $masonry === true || $masonry === 'true' ) {
745
+
746
+ $masonry_classes .= 'cff-masonry';
747
+
748
+ if( $cff_cols != 3 ) {
749
+ $masonry_classes .= sprintf( ' masonry-%s-desktop', $cff_cols );
750
+ }
751
+ if( $cff_cols_mobile == 2 ) {
752
+ $masonry_classes .= ' masonry-2-mobile';
753
+ }
754
+ if( ! $js_only ) {
755
+ $masonry_classes .= ' cff-masonry-css';
756
+ } else {
757
+ $masonry_classes .= ' cff-masonry-js';
758
+ }
759
+ }
760
+ }
761
+
762
+
763
+
764
  //If the Page ID contains a query string at the end then remove it
765
  if ( stripos( $page_id, '?') !== false ) $page_id = substr($page_id, 0, strrpos($page_id, '?'));
766
 
937
  if( $atts[ 'disablestyles' ] === 'false' ) $cff_disable_styles = false;
938
 
939
  //If there's a class then add it here
940
+ if( !empty($cff_class) || !empty($cff_feed_height) || !$cff_disable_styles || $cff_feed_width_resp || !empty($masonry_classes) ) $cff_content .= ' class="';
941
  if( !empty($cff_class) ) $cff_content .= $cff_class . ' ';
942
+ if( !empty($masonry_classes) ) $cff_content .= $masonry_classes;
943
+ if ( !empty($cff_feed_height) ) $cff_content .= ' cff-fixed-height ';
944
+ if ( $cff_feed_width_resp ) $cff_content .= ' cff-width-resp ';
945
+ if ( !$cff_disable_styles ) $cff_content .= ' cff-default-styles';
946
  if( !empty($cff_class) || !empty($cff_feed_height) || !$cff_disable_styles || $cff_feed_width_resp ) $cff_content .= '"';
947
 
948
  $cff_content .= ' ' . $cff_feed_styles . '>';
img/cff-icon-offer.png ADDED
Binary file
img/cff-icon.png CHANGED
Binary file
img/pro.png CHANGED
Binary file
js/cff-admin-scripts.js CHANGED
@@ -290,4 +290,26 @@ jQuery(document).ready(function($) {
290
  jQuery('.cff-groups-list #' + jQuery(this).attr('id') ).eq(1).hide();
291
  });
292
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
293
  });
290
  jQuery('.cff-groups-list #' + jQuery(this).attr('id') ).eq(1).hide();
291
  });
292
 
293
+
294
+ //Show/hide mobile column setting
295
+ var cff_masonry_desktop_col = jQuery('#cff_cols').val(),
296
+ $cff_mobile_col_settings = jQuery('.cff-mobile-col-settings');
297
+ if( typeof cff_post_limit === 'undefined' ) cff_masonry_desktop_col = '1';
298
+
299
+ //Should we show anything initially?
300
+ if( cff_masonry_desktop_col == '1' ) $cff_mobile_col_settings.hide();
301
+ if( parseInt(cff_masonry_desktop_col) > 1 ){
302
+ $cff_mobile_col_settings.show();
303
+ }
304
+
305
+ jQuery('#cff_cols').change(function(){
306
+ cff_cols_num = parseInt( jQuery('#cff_cols').val() );
307
+
308
+ if(cff_cols_num > 1){
309
+ $cff_mobile_col_settings.slideDown(200);
310
+ } else {
311
+ $cff_mobile_col_settings.slideUp(200);
312
+ }
313
+ });
314
+
315
  });
js/cff-scripts.js CHANGED
@@ -1,6 +1,82 @@
1
  var cff_js_exists = (typeof cff_js_exists !== 'undefined') ? true : false;
2
  if(!cff_js_exists){
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  function cff_init(){
5
 
6
  //Set likebox width
@@ -192,6 +268,25 @@ if(!cff_js_exists){
192
 
193
  }); //End .cff-item each
194
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
  }
196
  cff_init();
197
 
1
  var cff_js_exists = (typeof cff_js_exists !== 'undefined') ? true : false;
2
  if(!cff_js_exists){
3
 
4
+ //Only load the Masonry code if there's a masonry feed on the page
5
+ if( jQuery('#cff.cff-masonry-js').length ){
6
+
7
+ //Masonry
8
+ !function(a){function b(){}
9
+ function c(a){function c(b){b.prototype.option||(b.prototype.option=function(b){a.isPlainObject(b)&&(this.options=a.extend(!0,this.options,b))})}
10
+ function e(b,c){a.fn[b]=function(e){if("string"==typeof e){for(var g=d.call(arguments,1),h=0,i=this.length;i>h;h++){var j=this[h],k=a.data(j,b);if(k)if(a.isFunction(k[e])&&"_"!==e.charAt(0)){var l=k[e].apply(k,g);if(void 0!==l)return l}else f("no such method '"+e+"' for "+b+" instance");else f("cannot call methods on "+b+" prior to initialization; attempted to call '"+e+"'")}
11
+ return this}
12
+ return this.each(function(){var d=a.data(this,b);d?(d.option(e),d._init()):(d=new c(this,e),a.data(this,b,d))})}}
13
+ if(a){var f="undefined"==typeof console?b:function(a){console.error(a)};return a.bridget=function(a,b){c(b),e(a,b)},a.bridget}}
14
+ var d=Array.prototype.slice;"function"==typeof define&&define.amd?define("jquery-bridget/jquery.bridget",["jquery"],c):c("object"==typeof exports?require("jquery"):a.jQuery)}(window),function(a){function b(b){var c=a.event;return c.target=c.target||c.srcElement||b,c}
15
+ var c=document.documentElement,d=function(){};c.addEventListener?d=function(a,b,c){a.addEventListener(b,c,!1)}:c.attachEvent&&(d=function(a,c,d){a[c+d]=d.handleEvent?function(){var c=b(a);d.handleEvent.call(d,c)}:function(){var c=b(a);d.call(a,c)},a.attachEvent("on"+c,a[c+d])});var e=function(){};c.removeEventListener?e=function(a,b,c){a.removeEventListener(b,c,!1)}:c.detachEvent&&(e=function(a,b,c){a.detachEvent("on"+b,a[b+c]);try{delete a[b+c]}catch(d){a[b+c]=void 0}});var f={bind:d,unbind:e};"function"==typeof define&&define.amd?define("eventie/eventie",f):"object"==typeof exports?module.exports=f:a.eventie=f}(window),function(){function a(){}
16
+ function b(a,b){for(var c=a.length;c--;)if(a[c].listener===b)return c;return-1}
17
+ function c(a){return function(){return this[a].apply(this,arguments)}}
18
+ var d=a.prototype,e=this,f=e.EventEmitter;d.getListeners=function(a){var b,c,d=this._getEvents();if(a instanceof RegExp){b={};for(c in d)d.hasOwnProperty(c)&&a.test(c)&&(b[c]=d[c])}else b=d[a]||(d[a]=[]);return b},d.flattenListeners=function(a){var b,c=[];for(b=0;b<a.length;b+=1)c.push(a[b].listener);return c},d.getListenersAsObject=function(a){var b,c=this.getListeners(a);return c instanceof Array&&(b={},b[a]=c),b||c},d.addListener=function(a,c){var d,e=this.getListenersAsObject(a),f="object"==typeof c;for(d in e)e.hasOwnProperty(d)&&-1===b(e[d],c)&&e[d].push(f?c:{listener:c,once:!1});return this},d.on=c("addListener"),d.addOnceListener=function(a,b){return this.addListener(a,{listener:b,once:!0})},d.once=c("addOnceListener"),d.defineEvent=function(a){return this.getListeners(a),this},d.defineEvents=function(a){for(var b=0;b<a.length;b+=1)this.defineEvent(a[b]);return this},d.removeListener=function(a,c){var d,e,f=this.getListenersAsObject(a);for(e in f)f.hasOwnProperty(e)&&(d=b(f[e],c),-1!==d&&f[e].splice(d,1));return this},d.off=c("removeListener"),d.addListeners=function(a,b){return this.manipulateListeners(!1,a,b)},d.removeListeners=function(a,b){return this.manipulateListeners(!0,a,b)},d.manipulateListeners=function(a,b,c){var d,e,f=a?this.removeListener:this.addListener,g=a?this.removeListeners:this.addListeners;if("object"!=typeof b||b instanceof RegExp)for(d=c.length;d--;)f.call(this,b,c[d]);else for(d in b)b.hasOwnProperty(d)&&(e=b[d])&&("function"==typeof e?f.call(this,d,e):g.call(this,d,e));return this},d.removeEvent=function(a){var b,c=typeof a,d=this._getEvents();if("string"===c)delete d[a];else if(a instanceof RegExp)for(b in d)d.hasOwnProperty(b)&&a.test(b)&&delete d[b];else delete this._events;return this},d.removeAllListeners=c("removeEvent"),d.emitEvent=function(a,b){var c,d,e,f,g=this.getListenersAsObject(a);for(e in g)if(g.hasOwnProperty(e))for(d=g[e].length;d--;)c=g[e][d],c.once===!0&&this.removeListener(a,c.listener),f=c.listener.apply(this,b||[]),f===this._getOnceReturnValue()&&this.removeListener(a,c.listener);return this},d.trigger=c("emitEvent"),d.emit=function(a){var b=Array.prototype.slice.call(arguments,1);return this.emitEvent(a,b)},d.setOnceReturnValue=function(a){return this._onceReturnValue=a,this},d._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},d._getEvents=function(){return this._events||(this._events={})},a.noConflict=function(){return e.EventEmitter=f,a},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return a}):"object"==typeof module&&module.exports?module.exports=a:e.EventEmitter=a}.call(this),function(a){function b(a){if(a){if("string"==typeof d[a])return a;a=a.charAt(0).toUpperCase()+a.slice(1);for(var b,e=0,f=c.length;f>e;e++)if(b=c[e]+a,"string"==typeof d[b])return b}}
19
+ var c="Webkit Moz ms Ms O".split(" "),d=document.documentElement.style;"function"==typeof define&&define.amd?define("get-style-property/get-style-property",[],function(){return b}):"object"==typeof exports?module.exports=b:a.getStyleProperty=b}(window),function(a){function b(a){var b=parseFloat(a),c=-1===a.indexOf("%")&&!isNaN(b);return c&&b}
20
+ function c(){}
21
+ function d(){for(var a={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},b=0,c=g.length;c>b;b++){var d=g[b];a[d]=0}
22
+ return a}
23
+ function e(c){function e(){if(!m){m=!0;var d=a.getComputedStyle;if(j=function(){var a=d?function(a){return d(a,null)}:function(a){return a.currentStyle};return function(b){var c=a(b);return c||f("Style returned "+c+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),c}}(),k=c("boxSizing")){var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style[k]="border-box";var g=document.body||document.documentElement;g.appendChild(e);var h=j(e);l=200===b(h.width),g.removeChild(e)}}}
24
+ function h(a){if(e(),"string"==typeof a&&(a=document.querySelector(a)),a&&"object"==typeof a&&a.nodeType){var c=j(a);if("none"===c.display)return d();var f={};f.width=a.offsetWidth,f.height=a.offsetHeight;for(var h=f.isBorderBox=!(!k||!c[k]||"border-box"!==c[k]),m=0,n=g.length;n>m;m++){var o=g[m],p=c[o];p=i(a,p);var q=parseFloat(p);f[o]=isNaN(q)?0:q}
25
+ var r=f.paddingLeft+f.paddingRight,s=f.paddingTop+f.paddingBottom,t=f.marginLeft+f.marginRight,u=f.marginTop+f.marginBottom,v=f.borderLeftWidth+f.borderRightWidth,w=f.borderTopWidth+f.borderBottomWidth,x=h&&l,y=b(c.width);y!==!1&&(f.width=y+(x?0:r+v));var z=b(c.height);return z!==!1&&(f.height=z+(x?0:s+w)),f.innerWidth=f.width-(r+v),f.innerHeight=f.height-(s+w),f.outerWidth=f.width+t,f.outerHeight=f.height+u,f}}
26
+ function i(b,c){if(a.getComputedStyle||-1===c.indexOf("%"))return c;var d=b.style,e=d.left,f=b.runtimeStyle,g=f&&f.left;return g&&(f.left=b.currentStyle.left),d.left=c,c=d.pixelLeft,d.left=e,g&&(f.left=g),c}
27
+ var j,k,l,m=!1;return h}
28
+ var f="undefined"==typeof console?c:function(a){console.error(a)},g=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];"function"==typeof define&&define.amd?define("get-size/get-size",["get-style-property/get-style-property"],e):"object"==typeof exports?module.exports=e(require("desandro-get-style-property")):a.getSize=e(a.getStyleProperty)}(window),function(a){function b(a){"function"==typeof a&&(b.isReady?a():g.push(a))}
29
+ function c(a){var c="readystatechange"===a.type&&"complete"!==f.readyState;b.isReady||c||d()}
30
+ function d(){b.isReady=!0;for(var a=0,c=g.length;c>a;a++){var d=g[a];d()}}
31
+ function e(e){return"complete"===f.readyState?d():(e.bind(f,"DOMContentLoaded",c),e.bind(f,"readystatechange",c),e.bind(a,"load",c)),b}
32
+ var f=a.document,g=[];b.isReady=!1,"function"==typeof define&&define.amd?define("doc-ready/doc-ready",["eventie/eventie"],e):"object"==typeof exports?module.exports=e(require("eventie")):a.docReady=e(a.eventie)}(window),function(a){function b(a,b){return a[g](b)}
33
+ function c(a){if(!a.parentNode){var b=document.createDocumentFragment();b.appendChild(a)}}
34
+ function d(a,b){c(a);for(var d=a.parentNode.querySelectorAll(b),e=0,f=d.length;f>e;e++)if(d[e]===a)return!0;return!1}
35
+ function e(a,d){return c(a),b(a,d)}
36
+ var f,g=function(){if(a.matches)return"matches";if(a.matchesSelector)return"matchesSelector";for(var b=["webkit","moz","ms","o"],c=0,d=b.length;d>c;c++){var e=b[c],f=e+"MatchesSelector";if(a[f])return f}}();if(g){var h=document.createElement("div"),i=b(h,"div");f=i?b:e}else f=d;"function"==typeof define&&define.amd?define("matches-selector/matches-selector",[],function(){return f}):"object"==typeof exports?module.exports=f:window.matchesSelector=f}(Element.prototype),function(a,b){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["doc-ready/doc-ready","matches-selector/matches-selector"],function(c,d){return b(a,c,d)}):"object"==typeof exports?module.exports=b(a,require("doc-ready"),require("desandro-matches-selector")):a.fizzyUIUtils=b(a,a.docReady,a.matchesSelector)}(window,function(a,b,c){var d={};d.extend=function(a,b){for(var c in b)a[c]=b[c];return a},d.modulo=function(a,b){return(a%b+b)%b};var e=Object.prototype.toString;d.isArray=function(a){return"[object Array]"==e.call(a)},d.makeArray=function(a){var b=[];if(d.isArray(a))b=a;else if(a&&"number"==typeof a.length)for(var c=0,e=a.length;e>c;c++)b.push(a[c]);else b.push(a);return b},d.indexOf=Array.prototype.indexOf?function(a,b){return a.indexOf(b)}:function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},d.removeFrom=function(a,b){var c=d.indexOf(a,b);-1!=c&&a.splice(c,1)},d.isElement="function"==typeof HTMLElement||"object"==typeof HTMLElement?function(a){return a instanceof HTMLElement}:function(a){return a&&"object"==typeof a&&1==a.nodeType&&"string"==typeof a.nodeName},d.setText=function(){function a(a,c){b=b||(void 0!==document.documentElement.textContent?"textContent":"innerText"),a[b]=c}
37
+ var b;return a}(),d.getParent=function(a,b){for(;a!=document.body;)if(a=a.parentNode,c(a,b))return a},d.getQueryElement=function(a){return"string"==typeof a?document.querySelector(a):a},d.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},d.filterFindElements=function(a,b){a=d.makeArray(a);for(var e=[],f=0,g=a.length;g>f;f++){var h=a[f];if(d.isElement(h))if(b){c(h,b)&&e.push(h);for(var i=h.querySelectorAll(b),j=0,k=i.length;k>j;j++)e.push(i[j])}else e.push(h)}
38
+ return e},d.debounceMethod=function(a,b,c){var d=a.prototype[b],e=b+"Timeout";a.prototype[b]=function(){var a=this[e];a&&clearTimeout(a);var b=arguments,f=this;this[e]=setTimeout(function(){d.apply(f,b),delete f[e]},c||100)}},d.toDashed=function(a){return a.replace(/(.)([A-Z])/g,function(a,b,c){return b+"-"+c}).toLowerCase()};var f=a.console;return d.htmlInit=function(c,e){b(function(){for(var b=d.toDashed(e),g=document.querySelectorAll(".js-"+b),h="data-"+b+"-options",i=0,j=g.length;j>i;i++){var k,l=g[i],m=l.getAttribute(h);try{k=m&&JSON.parse(m)}catch(n){f&&f.error("Error parsing "+h+" on "+l.nodeName.toLowerCase()+(l.id?"#"+l.id:"")+": "+n);continue}
39
+ var o=new c(l,k),p=a.jQuery;p&&p.data(l,e,o)}})},d}),function(a,b){"function"==typeof define&&define.amd?define("outlayer/item",["eventEmitter/EventEmitter","get-size/get-size","get-style-property/get-style-property","fizzy-ui-utils/utils"],function(c,d,e,f){return b(a,c,d,e,f)}):"object"==typeof exports?module.exports=b(a,require("wolfy87-eventemitter"),require("get-size"),require("desandro-get-style-property"),require("fizzy-ui-utils")):(a.Outlayer={},a.Outlayer.Item=b(a,a.EventEmitter,a.getSize,a.getStyleProperty,a.fizzyUIUtils))}(window,function(a,b,c,d,e){function f(a){for(var b in a)return!1;return b=null,!0}
40
+ function g(a,b){a&&(this.element=a,this.layout=b,this.position={x:0,y:0},this._create())}
41
+ var h=a.getComputedStyle,i=h?function(a){return h(a,null)}:function(a){return a.currentStyle},j=d("transition"),k=d("transform"),l=j&&k,m=!!d("perspective"),n={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"}[j],o=["transform","transition","transitionDuration","transitionProperty"],p=function(){for(var a={},b=0,c=o.length;c>b;b++){var e=o[b],f=d(e);f&&f!==e&&(a[e]=f)}
42
+ return a}();e.extend(g.prototype,b.prototype),g.prototype._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},g.prototype.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},g.prototype.getSize=function(){this.size=c(this.element)},g.prototype.css=function(a){var b=this.element.style;for(var c in a){var d=p[c]||c;b[d]=a[c]}},g.prototype.getPosition=function(){var a=i(this.element),b=this.layout.options,c=b.isOriginLeft,d=b.isOriginTop,e=parseInt(a[c?"left":"right"],10),f=parseInt(a[d?"top":"bottom"],10);e=isNaN(e)?0:e,f=isNaN(f)?0:f;var g=this.layout.size;e-=c?g.paddingLeft:g.paddingRight,f-=d?g.paddingTop:g.paddingBottom,this.position.x=e,this.position.y=f},g.prototype.layoutPosition=function(){var a=this.layout.size,b=this.layout.options,c={},d=b.isOriginLeft?"paddingLeft":"paddingRight",e=b.isOriginLeft?"left":"right",f=b.isOriginLeft?"right":"left",g=this.position.x+a[d];g=b.percentPosition&&!b.isHorizontal?g/a.width*100+"%":g+"px",c[e]=g,c[f]="";var h=b.isOriginTop?"paddingTop":"paddingBottom",i=b.isOriginTop?"top":"bottom",j=b.isOriginTop?"bottom":"top",k=this.position.y+a[h];k=b.percentPosition&&b.isHorizontal?k/a.height*100+"%":k+"px",c[i]=k,c[j]="",this.css(c),this.emitEvent("layout",[this])};var q=m?function(a,b){return"translate3d("+a+"px, "+b+"px, 0)"}:function(a,b){return"translate("+a+"px, "+b+"px)"};g.prototype._transitionTo=function(a,b){this.getPosition();var c=this.position.x,d=this.position.y,e=parseInt(a,10),f=parseInt(b,10),g=e===this.position.x&&f===this.position.y;if(this.setPosition(a,b),g&&!this.isTransitioning)return void this.layoutPosition();var h=a-c,i=b-d,j={},k=this.layout.options;h=k.isOriginLeft?h:-h,i=k.isOriginTop?i:-i,j.transform=q(h,i),this.transition({to:j,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},g.prototype.goTo=function(a,b){this.setPosition(a,b),this.layoutPosition()},g.prototype.moveTo=l?g.prototype._transitionTo:g.prototype.goTo,g.prototype.setPosition=function(a,b){this.position.x=parseInt(a,10),this.position.y=parseInt(b,10)},g.prototype._nonTransition=function(a){this.css(a.to),a.isCleaning&&this._removeStyles(a.to);for(var b in a.onTransitionEnd)a.onTransitionEnd[b].call(this)},g.prototype._transition=function(a){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(a);var b=this._transn;for(var c in a.onTransitionEnd)b.onEnd[c]=a.onTransitionEnd[c];for(c in a.to)b.ingProperties[c]=!0,a.isCleaning&&(b.clean[c]=!0);if(a.from){this.css(a.from);var d=this.element.offsetHeight;d=null}
43
+ this.enableTransition(a.to),this.css(a.to),this.isTransitioning=!0};var r=k&&e.toDashed(k)+",opacity";g.prototype.enableTransition=function(){this.isTransitioning||(this.css({transitionProperty:r,transitionDuration:this.layout.options.transitionDuration}),this.element.addEventListener(n,this,!1))},g.prototype.transition=g.prototype[j?"_transition":"_nonTransition"],g.prototype.onwebkitTransitionEnd=function(a){this.ontransitionend(a)},g.prototype.onotransitionend=function(a){this.ontransitionend(a)};var s={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};g.prototype.ontransitionend=function(a){if(a.target===this.element){var b=this._transn,c=s[a.propertyName]||a.propertyName;if(delete b.ingProperties[c],f(b.ingProperties)&&this.disableTransition(),c in b.clean&&(this.element.style[a.propertyName]="",delete b.clean[c]),c in b.onEnd){var d=b.onEnd[c];d.call(this),delete b.onEnd[c]}
44
+ this.emitEvent("transitionEnd",[this])}},g.prototype.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(n,this,!1),this.isTransitioning=!1},g.prototype._removeStyles=function(a){var b={};for(var c in a)b[c]="";this.css(b)};var t={transitionProperty:"",transitionDuration:""};return g.prototype.removeTransitionStyles=function(){this.css(t)},g.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},g.prototype.remove=function(){if(!j||!parseFloat(this.layout.options.transitionDuration))return void this.removeElem();var a=this;this.once("transitionEnd",function(){a.removeElem()}),this.hide()},g.prototype.reveal=function(){delete this.isHidden,this.css({display:""});var a=this.layout.options,b={},c=this.getHideRevealTransitionEndProperty("visibleStyle");b[c]=this.onRevealTransitionEnd,this.transition({from:a.hiddenStyle,to:a.visibleStyle,isCleaning:!0,onTransitionEnd:b})},g.prototype.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},g.prototype.getHideRevealTransitionEndProperty=function(a){var b=this.layout.options[a];if(b.opacity)return"opacity";for(var c in b)return c},g.prototype.hide=function(){this.isHidden=!0,this.css({display:""});var a=this.layout.options,b={},c=this.getHideRevealTransitionEndProperty("hiddenStyle");b[c]=this.onHideTransitionEnd,this.transition({from:a.visibleStyle,to:a.hiddenStyle,isCleaning:!0,onTransitionEnd:b})},g.prototype.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},g.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},g}),function(a,b){"function"==typeof define&&define.amd?define("outlayer/outlayer",["eventie/eventie","eventEmitter/EventEmitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(c,d,e,f,g){return b(a,c,d,e,f,g)}):"object"==typeof exports?module.exports=b(a,require("eventie"),require("wolfy87-eventemitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):a.Outlayer=b(a,a.eventie,a.EventEmitter,a.getSize,a.fizzyUIUtils,a.Outlayer.Item)}(window,function(a,b,c,d,e,f){function g(a,b){var c=e.getQueryElement(a);if(!c)return void(h&&h.error("Bad element for "+this.constructor.namespace+": "+(c||a)));this.element=c,i&&(this.$element=i(this.element)),this.options=e.extend({},this.constructor.defaults),this.option(b);var d=++k;this.element.outlayerGUID=d,l[d]=this,this._create(),this.options.isInitLayout&&this.layout()}
45
+ var h=a.console,i=a.jQuery,j=function(){},k=0,l={};return g.namespace="outlayer",g.Item=f,g.defaults={containerStyle:{position:"relative"},isInitLayout:!0,isOriginLeft:!0,isOriginTop:!0,isResizeBound:!0,isResizingContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}},e.extend(g.prototype,c.prototype),g.prototype.option=function(a){e.extend(this.options,a)},g.prototype._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),e.extend(this.element.style,this.options.containerStyle),this.options.isResizeBound&&this.bindResize()},g.prototype.reloadItems=function(){this.items=this._itemize(this.element.children)},g.prototype._itemize=function(a){for(var b=this._filterFindItemElements(a),c=this.constructor.Item,d=[],e=0,f=b.length;f>e;e++){var g=b[e],h=new c(g,this);d.push(h)}
46
+ return d},g.prototype._filterFindItemElements=function(a){return e.filterFindElements(a,this.options.itemSelector)},g.prototype.getItemElements=function(){for(var a=[],b=0,c=this.items.length;c>b;b++)a.push(this.items[b].element);return a},g.prototype.layout=function(){this._resetLayout(),this._manageStamps();var a=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;this.layoutItems(this.items,a),this._isLayoutInited=!0},g.prototype._init=g.prototype.layout,g.prototype._resetLayout=function(){this.getSize()},g.prototype.getSize=function(){this.size=d(this.element)},g.prototype._getMeasurement=function(a,b){var c,f=this.options[a];f?("string"==typeof f?c=this.element.querySelector(f):e.isElement(f)&&(c=f),this[a]=c?d(c)[b]:f):this[a]=0},g.prototype.layoutItems=function(a,b){a=this._getItemsForLayout(a),this._layoutItems(a,b),this._postLayout()},g.prototype._getItemsForLayout=function(a){for(var b=[],c=0,d=a.length;d>c;c++){var e=a[c];e.isIgnored||b.push(e)}
47
+ return b},g.prototype._layoutItems=function(a,b){if(this._emitCompleteOnItems("layout",a),a&&a.length){for(var c=[],d=0,e=a.length;e>d;d++){var f=a[d],g=this._getItemLayoutPosition(f);g.item=f,g.isInstant=b||f.isLayoutInstant,c.push(g)}
48
+ this._processLayoutQueue(c)}},g.prototype._getItemLayoutPosition=function(){return{x:0,y:0}},g.prototype._processLayoutQueue=function(a){for(var b=0,c=a.length;c>b;b++){var d=a[b];this._positionItem(d.item,d.x,d.y,d.isInstant)}},g.prototype._positionItem=function(a,b,c,d){d?a.goTo(b,c):a.moveTo(b,c)},g.prototype._postLayout=function(){this.resizeContainer()},g.prototype.resizeContainer=function(){if(this.options.isResizingContainer){var a=this._getContainerSize();a&&(this._setContainerMeasure(a.width,!0),this._setContainerMeasure(a.height,!1))}},g.prototype._getContainerSize=j,g.prototype._setContainerMeasure=function(a,b){if(void 0!==a){var c=this.size;c.isBorderBox&&(a+=b?c.paddingLeft+c.paddingRight+c.borderLeftWidth+c.borderRightWidth:c.paddingBottom+c.paddingTop+c.borderTopWidth+c.borderBottomWidth),a=Math.max(a,0),this.element.style[b?"width":"height"]=a+"px"}},g.prototype._emitCompleteOnItems=function(a,b){function c(){e.emitEvent(a+"Complete",[b])}
49
+ function d(){g++,g===f&&c()}
50
+ var e=this,f=b.length;if(!b||!f)return void c();for(var g=0,h=0,i=b.length;i>h;h++){var j=b[h];j.once(a,d)}},g.prototype.ignore=function(a){var b=this.getItem(a);b&&(b.isIgnored=!0)},g.prototype.unignore=function(a){var b=this.getItem(a);b&&delete b.isIgnored},g.prototype.stamp=function(a){if(a=this._find(a)){this.stamps=this.stamps.concat(a);for(var b=0,c=a.length;c>b;b++){var d=a[b];this.ignore(d)}}},g.prototype.unstamp=function(a){if(a=this._find(a))for(var b=0,c=a.length;c>b;b++){var d=a[b];e.removeFrom(this.stamps,d),this.unignore(d)}},g.prototype._find=function(a){return a?("string"==typeof a&&(a=this.element.querySelectorAll(a)),a=e.makeArray(a)):void 0},g.prototype._manageStamps=function(){if(this.stamps&&this.stamps.length){this._getBoundingRect();for(var a=0,b=this.stamps.length;b>a;a++){var c=this.stamps[a];this._manageStamp(c)}}},g.prototype._getBoundingRect=function(){var a=this.element.getBoundingClientRect(),b=this.size;this._boundingRect={left:a.left+b.paddingLeft+b.borderLeftWidth,top:a.top+b.paddingTop+b.borderTopWidth,right:a.right-(b.paddingRight+b.borderRightWidth),bottom:a.bottom-(b.paddingBottom+b.borderBottomWidth)}},g.prototype._manageStamp=j,g.prototype._getElementOffset=function(a){var b=a.getBoundingClientRect(),c=this._boundingRect,e=d(a),f={left:b.left-c.left-e.marginLeft,top:b.top-c.top-e.marginTop,right:c.right-b.right-e.marginRight,bottom:c.bottom-b.bottom-e.marginBottom};return f},g.prototype.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},g.prototype.bindResize=function(){this.isResizeBound||(b.bind(a,"resize",this),this.isResizeBound=!0)},g.prototype.unbindResize=function(){this.isResizeBound&&b.unbind(a,"resize",this),this.isResizeBound=!1},g.prototype.onresize=function(){function a(){b.resize(),delete b.resizeTimeout}
51
+ this.resizeTimeout&&clearTimeout(this.resizeTimeout);var b=this;this.resizeTimeout=setTimeout(a,100)},g.prototype.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},g.prototype.needsResizeLayout=function(){var a=d(this.element),b=this.size&&a;return b&&a.innerWidth!==this.size.innerWidth},g.prototype.addItems=function(a){var b=this._itemize(a);return b.length&&(this.items=this.items.concat(b)),b},g.prototype.appended=function(a){var b=this.addItems(a);b.length&&(this.layoutItems(b,!0),this.reveal(b))},g.prototype.prepended=function(a){var b=this._itemize(a);if(b.length){var c=this.items.slice(0);this.items=b.concat(c),this._resetLayout(),this._manageStamps(),this.layoutItems(b,!0),this.reveal(b),this.layoutItems(c)}},g.prototype.reveal=function(a){this._emitCompleteOnItems("reveal",a);for(var b=a&&a.length,c=0;b&&b>c;c++){var d=a[c];d.reveal()}},g.prototype.hide=function(a){this._emitCompleteOnItems("hide",a);for(var b=a&&a.length,c=0;b&&b>c;c++){var d=a[c];d.hide()}},g.prototype.revealItemElements=function(a){var b=this.getItems(a);this.reveal(b)},g.prototype.hideItemElements=function(a){var b=this.getItems(a);this.hide(b)},g.prototype.getItem=function(a){for(var b=0,c=this.items.length;c>b;b++){var d=this.items[b];if(d.element===a)return d}},g.prototype.getItems=function(a){a=e.makeArray(a);for(var b=[],c=0,d=a.length;d>c;c++){var f=a[c],g=this.getItem(f);g&&b.push(g)}
52
+ return b},g.prototype.remove=function(a){var b=this.getItems(a);if(this._emitCompleteOnItems("remove",b),b&&b.length)for(var c=0,d=b.length;d>c;c++){var f=b[c];f.remove(),e.removeFrom(this.items,f)}},g.prototype.destroy=function(){var a=this.element.style;a.height="",a.position="",a.width="";for(var b=0,c=this.items.length;c>b;b++){var d=this.items[b];d.destroy()}
53
+ this.unbindResize();var e=this.element.outlayerGUID;delete l[e],delete this.element.outlayerGUID,i&&i.removeData(this.element,this.constructor.namespace)},g.data=function(a){a=e.getQueryElement(a);var b=a&&a.outlayerGUID;return b&&l[b]},g.create=function(a,b){function c(){g.apply(this,arguments)}
54
+ return Object.create?c.prototype=Object.create(g.prototype):e.extend(c.prototype,g.prototype),c.prototype.constructor=c,c.defaults=e.extend({},g.defaults),e.extend(c.defaults,b),c.prototype.settings={},c.namespace=a,c.data=g.data,c.Item=function(){f.apply(this,arguments)},c.Item.prototype=new f,e.htmlInit(c,a),i&&i.bridget&&i.bridget(a,c),c},g.Item=f,g}),function(a,b){"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size","fizzy-ui-utils/utils"],b):"object"==typeof exports?module.exports=b(require("outlayer"),require("get-size"),require("fizzy-ui-utils")):a.Masonry=b(a.Outlayer,a.getSize,a.fizzyUIUtils)}(window,function(a,b,c){var d=a.create("masonry");return d.prototype._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns();var a=this.cols;for(this.colYs=[];a--;)this.colYs.push(0);this.maxY=0},d.prototype.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var a=this.items[0],c=a&&a.element;this.columnWidth=c&&b(c).outerWidth||this.containerWidth}
55
+ var d=this.columnWidth+=this.gutter,e=this.containerWidth+this.gutter,f=e/d,g=d-e%d,h=g&&1>g?"round":"floor";f=Math[h](f),this.cols=Math.max(f,1)},d.prototype.getContainerWidth=function(){var a=this.options.isFitWidth?this.element.parentNode:this.element,c=b(a);this.containerWidth=c&&c.innerWidth},d.prototype._getItemLayoutPosition=function(a){a.getSize();var b=a.size.outerWidth%this.columnWidth,d=b&&1>b?"round":"ceil",e=Math[d](a.size.outerWidth/this.columnWidth);e=Math.min(e,this.cols);for(var f=this._getColGroup(e),g=Math.min.apply(Math,f),h=c.indexOf(f,g),i={x:this.columnWidth*h,y:g},j=g+a.size.outerHeight,k=this.cols+1-f.length,l=0;k>l;l++)this.colYs[h+l]=j;return i},d.prototype._getColGroup=function(a){if(2>a)return this.colYs;for(var b=[],c=this.cols+1-a,d=0;c>d;d++){var e=this.colYs.slice(d,d+a);b[d]=Math.max.apply(Math,e)}
56
+ return b},d.prototype._manageStamp=function(a){var c=b(a),d=this._getElementOffset(a),e=this.options.isOriginLeft?d.left:d.right,f=e+c.outerWidth,g=Math.floor(e/this.columnWidth);g=Math.max(0,g);var h=Math.floor(f/this.columnWidth);h-=f%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var i=(this.options.isOriginTop?d.top:d.bottom)+c.outerHeight,j=g;h>=j;j++)this.colYs[j]=Math.max(i,this.colYs[j])},d.prototype._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var a={height:this.maxY};return this.options.isFitWidth&&(a.width=this._getContainerFitWidth()),a},d.prototype._getContainerFitWidth=function(){for(var a=0,b=this.cols;--b&&0===this.colYs[b];)a++;return(this.cols-a)*this.columnWidth-this.gutter},d.prototype.needsResizeLayout=function(){var a=this.containerWidth;return this.getContainerWidth(),a!==this.containerWidth},d})
57
+
58
+ function cffAddMasonry($self) {
59
+ if (jQuery(window).width() > 780 || $self.hasClass('masonry-2-mobile') ) {
60
+ //Add the class in case it was removed when resizing down
61
+ $self.addClass('cff-masonry cff-masonry-js').removeClass('cff-disable-masonry');
62
+ if($self.find('.cff-item').length) {
63
+ $self.masonry({itemSelector: '.cff-new, .cff-item, .cff-likebox'});
64
+ // Add margin to the bottom of each post to give some space
65
+ $self.find('.cff-item').each( function() {
66
+ jQuery(this).css('margin-bottom', '15px');
67
+ });
68
+ } else if($self.find('.cff-album-item').length) {
69
+ $self.masonry({itemSelector: '.cff-album-item'});
70
+ }
71
+ } else {
72
+ //Disable masonry in 1 col mobile as isn't needed
73
+ $self.addClass('cff-disable-masonry');
74
+ }
75
+ }
76
+
77
+ } //End Masonry code
78
+
79
+
80
  function cff_init(){
81
 
82
  //Set likebox width
268
 
269
  }); //End .cff-item each
270
 
271
+
272
+ jQuery('.cff-wrapper').each(function(){
273
+ var $cff = jQuery(this).find('#cff');
274
+
275
+ //Masonry
276
+ if( $cff.hasClass('cff-masonry-js') ){
277
+ cffAddMasonry($cff);
278
+ //Call it again in case post isn't fully loaded
279
+ setTimeout(function(){ cffAddMasonry($cff); }, 500);
280
+ // Resizing the window can affect the masonry feed so it is reset on resize
281
+ jQuery(window).resize(function () {
282
+ setTimeout(function(){
283
+ cffAddMasonry($cff);
284
+ }, 500);
285
+ });
286
+ if( $cff.find('.cff-credit').length ) $cff.css('padding-bottom', 30);
287
+ }
288
+ });
289
+
290
  }
291
  cff_init();
292