Version Description
- New: Loading icon appears when waiting for new posts after clicking the "Load More..." button
- New: Added translation files for Dutch (nl_NL)
- Fix: Fixed a potential security vulnerability. Thanks to Magnus Stubman for reporting the issue.
Download this release
Release Info
Developer | smashballoon |
Plugin | Instagram Feed |
Version | 1.6 |
Comparing to | |
See all releases |
Code changes from version 1.5.1 to 1.6
- README.txt +6 -1
- css/sb-instagram.css +11 -0
- css/sb-instagram.min.css +1 -1
- instagram-feed-admin.php +24 -25
- instagram-feed.php +6 -5
- js/sb-instagram.js +4 -2
- js/sb-instagram.min.js +7 -7
README.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: smashballoon, craig-at-smash-balloon
|
|
3 |
Tags: Instagram, Instagram feed, Instagram photos, Instagram widget, Instagram gallery
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 4.9
|
6 |
-
Stable tag: 1.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -310,6 +310,11 @@ We understand that sometimes you need help, have issues or just have questions.
|
|
310 |
* Plus more customization options added all the time!
|
311 |
|
312 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
313 |
= 1.5.1 =
|
314 |
* New: The plugin is now compatible with the [WPML plugin](https://wpml.org/) allowing you to use multiple translations for your feeds on your multi-language sites
|
315 |
* New: Added translation files for Danish (da_DK), Finnish (fi_FL), Japanese (ja_JP), Norwegian (nn_NO), Portuguese (pt_PT), and Swedish (sv_SE) to translate the "Load More" and "Follow on Instagram" text
|
3 |
Tags: Instagram, Instagram feed, Instagram photos, Instagram widget, Instagram gallery
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 4.9
|
6 |
+
Stable tag: 1.6
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
310 |
* Plus more customization options added all the time!
|
311 |
|
312 |
== Changelog ==
|
313 |
+
= 1.6 =
|
314 |
+
* New: Loading icon appears when waiting for new posts after clicking the "Load More..." button
|
315 |
+
* New: Added translation files for Dutch (nl_NL)
|
316 |
+
* Fix: Fixed a potential security vulnerability. Thanks to [Magnus Stubman](http://dumpco.re/) for reporting the issue.
|
317 |
+
|
318 |
= 1.5.1 =
|
319 |
* New: The plugin is now compatible with the [WPML plugin](https://wpml.org/) allowing you to use multiple translations for your feeds on your multi-language sites
|
320 |
* New: Added translation files for Danish (da_DK), Finnish (fi_FL), Japanese (ja_JP), Norwegian (nn_NO), Portuguese (pt_PT), and Swedish (sv_SE) to translate the "Load More" and "Follow on Instagram" text
|
css/sb-instagram.css
CHANGED
@@ -280,6 +280,14 @@
|
|
280 |
width: 100%;
|
281 |
text-align: center;
|
282 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
283 |
#sb_instagram #sbi_load .sbi_load_btn,
|
284 |
#sb_instagram .sbi_follow_btn a{
|
285 |
display: -moz-inline-stack;
|
@@ -306,6 +314,9 @@
|
|
306 |
-moz-box-sizing: border-box;
|
307 |
box-sizing: border-box;
|
308 |
}
|
|
|
|
|
|
|
309 |
/* Follow button */
|
310 |
#sb_instagram .sbi_follow_btn{
|
311 |
display: -moz-inline-stack;
|
280 |
width: 100%;
|
281 |
text-align: center;
|
282 |
}
|
283 |
+
#sb_instagram #sbi_load .fa-spinner{
|
284 |
+
display: none;
|
285 |
+
position: absolute;
|
286 |
+
top: 50%;
|
287 |
+
left: 50%;
|
288 |
+
margin: -8px 0 0 -7px;
|
289 |
+
font-size: 15px;
|
290 |
+
}
|
291 |
#sb_instagram #sbi_load .sbi_load_btn,
|
292 |
#sb_instagram .sbi_follow_btn a{
|
293 |
display: -moz-inline-stack;
|
314 |
-moz-box-sizing: border-box;
|
315 |
box-sizing: border-box;
|
316 |
}
|
317 |
+
#sb_instagram #sbi_load .sbi_load_btn {
|
318 |
+
position: relative;
|
319 |
+
}
|
320 |
/* Follow button */
|
321 |
#sb_instagram .sbi_follow_btn{
|
322 |
display: -moz-inline-stack;
|
css/sb-instagram.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
#sb_instagram
|
1 |
+
#sb_instagram{width:100%;margin:0 auto;padding:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#sb_instagram:after{content:"";display:table;clear:both}#sb_instagram.sbi_fixed_height{overflow:hidden;overflow-y:auto;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#sb_instagram #sbi_images{width:100%;float:left;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#sb_instagram #sbi_images .sbi_item{display:-moz-inline-stack;display:inline-block;vertical-align:top;zoom:1;*display:inline;padding:inherit!important;margin:0!important;text-decoration:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#sb_instagram.sbi_col_1 #sbi_images .sbi_item{width:100%}#sb_instagram.sbi_col_2 #sbi_images .sbi_item{width:50%}#sb_instagram.sbi_col_3 #sbi_images .sbi_item{width:33.33%}#sb_instagram.sbi_col_4 #sbi_images .sbi_item{width:25%}#sb_instagram.sbi_col_5 #sbi_images .sbi_item{width:20%}#sb_instagram.sbi_col_6 #sbi_images .sbi_item{width:16.66%}#sb_instagram.sbi_col_7 #sbi_images .sbi_item{width:14.28%}#sb_instagram.sbi_col_8 #sbi_images .sbi_item{width:12.5%}#sb_instagram.sbi_col_9 #sbi_images .sbi_item{width:11.11%}#sb_instagram.sbi_col_10 #sbi_images .sbi_item{width:10%}#sb_instagram.sbi_col_1.sbi_disable_mobile #sbi_images .sbi_item{width:100%}#sb_instagram.sbi_col_2.sbi_disable_mobile #sbi_images .sbi_item{width:50%}#sb_instagram.sbi_col_3.sbi_disable_mobile #sbi_images .sbi_item{width:33.33%}#sb_instagram.sbi_col_4.sbi_disable_mobile #sbi_images .sbi_item{width:25%}#sb_instagram.sbi_col_5.sbi_disable_mobile #sbi_images .sbi_item{width:20%}#sb_instagram.sbi_col_6.sbi_disable_mobile #sbi_images .sbi_item{width:16.66%}#sb_instagram.sbi_col_7.sbi_disable_mobile #sbi_images .sbi_item{width:14.28%}#sb_instagram.sbi_col_8.sbi_disable_mobile #sbi_images .sbi_item{width:12.5%}#sb_instagram.sbi_col_9.sbi_disable_mobile #sbi_images .sbi_item{width:11.11%}#sb_instagram.sbi_col_10.sbi_disable_mobile #sbi_images .sbi_item{width:10%}#sb_instagram .sbi_photo_wrap{position:relative}#sb_instagram .sbi_photo{display:block;text-decoration:none}#sb_instagram .sbi_photo img{width:100%;height:auto}#sb_instagram a,#sb_instagram a:hover,#sb_instagram a:focus,#sb_instagram a:active{outline:none}#sb_instagram img{display:block;padding:0!important;margin:0!important;max-width:100%!important;opacity:1!important}#sb_instagram .sbi_link{display:none;position:absolute;bottom:0;right:0;width:100%;padding:10px 0;background:rgba(0,0,0,.5);text-align:center;color:#fff;font-size:12px;line-height:1.1}#sb_instagram .sbi_link a{padding:0 6px;text-decoration:none;color:#fff;font-size:12px;line-height:1.1;display:-moz-inline-stack;display:inline-block;vertical-align:top;zoom:1;*display:inline}#sb_instagram .sbi_link .sbi_lightbox_link{padding-bottom:5px}#sb_instagram .sbi_link a:hover,#sb_instagram .sbi_link a:focus{text-decoration:underline}#sb_instagram .sbi_photo_wrap:hover .sbi_link,#sb_instagram .sbi_photo_wrap:focus .sbi_link{display:block}#sb_instagram .sbi_type_video .sbi_playbtn{display:block!important;position:absolute;z-index:0;top:50%;left:50%;margin-top:-24px;margin-left:-19px;padding:0;font-size:48px;color:#fff;color:rgba(255,255,255,.9);font-style:normal!important;text-shadow:0 0 8px rgba(0,0,0,.8)}#sb_instagram .sbi_loader{position:relative;left:50%;width:16px;height:16px;margin:10px 0 10px -8px;background:url(../img/loader.png) no-repeat}#sb_instagram .sb_instagram_header{float:left;clear:both;margin:0 0 15px 0;padding:0;line-height:1.2;width:100%}#sb_instagram .sb_instagram_header a{float:left;display:block;min-width:100%\9}#sb_instagram .sbi_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}#sb_instagram .sbi_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}#sb_instagram .sbi_header_img_hover{position:absolute;width:100%;top:0;bottom:0;left:0;text-align:center;color:#fff;background:rgba(0,0,0,.75);-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity:0;opacity:0;border-radius:40px;transition:opacity 0.2s}#sb_instagram .sb_instagram_header a:hover .sbi_header_img_hover,#sb_instagram .sb_instagram_header a:focus .sbi_header_img_hover{opacity:1}#sb_instagram .sbi_header_img_hover i{position:absolute;top:50%;left:50%;margin-top:-12px;margin-left:-12px;width:24px;height:24px;overflow:hidden;background:url(../img/small-logo.png) no-repeat 0 0}#sb_instagram .sbi_header_text{float:left;width:100%;padding-top:5px}#sb_instagram .sb_instagram_header a{text-decoration:none}#sb_instagram .sbi_header_text .sbi_bio,#sb_instagram .sbi_header_text h3{float:left;clear:both;width:auto;margin:0 0 0 60px!important;padding:0!important}#sb_instagram .sb_instagram_header h3{font-size:16px;line-height:1.3}#sb_instagram .sb_instagram_header p{font-size:13px;line-height:1.3}#sb_instagram .sb_instagram_header h3.sbi_no_bio{padding-top:9px!important}#sb_instagram .sbi_header_text img.emoji{margin-right:3px!important}#sb_instagram #sbi_load{float:left;clear:both;width:100%;text-align:center}#sb_instagram #sbi_load .fa-spinner{display:none;position:absolute;top:50%;left:50%;margin:-8px 0 0 -7px;font-size:15px}#sb_instagram #sbi_load .sbi_load_btn,#sb_instagram .sbi_follow_btn a{display:-moz-inline-stack;display:inline-block;vertical-align:top;zoom:1;*display:inline;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}#sb_instagram #sbi_load .sbi_load_btn{position:relative}#sb_instagram .sbi_follow_btn{display:-moz-inline-stack;display:inline-block;vertical-align:top;zoom:1;*display:inline;text-align:center}#sb_instagram .sbi_follow_btn.sbi_top{display:block;margin-bottom:5px}#sb_instagram .sbi_follow_btn a{background:#517fa4;color:#fff}#sb_instagram .sbi_follow_btn a:hover,#sb_instagram .sbi_follow_btn a:focus,#sb_instagram #sbi_load .sbi_load_btn:hover,#sb_instagram #sbi_load .sbi_load_btn:focus{filter:alpha(opacity=85);opacity:.85}#sb_instagram #sbi_load .fa,#sb_instagram .sbi_follow_btn .fa{margin-bottom:-1px;margin-right:7px;font-size:15px}#sb_instagram #sbi_load .sbi_follow_btn{margin-left:5px}#sb_instagram .sb_instagram_error{width:100%;text-align:center}#sbi_mod_error{display:none;border:1px solid #ddd;background:#eee;color:#333;margin:0;padding:10px 15px;font-size:13px;text-align:center;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}#sbi_mod_error p{padding:5px 0!important;margin:0!important;line-height:1.3!important}#sbi_mod_error ol,#sbi_mod_error ul{padding:5px 0 5px 20px!important;margin:0!important}#sbi_mod_error li{padding:1px 0!important;margin:0!important}#sbi_mod_error span{font-size:12px}#sb_instagram.sbi_medium .sbi_playbtn{font-size:23px;margin-top:-12px;margin-left:-9px}#sb_instagram.sbi_small .sbi_playbtn{font-size:18px;margin-top:-9px;margin-left:-7px}@media all and (max-width:640px){#sb_instagram.sbi_col_3 #sbi_images .sbi_item,#sb_instagram.sbi_col_4 #sbi_images .sbi_item,#sb_instagram.sbi_col_5 #sbi_images .sbi_item,#sb_instagram.sbi_col_6 #sbi_images .sbi_item{width:50%}#sb_instagram.sbi_col_7 #sbi_images .sbi_item,#sb_instagram.sbi_col_8 #sbi_images .sbi_item,#sb_instagram.sbi_col_9 #sbi_images .sbi_item,#sb_instagram.sbi_col_10 #sbi_images .sbi_item{width:25%}#sb_instagram.sbi_width_resp{width:100%!important}}@media all and (max-width:480px){#sb_instagram.sbi_col_3 #sbi_images .sbi_item,#sb_instagram.sbi_col_4 #sbi_images .sbi_item,#sb_instagram.sbi_col_5 #sbi_images .sbi_item,#sb_instagram.sbi_col_6 #sbi_images .sbi_item,#sb_instagram.sbi_col_7 #sbi_images .sbi_item,#sb_instagram.sbi_col_8 #sbi_images .sbi_item,#sb_instagram.sbi_col_9 #sbi_images .sbi_item,#sb_instagram.sbi_col_10 #sbi_images .sbi_item{width:100%}}
|
instagram-feed-admin.php
CHANGED
@@ -511,32 +511,32 @@ function sb_instagram_settings_page() {
|
|
511 |
</p>
|
512 |
<table class="form-table">
|
513 |
<tbody>
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
</tbody>
|
541 |
</table>
|
542 |
</div>
|
@@ -1693,7 +1693,6 @@ function sbi_auto_save_tokens() {
|
|
1693 |
$options['sb_instagram_at'] = isset( $_POST['access_token'] ) ? sanitize_text_field( $_POST['access_token'] ) : '';
|
1694 |
|
1695 |
update_option( 'sb_instagram_settings', $options );
|
1696 |
-
echo $_POST['access_token'];
|
1697 |
}
|
1698 |
die();
|
1699 |
}
|
511 |
</p>
|
512 |
<table class="form-table">
|
513 |
<tbody>
|
514 |
+
<tr valign="top" class="sbi_pro">
|
515 |
+
<th scope="row"><label><?php _e('Media Type to Display'); ?></label></th>
|
516 |
+
<td>
|
517 |
+
<select name="sb_instagram_media_type" disabled>
|
518 |
+
<option value="all"><?php _e('All'); ?></option>
|
519 |
+
<option value="photos"><?php _e('Photos only'); ?></option>
|
520 |
+
<option value="videos"><?php _e('Videos only'); ?></option>
|
521 |
+
</select>
|
522 |
+
</td>
|
523 |
+
</tr>
|
524 |
|
525 |
+
<tr valign="top" class="sbi_pro">
|
526 |
+
<th scope="row"><label><?php _e("Enable Pop-up Lightbox", 'instagram-feed'); ?></label></th>
|
527 |
+
<td>
|
528 |
+
<input type="checkbox" name="sb_instagram_captionlinks" id="sb_instagram_captionlinks" disabled />
|
529 |
+
</td>
|
530 |
+
</tr>
|
531 |
|
532 |
+
<tr valign="top" class="sbi_pro">
|
533 |
+
<th scope="row"><label><?php _e("Link Posts to URL in Caption (Shoppable feed)"); ?></label></th>
|
534 |
+
<td>
|
535 |
+
<input type="checkbox" name="sb_instagram_captionlinks" id="sb_instagram_captionlinks" disabled />
|
536 |
+
<a class="sbi_tooltip_link sbi_pro" href="JavaScript:void(0);"><?php _e("What will this do?"); ?></a>
|
537 |
+
<p class="sbi_tooltip"><?php _e("Checking this box will change the link for each post to any url included in the caption for that Instagram post. The lightbox will be disabled. Visit <a href='https://smashballoon.com/make-a-shoppable-feed'>this link</a> to learn how this works."); ?></p>
|
538 |
+
</td>
|
539 |
+
</tr>
|
540 |
</tbody>
|
541 |
</table>
|
542 |
</div>
|
1693 |
$options['sb_instagram_at'] = isset( $_POST['access_token'] ) ? sanitize_text_field( $_POST['access_token'] ) : '';
|
1694 |
|
1695 |
update_option( 'sb_instagram_settings', $options );
|
|
|
1696 |
}
|
1697 |
die();
|
1698 |
}
|
instagram-feed.php
CHANGED
@@ -3,13 +3,13 @@
|
|
3 |
Plugin Name: Instagram Feed
|
4 |
Plugin URI: https://smashballoon.com/instagram-feed
|
5 |
Description: Display beautifully clean, customizable, and responsive Instagram feeds
|
6 |
-
Version: 1.
|
7 |
Author: Smash Balloon
|
8 |
Author URI: https://smashballoon.com/
|
9 |
License: GPLv2 or later
|
10 |
Text Domain: instagram-feed
|
11 |
|
12 |
-
Copyright
|
13 |
This program is free software; you can redistribute it and/or modify
|
14 |
it under the terms of the GNU General Public License as published by
|
15 |
the Free Software Foundation; either version 2 of the License, or
|
@@ -23,11 +23,12 @@ along with this program; if not, write to the Free Software
|
|
23 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
24 |
*/
|
25 |
|
26 |
-
define( 'SBIVER', '1.
|
27 |
|
28 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
|
|
29 |
//Include admin
|
30 |
-
include dirname( __FILE__ ) .'/instagram-feed-admin.php';
|
31 |
|
32 |
// Add shortcodes
|
33 |
add_shortcode('instagram-feed', 'display_instagram');
|
@@ -198,7 +199,7 @@ function display_instagram($atts, $content = null) {
|
|
198 |
$sb_instagram_content .= '>';
|
199 |
|
200 |
//Load More button
|
201 |
-
if( $sb_instagram_show_btn && !$sb_instagram_error ) $sb_instagram_content .= '<a class="sbi_load_btn" href="javascript:void(0);" '.$sb_instagram_button_styles.'>' . esc_html( stripslashes( $sb_instagram_load_btn_text ) ).'</a>';
|
202 |
|
203 |
//Follow button
|
204 |
if( $sb_instagram_show_follow_btn && !$sb_instagram_error ) $sb_instagram_content .= $sb_instagram_follow_btn_html;
|
3 |
Plugin Name: Instagram Feed
|
4 |
Plugin URI: https://smashballoon.com/instagram-feed
|
5 |
Description: Display beautifully clean, customizable, and responsive Instagram feeds
|
6 |
+
Version: 1.6
|
7 |
Author: Smash Balloon
|
8 |
Author URI: https://smashballoon.com/
|
9 |
License: GPLv2 or later
|
10 |
Text Domain: instagram-feed
|
11 |
|
12 |
+
Copyright 2018 Smash Balloon LLC (email : hey@smashballoon.com)
|
13 |
This program is free software; you can redistribute it and/or modify
|
14 |
it under the terms of the GNU General Public License as published by
|
15 |
the Free Software Foundation; either version 2 of the License, or
|
23 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
24 |
*/
|
25 |
|
26 |
+
define( 'SBIVER', '1.6' );
|
27 |
|
28 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
29 |
+
|
30 |
//Include admin
|
31 |
+
if ( is_admin() ) include dirname( __FILE__ ) .'/instagram-feed-admin.php';
|
32 |
|
33 |
// Add shortcodes
|
34 |
add_shortcode('instagram-feed', 'display_instagram');
|
199 |
$sb_instagram_content .= '>';
|
200 |
|
201 |
//Load More button
|
202 |
+
if( $sb_instagram_show_btn && !$sb_instagram_error ) $sb_instagram_content .= '<a class="sbi_load_btn" href="javascript:void(0);" '.$sb_instagram_button_styles.'><span class="sbi_btn_text">' . esc_html( stripslashes( $sb_instagram_load_btn_text ) ).'</span><i class="fa fa-spinner fa-pulse" aria-hidden="true" style="display:none;"></i></a>';
|
203 |
|
204 |
//Follow button
|
205 |
if( $sb_instagram_show_follow_btn && !$sb_instagram_error ) $sb_instagram_content .= $sb_instagram_follow_btn_html;
|
js/sb-instagram.js
CHANGED
@@ -147,7 +147,8 @@ if(!sbi_js_exists){
|
|
147 |
after: function() {
|
148 |
|
149 |
$self.find('.sbi_loader').remove();
|
150 |
-
|
|
|
151 |
/* Load more button */
|
152 |
if (this.hasNext()) morePosts.push('1');
|
153 |
|
@@ -158,7 +159,6 @@ if(!sbi_js_exists){
|
|
158 |
$self.css('padding-bottom', 0);
|
159 |
}
|
160 |
|
161 |
-
|
162 |
// Call Custom JS if it exists
|
163 |
if (typeof sbi_custom_js == 'function') setTimeout(function(){ sbi_custom_js(); }, 100);
|
164 |
|
@@ -323,6 +323,8 @@ if(!sbi_js_exists){
|
|
323 |
});
|
324 |
|
325 |
$loadBtn.click(function() {
|
|
|
|
|
326 |
userFeed.next();
|
327 |
});
|
328 |
|
147 |
after: function() {
|
148 |
|
149 |
$self.find('.sbi_loader').remove();
|
150 |
+
$self.find('.sbi_load_btn .fa-spinner').hide();
|
151 |
+
$self.find('.sbi_load_btn .sbi_btn_text').css('opacity', 1);
|
152 |
/* Load more button */
|
153 |
if (this.hasNext()) morePosts.push('1');
|
154 |
|
159 |
$self.css('padding-bottom', 0);
|
160 |
}
|
161 |
|
|
|
162 |
// Call Custom JS if it exists
|
163 |
if (typeof sbi_custom_js == 'function') setTimeout(function(){ sbi_custom_js(); }, 100);
|
164 |
|
323 |
});
|
324 |
|
325 |
$loadBtn.click(function() {
|
326 |
+
jQuery(this).find('.fa-spinner').show();
|
327 |
+
jQuery(this).find('.sbi_btn_text').css('opacity', 0);
|
328 |
userFeed.next();
|
329 |
});
|
330 |
|
js/sb-instagram.min.js
CHANGED
@@ -3,11 +3,11 @@ var sbi_js_exists=(typeof sbi_js_exists!=='undefined')?!0:!1;if(!sbi_js_exists){
|
|
3 |
function sbi_init(){window.sbiFeedMeta={};jQuery('#sb_instagram.sbi').each(function($i){var $self=jQuery(this),$target=$self.find('#sbi_images'),$loadBtn=$self.find("#sbi_load .sbi_load_btn"),imgRes='standard_resolution',cols=parseInt(this.getAttribute('data-cols'),10),feedOptions=JSON.parse(this.getAttribute('data-options')),getType='user',sortby='none',user_id=this.getAttribute('data-id'),num=this.getAttribute('data-num'),$header='',morePosts=[];jQuery(this).attr('data-sbi-index',$i);feedOptions.feedIndex=$i;window.sbiFeedMeta[$i]={'error':{},'idsInFeed':[]};if(feedOptions.sortby!=='')sortby=feedOptions.sortby;switch(this.getAttribute('data-res')){case 'auto':var feedWidth=$self.innerWidth(),colWidth=$self.innerWidth()/cols;var sbiWindowWidth=jQuery(window).width();if(sbiWindowWidth<640){if(feedWidth<640&&$self.is('.sbi_col_3, .sbi_col_4, .sbi_col_5, .sbi_col_6'))colWidth=300;if(feedWidth<640&&$self.is('.sbi_col_7, .sbi_col_8, .sbi_col_9, .sbi_col_10'))colWidth=100;if((feedWidth>320&&feedWidth<480)&&sbiWindowWidth<480)colWidth=480;if(feedWidth<320&&sbiWindowWidth<480)colWidth=300}
|
4 |
if(colWidth<150){imgRes='thumbnail'}else if(colWidth<320){imgRes='low_resolution'}else{imgRes='standard_resolution'}
|
5 |
if(feedWidth<=100)imgRes='low_resolution';break;case 'thumb':imgRes='thumbnail';break;case 'medium':imgRes='low_resolution';break;default:imgRes='standard_resolution'}
|
6 |
-
var ids_arr=user_id.replace(/ /g,'').split(",");var looparray=ids_arr;var headerStyles='',sbi_page_url='https://api.instagram.com/v1/users/'+ids_arr[0]+'?access_token='+sb_instagram_js_options.sb_instagram_at;if(feedOptions.headercolor.length)headerStyles='style="color: #'+feedOptions.headercolor+'"';jQuery.ajax({method:"GET",url:sbi_page_url,dataType:"jsonp",success:function(data){var sbiErrorResponse=data.meta.error_message;if(typeof sbiErrorResponse==='undefined'){$header='<a href="https://instagram.com/'+data.data.username+'" target="_blank" title="@'+data.data.username+'" class="sbi_header_link">';$header+='<div class="sbi_header_text">';$header+='<h3 '+headerStyles;if(data.data.bio.length==0||feedOptions.showbio!=="true")$header+=' class="sbi_no_bio"';$header+='>@'+data.data.username+'</h3>';if(data.data.bio.length&&feedOptions.showbio==="true")$header+='<p class="sbi_bio" '+headerStyles+'>'+data.data.bio+'</p>';$header+='</div>';$header+='<div class="sbi_header_img">';$header+='<div class="sbi_header_img_hover"><i></i></div>';$header+='<img src="'+data.data.profile_picture+'" alt="'+data.data.full_name+'" width="50" height="50">';$header+='</div>';$header+='</a>';$self.find('.sb_instagram_header').prepend($header);if($self.find('.sbi_follow_btn').length)$self.find('.sbi_follow_btn a').attr('href','https://instagram.com/'+data.data.username)}}});jQuery.each(looparray,function(index,entry){window.sbiFeedMeta[$i].idsInFeed.push(entry);var userFeed=new instagramfeed({target:$target,get:getType,sortBy:sortby,resolution:imgRes,limit:parseInt(num,10),template:'<div class="sbi_item sbi_type_{{model.type}} sbi_new" id="sbi_{{id}}" data-date="{{model.created_time_raw}}"><div class="sbi_photo_wrap"><a class="sbi_photo" href="{{link}}" target="_blank"><img src="{{image}}" alt="{{caption}}" width="200" height="200" /></a></div></div>',filter:function(image){var date=new Date(image.created_time*1000),time=date.getTime();image.created_time_raw=time;if(image.caption!=null)image.caption.text=image.caption.text.replace(/[^a-zA-Z ]/g,"");image.images.thumbnail.url=image.images.thumbnail.url.split("?ig_cache_key")[0];image.images.standard_resolution.url=image.images.standard_resolution.url.split("?ig_cache_key")[0];image.images.low_resolution.url=image.images.low_resolution.url.split("?ig_cache_key")[0];return!0},userId:parseInt(entry,10),accessToken:sb_instagram_js_options.sb_instagram_at,after:function(){$self.find('.sbi_loader').remove();if(this.hasNext())morePosts.push('1');if(morePosts.length>0){$loadBtn.show()}else{$loadBtn.hide();$self.css('padding-bottom',0)}
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
jQuery(document).ready(function(){sbi_init()})}
|
3 |
function sbi_init(){window.sbiFeedMeta={};jQuery('#sb_instagram.sbi').each(function($i){var $self=jQuery(this),$target=$self.find('#sbi_images'),$loadBtn=$self.find("#sbi_load .sbi_load_btn"),imgRes='standard_resolution',cols=parseInt(this.getAttribute('data-cols'),10),feedOptions=JSON.parse(this.getAttribute('data-options')),getType='user',sortby='none',user_id=this.getAttribute('data-id'),num=this.getAttribute('data-num'),$header='',morePosts=[];jQuery(this).attr('data-sbi-index',$i);feedOptions.feedIndex=$i;window.sbiFeedMeta[$i]={'error':{},'idsInFeed':[]};if(feedOptions.sortby!=='')sortby=feedOptions.sortby;switch(this.getAttribute('data-res')){case 'auto':var feedWidth=$self.innerWidth(),colWidth=$self.innerWidth()/cols;var sbiWindowWidth=jQuery(window).width();if(sbiWindowWidth<640){if(feedWidth<640&&$self.is('.sbi_col_3, .sbi_col_4, .sbi_col_5, .sbi_col_6'))colWidth=300;if(feedWidth<640&&$self.is('.sbi_col_7, .sbi_col_8, .sbi_col_9, .sbi_col_10'))colWidth=100;if((feedWidth>320&&feedWidth<480)&&sbiWindowWidth<480)colWidth=480;if(feedWidth<320&&sbiWindowWidth<480)colWidth=300}
|
4 |
if(colWidth<150){imgRes='thumbnail'}else if(colWidth<320){imgRes='low_resolution'}else{imgRes='standard_resolution'}
|
5 |
if(feedWidth<=100)imgRes='low_resolution';break;case 'thumb':imgRes='thumbnail';break;case 'medium':imgRes='low_resolution';break;default:imgRes='standard_resolution'}
|
6 |
+
var ids_arr=user_id.replace(/ /g,'').split(",");var looparray=ids_arr;var headerStyles='',sbi_page_url='https://api.instagram.com/v1/users/'+ids_arr[0]+'?access_token='+sb_instagram_js_options.sb_instagram_at;if(feedOptions.headercolor.length)headerStyles='style="color: #'+feedOptions.headercolor+'"';jQuery.ajax({method:"GET",url:sbi_page_url,dataType:"jsonp",success:function(data){var sbiErrorResponse=data.meta.error_message;if(typeof sbiErrorResponse==='undefined'){$header='<a href="https://instagram.com/'+data.data.username+'" target="_blank" title="@'+data.data.username+'" class="sbi_header_link">';$header+='<div class="sbi_header_text">';$header+='<h3 '+headerStyles;if(data.data.bio.length==0||feedOptions.showbio!=="true")$header+=' class="sbi_no_bio"';$header+='>@'+data.data.username+'</h3>';if(data.data.bio.length&&feedOptions.showbio==="true")$header+='<p class="sbi_bio" '+headerStyles+'>'+data.data.bio+'</p>';$header+='</div>';$header+='<div class="sbi_header_img">';$header+='<div class="sbi_header_img_hover"><i></i></div>';$header+='<img src="'+data.data.profile_picture+'" alt="'+data.data.full_name+'" width="50" height="50">';$header+='</div>';$header+='</a>';$self.find('.sb_instagram_header').prepend($header);if($self.find('.sbi_follow_btn').length)$self.find('.sbi_follow_btn a').attr('href','https://instagram.com/'+data.data.username)}}});jQuery.each(looparray,function(index,entry){window.sbiFeedMeta[$i].idsInFeed.push(entry);var userFeed=new instagramfeed({target:$target,get:getType,sortBy:sortby,resolution:imgRes,limit:parseInt(num,10),template:'<div class="sbi_item sbi_type_{{model.type}} sbi_new" id="sbi_{{id}}" data-date="{{model.created_time_raw}}"><div class="sbi_photo_wrap"><a class="sbi_photo" href="{{link}}" target="_blank"><img src="{{image}}" alt="{{caption}}" width="200" height="200" /></a></div></div>',filter:function(image){var date=new Date(image.created_time*1000),time=date.getTime();image.created_time_raw=time;if(image.caption!=null)image.caption.text=image.caption.text.replace(/[^a-zA-Z ]/g,"");image.images.thumbnail.url=image.images.thumbnail.url.split("?ig_cache_key")[0];image.images.standard_resolution.url=image.images.standard_resolution.url.split("?ig_cache_key")[0];image.images.low_resolution.url=image.images.low_resolution.url.split("?ig_cache_key")[0];return!0},userId:parseInt(entry,10),accessToken:sb_instagram_js_options.sb_instagram_at,after:function(){$self.find('.sbi_loader').remove();$self.find('.sbi_load_btn .fa-spinner').hide();$self.find('.sbi_load_btn .sbi_btn_text').css('opacity',1);if(this.hasNext())morePosts.push('1');if(morePosts.length>0){$loadBtn.show()}else{$loadBtn.hide();$self.css('padding-bottom',0)}
|
7 |
+
if(typeof sbi_custom_js=='function')setTimeout(function(){sbi_custom_js()},100);if(imgRes!=='thumbnail'){var sbi_imgLiquid=sbi_imgLiquid||{VER:"0.9.944"};sbi_imgLiquid.bgs_Available=!1,sbi_imgLiquid.bgs_CheckRunned=!1,function(i){function t(){if(!sbi_imgLiquid.bgs_CheckRunned){sbi_imgLiquid.bgs_CheckRunned=!0;var t=i('<span style="background-size:cover" />');i("body").append(t),!function(){var i=t[0];if(i&&window.getComputedStyle){var e=window.getComputedStyle(i,null);e&&e.backgroundSize&&(sbi_imgLiquid.bgs_Available="cover"===e.backgroundSize)}}(),t.remove()}}i.fn.extend({sbi_imgLiquid:function(e){this.defaults={fill:!0,verticalAlign:"center",horizontalAlign:"center",useBackgroundSize:!0,useDataHtmlAttr:!0,responsive:!0,delay:0,fadeInTime:0,removeBoxBackground:!0,hardPixels:!0,responsiveCheckTime:500,timecheckvisibility:500,onStart:null,onFinish:null,onItemStart:null,onItemFinish:null,onItemError:null},t();var a=this;return this.options=e,this.settings=i.extend({},this.defaults,this.options),this.settings.onStart&&this.settings.onStart(),this.each(function(t){function e(){-1===u.css("background-image").indexOf(encodeURI(c.attr("src")))&&u.css({"background-image":'url("'+encodeURI(c.attr("src"))+'")'}),u.css({"background-size":g.fill?"cover":"contain","background-position":(g.horizontalAlign+" "+g.verticalAlign).toLowerCase(),"background-repeat":"no-repeat"}),i("a:first",u).css({display:"block",width:"100%",height:"100%"}),i("img",u).css({display:"none"}),g.onItemFinish&&g.onItemFinish(t,u,c),u.addClass("sbi_imgLiquid_bgSize"),u.addClass("sbi_imgLiquid_ready"),l()}function o(){function e(){c.data("sbi_imgLiquid_error")||c.data("sbi_imgLiquid_loaded")||c.data("sbi_imgLiquid_oldProcessed")||(u.is(":visible")&&c[0].complete&&c[0].width>0&&c[0].height>0?(c.data("sbi_imgLiquid_loaded",!0),setTimeout(r,t*g.delay)):setTimeout(e,g.timecheckvisibility))}if(c.data("oldSrc")&&c.data("oldSrc")!==c.attr("src")){var a=c.clone().removeAttr("style");return a.data("sbi_imgLiquid_settings",c.data("sbi_imgLiquid_settings")),c.parent().prepend(a),c.remove(),c=a,c[0].width=0,void setTimeout(o,10)}return c.data("sbi_imgLiquid_oldProcessed")?void r():(c.data("sbi_imgLiquid_oldProcessed",!1),c.data("oldSrc",c.attr("src")),i("img:not(:first)",u).css("display","none"),u.css({overflow:"hidden"}),c.fadeTo(0,0).removeAttr("width").removeAttr("height").css({visibility:"visible","max-width":"none","max-height":"none",width:"auto",height:"auto",display:"block"}),c.on("error",n),c[0].onerror=n,e(),void d())}function d(){(g.responsive||c.data("sbi_imgLiquid_oldProcessed"))&&c.data("sbi_imgLiquid_settings")&&(g=c.data("sbi_imgLiquid_settings"),u.actualSize=u.get(0).offsetWidth+u.get(0).offsetHeight/1e4,u.sizeOld&&u.actualSize!==u.sizeOld&&r(),u.sizeOld=u.actualSize,setTimeout(d,g.responsiveCheckTime))}function n(){c.data("sbi_imgLiquid_error",!0),u.addClass("sbi_imgLiquid_error"),g.onItemError&&g.onItemError(t,u,c),l()}function s(){var i={};if(a.settings.useDataHtmlAttr){var t=u.attr("data-sbi_imgLiquid-fill"),e=u.attr("data-sbi_imgLiquid-horizontalAlign"),o=u.attr("data-sbi_imgLiquid-verticalAlign");("true"===t||"false"===t)&&(i.fill=Boolean("true"===t)),void 0===e||"left"!==e&&"center"!==e&&"right"!==e&&-1===e.indexOf("%")||(i.horizontalAlign=e),void 0===o||"top"!==o&&"bottom"!==o&&"center"!==o&&-1===o.indexOf("%")||(i.verticalAlign=o)}return sbi_imgLiquid.isIE&&a.settings.ieFadeInDisabled&&(i.fadeInTime=0),i}function r(){var i,e,a,o,d,n,s,r,m=0,h=0,f=u.width(),v=u.height();void 0===c.data("owidth")&&c.data("owidth",c[0].width),void 0===c.data("oheight")&&c.data("oheight",c[0].height),g.fill===f/v>=c.data("owidth")/c.data("oheight")?(i="100%",e="auto",a=Math.floor(f),o=Math.floor(f*(c.data("oheight")/c.data("owidth")))):(i="auto",e="100%",a=Math.floor(v*(c.data("owidth")/c.data("oheight"))),o=Math.floor(v)),d=g.horizontalAlign.toLowerCase(),s=f-a,"left"===d&&(h=0),"center"===d&&(h=.5*s),"right"===d&&(h=s),-1!==d.indexOf("%")&&(d=parseInt(d.replace("%",""),10),d>0&&(h=s*d*.01)),n=g.verticalAlign.toLowerCase(),r=v-o,"left"===n&&(m=0),"center"===n&&(m=.5*r),"bottom"===n&&(m=r),-1!==n.indexOf("%")&&(n=parseInt(n.replace("%",""),10),n>0&&(m=r*n*.01)),g.hardPixels&&(i=a,e=o),c.css({width:i,height:e,"margin-left":Math.floor(h),"margin-top":Math.floor(m)}),c.data("sbi_imgLiquid_oldProcessed")||(c.fadeTo(g.fadeInTime,1),c.data("sbi_imgLiquid_oldProcessed",!0),g.removeBoxBackground&&u.css("background-image","none"),u.addClass("sbi_imgLiquid_nobgSize"),u.addClass("sbi_imgLiquid_ready")),g.onItemFinish&&g.onItemFinish(t,u,c),l()}function l(){t===a.length-1&&a.settings.onFinish&&a.settings.onFinish()}var g=a.settings,u=i(this),c=i("img:first",u);return c.length?(c.data("sbi_imgLiquid_settings")?(u.removeClass("sbi_imgLiquid_error").removeClass("sbi_imgLiquid_ready"),g=i.extend({},c.data("sbi_imgLiquid_settings"),a.options)):g=i.extend({},a.settings,s()),c.data("sbi_imgLiquid_settings",g),g.onItemStart&&g.onItemStart(t,u,c),void(sbi_imgLiquid.bgs_Available&&g.useBackgroundSize?e():o())):void n()})}})}(jQuery);!function(){var css=sbi_imgLiquid.injectCss,head=document.getElementsByTagName('head')[0],style=document.createElement('style');style.type='text/css';if(style.styleSheet){style.styleSheet.cssText=css}else{style.appendChild(document.createTextNode(css))}
|
8 |
+
head.appendChild(style)}();$self.find(".sbi_photo").sbi_imgLiquid({fill:!0})}
|
9 |
+
var sbi_delay=(function(){var sbi_timer=0;return function(sbi_callback,sbi_ms){clearTimeout(sbi_timer);sbi_timer=setTimeout(sbi_callback,sbi_ms)}})();jQuery(window).resize(function(){sbi_delay(function(){sbiSetPhotoHeight()},500)});function sbiSetPhotoHeight(){if(imgRes!=='thumbnail'){var sbi_photo_width=$self.find('.sbi_photo').eq(0).innerWidth();var sbi_num_cols=parseInt(cols);if(!$self.hasClass('sbi_disable_mobile')){var sbiWindowWidth=jQuery(window).width();if(sbiWindowWidth<640&&(parseInt(cols)>2&&parseInt(cols)<7))sbi_num_cols=2;if(sbiWindowWidth<640&&(parseInt(cols)>6&&parseInt(cols)<11))sbi_num_cols=4;if(sbiWindowWidth<=480&&parseInt(cols)>2)sbi_num_cols=1}
|
10 |
+
var sbi_photo_width_manual=($self.find('#sbi_images').width()/sbi_num_cols)-(feedOptions.imagepadding*2);if(sbi_photo_width<=(sbi_photo_width_manual))sbi_photo_width=sbi_photo_width_manual;$self.find('.sbi_photo').css('height',sbi_photo_width)}}
|
11 |
+
sbiSetPhotoHeight();!function(i){var n={callback:function(){},runOnLoad:!0,frequency:100,sbiPreviousVisibility:null},c={};c.sbiCheckVisibility=function(i,n){if(jQuery.contains(document,i[0])){var e=n.sbiPreviousVisibility,t=i.is(":visible");n.sbiPreviousVisibility=t,null==e?n.runOnLoad&&n.callback(i,t):e!==t&&n.callback(i,t),setTimeout(function(){c.sbiCheckVisibility(i,n)},n.frequency)}},i.fn.sbiVisibilityChanged=function(e){var t=i.extend({},n,e);return this.each(function(){c.sbiCheckVisibility(i(this),t)})}}(jQuery);jQuery(".sbi").filter(':hidden').sbiVisibilityChanged({callback:function(element,visible){sbiSetPhotoHeight()},runOnLoad:!1});jQuery('#sb_instagram .sbi_photo').each(function(){$sbi_photo=jQuery(this);$sbi_photo.hover(function(){jQuery(this).fadeTo(200,0.85)},function(){jQuery(this).stop().fadeTo(500,1)});if($sbi_photo.closest('.sbi_item').hasClass('sbi_type_video')){if(!$sbi_photo.find('.sbi_playbtn').length)$sbi_photo.append('<i class="fa fa-play sbi_playbtn"></i>')}});$self.find('#sbi_images .sbi_item.sbi_new').sort(function(a,b){var aComp=jQuery(a).data('date'),bComp=jQuery(b).data('date');if(sortby=='none'){return bComp-aComp}else{return(Math.round(Math.random())-0.5)}}).appendTo($self.find("#sbi_images"));setTimeout(function(){jQuery('#sbi_images .sbi_item.sbi_new').removeClass('sbi_new');morePosts=[]},500);function sbiGetItemSize(){$self.removeClass('sbi_small sbi_medium');var sbiItemWidth=$self.find('.sbi_item').innerWidth();if(sbiItemWidth>120&&sbiItemWidth<240){$self.addClass('sbi_medium')}else if(sbiItemWidth<=120){$self.addClass('sbi_small')}}
|
12 |
+
sbiGetItemSize()},error:function(data){var sbiErrorMsg='',sbiErrorDir='',sbiErrorResponse=data;if(sbiErrorResponse.indexOf('access_token')>-1){sbiErrorMsg+='<p><b>Error: Access Token is not valid or has expired</b><br /><span>This error message is only visible to WordPress admins</span>';sbiErrorDir="<p>There's an issue with the Instagram Access Token that you are using. Please obtain a new Access Token on the plugin's Settings page.<br />If you continue to have an issue with your Access Token then please see <a href='https://smashballoon.com/my-instagram-access-token-keep-expiring/' target='_blank'>this FAQ</a> for more information.";jQuery('#sb_instagram').empty().append('<p style="text-align: center;">Unable to show Instagram photos</p><div id="sbi_mod_error">'+sbiErrorMsg+sbiErrorDir+'</div>');return}else if(sbiErrorResponse.indexOf('user does not exist')>-1||sbiErrorResponse.indexOf('you cannot view this resource')>-1){window.sbiFeedMeta[$i].error={errorMsg:'<p><b>Error: User ID <span class="sbiErrorIds">'+window.sbiFeedMeta[$i].idsInFeed[index]+'</span> does not exist, is invalid, or is private</b><br /><span>This error is only visible to WordPress admins</span>',errorDir:"<p>Please double check the Instagram User ID that you are using and ensure that it is valid and not from a private account. To find your User ID simply enter your Instagram user name into this <a href='https://smashballoon.com/instagram-feed/find-instagram-user-id/' target='_blank'>tool</a>.</p>"};if(!$self.find('#sbi_mod_error').length){$self.prepend('<div id="sbi_mod_error">'+window.sbiFeedMeta[$i].error.errorMsg+window.sbiFeedMeta[$i].error.errorDir+'</div>')}else if($self.find('.sbiErrorIds').text().indexOf(window.sbiFeedMeta[$i].idsInFeed[index])==-1){$self.find('.sbiErrorIds').append(','+window.sbiFeedMeta[$i].idsInFeed[index])}}else if(sbiErrorResponse.indexOf('No images were returned')>-1){window.sbiFeedMeta[$i].error={errorMsg:'<p><b>Error: User ID <span class="sbiErrorNone">'+window.sbiFeedMeta[$i].idsInFeed[index]+'</span> has no posts</b><br /><span>This error is only visible to WordPress admins</span>',errorDir:"<p>If you are the owner of this account, make a post on Instagram to see it in your feed.</p>"};if(!$self.find('#sbi_mod_error.sbi_error_none').length){$self.prepend('<div id="sbi_mod_error" class="sbi_error_none">'+window.sbiFeedMeta[$i].error.errorMsg+window.sbiFeedMeta[$i].error.errorDir+'</div>')}else if($self.find('.sbiErrorNone').text().indexOf(window.sbiFeedMeta[$i].idsInFeed[index])==-1){$self.find('.sbiErrorNone').append(','+window.sbiFeedMeta[$i].idsInFeed[index])}}}});$loadBtn.click(function(){jQuery(this).find('.fa-spinner').show();jQuery(this).find('.sbi_btn_text').css('opacity',0);userFeed.next()});userFeed.run()})})}
|
13 |
jQuery(document).ready(function(){sbi_init()})}
|