Version Description
Fixed: Hashtag exclude. Fixed: Privacy policy text structure.
Download this release
Release Info
Developer | 10web |
Plugin | WD Instagram Feed – Instagram Gallery |
Version | 1.3.25 |
Comparing to | |
See all releases |
Code changes from version 1.3.24 to 1.3.25
- admin/models/WDIModelFeeds_wdi.php +6 -6
- admin/views/WDIViewFeeds_wdi.php +6 -4
- framework/WDI_admin_view.php +1 -1
- frontend/views/WDIViewGalleryBox.php +11 -3
- js/wdi_admin.js +1 -1
- js/wdi_frontend.js +25 -79
- js/wdi_frontend.min.js +1 -1
- js/wdi_instagram.js +6 -14
- readme.txt +5 -1
- wd-instagram-feed.php +21 -17
admin/models/WDIModelFeeds_wdi.php
CHANGED
@@ -89,7 +89,7 @@ class WDIModelFeeds_wdi {
|
|
89 |
'feed_display_view' => 'load_more_btn',
|
90 |
'sort_images_by' => 'date',
|
91 |
'display_order' => 'desc',
|
92 |
-
'follow_on_instagram_btn' => '1',
|
93 |
'display_header' => '0',
|
94 |
'number_of_photos' => '20',
|
95 |
'load_more_number' => '4',
|
@@ -101,11 +101,11 @@ class WDIModelFeeds_wdi {
|
|
101 |
'resort_after_load_more' => '0',
|
102 |
'show_likes' => '0',
|
103 |
'show_description' => '0',
|
104 |
-
'show_comments' => '
|
105 |
-
'show_usernames' => '1',
|
106 |
-
'display_user_info' => '1',
|
107 |
-
'display_user_post_follow_number' => '1',
|
108 |
-
'show_full_description' => '1',
|
109 |
'disable_mobile_layout' => '0',
|
110 |
'feed_type' => 'thumbnails',
|
111 |
'feed_item_onclick' => 'lightbox',
|
89 |
'feed_display_view' => 'load_more_btn',
|
90 |
'sort_images_by' => 'date',
|
91 |
'display_order' => 'desc',
|
92 |
+
'follow_on_instagram_btn' => '1', /* @TODO API Changes 2020. */
|
93 |
'display_header' => '0',
|
94 |
'number_of_photos' => '20',
|
95 |
'load_more_number' => '4',
|
101 |
'resort_after_load_more' => '0',
|
102 |
'show_likes' => '0',
|
103 |
'show_description' => '0',
|
104 |
+
'show_comments' => '1', /* @TODO API Changes 2020. */
|
105 |
+
'show_usernames' => '1', /* @TODO API Changes 2020. */
|
106 |
+
'display_user_info' => '1', /* @TODO API Changes 2020. */
|
107 |
+
'display_user_post_follow_number' => '1', /* @TODO API Changes 2020. */
|
108 |
+
'show_full_description' => '1', /* @TODO API Changes 2020. */
|
109 |
'disable_mobile_layout' => '0',
|
110 |
'feed_type' => 'thumbnails',
|
111 |
'feed_item_onclick' => 'lightbox',
|
admin/views/WDIViewFeeds_wdi.php
CHANGED
@@ -242,7 +242,7 @@ class WDIViewFeeds_wdi
|
|
242 |
array(
|
243 |
//'feed_name' => array('name' => 'feed_name', 'title' => __('Feed Title', "wd-instagram-feed"), 'type' => 'input', 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
|
244 |
'liked_feed' => array('disabled_options' => array('liked'), 'disabled' => array('text' => __("Feed of liked media is available only in premium version", "wd-instagram-feed")), 'name' => 'liked_feed', 'title' => __('Feed Media', "wd-instagram-feed"), 'type' => 'select', 'valid_options' => array('userhash' => __('Username/Hashtag', "wd-instagram-feed"), 'liked' => __('Media I liked', "wd-instagram-feed")), 'break' => 'false', 'hide_ids' => array(), 'tooltip' => __('Display media of User/Hashtag or the media I liked', "wd-instagram-feed"), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
|
245 |
-
'feed_users' => array('name' => 'feed_users', 'title' => __('Feed
|
246 |
'hashtag_top_recent' => array('name' => 'hashtag_top_recent', 'title' => __('Hashtag Top/Recent', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Recent', "wd-instagram-feed"), '0' => __('Top', "wd-instagram-feed")), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings')), 'hide_ids' => array('1' => 'popup_width,popup_height')),
|
247 |
),
|
248 |
array(
|
@@ -284,15 +284,16 @@ class WDIViewFeeds_wdi
|
|
284 |
'feed_resolution' => array('name' => 'feed_resolution', 'title' => __('Feed Media Resolution', "wd-instagram-feed"), 'type' => 'select', 'label' => array('text' => '', 'place' => 'after'), 'valid_options' => array('optimal' => 'Optimal', 'standard' => 'Standard (640 pixels)', 'low' => 'Low (320 pixels)', 'thumbnail' => 'Thumbnail (150 pixels)'), 'tooltip' => 'If set optimal, loaded media size is calculated according to container size. Fast loading and no stretched images.', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
|
285 |
'thumb_user' => array('name' => 'thumb_user', 'title' => __('Featured Image', "wd-instagram-feed"), 'valid_options' => array(), 'type' => 'select', 'tooltip' => __('Select featured image for header section', "wd-instagram-feed"), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
|
286 |
'display_header' => array('name' => 'display_header', 'title' => __('Show Feed Header', "wd-instagram-feed"), 'type' => 'checkbox', 'tooltip' => __('Header includes feed title and featured image', "wd-instagram-feed"), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
|
|
|
287 |
'show_usernames' => array('name' => 'show_usernames', 'title' => __('Show User Data', "wd-instagram-feed"), 'type' => 'checkbox', 'tooltip' => '','hide_ids' => array('display_user_info','display_user_post_follow_number','follow_on_instagram_btn'), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
|
288 |
'follow_on_instagram_btn' => array('name' => 'follow_on_instagram_btn', 'title' => __('Show "Follow On Instagram" button', "wd-instagram-feed"), 'type' => 'checkbox', 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
|
289 |
'display_user_post_follow_number' => array('name' => 'display_user_post_follow_number', 'title' => __('Show User Posts and Followers count', "wd-instagram-feed"), 'type' => 'checkbox', 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
|
290 |
'display_user_info' => array('name' => 'display_user_info', 'title' => __('Show User Bio and Website', "wd-instagram-feed"), 'type' => 'checkbox', 'tooltip' => __('User bio will be displayed if feed has only one user', "wd-instagram-feed"), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
|
291 |
'show_description' => array('switched' => 'off', 'name' => 'show_description', 'title' => __('Show Media Caption', "wd-instagram-feed"), 'type' => 'checkbox', 'label' => array('place' => 'after', 'class' => 'wdi_pro_only', 'text' => __("This feature is available only in premium version", "wd-instagram-feed"), 'br' => 'true'), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
|
292 |
-
'show_likes' => array('switched' => 'off', 'name' => 'show_likes', 'title' => __('Show Number of Likes', "wd-instagram-feed"), 'type' => 'checkbox', 'label' => array('place' => 'after', 'class' => 'wdi_pro_only', 'text' => __("This feature is available only in premium version", "wd-instagram-feed"), 'br' => 'true'), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
|
293 |
-
'show_comments' => array('switched' => 'off', 'name' => 'show_comments', 'title' => __('Show Number of Comments', "wd-instagram-feed"), 'type' => 'checkbox', 'label' => array('place' => 'after', 'class' => 'wdi_pro_only', 'text' => __("This feature is available only in premium version", "wd-instagram-feed"), 'br' => 'true'), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
|
294 |
-
'show_username_on_thumb' => array('switched' => 'off', 'name' => 'show_username_on_thumb', 'title' => __('Show Username On Image Thumb', "wd-instagram-feed"), 'type' => 'checkbox', 'label' => array('place' => 'after', 'class' => 'wdi_pro_only', 'text' => __("This feature is available only in premium version", "wd-instagram-feed"), 'br' => 'true'), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry'))),
|
295 |
'show_full_description' => array('name' => 'show_full_description', 'title' => __('Show Full Description', "wd-instagram-feed"), 'type' => 'checkbox', 'tooltip' => __('Discription will be shown no matter how long it is', "wd-instagram-feed"), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'masonry'))),
|
|
|
|
|
|
|
296 |
)
|
297 |
)
|
298 |
),
|
@@ -336,6 +337,7 @@ class WDIViewFeeds_wdi
|
|
336 |
'popup_enable_ctrl_btn' => array('name' => 'popup_enable_ctrl_btn', 'title' => __('Enable Control Buttons', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'hide_ids' => array('0' => 'popup_enable_info,popup_enable_fullscreen,popup_enable_info,popup_enable_comment,popup_enable_download,popup_enable_share_buttons,popup_enable_fullsize_image'), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
|
337 |
'popup_enable_info' => array('disabled_options' => array('1' => '', '0' => ''), 'name' => 'popup_enable_info', 'title' => __('Enable Caption Control', "wd-instagram-feed"), 'type' => 'radio', 'label' => array('place' => 'after', 'class' => 'wdi_pro_only', 'text' => __("This feature is available only in premium version", "wd-instagram-feed"), 'br' => 'true'), 'valid_options' => array('1' => 'Yes', '0' => 'No'), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
|
338 |
'popup_enable_fullscreen' => array('name' => 'popup_enable_fullscreen', 'title' => __('Show Fullscreen Control Button', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
|
|
|
339 |
'popup_enable_comment' => array('switched' => 'off', 'disabled_options' => array('1' => '', '0' => ''), 'label' => array('place' => 'after', 'class' => 'wdi_pro_only', 'text' => __("This feature is available only in premium version", "wd-instagram-feed"), 'br' => 'true'), 'name' => 'popup_enable_comment', 'title' => __('Enable Comments Control', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
|
340 |
'popup_enable_fullsize_image' => array('name' => 'popup_enable_fullsize_image', 'title' => __('Add Link to Instagram Post', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
|
341 |
'popup_enable_download' => array('name' => 'popup_enable_download', 'title' => __('Enable Download Button', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
|
242 |
array(
|
243 |
//'feed_name' => array('name' => 'feed_name', 'title' => __('Feed Title', "wd-instagram-feed"), 'type' => 'input', 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
|
244 |
'liked_feed' => array('disabled_options' => array('liked'), 'disabled' => array('text' => __("Feed of liked media is available only in premium version", "wd-instagram-feed")), 'name' => 'liked_feed', 'title' => __('Feed Media', "wd-instagram-feed"), 'type' => 'select', 'valid_options' => array('userhash' => __('Username/Hashtag', "wd-instagram-feed"), 'liked' => __('Media I liked', "wd-instagram-feed")), 'break' => 'false', 'hide_ids' => array(), 'tooltip' => __('Display media of User/Hashtag or the media I liked', "wd-instagram-feed"), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
|
245 |
+
'feed_users' => array('name' => 'feed_users', 'title' => __('Feed Username and Hashtags', "wd-instagram-feed"), 'type' => 'input', 'input_type' => 'hidden', 'tooltip' => sprintf('%s <span class="wdi_settings_notification">%s</span>', __('Add username or hashtags to your feed. Hashtags must start with #, username shouldn\'t start with @.', "wd-instagram-feed"), __('Note, that the more hashtags you add, the slower feed loading will be on front-end.', "wd-instagram-feed")), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
|
246 |
'hashtag_top_recent' => array('name' => 'hashtag_top_recent', 'title' => __('Hashtag Top/Recent', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Recent', "wd-instagram-feed"), '0' => __('Top', "wd-instagram-feed")), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings')), 'hide_ids' => array('1' => 'popup_width,popup_height')),
|
247 |
),
|
248 |
array(
|
284 |
'feed_resolution' => array('name' => 'feed_resolution', 'title' => __('Feed Media Resolution', "wd-instagram-feed"), 'type' => 'select', 'label' => array('text' => '', 'place' => 'after'), 'valid_options' => array('optimal' => 'Optimal', 'standard' => 'Standard (640 pixels)', 'low' => 'Low (320 pixels)', 'thumbnail' => 'Thumbnail (150 pixels)'), 'tooltip' => 'If set optimal, loaded media size is calculated according to container size. Fast loading and no stretched images.', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
|
285 |
'thumb_user' => array('name' => 'thumb_user', 'title' => __('Featured Image', "wd-instagram-feed"), 'valid_options' => array(), 'type' => 'select', 'tooltip' => __('Select featured image for header section', "wd-instagram-feed"), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
|
286 |
'display_header' => array('name' => 'display_header', 'title' => __('Show Feed Header', "wd-instagram-feed"), 'type' => 'checkbox', 'tooltip' => __('Header includes feed title and featured image', "wd-instagram-feed"), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
|
287 |
+
/* @TODO API Changes 2020. */
|
288 |
'show_usernames' => array('name' => 'show_usernames', 'title' => __('Show User Data', "wd-instagram-feed"), 'type' => 'checkbox', 'tooltip' => '','hide_ids' => array('display_user_info','display_user_post_follow_number','follow_on_instagram_btn'), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
|
289 |
'follow_on_instagram_btn' => array('name' => 'follow_on_instagram_btn', 'title' => __('Show "Follow On Instagram" button', "wd-instagram-feed"), 'type' => 'checkbox', 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
|
290 |
'display_user_post_follow_number' => array('name' => 'display_user_post_follow_number', 'title' => __('Show User Posts and Followers count', "wd-instagram-feed"), 'type' => 'checkbox', 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
|
291 |
'display_user_info' => array('name' => 'display_user_info', 'title' => __('Show User Bio and Website', "wd-instagram-feed"), 'type' => 'checkbox', 'tooltip' => __('User bio will be displayed if feed has only one user', "wd-instagram-feed"), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
|
292 |
'show_description' => array('switched' => 'off', 'name' => 'show_description', 'title' => __('Show Media Caption', "wd-instagram-feed"), 'type' => 'checkbox', 'label' => array('place' => 'after', 'class' => 'wdi_pro_only', 'text' => __("This feature is available only in premium version", "wd-instagram-feed"), 'br' => 'true'), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
|
|
|
|
|
|
|
293 |
'show_full_description' => array('name' => 'show_full_description', 'title' => __('Show Full Description', "wd-instagram-feed"), 'type' => 'checkbox', 'tooltip' => __('Discription will be shown no matter how long it is', "wd-instagram-feed"), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'masonry'))),
|
294 |
+
'show_likes' => array('switched' => 'off', 'name' => 'show_likes', 'title' => __('Show Number of Likes', "wd-instagram-feed"), 'type' => 'checkbox', 'label' => array('place' => 'after', 'class' => 'wdi_pro_only', 'text' => __("This feature is available only in premium version", "wd-instagram-feed"), 'br' => 'true'), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
|
295 |
+
'show_comments' => array('switched' => 'off', 'name' => 'show_comments', 'title' => __('Show Number of Comments', "wd-instagram-feed"), 'type' => 'checkbox', 'label' => array('place' => 'after', 'class' => 'wdi_pro_only', 'text' => __("This feature is available only in premium version", "wd-instagram-feed"), 'br' => 'true'), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
|
296 |
+
'show_username_on_thumb' => array('switched' => 'off', 'name' => 'show_username_on_thumb', 'title' => __('Show Username On Image Thumb', "wd-instagram-feed"), 'type' => 'checkbox', 'label' => array('place' => 'after', 'class' => 'wdi_pro_only', 'text' => __("This feature is available only in premium version", "wd-instagram-feed"), 'br' => 'true'), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry'))),
|
297 |
)
|
298 |
)
|
299 |
),
|
337 |
'popup_enable_ctrl_btn' => array('name' => 'popup_enable_ctrl_btn', 'title' => __('Enable Control Buttons', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'hide_ids' => array('0' => 'popup_enable_info,popup_enable_fullscreen,popup_enable_info,popup_enable_comment,popup_enable_download,popup_enable_share_buttons,popup_enable_fullsize_image'), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
|
338 |
'popup_enable_info' => array('disabled_options' => array('1' => '', '0' => ''), 'name' => 'popup_enable_info', 'title' => __('Enable Caption Control', "wd-instagram-feed"), 'type' => 'radio', 'label' => array('place' => 'after', 'class' => 'wdi_pro_only', 'text' => __("This feature is available only in premium version", "wd-instagram-feed"), 'br' => 'true'), 'valid_options' => array('1' => 'Yes', '0' => 'No'), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
|
339 |
'popup_enable_fullscreen' => array('name' => 'popup_enable_fullscreen', 'title' => __('Show Fullscreen Control Button', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
|
340 |
+
/* @TODO API Changes 2020. */
|
341 |
'popup_enable_comment' => array('switched' => 'off', 'disabled_options' => array('1' => '', '0' => ''), 'label' => array('place' => 'after', 'class' => 'wdi_pro_only', 'text' => __("This feature is available only in premium version", "wd-instagram-feed"), 'br' => 'true'), 'name' => 'popup_enable_comment', 'title' => __('Enable Comments Control', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
|
342 |
'popup_enable_fullsize_image' => array('name' => 'popup_enable_fullsize_image', 'title' => __('Add Link to Instagram Post', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
|
343 |
'popup_enable_download' => array('name' => 'popup_enable_download', 'title' => __('Enable Download Button', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
|
framework/WDI_admin_view.php
CHANGED
@@ -232,7 +232,7 @@ class WDI_admin_view{
|
|
232 |
</div>
|
233 |
</div>
|
234 |
<div style="margin-left: 15px;font-style: italic;">
|
235 |
-
|
236 |
</div>
|
237 |
<?php
|
238 |
}
|
232 |
</div>
|
233 |
</div>
|
234 |
<div style="margin-left: 15px;font-style: italic;">
|
235 |
+
<p>Log out from current Instagram account(same browser)<br> before signing in to the another account.</p>
|
236 |
</div>
|
237 |
<?php
|
238 |
}
|
frontend/views/WDIViewGalleryBox.php
CHANGED
@@ -15,7 +15,13 @@ class WDIViewGalleryBox {
|
|
15 |
|
16 |
$feed_id = (int) WDILibrary::get('feed_id', 0);
|
17 |
$current_feed = $this->model->get_feed_row_data($feed_id);
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
$theme_row = WDILibrary::arrayToObject($this->model->get_theme_row_data($current_feed['theme_id']));
|
20 |
$option_row = WDILibrary::arrayToObject($current_feed);
|
21 |
$option_row->preload_images_count = 0;
|
@@ -298,7 +304,7 @@ class WDIViewGalleryBox {
|
|
298 |
}
|
299 |
continue;
|
300 |
//sanitizing image description
|
301 |
-
$instaDesc = $image_row->description
|
302 |
$instaDesc = preg_replace('/\\\\/', esc_html('\'), $instaDesc);
|
303 |
|
304 |
/*last two are ZWSP and P-SEP*/
|
@@ -355,7 +361,9 @@ continue;
|
|
355 |
<i title="<?php echo __('Fullscreen', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_fullscreen tenweb-i tenweb-i-arrows-out"></i>
|
356 |
<?php } if ($popup_enable_info) { ?>
|
357 |
<i title="<?php echo __('Show Caption', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_info tenweb-i tenweb-i-info"></i>
|
358 |
-
|
|
|
|
|
359 |
<i title="<?php echo __('Show comments', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_comment tenweb-i tenweb-i-comment"></i>
|
360 |
<?php } if ($popup_enable_rate) { ?>
|
361 |
<i title="<?php echo __('Show rating', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_rate tenweb-i tenweb-i-star"></i>
|
15 |
|
16 |
$feed_id = (int) WDILibrary::get('feed_id', 0);
|
17 |
$current_feed = $this->model->get_feed_row_data($feed_id);
|
18 |
+
$is_hashtag = false;
|
19 |
+
if ( isset($current_feed["thumb_user"]) && !empty($current_feed["thumb_user"]) ) {
|
20 |
+
$first_char = mb_substr($current_feed["thumb_user"], 0, 1);
|
21 |
+
if ( $first_char === "#" ) {
|
22 |
+
$is_hashtag = TRUE;
|
23 |
+
}
|
24 |
+
}
|
25 |
$theme_row = WDILibrary::arrayToObject($this->model->get_theme_row_data($current_feed['theme_id']));
|
26 |
$option_row = WDILibrary::arrayToObject($current_feed);
|
27 |
$option_row->preload_images_count = 0;
|
304 |
}
|
305 |
continue;
|
306 |
//sanitizing image description
|
307 |
+
$instaDesc = $image_row->description;
|
308 |
$instaDesc = preg_replace('/\\\\/', esc_html('\'), $instaDesc);
|
309 |
|
310 |
/*last two are ZWSP and P-SEP*/
|
361 |
<i title="<?php echo __('Fullscreen', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_fullscreen tenweb-i tenweb-i-arrows-out"></i>
|
362 |
<?php } if ($popup_enable_info) { ?>
|
363 |
<i title="<?php echo __('Show Caption', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_info tenweb-i tenweb-i-info"></i>
|
364 |
+
<?php }
|
365 |
+
/* @TODO API Changes 2020. */
|
366 |
+
if ( $enable_comment_social && !$is_hashtag ) { ?>
|
367 |
<i title="<?php echo __('Show comments', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_comment tenweb-i tenweb-i-comment"></i>
|
368 |
<?php } if ($popup_enable_rate) { ?>
|
369 |
<i title="<?php echo __('Show rating', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_rate tenweb-i tenweb-i-star"></i>
|
js/wdi_admin.js
CHANGED
@@ -564,7 +564,7 @@ wdi_controller.makeInstagramUserRequest = function(user_input, ignoreConfirm) {
|
|
564 |
}
|
565 |
|
566 |
if(user_feed && hashtag_feed){
|
567 |
-
alert("You can add only username or hashtags.")
|
568 |
return false;
|
569 |
}
|
570 |
|
564 |
}
|
565 |
|
566 |
if(user_feed && hashtag_feed){
|
567 |
+
alert("You can add only username or hashtags.");
|
568 |
return false;
|
569 |
}
|
570 |
|
js/wdi_frontend.js
CHANGED
@@ -326,22 +326,17 @@ wdi_front.init = function (currentFeed)
|
|
326 |
for (var i = 0; i < currentFeed.dataCount; i++) {
|
327 |
wdi_front.instagramRequest(i, currentFeed);
|
328 |
}
|
329 |
-
|
330 |
-
|
331 |
if (currentFeed.feed_row["number_of_photos"] > 0) {
|
332 |
wdi_front.ajaxLoader(currentFeed);
|
333 |
}
|
334 |
-
|
335 |
-
|
336 |
//setting feed name
|
337 |
if (currentFeed['feed_row']['display_header'] === '1') {
|
338 |
wdi_front.show('header', currentFeed);
|
339 |
}
|
|
|
340 |
if (currentFeed['feed_row']['show_usernames'] === '1') {
|
341 |
wdi_front.show('users', currentFeed);
|
342 |
}
|
343 |
-
|
344 |
-
|
345 |
}
|
346 |
|
347 |
wdi_front.getFeedItemResolution = function (currentFeed) {
|
@@ -419,7 +414,6 @@ wdi_front.isJsonString = function (str)
|
|
419 |
*/
|
420 |
wdi_front.instagramRequest = function (id, currentFeed)
|
421 |
{
|
422 |
-
|
423 |
var feed_users = currentFeed.feed_users,
|
424 |
_this = this;
|
425 |
if (typeof feed_users[id] === 'string' && feed_users[id] === 'self') { // self liked media
|
@@ -454,7 +448,7 @@ wdi_front.instagramRequest = function (id, currentFeed)
|
|
454 |
_this.saveUserData(response, currentFeed.feed_users[id], currentFeed);
|
455 |
}
|
456 |
}
|
457 |
-
},null, currentFeed.feed_row.hashtag_top_recent);
|
458 |
}
|
459 |
else
|
460 |
if (this.getInputType(feed_users[id]['username']) == 'user') {
|
@@ -492,10 +486,7 @@ wdi_front.instagramRequest = function (id, currentFeed)
|
|
492 |
}
|
493 |
}
|
494 |
});
|
495 |
-
|
496 |
}
|
497 |
-
|
498 |
-
|
499 |
}
|
500 |
|
501 |
/**
|
@@ -537,7 +528,6 @@ wdi_front.saveUserData = function (data, user, currentFeed)
|
|
537 |
|
538 |
//if getted objects is not enough then recuest new ones
|
539 |
if (currentFeed.currentResponseLength < currentFeed.feed_row.number_of_photos && !wdi_front.userHasNoPhoto(currentFeed)) {
|
540 |
-
//console.log('initial recursion');
|
541 |
/*here we are calling loadMore function out of recursion cycle, after this initial-keep call
|
542 |
loadMore will be called with 'initial' recursively until the desired number of photos is reached
|
543 |
if possible*/
|
@@ -560,13 +550,8 @@ wdi_front.saveUserData = function (data, user, currentFeed)
|
|
560 |
feed_container.find('.wdi_spinner').addClass('wdi_hidden');
|
561 |
}
|
562 |
}
|
563 |
-
;
|
564 |
-
|
565 |
}
|
566 |
-
|
567 |
-
|
568 |
}
|
569 |
-
|
570 |
}
|
571 |
|
572 |
|
@@ -583,7 +568,6 @@ wdi_front.saveSelfUserData = function (data, currentFeed)
|
|
583 |
|
584 |
currentFeed.usersData.push(data);
|
585 |
|
586 |
-
|
587 |
currentFeed.currentResponseLength = wdi_front.getArrayContentLength(currentFeed.usersData, 'data');
|
588 |
currentFeed.allResponseLength += currentFeed.currentResponseLength;
|
589 |
|
@@ -593,7 +577,6 @@ wdi_front.saveSelfUserData = function (data, currentFeed)
|
|
593 |
//if retrieved objects are not enough then request new ones
|
594 |
|
595 |
if (currentFeed.currentResponseLength < currentFeed.feed_row.number_of_photos && !wdi_front.userHasNoPhoto(currentFeed)) {
|
596 |
-
//console.log('initial recursion');
|
597 |
/*here we are calling loadMore function out of recursion cycle, after this initial-keep call
|
598 |
loadMore will be called with 'initial' recursively until the desired number of photos is reached
|
599 |
if possible*/
|
@@ -615,14 +598,9 @@ wdi_front.saveSelfUserData = function (data, currentFeed)
|
|
615 |
feed_container.find('.wdi_load_more').addClass('wdi_hidden');
|
616 |
feed_container.find('.wdi_spinner').addClass('wdi_hidden');
|
617 |
}
|
618 |
-
}
|
619 |
-
;
|
620 |
-
|
621 |
}
|
622 |
-
|
623 |
-
|
624 |
}
|
625 |
-
|
626 |
}
|
627 |
|
628 |
/**
|
@@ -630,7 +608,6 @@ wdi_front.saveSelfUserData = function (data, currentFeed)
|
|
630 |
*/
|
631 |
wdi_front.userHasNoPhoto = function (currentFeed, cstData)
|
632 |
{
|
633 |
-
|
634 |
var counter = 0;
|
635 |
var data = currentFeed.usersData;
|
636 |
if (typeof cstData != 'undefined') {
|
@@ -640,6 +617,7 @@ wdi_front.userHasNoPhoto = function (currentFeed, cstData)
|
|
640 |
if(typeof data[i]['pagination'] == 'undefined'){
|
641 |
data[i]['pagination'] = [];
|
642 |
}
|
|
|
643 |
if (currentFeed.feed_row.liked_feed === 'liked') {
|
644 |
if (typeof data[i]['pagination']['next_max_like_id'] == 'undefined') {
|
645 |
counter++
|
@@ -798,8 +776,6 @@ wdi_front.updateUsersImages = function (currentFeed)
|
|
798 |
elements.each(function ()
|
799 |
{
|
800 |
if (jQuery(this).attr('src') == wdi_url.plugin_url + 'images/missing.png' || jQuery(this).attr('src') == '') {
|
801 |
-
//console.log('missing');
|
802 |
-
|
803 |
if (currentFeed.feed_row.liked_feed == 'liked') {
|
804 |
return;
|
805 |
}
|
@@ -1015,8 +991,7 @@ wdi_front.getArrayContentLength = function (array, data)
|
|
1015 |
* @param {Object} data data to be displayed
|
1016 |
* @param {Object} currentFeed
|
1017 |
*/
|
1018 |
-
wdi_front.displayFeedItems = function (data, currentFeed)
|
1019 |
-
{
|
1020 |
if (jQuery('#wdi_feed_' + currentFeed.feed_row.wdi_feed_counter + " .wdi_feed_wrapper").length == 0) {
|
1021 |
//no feed in DOM, ignore
|
1022 |
return;
|
@@ -1604,6 +1579,7 @@ wdi_front.getPhotoTemplate = function (currentFeed)
|
|
1604 |
'</div>';
|
1605 |
if (currentFeed['feed_row']['show_likes'] === '1' || currentFeed['feed_row']['show_comments'] === '1' || currentFeed['feed_row']['show_description'] === '1') {
|
1606 |
source += '<div class="wdi_photo_meta">';
|
|
|
1607 |
if (currentFeed['feed_row']['show_likes'] === '1') {
|
1608 |
source += '<div class="wdi_thumb_likes"><i class="tenweb-i tenweb-i-heart-o"> <%= likes%></i></div>';
|
1609 |
}
|
@@ -1721,6 +1697,7 @@ wdi_front.getSliderTemplate = function (currentFeed)
|
|
1721 |
'</div>';
|
1722 |
if (currentFeed['feed_row']['show_likes'] === '1' || currentFeed['feed_row']['show_comments'] === '1' || currentFeed['feed_row']['show_description'] === '1') {
|
1723 |
source += '<div class="wdi_photo_meta">';
|
|
|
1724 |
if (currentFeed['feed_row']['show_likes'] === '1') {
|
1725 |
source += '<div class="wdi_thumb_likes"><i class="tenweb-i tenweb-i-heart-o"> <%= likes%></i></div>';
|
1726 |
}
|
@@ -1849,6 +1826,7 @@ wdi_front.getVideoTemplate = function (currentFeed)
|
|
1849 |
'</div>';
|
1850 |
if (currentFeed['feed_row']['show_likes'] === '1' || currentFeed['feed_row']['show_comments'] === '1' || currentFeed['feed_row']['show_description'] === '1') {
|
1851 |
source += '<div class="wdi_photo_meta">';
|
|
|
1852 |
if (currentFeed['feed_row']['show_likes'] === '1') {
|
1853 |
source += '<div class="wdi_thumb_likes"><i class="tenweb-i tenweb-i-heart-o"> <%= likes%></i></div>';
|
1854 |
}
|
@@ -2072,10 +2050,7 @@ wdi_front.updatePagination = function (currentFeed, dir, oldPage)
|
|
2072 |
}
|
2073 |
|
2074 |
|
2075 |
-
wdi_front.loadMore = function (button, _currentFeed)
|
2076 |
-
{
|
2077 |
-
|
2078 |
-
|
2079 |
var dataCounter = 0;
|
2080 |
if (button != '' && typeof button != 'undefined' && button != 'initial' && button != 'initial-keep') {
|
2081 |
var currentFeed = window[button.parent().parent().parent().parent().attr('id')];
|
@@ -2269,8 +2244,6 @@ wdi_front.checkForLoadMoreDone = function (currentFeed, button)
|
|
2269 |
also if it is not possible to reach the desired number (this will happen when all users has no more photos) then
|
2270 |
displayFeed()*/
|
2271 |
if (gettedDataLength < number_of_photos && !wdi_front.userHasNoPhoto(currentFeed, currentFeed.temproraryUsersData) && currentFeed.instagramRequestCounter <= currentFeed.maxConditionalFiltersRequestCount) {
|
2272 |
-
//console.log('checkForLoadMoreDone recursion');
|
2273 |
-
|
2274 |
wdi_front.loadMore('initial', currentFeed);
|
2275 |
} else {
|
2276 |
|
@@ -2291,7 +2264,6 @@ wdi_front.checkForLoadMoreDone = function (currentFeed, button)
|
|
2291 |
//if existing data length is smaller then load_more_number then get more objects until desired number is reached
|
2292 |
|
2293 |
if (gettedDataLength < load_more_number && !wdi_front.userHasNoPhoto(currentFeed, currentFeed.temproraryUsersData) && currentFeed.instagramRequestCounter <= currentFeed.maxConditionalFiltersRequestCount) {
|
2294 |
-
//console.log('load more recursion');
|
2295 |
wdi_front.loadMore(undefined, currentFeed);
|
2296 |
} else {
|
2297 |
|
@@ -2363,17 +2335,14 @@ wdi_front.brokenImageHandler = function (source)
|
|
2363 |
{
|
2364 |
var url_params = source.src.split("/p/");
|
2365 |
if(typeof url_params[0] !== "undefined" && typeof url_params[1] !== "undefined" && url_params[0] !== "https://www.instagram.com"){
|
2366 |
-
|
2367 |
-
|
2368 |
-
|
2369 |
}else{
|
2370 |
source.src = wdi_url.plugin_url + "images/missing.png";
|
2371 |
}
|
2372 |
-
|
2373 |
-
|
2374 |
-
source.onerror = "";
|
2375 |
-
return true;
|
2376 |
-
|
2377 |
}
|
2378 |
function wdi_baseName(str)
|
2379 |
{
|
@@ -2381,7 +2350,6 @@ function wdi_baseName(str)
|
|
2381 |
return str.replace(base, "");
|
2382 |
}
|
2383 |
|
2384 |
-
|
2385 |
//ajax loading
|
2386 |
wdi_front.ajaxLoader = function (currentFeed)
|
2387 |
{
|
@@ -2439,38 +2407,29 @@ wdi_front.allImagesLoaded = function (currentFeed)
|
|
2439 |
if (currentFeed.feed_row.feed_display_view == 'infinite_scroll') {
|
2440 |
jQuery('#wdi_feed_' + currentFeed.feed_row['wdi_feed_counter'] + ' .wdi_ajax_loading').addClass('wdi_hidden');
|
2441 |
}
|
2442 |
-
|
2443 |
-
|
2444 |
//custom event fired for user based custom js
|
2445 |
feed_container.trigger('wdi_feed_loaded');
|
2446 |
-
|
2447 |
-
|
2448 |
}
|
2449 |
|
2450 |
|
2451 |
//shows different parts of the feed based user choice
|
2452 |
-
wdi_front.show = function (name, currentFeed)
|
2453 |
-
{
|
2454 |
var wdi_feed_counter = currentFeed.feed_row['wdi_feed_counter'];
|
2455 |
var feed_container = jQuery('#wdi_feed_' + wdi_feed_counter + ' .wdi_feed_container');
|
2456 |
var _this = this;
|
2457 |
switch (name) {
|
2458 |
-
case 'header':
|
2459 |
-
{
|
2460 |
show_header();
|
2461 |
break;
|
2462 |
}
|
2463 |
-
case 'users':
|
2464 |
-
|
2465 |
show_users(currentFeed);
|
2466 |
break;
|
2467 |
}
|
2468 |
-
|
2469 |
}
|
2470 |
|
2471 |
-
function show_header()
|
2472 |
-
{
|
2473 |
-
|
2474 |
var templateData = {
|
2475 |
'feed_thumb': currentFeed['feed_row']['feed_thumb'],
|
2476 |
'feed_name': currentFeed['feed_row']['feed_name'],
|
@@ -2479,14 +2438,10 @@ wdi_front.show = function (name, currentFeed)
|
|
2479 |
var headerTemplate = wdi_front.getHeaderTemplate(),
|
2480 |
html = headerTemplate(templateData),
|
2481 |
containerHtml = feed_container.find('.wdi_feed_header').html();
|
2482 |
-
|
2483 |
-
feed_container.find('.wdi_feed_header').html(containerHtml + html);
|
2484 |
-
|
2485 |
-
|
2486 |
}
|
2487 |
|
2488 |
-
function show_users(currentFeed)
|
2489 |
-
{
|
2490 |
feed_container.find('.wdi_feed_users').html('');
|
2491 |
var users = currentFeed['feed_users'];
|
2492 |
var access_token = currentFeed['feed_row']['access_token'];
|
@@ -2496,7 +2451,6 @@ wdi_front.show = function (name, currentFeed)
|
|
2496 |
//recursively calls itself until all user data is ready then displyes it with escapeRequest
|
2497 |
function getThumb()
|
2498 |
{
|
2499 |
-
|
2500 |
if (currentFeed.headerUserinfo.length == users.length) {
|
2501 |
escapeRequest(currentFeed.headerUserinfo, currentFeed);
|
2502 |
return;
|
@@ -2628,7 +2582,6 @@ wdi_front.show = function (name, currentFeed)
|
|
2628 |
if(info[k]=== null){
|
2629 |
continue;
|
2630 |
}
|
2631 |
-
|
2632 |
var userFilter = {
|
2633 |
'flag': false,
|
2634 |
'id': info[k]['id'],
|
@@ -2639,7 +2592,6 @@ wdi_front.show = function (name, currentFeed)
|
|
2639 |
//user inforamtion
|
2640 |
var hashtagClass = (info[k]['name'][0] == '#') ? 'wdi_header_hashtag' : '';
|
2641 |
var website_host_name = wdi_extractHostname(info[k]['website']);
|
2642 |
-
|
2643 |
var templateData = {
|
2644 |
'user_index': k,
|
2645 |
'user_img_url': info[k]['url'],
|
@@ -2670,13 +2622,11 @@ wdi_front.show = function (name, currentFeed)
|
|
2670 |
wdi_front.updateUsersImages(currentFeed);
|
2671 |
};
|
2672 |
}
|
2673 |
-
|
2674 |
}
|
2675 |
|
2676 |
|
2677 |
wdi_front.getUserTemplate = function (currentFeed, username)
|
2678 |
{
|
2679 |
-
|
2680 |
var usersCount = currentFeed.dataCount,
|
2681 |
instagramLink, instagramLinkOnClick, js;
|
2682 |
|
@@ -2889,8 +2839,7 @@ wdi_front.parseLighboxData = function (currentFeed, filterFlag)
|
|
2889 |
data.sort(sortOperator);
|
2890 |
}
|
2891 |
|
2892 |
-
|
2893 |
-
for (i = 0; i < data.length; i++) {
|
2894 |
obj = {
|
2895 |
'alt': '',
|
2896 |
'avg_rating': '',
|
@@ -3234,9 +3183,6 @@ WDIFeed.prototype.conditionalFilter = function (response, args)
|
|
3234 |
if (currentFeed.feed_row.conditional_filter_enable == '0') {
|
3235 |
return response;
|
3236 |
}
|
3237 |
-
|
3238 |
-
|
3239 |
-
//console.log('filtering');
|
3240 |
//increase counter for determing request count if this counter is more then
|
3241 |
//currentFeed.maxConditionalFiltersRequestCount then program will terminate recursion loop
|
3242 |
currentFeed.instagramRequestCounter++;
|
@@ -3664,9 +3610,9 @@ WDIFeed.prototype.storeRawData = function (objects, variable)
|
|
3664 |
|
3665 |
var hash_id = "";
|
3666 |
if (wdi_front.isHashtag(objects[i].user_id)) {
|
3667 |
-
|
3668 |
-
|
3669 |
-
|
3670 |
}
|
3671 |
else
|
3672 |
if (_this.feed_row.liked_feed == 'liked') {
|
326 |
for (var i = 0; i < currentFeed.dataCount; i++) {
|
327 |
wdi_front.instagramRequest(i, currentFeed);
|
328 |
}
|
|
|
|
|
329 |
if (currentFeed.feed_row["number_of_photos"] > 0) {
|
330 |
wdi_front.ajaxLoader(currentFeed);
|
331 |
}
|
|
|
|
|
332 |
//setting feed name
|
333 |
if (currentFeed['feed_row']['display_header'] === '1') {
|
334 |
wdi_front.show('header', currentFeed);
|
335 |
}
|
336 |
+
/* @TODO API Changes 2020. */
|
337 |
if (currentFeed['feed_row']['show_usernames'] === '1') {
|
338 |
wdi_front.show('users', currentFeed);
|
339 |
}
|
|
|
|
|
340 |
}
|
341 |
|
342 |
wdi_front.getFeedItemResolution = function (currentFeed) {
|
414 |
*/
|
415 |
wdi_front.instagramRequest = function (id, currentFeed)
|
416 |
{
|
|
|
417 |
var feed_users = currentFeed.feed_users,
|
418 |
_this = this;
|
419 |
if (typeof feed_users[id] === 'string' && feed_users[id] === 'self') { // self liked media
|
448 |
_this.saveUserData(response, currentFeed.feed_users[id], currentFeed);
|
449 |
}
|
450 |
}
|
451 |
+
}, null, currentFeed.feed_row.hashtag_top_recent);
|
452 |
}
|
453 |
else
|
454 |
if (this.getInputType(feed_users[id]['username']) == 'user') {
|
486 |
}
|
487 |
}
|
488 |
});
|
|
|
489 |
}
|
|
|
|
|
490 |
}
|
491 |
|
492 |
/**
|
528 |
|
529 |
//if getted objects is not enough then recuest new ones
|
530 |
if (currentFeed.currentResponseLength < currentFeed.feed_row.number_of_photos && !wdi_front.userHasNoPhoto(currentFeed)) {
|
|
|
531 |
/*here we are calling loadMore function out of recursion cycle, after this initial-keep call
|
532 |
loadMore will be called with 'initial' recursively until the desired number of photos is reached
|
533 |
if possible*/
|
550 |
feed_container.find('.wdi_spinner').addClass('wdi_hidden');
|
551 |
}
|
552 |
}
|
|
|
|
|
553 |
}
|
|
|
|
|
554 |
}
|
|
|
555 |
}
|
556 |
|
557 |
|
568 |
|
569 |
currentFeed.usersData.push(data);
|
570 |
|
|
|
571 |
currentFeed.currentResponseLength = wdi_front.getArrayContentLength(currentFeed.usersData, 'data');
|
572 |
currentFeed.allResponseLength += currentFeed.currentResponseLength;
|
573 |
|
577 |
//if retrieved objects are not enough then request new ones
|
578 |
|
579 |
if (currentFeed.currentResponseLength < currentFeed.feed_row.number_of_photos && !wdi_front.userHasNoPhoto(currentFeed)) {
|
|
|
580 |
/*here we are calling loadMore function out of recursion cycle, after this initial-keep call
|
581 |
loadMore will be called with 'initial' recursively until the desired number of photos is reached
|
582 |
if possible*/
|
598 |
feed_container.find('.wdi_load_more').addClass('wdi_hidden');
|
599 |
feed_container.find('.wdi_spinner').addClass('wdi_hidden');
|
600 |
}
|
601 |
+
}
|
|
|
|
|
602 |
}
|
|
|
|
|
603 |
}
|
|
|
604 |
}
|
605 |
|
606 |
/**
|
608 |
*/
|
609 |
wdi_front.userHasNoPhoto = function (currentFeed, cstData)
|
610 |
{
|
|
|
611 |
var counter = 0;
|
612 |
var data = currentFeed.usersData;
|
613 |
if (typeof cstData != 'undefined') {
|
617 |
if(typeof data[i]['pagination'] == 'undefined'){
|
618 |
data[i]['pagination'] = [];
|
619 |
}
|
620 |
+
|
621 |
if (currentFeed.feed_row.liked_feed === 'liked') {
|
622 |
if (typeof data[i]['pagination']['next_max_like_id'] == 'undefined') {
|
623 |
counter++
|
776 |
elements.each(function ()
|
777 |
{
|
778 |
if (jQuery(this).attr('src') == wdi_url.plugin_url + 'images/missing.png' || jQuery(this).attr('src') == '') {
|
|
|
|
|
779 |
if (currentFeed.feed_row.liked_feed == 'liked') {
|
780 |
return;
|
781 |
}
|
991 |
* @param {Object} data data to be displayed
|
992 |
* @param {Object} currentFeed
|
993 |
*/
|
994 |
+
wdi_front.displayFeedItems = function (data, currentFeed) {
|
|
|
995 |
if (jQuery('#wdi_feed_' + currentFeed.feed_row.wdi_feed_counter + " .wdi_feed_wrapper").length == 0) {
|
996 |
//no feed in DOM, ignore
|
997 |
return;
|
1579 |
'</div>';
|
1580 |
if (currentFeed['feed_row']['show_likes'] === '1' || currentFeed['feed_row']['show_comments'] === '1' || currentFeed['feed_row']['show_description'] === '1') {
|
1581 |
source += '<div class="wdi_photo_meta">';
|
1582 |
+
/* @TODO API Changes 2020. */
|
1583 |
if (currentFeed['feed_row']['show_likes'] === '1') {
|
1584 |
source += '<div class="wdi_thumb_likes"><i class="tenweb-i tenweb-i-heart-o"> <%= likes%></i></div>';
|
1585 |
}
|
1697 |
'</div>';
|
1698 |
if (currentFeed['feed_row']['show_likes'] === '1' || currentFeed['feed_row']['show_comments'] === '1' || currentFeed['feed_row']['show_description'] === '1') {
|
1699 |
source += '<div class="wdi_photo_meta">';
|
1700 |
+
/* @TODO API Changes 2020. */
|
1701 |
if (currentFeed['feed_row']['show_likes'] === '1') {
|
1702 |
source += '<div class="wdi_thumb_likes"><i class="tenweb-i tenweb-i-heart-o"> <%= likes%></i></div>';
|
1703 |
}
|
1826 |
'</div>';
|
1827 |
if (currentFeed['feed_row']['show_likes'] === '1' || currentFeed['feed_row']['show_comments'] === '1' || currentFeed['feed_row']['show_description'] === '1') {
|
1828 |
source += '<div class="wdi_photo_meta">';
|
1829 |
+
/* @TODO API Changes 2020. */
|
1830 |
if (currentFeed['feed_row']['show_likes'] === '1') {
|
1831 |
source += '<div class="wdi_thumb_likes"><i class="tenweb-i tenweb-i-heart-o"> <%= likes%></i></div>';
|
1832 |
}
|
2050 |
}
|
2051 |
|
2052 |
|
2053 |
+
wdi_front.loadMore = function (button, _currentFeed) {
|
|
|
|
|
|
|
2054 |
var dataCounter = 0;
|
2055 |
if (button != '' && typeof button != 'undefined' && button != 'initial' && button != 'initial-keep') {
|
2056 |
var currentFeed = window[button.parent().parent().parent().parent().attr('id')];
|
2244 |
also if it is not possible to reach the desired number (this will happen when all users has no more photos) then
|
2245 |
displayFeed()*/
|
2246 |
if (gettedDataLength < number_of_photos && !wdi_front.userHasNoPhoto(currentFeed, currentFeed.temproraryUsersData) && currentFeed.instagramRequestCounter <= currentFeed.maxConditionalFiltersRequestCount) {
|
|
|
|
|
2247 |
wdi_front.loadMore('initial', currentFeed);
|
2248 |
} else {
|
2249 |
|
2264 |
//if existing data length is smaller then load_more_number then get more objects until desired number is reached
|
2265 |
|
2266 |
if (gettedDataLength < load_more_number && !wdi_front.userHasNoPhoto(currentFeed, currentFeed.temproraryUsersData) && currentFeed.instagramRequestCounter <= currentFeed.maxConditionalFiltersRequestCount) {
|
|
|
2267 |
wdi_front.loadMore(undefined, currentFeed);
|
2268 |
} else {
|
2269 |
|
2335 |
{
|
2336 |
var url_params = source.src.split("/p/");
|
2337 |
if(typeof url_params[0] !== "undefined" && typeof url_params[1] !== "undefined" && url_params[0] !== "https://www.instagram.com"){
|
2338 |
+
var main_url = wdi_baseName(url_params[0]);
|
2339 |
+
var new_url = main_url+"/p/"+url_params[1];
|
2340 |
+
source.src = new_url;
|
2341 |
}else{
|
2342 |
source.src = wdi_url.plugin_url + "images/missing.png";
|
2343 |
}
|
2344 |
+
source.onerror = "";
|
2345 |
+
return true;
|
|
|
|
|
|
|
2346 |
}
|
2347 |
function wdi_baseName(str)
|
2348 |
{
|
2350 |
return str.replace(base, "");
|
2351 |
}
|
2352 |
|
|
|
2353 |
//ajax loading
|
2354 |
wdi_front.ajaxLoader = function (currentFeed)
|
2355 |
{
|
2407 |
if (currentFeed.feed_row.feed_display_view == 'infinite_scroll') {
|
2408 |
jQuery('#wdi_feed_' + currentFeed.feed_row['wdi_feed_counter'] + ' .wdi_ajax_loading').addClass('wdi_hidden');
|
2409 |
}
|
|
|
|
|
2410 |
//custom event fired for user based custom js
|
2411 |
feed_container.trigger('wdi_feed_loaded');
|
|
|
|
|
2412 |
}
|
2413 |
|
2414 |
|
2415 |
//shows different parts of the feed based user choice
|
2416 |
+
wdi_front.show = function (name, currentFeed) {
|
|
|
2417 |
var wdi_feed_counter = currentFeed.feed_row['wdi_feed_counter'];
|
2418 |
var feed_container = jQuery('#wdi_feed_' + wdi_feed_counter + ' .wdi_feed_container');
|
2419 |
var _this = this;
|
2420 |
switch (name) {
|
2421 |
+
case 'header': {
|
|
|
2422 |
show_header();
|
2423 |
break;
|
2424 |
}
|
2425 |
+
case 'users': {
|
2426 |
+
/* @TODO API Changes 2020. */
|
2427 |
show_users(currentFeed);
|
2428 |
break;
|
2429 |
}
|
|
|
2430 |
}
|
2431 |
|
2432 |
+
function show_header() {
|
|
|
|
|
2433 |
var templateData = {
|
2434 |
'feed_thumb': currentFeed['feed_row']['feed_thumb'],
|
2435 |
'feed_name': currentFeed['feed_row']['feed_name'],
|
2438 |
var headerTemplate = wdi_front.getHeaderTemplate(),
|
2439 |
html = headerTemplate(templateData),
|
2440 |
containerHtml = feed_container.find('.wdi_feed_header').html();
|
2441 |
+
feed_container.find('.wdi_feed_header').html(containerHtml + html);
|
|
|
|
|
|
|
2442 |
}
|
2443 |
|
2444 |
+
function show_users(currentFeed) {
|
|
|
2445 |
feed_container.find('.wdi_feed_users').html('');
|
2446 |
var users = currentFeed['feed_users'];
|
2447 |
var access_token = currentFeed['feed_row']['access_token'];
|
2451 |
//recursively calls itself until all user data is ready then displyes it with escapeRequest
|
2452 |
function getThumb()
|
2453 |
{
|
|
|
2454 |
if (currentFeed.headerUserinfo.length == users.length) {
|
2455 |
escapeRequest(currentFeed.headerUserinfo, currentFeed);
|
2456 |
return;
|
2582 |
if(info[k]=== null){
|
2583 |
continue;
|
2584 |
}
|
|
|
2585 |
var userFilter = {
|
2586 |
'flag': false,
|
2587 |
'id': info[k]['id'],
|
2592 |
//user inforamtion
|
2593 |
var hashtagClass = (info[k]['name'][0] == '#') ? 'wdi_header_hashtag' : '';
|
2594 |
var website_host_name = wdi_extractHostname(info[k]['website']);
|
|
|
2595 |
var templateData = {
|
2596 |
'user_index': k,
|
2597 |
'user_img_url': info[k]['url'],
|
2622 |
wdi_front.updateUsersImages(currentFeed);
|
2623 |
};
|
2624 |
}
|
|
|
2625 |
}
|
2626 |
|
2627 |
|
2628 |
wdi_front.getUserTemplate = function (currentFeed, username)
|
2629 |
{
|
|
|
2630 |
var usersCount = currentFeed.dataCount,
|
2631 |
instagramLink, instagramLinkOnClick, js;
|
2632 |
|
2839 |
data.sort(sortOperator);
|
2840 |
}
|
2841 |
|
2842 |
+
for (i = 0; i < data.length; i++) {
|
|
|
2843 |
obj = {
|
2844 |
'alt': '',
|
2845 |
'avg_rating': '',
|
3183 |
if (currentFeed.feed_row.conditional_filter_enable == '0') {
|
3184 |
return response;
|
3185 |
}
|
|
|
|
|
|
|
3186 |
//increase counter for determing request count if this counter is more then
|
3187 |
//currentFeed.maxConditionalFiltersRequestCount then program will terminate recursion loop
|
3188 |
currentFeed.instagramRequestCounter++;
|
3610 |
|
3611 |
var hash_id = "";
|
3612 |
if (wdi_front.isHashtag(objects[i].user_id)) {
|
3613 |
+
if(typeof objects[i].pagination.cursors !== "undefined") {
|
3614 |
+
hash_id = objects[i].pagination.cursors.after;
|
3615 |
+
}
|
3616 |
}
|
3617 |
else
|
3618 |
if (_this.feed_row.liked_feed == 'liked') {
|
js/wdi_frontend.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
"undefined"==typeof wdi_front&&(wdi_front={type:"not_declared"}),wdi_front.detectEvent=function(){return/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())?"touchend":"click"};var wdi_error_show=!1;function wdi_baseName(e){var i=e.substr(e.lastIndexOf("/"));return e.replace(i,"")}wdi_front.escape_tags=function(e){return void 0===e&&(e=""),e=e.toString().replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""")},wdi_front.show_alert=function(e,i,t){if(t=jQuery("#wdi_feed_"+t.feed_row.wdi_feed_counter),400===i.meta.code&&"APINotAllowedError"===i.meta.error_type){if(void 0!==i.wdi_current_feed_name){var r=i.wdi_current_feed_name;t.find(".wdi_private_feed_names").html(r),t.find(".wdi_private_feed_error").removeClass("wdi_hidden")}t.find(".wdi_spinner").remove()}if(void 0!==t&&"APINotAllowedError"!=i.meta.error_type){t.find(".wdi_spinner").remove(),wdi_error_show=!0;var a=t.find(".wdi_js_error"),d=t.find(".wdi_token_error");0!=i&&null!=typeof i.meta&&"OAuthAccessTokenException"===i.meta.error_type?(d.removeClass("wdi_hidden"),"1"!=wdi_front_messages.wdi_token_error_flag&&jQuery.ajax({type:"POST",url:wdi_url.ajax_url,dataType:"json",data:{action:"wdi_token_flag",wdi_token_flag_nonce:wdi_front_messages.wdi_token_flag_nonce},success:function(e){}})):(a.removeClass("wdi_js_error"),a.addClass("wdi_js_error_no_animate"),jQuery(".wdi_js_error_no_animate").show()),wdi_front_messages.show_alerts||console.log("%c"+e,"color:#cc0000;")}wdi_error_show=!0},wdi_front.globalInit=function(){var e=wdi_front.feed_counter;if(void 0!==wdi_ajax.ajax_response)var i=wdi_feed_counter_init.wdi_feed_counter_init;else i=0;for(var t=i;t<=e;t++)if(0!==jQuery("#wdi_feed_"+t).length){var r=new WDIFeed(window["wdi_feed_"+t]);r.instagram=new WDIInstagram,r.instagram.filterArguments={feed:r},r.instagram.filters=[{where:"getUserRecentMedia",what:function(e,i,t){return i.feed.conditionalFilter(e,t)}},{where:"getTagRecentMedia",what:function(e,i,t){return i.feed.conditionalFilter(e,t)}},{where:"getRecentLikedMedia",what:function(e,i,t){return i.feed.conditionalFilter(e,t)}},{where:"requestByUrl",what:function(e,i,t){return i.feed.conditionalFilter(e,t)}}],r.instagram.addToken(r.feed_row.access_token),wdi_front.access_token=r.feed_row.access_token,r.dataStorageRaw=[],r.dataStorage=[],r.dataStorageList=[],r.allResponseLength=0,r.currentResponseLength=0,r.temproraryUsersData=[],r.removedUsers=0,r.nowLoadingImages=!0,r.imageIndex=0,r.resIndex=0,r.currentPage=1,r.userSortFlags=[],r.customFilterChanged=!1,r.maxConditionalFiltersRequestCount=10,r.instagramRequestCounter=0,r.mediaRequestsDone=!1,r.conditionalFilterBuffer=[],r.stopInfiniteScrollFlag=!1,"masonry"==r.feed_row.feed_type&&(r.displayedData=[]),"pagination"==r.feed_row.feed_display_view?(r.feed_row.resort_after_load_more=0,"image_browser"!=r.feed_row.feed_type?(r.feed_row.load_more_number=parseInt(r.feed_row.pagination_per_page_number),r.feed_row.number_of_photos=(1+parseInt(r.feed_row.pagination_preload_number))*r.feed_row.load_more_number):(r.feed_row.number_of_photos=1+parseInt(r.feed_row.image_browser_preload_number),r.feed_row.load_more_number=parseInt(r.feed_row.image_browser_load_number)),r.freeSpaces=(Math.floor(r.feed_row.pagination_per_page_number/r.feed_row.number_of_columns)+1)*r.feed_row.number_of_columns-r.feed_row.pagination_per_page_number):r.freeSpaces=0,r.galleryBox=function(e){wdi_spider_createpopup(wdi_url.ajax_url+"?gallery_id="+this.feed_row.id+"&image_id="+e,this.feed_row.wdi_feed_counter,this.feed_row.lightbox_width,this.feed_row.lightbox_height,1,"testpopup",5,this,e)},wdi_responsive.columnControl(r),"masonry"==r.feed_row.feed_type&&jQuery(window).trigger("resize"),wdi_front.bindEvents(r),window["wdi_feed_"+t]=r,wdi_front.init(r)}},wdi_front.init=function(e){if(jQuery(".wdi_js_error").hide(),e.photoCounter=e.feed_row.number_of_photos,"liked"==e.feed_row.liked_feed)e.feed_users=["self"];else{if(!wdi_front.isJsonString(e.feed_row.feed_users))return void wdi_front.show_alert(wdi_front_messages.invalid_users_format,!1,e);e.feed_users=JSON.parse(e.feed_row.feed_users)}var i=[];void 0!==window.wdi_all_tags&&(i=window.wdi_all_tags);for(var t=0;t<e.feed_users.length;t++)"#"===e.feed_users[t].username[0]&&void 0!==e.feed_users[t].tag_id&&(i[e.feed_users[t].tag_id]=e.feed_users[t]);window.wdi_all_tags=i,e.dataCount=e.feed_users.length;var r=wdi_front.getFeedItemResolution(e);e.feedImageResolution=r.image,e.feedVideoResolution=r.video;for(var a=0;a<e.dataCount;a++)wdi_front.instagramRequest(a,e);e.feed_row.number_of_photos>0&&wdi_front.ajaxLoader(e),"1"===e.feed_row.display_header&&wdi_front.show("header",e),"1"===e.feed_row.show_usernames&&wdi_front.show("users",e)},wdi_front.getFeedItemResolution=function(e){var i={image:"standard_resolution",video:"standard_resolution"};if("thumbnail"===e.feed_row.feed_resolution)return{image:"thumbnail",video:"low_bandwidth"};if("low"===e.feed_row.feed_resolution)return{image:"low_resolution",video:"low_resolution"};if("standard"===e.feed_row.feed_resolution)return{image:"standard_resolution",video:"standard_resolution"};var t=jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter).find(".wdi_feed_wrapper");t.append('<div class="wdi_feed_item" id="wdi_feed_item_example"></div>'),wdi_responsive.columnControl(e,1);var r=t.attr("wdi-res").split("wdi_col_");if(t.find("#wdi_feed_item_example").remove(),2!==r.length)return i;var a=parseInt(r[1]);if(a<=0)return i;var d=t.width()/a-10,o=i;return d<=150?(o.image="thumbnail",o.video="low_bandwidth"):d>150&&d<=320?(o.image="low_resolution",o.video="low_resolution"):(o.image="standard_resolution",o.video="standard_resolution"),o},wdi_front.isJsonString=function(e){try{JSON.parse(e)}catch(e){return!1}return!0},wdi_front.instagramRequest=function(e,i){var t=i.feed_users,r=this;"string"==typeof t[e]&&"self"===t[e]?i.instagram.getRecentLikedMedia({success:function(e){void 0!==e.meta&&void 0!==e.meta.error_type&&wdi_front.show_alert(!1,e,i),i.mediaRequestsDone=!0,0!=(e=r.checkMediaResponse(e,i))&&r.saveSelfUserData(e,i)}}):"hashtag"==this.getInputType(t[e].username)?i.instagram.getTagRecentMedia(this.stripHashtag(t[e].username),{success:function(t){void 0!==t.meta&&void 0!==t.meta.error_type&&wdi_front.show_alert(!1,t,i),i.mediaRequestsDone=!0,0!=(t=r.checkMediaResponse(t,i))&&r.saveUserData(t,i.feed_users[e],i)}},null,i.feed_row.hashtag_top_recent):"user"==this.getInputType(t[e].username)&&i.instagram.getSelfRecentMedia({success:function(a){void 0!==a.meta&&void 0!==a.meta.error_type&&(a.wdi_current_feed_name=t[e].username,wdi_front.show_alert(!1,a,i)),i.mediaRequestsDone=!0,0!=(a=r.checkMediaResponse(a,i))&&r.saveUserData(a,i.feed_users[e],i)}})},wdi_front.isHashtag=function(e){return"#"===e[0]},wdi_front.saveUserData=function(e,i,t){if(e.username=i.username,e.user_id=i.id,"#"===e.user_id[0]&&(e.data=wdi_front.appendRequestHashtag(e.data,e.user_id)),t.usersData.push(e),t.currentResponseLength=wdi_front.getArrayContentLength(t.usersData,"data"),t.allResponseLength+=t.currentResponseLength,t.dataCount==t.usersData.length)if(t.currentResponseLength<t.feed_row.number_of_photos&&!wdi_front.userHasNoPhoto(t))wdi_front.loadMore("initial-keep",t);else if(wdi_front.displayFeed(t),wdi_front.applyFilters(t),!wdi_front.activeUsersCount(t)&&"load_more_btn"==t.feed_row.feed_display_view){var r=jQuery("#wdi_feed_"+t.feed_row.wdi_feed_counter);r.find(".wdi_load_more").addClass("wdi_hidden"),r.find(".wdi_spinner").addClass("wdi_hidden")}},wdi_front.saveSelfUserData=function(e,i){if(e.username="",e.user_id="",i.usersData.push(e),i.currentResponseLength=wdi_front.getArrayContentLength(i.usersData,"data"),i.allResponseLength+=i.currentResponseLength,i.dataCount==i.usersData.length)if(i.currentResponseLength<i.feed_row.number_of_photos&&!wdi_front.userHasNoPhoto(i))wdi_front.loadMore("initial-keep",i);else if(wdi_front.displayFeed(i),wdi_front.applyFilters(i),!wdi_front.activeUsersCount(i)&&"load_more_btn"==i.feed_row.feed_display_view){var t=jQuery("#wdi_feed_"+i.feed_row.wdi_feed_counter);t.find(".wdi_load_more").addClass("wdi_hidden"),t.find(".wdi_spinner").addClass("wdi_hidden")}},wdi_front.userHasNoPhoto=function(e,i){var t=0,r=e.usersData;void 0!==i&&(r=i);for(var a=0;a<r.length;a++)void 0===r[a].pagination&&(r[a].pagination=[]),"liked"===e.feed_row.liked_feed?void 0===r[a].pagination.next_max_like_id&&t++:void 0===r[a].pagination.next_max_id&&t++;return t==r.length?1:0},wdi_front.appendRequestHashtag=function(e,i){for(var t=0;t<e.length;t++)e[t].wdi_hashtag=i;return e},wdi_front.displayFeed=function(e,i){if(0==e.customFilterChanged)var t=wdi_front.feedSort(e,i);var r=e.customFilterChanged;if(1==e.customFilterChanged){t=e.customFilteredData;e.parsedData=wdi_front.parseLighboxData(e,!0)}"1"!=e.feed_row.resort_after_load_more?0==e.customFilterChanged&&(e.dataStorageList=e.dataStorageList.concat(t)):0==e.customFilterChanged&&(e.dataStorageList=t),"masonry"==e.feed_row.feed_type&&wdi_front.masonryDisplayFeedItems(t,e),"thumbnails"!=e.feed_row.feed_type&&"blog_style"!=e.feed_row.feed_type&&"image_browser"!=e.feed_row.feed_type||wdi_front.displayFeedItems(t,e),wdi_front.getDataLength(e)<e.photoCounter&&!r&&e.instagramRequestCounter<=e.maxConditionalFiltersRequestCount&&!wdi_front.allDataHasFinished(e)?wdi_front.loadMore("",e):wdi_front.allImagesLoaded(e),e.instagramRequestCounter>e.maxConditionalFiltersRequestCount&&(wdi_front.allImagesLoaded(e),0==t.length&&(e.stopInfiniteScrollFlag=!0)),"pagination"==e.feed_row.feed_display_view&&e.currentPage<e.paginator&&jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter).find("#wdi_last_page").removeClass("wdi_disabled"),e.instagramRequestCounter=0,e.conditionalFilterBuffer=[],wdi_front.updateUsersImages(e)},wdi_front.updateUsersImages=function(e){jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter).find(".wdi_single_user .wdi_user_img_wrap img").each(function(){if(jQuery(this).attr("src")==wdi_url.plugin_url+"images/missing.png"||""==jQuery(this).attr("src")){if("liked"==e.feed_row.liked_feed)return;for(var i=0;i<e.usersData.length;i++)e.usersData[i].username==jQuery(this).parent().parent().find("h3").text()&&0!=e.usersData[i].data.length&&jQuery(this).attr("src",e.usersData[i].data[0].images.thumbnail.url)}})},wdi_front.masonryDisplayFeedItems=function(e,i){var t=[],r=[];if(0!=jQuery("#wdi_feed_"+i.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").length){jQuery("#wdi_feed_"+i.feed_row.wdi_feed_counter+" .wdi_masonry_column").each(function(){1==i.feed_row.resort_after_load_more&&(jQuery(this).html(""),i.imageIndex=0),1==i.customFilterChanged&&(jQuery(this).html(""),i.imageIndex=0),"pagination"==i.feed_row.feed_display_view?t.push(0):t.push(jQuery(this).height()),r.push(jQuery(this))}),1==i.customFilterChanged&&(i.customFilterChanged=!1);for(var a=0;a<e.length;a++){if(i.displayedData.push(e[a]),"image"==e[a].type)var d=wdi_front.getPhotoTemplate(i);else if(e[a].hasOwnProperty("videos")||"video"==e[a].type)d=wdi_front.getVideoTemplate(i);else d=wdi_front.getSliderTemplate(i);var o=e[a],n=d(wdi_front.createObject(o,i)),s=wdi_front.array_min(t),_=wdi_front.getImageResolution(e[a]);r[s.index].html(r[s.index].html()+n),t[s.index]+=r[s.index].width()*_,i.imageIndex++,"pagination"==i.feed_row.feed_display_view&&((a+1)%i.feed_row.pagination_per_page_number==0?i.resIndex+=i.freeSpaces+1:i.resIndex++)}i.wdi_loadedImages=0;var f=!1;i.wdi_load_count=a;var l=i.feed_row.wdi_feed_counter;jQuery("#wdi_feed_"+l+" img.wdi_img").on("load",function(){i.wdi_loadedImages++,w(),!1===f&&(wdi_responsive.columnControl(i,1),f=!0)});w(),1==i.paginatorNextFlag&&wdi_front.updatePagination(i,"next"),i.infiniteScrollFlag=!1}function w(){i.wdi_load_count===i.wdi_loadedImages&&0!=i.wdi_loadedImages&&(i.loadedImages=0,i.wdi_load_count=0,wdi_front.allImagesLoaded(i))}},wdi_front.getImageResolution=function(e){var i=e.images.standard_resolution.width;return e.images.standard_resolution.height/i},wdi_front.getDataLength=function(e,i){var t=0;if(void 0===i)for(var r=0;r<e.dataStorage.length;r++)t+=e.dataStorage[r].length;else for(r=0;r<i.length;r++)t+=i[r].length;return t},wdi_front.getArrayContentLength=function(e,i){for(var t=0,r=0;r<e.length;r++)"finished"!=e[r].finished&&(t+=e[r][i].length);return t},wdi_front.displayFeedItems=function(e,i){if(0!=jQuery("#wdi_feed_"+i.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").length){var t=i.feed_row.wdi_feed_counter,r=jQuery("#wdi_feed_"+t+" .wdi_feed_wrapper");"1"===i.feed_row.resort_after_load_more&&(r.html(""),i.imageIndex=0),1==i.customFilterChanged&&(r.html(""),i.imageIndex=0,i.customFilterChanged=!1);wdi_front.getImgCount(i),e.length;if("pagination"==i.feed_row.feed_display_view){var a=i.feed_row.load_more_number;"image_browser"==i.feed_row.feed_type&&(a=1),(jQuery("#wdi_feed_"+i.feed_row.wdi_feed_counter+' [wdi_page="'+(i.currentPage-1)+'"]').length<a||0==e.length)&&(i.currentPage=--i.currentPage<=1?1:i.currentPage)}for(var d=0;d<e.length;d++){if("image"==e[d].type)var o=wdi_front.getPhotoTemplate(i);else if(e[d].hasOwnProperty("videos"))o=wdi_front.getVideoTemplate(i);else o=wdi_front.getSliderTemplate(i);var n=e[d],s=o(wdi_front.createObject(n,i));r.html(r.html()+s),i.imageIndex++,"pagination"==i.feed_row.feed_display_view&&((d+1)%i.feed_row.pagination_per_page_number==0?i.resIndex+=i.freeSpaces+1:i.resIndex++)}i.wdi_loadedImages=0;var _=!1;i.wdi_load_count=d;t=i.feed_row.wdi_feed_counter,r=jQuery("#wdi_feed_"+t+" img.wdi_img").on("load",function(){i.wdi_loadedImages++,i.wdi_load_count===i.wdi_loadedImages&&0!=i.wdi_loadedImages&&(i.loadedImages=0,i.wdi_load_count=0,wdi_front.allImagesLoaded(i)),!1===_&&(wdi_responsive.columnControl(i,1),_=!0)});1==i.paginatorNextFlag&&wdi_front.updatePagination(i,"next"),i.infiniteScrollFlag=!1}},wdi_front.checkFeedFinished=function(e){for(var i=0;i<e.usersData.length;i++)if(void 0===e.usersData[i].finished)return!1;return!0},wdi_front.sortingOperator=function(e,i){var t;switch(e){case"date":switch(i){case"asc":t=function(e,i){return e.created_time>i.created_time?1:-1};break;case"desc":t=function(e,i){return e.created_time>i.created_time?-1:1}}break;case"likes":switch(i){case"asc":t=function(e,i){return e.likes.count<i.likes.count?-1:1};break;case"desc":t=function(e,i){return e.likes.count<i.likes.count?1:-1}}break;case"comments":switch(i){case"asc":t=function(e,i){return e.comments.count<i.comments.count?-1:1};break;case"desc":t=function(e,i){return e.comments.count<i.comments.count?1:-1}}break;case"random":t=function(e,i){return Math.random()>.5?1:-1}}return t},wdi_front.feedSort=function(e,i){var t=e.feed_row.sort_images_by,r=e.feed_row.display_order;"1"===e.feed_row.resort_after_load_more?e.data=e.data.concat(wdi_front.smartPicker(e,i)):e.data=wdi_front.smartPicker(e,i);var a=wdi_front.sortingOperator(t,r);return e.data.sort(a),e.data},wdi_front.smartPicker=function(e,i){var t=[],r=0,a=[],d=Math.ceil(e.feed_row.number_of_photos/e.usersData.length),o=parseInt(e.feed_row.number_of_photos),n=0;""!=i&&void 0!==i&&null!=i&&(o=parseInt(i),d=Math.ceil(o/wdi_front.activeUsersCount(e)));e.storeRawData(e.usersData,"dataStorageRaw");for(var s=e.dataStorageRaw.sort(function(e,i){return e.length()>i.length()?1:-1}),_=e.usersData.sort(function(e,i){return e.data.length>i.data.length?1:-1}),f=0;f<_.length;f++)if(n+=d,s[f].length()<=n)n-=s[f].length(),t.push(s[f].getData(s[f].length())),r+=t[t.length-1].length;else{r+n>o&&(n=o-r);var l=[];!1===e.auto_trigger?l=l.concat(s[f].getData(n)):l.length+wdi_front.getDataLength(e)+wdi_front.getDataLength(e,t)<e.feed_row.number_of_photos&&(l=l.concat(s[f].getData(n))),n=0,r+=l.length,t.push(l)}for(f=0;f<t.length;f++)void 0===e.dataStorage[f]?e.dataStorage.push(t[f]):e.dataStorage[f]=e.dataStorage[f].concat(t[f]);for(e.parsedData=wdi_front.parseLighboxData(e),f=0;f<t.length;f++)a=a.concat(t[f]);return a},wdi_front.createObject=function(e,i){var t=null!=e.caption?e.caption.text:" ",r="";if("video"==e.type&&(r=e.hasOwnProperty("videos")?e.videos[i.feedVideoResolution].url:""),void 0===e.images[i.feedImageResolution])var a=wdi_url.plugin_url+"images/missing.png";else a=e.images[i.feedImageResolution].url;var d=i.imageIndex,o="square",n=e.images.standard_resolution.height,s=e.images.standard_resolution.width;n>s?o="portrait":n<s&&(o="landscape");var _=e.user.username;return""===_&&(_="no_user"),{id:e.id,caption:wdi_front.escape_tags(t),image_url:a,likes:e.likes.count,comments:e.comments.count,wdi_index:d,wdi_res_index:i.resIndex,wdi_media_user:_,link:e.link,video_url:r,wdi_username:_,wdi_shape:o}},wdi_front.setPage=function(e){var i=e.feed_row.feed_display_view,t=e.feed_row.feed_type;if("pagination"!=i)return"";var r=e.imageIndex;if("image_browser"==t)var a=1;else a=Math.abs(e.feed_row.pagination_per_page_number);return e.paginator=Math.ceil((r+1)/a),e.paginator},wdi_front.getPhotoTemplate=function(e){var i=wdi_front.setPage(e),t="",r="",a="",d="",o="tenweb-i-arrows-out",n="";"blog_style"!=e.feed_row.feed_type&&"image_browser"!=e.feed_row.feed_type||(o=""),""!=i?(r='wdi_page="'+i+'"',sourceAttr="src"):sourceAttr="src",""!=i&&1!=i&&(t="wdi_hidden"),"1"==e.feed_row.show_username_on_thumb&&(n='<span class="wdi_media_user">@<%= wdi_username%></span>'),1==e.feed_row.show_full_description&&"masonry"==e.feed_row.feed_type&&(t+=" wdi_full_caption");var s="";switch("blog_style"!==e.feed_row.feed_type&&(s="masonry"==e.feed_row.feed_type?"wdi_responsive.showMasonryCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");":"wdi_responsive.showCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");"),e.feed_row.feed_item_onclick){case"lightbox":a="onclick=wdi_feed_"+e.feed_row.wdi_feed_counter+".galleryBox('<%=id%>')";break;case"instagram":a="onclick=\"window.open ('<%= link%>','_blank')\"",d="wdi_hover_off",o="";break;case"custom_redirect":a="onclick=\"window.open ('"+e.feed_row.redirect_url+"','_self')\"",d="wdi_hover_off",o="";break;case"none":a="",d="wdi_cursor_off wdi_hover_off",o=""}var f='<div class="wdi_feed_item '+t+'" wdi_index=<%= wdi_index%> wdi_res_index=<%= wdi_res_index%> wdi_media_user=<%= wdi_media_user%> '+r+' wdi_type="image" id="wdi_'+e.feed_row.wdi_feed_counter+"_<%=id%>\"><div class=\"wdi_photo_wrap\"><div class=\"wdi_photo_wrap_inner\"><div class=\"wdi_photo_img <%= wdi_shape == 'square' ? 'wdi_shape_square' : (wdi_shape == 'portrait' ? 'wdi_shape_portrait' : (wdi_shape == 'landscape' ? 'wdi_shape_landscape' : 'wdi_shape_square') ) %>\"><img class=\"wdi_img\" "+sourceAttr+'="<%=image_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);"><div class="wdi_photo_overlay '+d+'" >'+n+'<div class="wdi_thumb_icon" '+a+' style="display:table;width:100%;height:100%;"><div style="display:table-cell;vertical-align:middle;text-align:center;color:white;"><i class="tenweb-i '+o+'"></i></div></div></div></div></div></div>';return"1"!==e.feed_row.show_likes&&"1"!==e.feed_row.show_comments&&"1"!==e.feed_row.show_description||(f+='<div class="wdi_photo_meta">',"1"===e.feed_row.show_likes&&(f+='<div class="wdi_thumb_likes"><i class="tenweb-i tenweb-i-heart-o"> <%= likes%></i></div>'),"1"===e.feed_row.show_comments&&(f+='<div class="wdi_thumb_comments"><i class="tenweb-i tenweb-i-comment-square"> <%= comments%></i></div>'),f+='<div class="wdi_clear"></div>',"1"===e.feed_row.show_description&&(f+='<div class="wdi_photo_title" onclick='+s+" ><%=caption%></div>"),f+="</div>"),f+="</div>",_.template(f)},wdi_front.getSliderTemplate=function(e){var i=wdi_front.setPage(e),t="",r="",a="",d="",o="tenweb-i-clone",n="";"blog_style"!=e.feed_row.feed_type&&"image_browser"!=e.feed_row.feed_type||(o=""),""!=i?(r='wdi_page="'+i+'"',sourceAttr="src"):sourceAttr="src",""!=i&&1!=i&&(t="wdi_hidden"),"1"==e.feed_row.show_username_on_thumb&&(n='<span class="wdi_media_user">@<%= wdi_username%></span>'),1==e.feed_row.show_full_description&&"masonry"==e.feed_row.feed_type&&(t+=" wdi_full_caption");var s="";switch("blog_style"!==e.feed_row.feed_type&&(s="masonry"==e.feed_row.feed_type?"wdi_responsive.showMasonryCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");":"wdi_responsive.showCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");"),e.feed_row.feed_item_onclick){case"lightbox":a="onclick=wdi_feed_"+e.feed_row.wdi_feed_counter+".galleryBox('<%=id%>')";break;case"instagram":a="onclick=\"window.open ('<%= link%>','_blank')\"",d="wdi_hover_off",o="tenweb-i-clone";break;case"custom_redirect":a="onclick=\"window.open ('"+e.feed_row.redirect_url+"','_self')\"",d="wdi_hover_off",o="";break;case"none":a="",d="wdi_cursor_off wdi_hover_off",o=""}var f='<div class="wdi_feed_item '+t+'" wdi_index=<%= wdi_index%> wdi_res_index=<%= wdi_res_index%> wdi_media_user=<%= wdi_media_user%> '+r+' wdi_type="slideshow" id="wdi_'+e.feed_row.wdi_feed_counter+"_<%=id%>\"><div class=\"wdi_photo_wrap\"><div class=\"wdi_photo_wrap_inner\"><div class=\"wdi_photo_img <%= wdi_shape == 'square' ? 'wdi_shape_square' : (wdi_shape == 'portrait' ? 'wdi_shape_portrait' : (wdi_shape == 'landscape' ? 'wdi_shape_landscape' : 'wdi_shape_square') ) %>\"><img class=\"wdi_img\" "+sourceAttr+'="<%=image_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);"><div class="wdi_photo_overlay '+d+'" >'+n+'<div class="wdi_thumb_icon" '+a+' style="display:table;width:100%;height:100%;"><div style="display:table-cell;vertical-align:middle;text-align:center;color:white;"><i class="tenweb-i '+o+'"></i></div></div></div></div></div></div>';return"1"!==e.feed_row.show_likes&&"1"!==e.feed_row.show_comments&&"1"!==e.feed_row.show_description||(f+='<div class="wdi_photo_meta">',"1"===e.feed_row.show_likes&&(f+='<div class="wdi_thumb_likes"><i class="tenweb-i tenweb-i-heart-o"> <%= likes%></i></div>'),"1"===e.feed_row.show_comments&&(f+='<div class="wdi_thumb_comments"><i class="tenweb-i tenweb-i-comment-square"> <%= comments%></i></div>'),f+='<div class="wdi_clear"></div>',"1"===e.feed_row.show_description&&(f+='<div class="wdi_photo_title" onclick='+s+" ><%=caption%></div>"),f+="</div>"),f+="</div>",_.template(f)},wdi_front.replaceToVideo=function(e,i,t){overlayHtml="<video style='width:auto !important; height:auto !important; max-width:100% !important; max-height:100% !important; margin:0 !important;' controls=''><source src='"+e+"' type='video/mp4'>Your browser does not support the video tag. </video>",jQuery("#wdi_feed_"+t+' [wdi_index="'+i+'"] .wdi_photo_wrap_inner').html(overlayHtml),jQuery("#wdi_feed_"+t+' [wdi_index="'+i+'"] .wdi_photo_wrap_inner video').get(0).play()},wdi_front.getVideoTemplate=function(e){var i,t=wdi_front.setPage(e),r="",a="",d="tenweb-i-play",o="",n="",s="";""!=t?(a='wdi_page="'+t+'"',i="src"):i="src",""!=t&&1!=t&&(r="wdi_hidden"),"1"==e.feed_row.show_username_on_thumb&&(s='<span class="wdi_media_user">@<%= wdi_username%></span>'),1==e.feed_row.show_full_description&&"masonry"==e.feed_row.feed_type&&(r+=" wdi_full_caption");var f="";switch("blog_style"!==e.feed_row.feed_type&&(f="masonry"==e.feed_row.feed_type?"wdi_responsive.showMasonryCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");":"wdi_responsive.showCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");"),e.feed_row.feed_item_onclick){case"lightbox":o="onclick=wdi_feed_"+e.feed_row.wdi_feed_counter+".galleryBox('<%=id%>')";break;case"instagram":o="onclick=\"window.open ('<%= link%>','_blank')\"",n="wdi_hover_off",d="tenweb-i-play";break;case"custom_redirect":o="onclick=\"window.open ('"+e.feed_row.redirect_url+"','_self')\"",n="wdi_hover_off",d="";break;case"none":n="wdi_cursor_off wdi_hover_off",d="","blog_style"!=e.feed_row.feed_type&&"image_browser"!=e.feed_row.feed_type||(o="onclick=wdi_front.replaceToVideo('<%= video_url%>','<%= wdi_index%>',"+e.feed_row.wdi_feed_counter+")",n="",d="tenweb-i-play")}var l='<div class="wdi_feed_item '+r+'" wdi_index=<%= wdi_index%> wdi_res_index=<%= wdi_res_index%> wdi_media_user=<%= wdi_media_user%> '+a+' wdi_type="image" id="wdi_'+e.feed_row.wdi_feed_counter+"_<%=id%>\"><div class=\"wdi_photo_wrap\"><div class=\"wdi_photo_wrap_inner\"><div class=\"wdi_photo_img <%= wdi_shape == 'square' ? 'wdi_shape_square' : (wdi_shape == 'portrait' ? 'wdi_shape_portrait' : (wdi_shape == 'landscape' ? 'wdi_shape_landscape' : 'wdi_shape_square') ) %>\"><img class=\"wdi_img\" "+i+'="<%=image_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);"><div class="wdi_photo_overlay '+n+'" '+o+">"+s+'<div class="wdi_thumb_icon" style="display:table;width:100%;height:100%;"><div style="display:table-cell;vertical-align:middle;text-align:center;color:white;"><i class="tenweb-i '+d+'"></i></div></div></div></div></div></div>';return"1"!==e.feed_row.show_likes&&"1"!==e.feed_row.show_comments&&"1"!==e.feed_row.show_description||(l+='<div class="wdi_photo_meta">',"1"===e.feed_row.show_likes&&(l+='<div class="wdi_thumb_likes"><i class="tenweb-i tenweb-i-heart-o"> <%= likes%></i></div>'),"1"===e.feed_row.show_comments&&(l+='<div class="wdi_thumb_comments"><i class="tenweb-i tenweb-i-comment-square"> <%= comments%></i></div>'),l+='<div class="wdi_clear"></div>',"1"===e.feed_row.show_description&&(l+='<div class="wdi_photo_title" onclick='+f+" ><%=caption%></div>"),l+="</div>"),l+="</div>",_.template(l)},wdi_front.bindEvents=function(e){0!=jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").length&&("load_more_btn"==e.feed_row.feed_display_view&&jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" .wdi_load_more_container").on(wdi_front.clickOrTouch,function(){wdi_front.loadMore(jQuery(this).find(".wdi_load_more_wrap"))}),"pagination"==e.feed_row.feed_display_view&&(jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_next").on(wdi_front.clickOrTouch,function(){wdi_front.paginatorNext(jQuery(this),e)}),jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_prev").on(wdi_front.clickOrTouch,function(){wdi_front.paginatorPrev(jQuery(this),e)}),jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_last_page").on(wdi_front.clickOrTouch,function(){wdi_front.paginationLastPage(jQuery(this),e)}),jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_first_page").on(wdi_front.clickOrTouch,function(){wdi_front.paginationFirstPage(jQuery(this),e)}),e.paginatorNextFlag=!1),"infinite_scroll"==e.feed_row.feed_display_view&&(jQuery(window).on("scroll",function(){wdi_front.infiniteScroll(e)}),e.infiniteScrollFlag=!1))},wdi_front.infiniteScroll=function(e){jQuery(window).scrollTop()+jQuery(window).height()-100>=jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_infinite_scroll").offset().top&&(!1===e.infiniteScrollFlag&&0==e.stopInfiniteScrollFlag?(e.infiniteScrollFlag=!0,wdi_front.loadMore(jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_infinite_scroll"),e)):e.stopInfiniteScrollFlag&&wdi_front.allImagesLoaded(e))},wdi_front.paginationFirstPage=function(e,i){if(1!=i.paginator&&1!=i.currentPage){var t=i.currentPage;i.currentPage=1,wdi_front.updatePagination(i,"custom",t),e.parent().find("#wdi_last_page").removeClass("wdi_disabled"),e.addClass("wdi_disabled")}else e.addClass("wdi_disabled")},wdi_front.paginationLastPage=function(e,i){if(1!=i.paginator&&i.currentPage!=i.paginator){var t=i.currentPage;i.currentPage=i.paginator,wdi_front.updatePagination(i,"custom",t),e.addClass("wdi_disabled"),e.parent().find("#wdi_first_page").removeClass("wdi_disabled")}},wdi_front.paginatorNext=function(e,i){var t=e.parent().find("#wdi_last_page"),r=e.parent().find("#wdi_first_page");if(i.paginatorNextFlag=!0,i.paginator!=i.currentPage||wdi_front.checkFeedFinished(i))i.paginator>i.currentPage&&(i.currentPage++,wdi_front.updatePagination(i,"next"),i.paginator>i.currentPage?t.removeClass("wdi_disabled"):t.addClass("wdi_disabled"));else{i.currentPage++;var a=i.feed_row.number_of_photos;wdi_front.loadMore(e,i,a),t.addClass("wdi_disabled")}r.removeClass("wdi_disabled")},wdi_front.paginatorPrev=function(e,i){var t=e.parent().find("#wdi_last_page"),r=e.parent().find("#wdi_first_page");1!=i.currentPage?(i.currentPage--,wdi_front.updatePagination(i,"prev"),t.removeClass("wdi_disabled"),1==i.currentPage&&r.addClass("wdi_disabled")):r.addClass("wdi_disabled")},wdi_front.updatePagination=function(e,i,t){var r="#wdi_feed_"+e.feed_row.wdi_feed_counter;switch(jQuery(r+' [wdi_page="'+e.currentPage+'"]').each(function(){jQuery(this).removeClass("wdi_hidden")}),i){case"next":t=e.currentPage-1;jQuery(r+" .wdi_feed_wrapper").height(jQuery(".wdi_feed_wrapper").height()),jQuery(r+' [wdi_page="'+t+'"]').each(function(){jQuery(this).addClass("wdi_hidden")});break;case"prev":t=e.currentPage+1;jQuery(r+" .wdi_feed_wrapper").height(jQuery(".wdi_feed_wrapper").height()),jQuery(r+' [wdi_page="'+t+'"]').each(function(){jQuery(this).addClass("wdi_hidden")});break;case"custom":(t=t)!=e.currentPage&&(jQuery(r+" .wdi_feed_wrapper").height(jQuery(".wdi_feed_wrapper").height()),jQuery(r+' [wdi_page="'+t+'"]').each(function(){jQuery(this).addClass("wdi_hidden")}))}e.paginatorNextFlag=!1,jQuery(r+" .wdi_feed_wrapper").css("height","auto"),jQuery(r+" #wdi_current_page").text(e.currentPage)},wdi_front.loadMore=function(e,i){var t=0;if(""!=e&&void 0!==e&&"initial"!=e&&"initial-keep"!=e)var r=window[e.parent().parent().parent().parent().attr("id")];if(void 0!==i)r=i;for(var a=0,d=0,o=0;o<r.userSortFlags.length;o++)if(!0===r.userSortFlags[o].flag){a++;for(var n=0;n<r.usersData.length;n++)r.userSortFlags[o].id===r.usersData[n].user_id&&"finished"===r.usersData[n].finished&&d++}if(a!==d||0==a){r.auto_trigger=""===e,wdi_front.ajaxLoader(r),"masonry"===r.feed_row.feed_type&&"pagination"==r.feed_row.feed_display_view&&jQuery("#wdi_feed_"+wdi_front.feed_counter+" .wdi_full_caption").each(function(){jQuery(this).find(".wdi_photo_title").trigger(wdi_front.clickOrTouch)});for(o=0;o<r.usersData.length;o++)"finished"===r.usersData[o].finished&&t++;t===r.usersData.length&&(wdi_front.allImagesLoaded(r),jQuery("#wdi_feed_"+r.feed_row.wdi_feed_counter+" .wdi_load_more").remove());var s=r.usersData;r.loadMoreDataCount=r.feed_users.length;for(o=0;o<s.length;o++){var _=s[o].pagination,f={user_id:s[o].user_id,username:s[o].username};if(""!=_.next_url&&null!=_.next_url&&void 0!==_.next_url){var l=_.next_url;wdi_front.loadMoreRequest(f,l,r,e)}else"initial-keep"==e&&(r.temproraryUsersData[o]=r.usersData[o]),r.loadMoreDataCount--,wdi_front.checkForLoadMoreDone(r,e)}}},wdi_front.loadMoreRequest=function(e,i,t,r){if(t.mediaRequestsDone){t.usersData;var a="",d=function(i){if(void 0!==i.meta&&void 0!==i.meta.error_type&&wdi_front.show_alert(!1,i,t),""===i||void 0===i||null==i)return a=wdi_front_messages.network_error,t.loadMoreDataCount--,void wdi_front.show_alert(a,i,t);if(200!=i.meta.code)return a=i.meta.error_message,t.loadMoreDataCount--,void wdi_front.show_alert(a,i,t);i.user_id=e.user_id,i.username=e.username;for(var d=0;d<t.usersData.length;d++)i.user_id===t.usersData[d].user_id&&("#"===i.user_id[0]&&(i.data=wdi_front.appendRequestHashtag(i.data,i.user_id)),"initial-keep"==r&&(t.temproraryUsersData[d]=t.usersData[d]),t.usersData[d]=i,t.loadMoreDataCount--);wdi_front.checkForLoadMoreDone(t,r)};"#"!==e.username[0]?t.instagram.requestByUrl(i,{success:d}):t.instagram.getTagRecentMedia(e.username,{success:d},i,t.feed_row.hashtag_top_recent)}},wdi_front.checkForLoadMoreDone=function(e,i){var t=e.feed_row.load_more_number,r=e.feed_row.number_of_photos;if(0==e.loadMoreDataCount){e.temproraryUsersData=wdi_front.mergeData(e.temproraryUsersData,e.usersData);var a=wdi_front.getArrayContentLength(e.temproraryUsersData,"data");if("initial-keep"==i&&(i="initial"),"initial"==i)a<r&&!wdi_front.userHasNoPhoto(e,e.temproraryUsersData)&&e.instagramRequestCounter<=e.maxConditionalFiltersRequestCount?wdi_front.loadMore("initial",e):(e.usersData=e.temproraryUsersData,wdi_front.displayFeed(e),wdi_front.applyFilters(e),e.temproraryUsersData=[]);else if(a<t&&!wdi_front.userHasNoPhoto(e,e.temproraryUsersData)&&e.instagramRequestCounter<=e.maxConditionalFiltersRequestCount)wdi_front.loadMore(void 0,e);else{if(e.usersData=e.temproraryUsersData,!wdi_front.activeUsersCount(e))return;wdi_front.displayFeed(e,t),wdi_front.applyFilters(e),e.temproraryUsersData=[]}}},wdi_front.allDataHasFinished=function(e){for(var i=0,t=0;t<e.dataStorageRaw.length;t++)0==e.dataStorageRaw[t].length()&&1==e.dataStorageRaw[t].locked&&i++;return i==e.dataStorageRaw.length},wdi_front.mergeData=function(e,i){for(var t=0;t<i.length;t++)if(void 0!==e[t]){if("finished"==i[t].finished)continue;if(void 0===e[t].pagination.next_max_id&&void 0===e[t].pagination.next_max_like_id)continue;e[t].data=e[t].data.concat(i[t].data),e[t].pagination=i[t].pagination,e[t].user_id=i[t].user_id,e[t].username=i[t].username,e[t].meta=i[t].meta}else e.push(i[t]);return e},wdi_front.brokenImageHandler=function(e){var i=e.src.split("/p/");if(void 0!==i[0]&&void 0!==i[1]&&"https://www.instagram.com"!==i[0]){var t=wdi_baseName(i[0])+"/p/"+i[1];e.src=t}else e.src=wdi_url.plugin_url+"images/missing.png";return e.onerror="",!0},wdi_front.ajaxLoader=function(e){var i,t=e.feed_row.wdi_feed_counter,r=jQuery("#wdi_feed_"+t);("load_more_btn"==e.feed_row.feed_display_view&&(r.find(".wdi_load_more").addClass("wdi_hidden"),r.find(".wdi_spinner").removeClass("wdi_hidden")),"infinite_scroll"==e.feed_row.feed_display_view)&&(0==r.find(".wdi_ajax_loading").length?(i=jQuery('<div class="wdi_ajax_loading"><div><div><img class="wdi_load_more_spinner" src="'+wdi_url.plugin_url+'images/ajax_loader.png"></div></div></div>'),r.append(i)):i=r.find(".wdi_ajax_loading"),i.removeClass("wdi_hidden"))},wdi_front.allImagesLoaded=function(e){var i=wdi_front.getDataLength(e);e.mediaRequestsDone||jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").remove("wdi_nomedia"),0!=i||!e.mediaRequestsDone||0!=e.feed_row.conditional_filters.length&&0!=e.feed_row.conditional_filter_enable||jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").append("<p class='wdi_nomedia'>"+wdi_front_messages.feed_nomedia+"</p>");var t=e.feed_row.wdi_feed_counter,r=jQuery("#wdi_feed_"+t);"load_more_btn"==e.feed_row.feed_display_view&&(r.find(".wdi_load_more").removeClass("wdi_hidden"),r.find(".wdi_spinner").addClass("wdi_hidden")),"infinite_scroll"==e.feed_row.feed_display_view&&jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" .wdi_ajax_loading").addClass("wdi_hidden"),r.trigger("wdi_feed_loaded")},wdi_front.show=function(e,i){var t,r,a,d=i.feed_row.wdi_feed_counter,o=jQuery("#wdi_feed_"+d+" .wdi_feed_container"),n=this;switch(e){case"header":t={feed_thumb:i.feed_row.feed_thumb,feed_name:i.feed_row.feed_name},r=wdi_front.getHeaderTemplate()(t),a=o.find(".wdi_feed_header").html(),o.find(".wdi_feed_header").html(a+r);break;case"users":!function(e){o.find(".wdi_feed_users").html("");var i=e.feed_users;e.feed_row.access_token;e.headerUserinfo=[],function t(){if(e.headerUserinfo.length==i.length)return void function(e,i){o.find(".wdi_feed_users").html("");for(var t=0;t<e.length;t++)if(null!==e[t]){var r={flag:!1,id:e[t].id,name:e[t].name},a="#"==e[t].name[0]?"wdi_header_hashtag":"",d=wdi_extractHostname(e[t].website),n={user_index:t,user_img_url:e[t].url,counts:e[t].counts,feed_counter:i.feed_row.wdi_feed_counter,user_name:e[t].name,bio:wdi_front.escape_tags(e[t].bio),website:d,website_url:e[t].website,usersCount:i.feed_row.feed_users.length,hashtagClass:a},s=wdi_front.getUserTemplate(i,e[t].name),_=s(n),f=o.find(".wdi_feed_users").html();o.find(".wdi_feed_users").html(f+_),i.userSortFlags.push(r);var l=jQuery('<div class="wdi_clear"></div>')}o.find(".wdi_feed_users").append(l),wdi_front.updateUsersImages(i)}(e.headerUserinfo,e);var r=i[e.headerUserinfo.length];"string"==typeof r&&"self"===r?e.instagram.getSelfInfo({success:function(i){if(void 0!==i.meta&&void 0!==i.meta.error_type&&wdi_front.show_alert(!1,i,e),0!=(i=n.checkMediaResponse(i,e))&&400===i.meta.code&&"APINotAllowedError"===i.meta.error_type){var r=null;e.headerUserinfo.push(r),0,t()}if(0!=i&&200===i.meta.code){var r={id:i.data.id,name:i.data.username,url:i.data.profile_picture,bio:wdi_front.escape_tags(i.data.bio),counts:i.data.counts,website:wdi_front.escape_tags(i.data.website),full_name:wdi_front.escape_tags(i.data.full_name)};e.headerUserinfo.push(r),0,t()}},args:{ignoreFiltering:!0}}):"user"==n.getInputType(r.username)&&e.instagram.getSelfInfo({success:function(i){if(void 0!==i.meta&&void 0!==i.meta.error_type&&wdi_front.show_alert(!1,i,e),0!=(i=n.checkMediaResponse(i,e))&&400===i.meta.code&&"APINotAllowedError"===i.meta.error_type){var r=null;e.headerUserinfo.push(r),0,t()}if(0!=i&&200===i.meta.code){var r={id:i.data.id,name:i.data.username,url:i.data.profile_picture,bio:wdi_front.escape_tags(i.data.bio),counts:i.data.counts,website:wdi_front.escape_tags(i.data.website),full_name:wdi_front.escape_tags(i.data.full_name)};e.headerUserinfo.push(r),0,t()}},args:{ignoreFiltering:!0}})}()}(i)}},wdi_front.getUserTemplate=function(e,i){var t,r,a=e.dataCount;switch(i[0]){case"#":t="//instagram.com/explore/tags/"+i.substr(1,i.length);break;default:t="//instagram.com/"+i}r="onclick='"+('window.open("'+t+'","_blank")')+"'";var d='<div class="wdi_single_user" user_index="<%=user_index%>"><div class="wdi_header_user_text <%=hashtagClass%>"><div class="wdi_user_img_wrap"><img onerror="wdi_front.brokenImageHandler(this);" src="<%= user_img_url%>">';return a>1&&(d+='<div title="'+wdi_front_messages.filter_title+'" class="wdi_filter_overlay"><div class="wdi_filter_icon"><span onclick="wdi_front.addFilter(<%=user_index%>,<%=feed_counter%>);" class="tenweb-i tenweb-i-filter"></span></div></div>'),d+="</div>",d+="<h3 "+r+"><%= user_name%></h3>","#"!==i[0]?("1"==e.feed_row.follow_on_instagram_btn&&(d+='<div class="wdi_user_controls"><div class="wdi_follow_btn" onclick="window.open(\'//instagram.com/<%= user_name%>\',\'_blank\')"><span> '+wdi_front_messages.follow+"</span></div></div>"),d+='<div class="wdi_media_info"><p class="wdi_posts"><span class="tenweb-i tenweb-i-camera-retro"></span><%= counts.media%></p><p class="wdi_followers"><span class="tenweb-i tenweb-i-user"></span><%= counts.followed_by%></p></div>'):d+='<div class="wdi_user_controls"></div><div class="wdi_media_info"><p class="wdi_posts"><span class="tenweb-i tenweb-i-camera-retro"></span><%= counts.media%></p><p class="wdi_followers"><span></span></p></div>',d+='<div class="wdi_clear"></div>',1==a&&"#"!==i[0]&&"1"==e.feed_row.display_user_info&&(d+='<div class="wdi_bio"><%= bio%></div>',d+='<div class="wdi_website"><a target="_blank" href="<%= website_url%>" ><%= website%></a></div>'),d+="</div></div>",_.template(d)},wdi_front.getHeaderTemplate=function(){return _.template('<div class="wdi_header_wrapper"><div class="wdi_header_img_wrap"><img src="<%=feed_thumb%>"></div><div class="wdi_header_text"><%=feed_name%></div><div class="wdi_clear"></div>')},wdi_front.addFilter=function(e,i){var t=window["wdi_feed_"+i];if(!(t.dataCount<2)&&0==t.nowLoadingImages){var r=jQuery("#wdi_feed_"+t.feed_row.wdi_feed_counter+'_users [user_index="'+e+'"]');r.find(".wdi_filter_overlay").toggleClass("wdi_filter_active_bg"),r.find(".wdi_header_user_text h3").toggleClass("wdi_filter_active_col"),r.find(".wdi_media_info").toggleClass("wdi_filter_active_col"),r.find(".wdi_follow_btn").toggleClass("wdi_filter_active_col"),t.customFilterChanged=!0,0==t.userSortFlags[e].flag?t.userSortFlags[e].flag=!0:t.userSortFlags[e].flag=!1;for(var a=0,d=0;d<t.userSortFlags.length;d++)1==t.userSortFlags[d].flag&&a++;"pagination"==t.feed_row.feed_display_view&&(t.resIndex=0),0!=a?(wdi_front.filterData(t),wdi_front.displayFeed(t)):(t.customFilteredData=t.dataStorageList,wdi_front.displayFeed(t)),"pagination"==t.feed_row.feed_display_view&&(t.paginator=Math.ceil(t.imageIndex/parseInt(t.feed_row.pagination_per_page_number)),t.currentPage=t.paginator,wdi_front.updatePagination(t,"custom",1),jQuery("#wdi_first_page").removeClass("wdi_disabled"),jQuery("#wdi_last_page").addClass("wdi_disabled"))}},wdi_front.filterData=function(e){var i=e.userSortFlags;e.customFilteredData=[];for(var t=0;t<e.dataStorageList.length;t++)for(var r=0;r<i.length;r++)(void 0!==e.dataStorageList[t].user.id&&e.dataStorageList[t].user.id==i[r].id||e.dataStorageList[t].wdi_hashtag==i[r].name)&&1==i[r].flag&&e.customFilteredData.push(e.dataStorageList[t])},wdi_front.applyFilters=function(e){for(var i=0;i<e.userSortFlags.length;i++)if(1==e.userSortFlags[i].flag){jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+'[user_index="'+i+'"]');wdi_front.addFilter(i,e.feed_row.wdi_feed_counter),wdi_front.addFilter(i,e.feed_row.wdi_feed_counter)}},wdi_front.getImgCount=function(e){for(var i=e.dataStorage,t=0,r=0;r<i.length;r++)t+=i[r].length;return t},wdi_front.parseLighboxData=function(e,i){var t=e.dataStorage,r=e.feed_row.sort_images_by,a=e.feed_row.display_order,d=wdi_front.sortingOperator(r,a),o=[],n=[],s={};if(1==i)o=e.customFilteredData;else{for(var _=0;_<t.length;_++)for(var f=0;f<t[_].length;f++)o.push(t[_][f]);o.sort(d)}for(_=0;_<o.length;_++)s={alt:"",avg_rating:"",comment_count:o[_].comments.count,date:wdi_front.convertUnixDate(o[_].created_time),description:wdi_front.getDescription(null!==o[_].caption?wdi_front.escape_tags(o[_].caption.text):""),filename:wdi_front.getFileName(o[_]),filetype:wdi_front.getFileType(o[_]),hit_count:"0",id:o[_].id,image_url:o[_].link,number:0,rate:"",rate_count:"0",username:o[_].user.username,profile_picture:o[_].user.profile_picture,thumb_url:o[_].link+"media/?size=t",comments_data:o[_].comments.data,images:o[_].images,carousel_media:void 0!==o[_].carousel_media?o[_].carousel_media:null},n.push(s);return n},wdi_front.convertUnixDate=function(e){var i=parseInt(e),t=new Date(0);t.setUTCSeconds(i);var r=t.getFullYear()+"-"+t.getMonth()+"-"+t.getDate();return r+=" "+t.getHours()+":"+t.getMinutes()},wdi_front.getDescription=function(e){return e=e.replace(/\r?\n|\r/g," ")},wdi_front.getFileName=function(e){var i=e.link;if("video"===e.type&&e.hasOwnProperty("videos"))return e.videos.standard_resolution.url;var t=i.split("/");return t[t.length-2]},wdi_front.getFileType=function(e){return"video"==e.type&&e.hasOwnProperty("videos")?"EMBED_OEMBED_INSTAGRAM_VIDEO":"EMBED_OEMBED_INSTAGRAM_IMAGE"},wdi_front.array_max=function(e){for(var i=e[0],t=0,r=1;r<e.length;r++)i<e[r]&&(i=e[r],t=r);return{value:i,index:t}},wdi_front.array_min=function(e){for(var i=e[0],t=0,r=1;r<e.length;r++)i>e[r]&&(i=e[r],t=r);return{value:i,index:t}},wdi_front.activeUsersCount=function(e){for(var i=0,t=0;t<e.usersData.length;t++)"finished"!=e.usersData[t].finished&&i++;return i},wdi_front.checkMediaResponse=function(e,i){return""!=e&&void 0!==e&&null!=e&&400===e.meta.code&&"APINotAllowedError"===e.meta.error_type?e:""==e||void 0===e||null==e?(errorMessage=wdi_front_messages.connection_error,wdi_front.show_alert(errorMessage,e,i),!1):200!=e.meta.code?(errorMessage=e.meta.error_message,wdi_front.show_alert(errorMessage,e,i),!1):e},wdi_front.stripHashtag=function(e){switch(e[0]){case"#":return e.substr(1,e.length);default:return e}},wdi_front.getInputType=function(e){switch(e[0]){case"#":return"hashtag";case"%":return"location";default:return"user"}},wdi_front.regexpTestCaption=function(e,i){var t=!1,r=!1,a=i.replace(/[-[\]{}()*+?.,\\^$|]/g,"\\$&"),d=new RegExp("(?:^|\\s)"+a+"(?:^|\\s)"),o=new RegExp("(?:^|\\s)"+a,"g");for(null!=d.exec(e)&&(t=!0);null!=(match=o.exec(e));)match.index==e.length-i.length-1&&(r=!0);return 1==t||1==r},wdi_front.replaceNewLines=function(e){var i,t=[];for(e=e.replace(/\r?\n|\r/g,"vUkCJvN2ps3t"),i=new RegExp("vUkCJvN2ps3t","g");null!=(match=i.exec(e));)t.push(match.index);for(var r=e.split("vUkCJvN2ps3t"),a=0,d=0;d<r.length;d++)""==r[d]?a++:a=0,a>0&&(r.splice(d,1),a--,d--);return e=r.join(" ")},wdi_front.isEmptyObject=function(e){for(var i in e)if(e.hasOwnProperty(i))return!1;return!0};var WDIFeed=function(e){this.data=e.data,this.dataCount=e.dataCount,this.feed_row=e.feed_row,this.usersData=e.usersData,_this=this,this.set_images_loading_flag=function(e){window.addEventListener("load",function(){e.nowLoadingImages=!1})},this.set_images_loading_flag(_this)};function wdi_extractHostname(e){return void 0===e||""===e?"":e.replace(/(^\w+:|^)\/\//,"")}WDIFeed.prototype.conditionalFilter=function(e,i){var t=this.feed_row.conditional_filter_type,r=this.feed_row.conditional_filters;if(1==i.ignoreFiltering||(e=this.avoidDuplicateMedia(e)),!wdi_front.isJsonString(r))return e;if(0==(r=JSON.parse(r)).length)return e;if("0"==this.feed_row.conditional_filter_enable)return e;switch(this.instagramRequestCounter++,t){case"AND":e=this.applyANDLogic(e,r,this);break;case"OR":e=this.applyORLogic(e,r,this);break;case"NOR":e=this.applyNORLogic(e,r,this)}return e},WDIFeed.prototype.applyANDLogic=function(e,i){for(var t=0;t<i.length;t++)e=this.filterResponse(e,i[t]);return e},WDIFeed.prototype.applyORLogic=function(e,i){for(var t,r,a=[],d=[],o=0;o<i.length;o++)t=this.filterResponse(e,i[o]),a=a.concat(t.data),t={};for(o=0;o<a.length;o++)r=a[o],this.mediaExists(r,d)||this.mediaExists(r,this.dataStorageList)||d.push(r);return{data:d,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.applyNORLogic=function(e,i){for(var t=e,r=this.applyORLogic(e,i,this),a=[],d=0;d<t.data.length;d++)this.mediaExists(t.data[d],r.data)||a.push(t.data[d]);return{data:a,meta:t.meta,pagination:t.pagination}},WDIFeed.prototype.mediaExists=function(e,i){for(var t=0;t<i.length;t++)if(e.id==i[t].id)return!0;return!1},WDIFeed.prototype.filterResponse=function(e,i){switch(i.filter_type){case"hashtag":return this.filterByHashtag(e,i);case"username":return this.filterByUsername(e,i);case"mention":return this.filterByMention(e,i);case"description":return this.filterByDescription(e,i);case"location":return this.filterByLocation(e,i);case"url":return this.filterByUrl(e,i)}},WDIFeed.prototype.filterByHashtag=function(e,i){for(var t,r=[],a=0;a<e.data.length;a++){t=e.data[a];for(var d=0;d<t.tags.length;d++)tag=t.tags[d],tag.toLowerCase()==i.filter_by.toLowerCase()&&r.push(t)}return{data:r,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByUsername=function(e,i){for(var t,r=[],a=0;a<e.data.length;a++)(t=e.data[a]).user.username.toLowerCase()==i.filter_by.toLowerCase()&&r.push(t);return{data:r,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByMention=function(e,i){for(var t,r=[],a=0;a<e.data.length;a++)null!==(t=e.data[a]).caption&&-1!=t.caption.text.toLowerCase().indexOf("@"+i.filter_by.toLowerCase())&&r.push(t);return{data:r,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByDescription=function(e,i){for(var t,r,a=[],d=0;d<e.data.length;d++)if(null!==(t=e.data[d]).caption){r=t.caption.text.toLowerCase(),r=wdi_front.replaceNewLines(r);var o=i.filter_by.toLowerCase();wdi_front.regexpTestCaption(r,o)&&a.push(t)}return{data:a,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByLocation=function(e,i){for(var t,r=[],a=0;a<e.data.length;a++)null!==(t=e.data[a]).location&&t.location.id==i.filter_by&&r.push(t);return{data:r,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByUrl=function(e,i){var t,r=[];i.filter_by=this.getIdFromUrl(i.filter_by);for(var a=0;a<e.data.length;a++)null!==(t=e.data[a]).link&&this.getIdFromUrl(t.link)==i.filter_by&&r.push(t);return{data:r,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.getIdFromUrl=function(e){for(var i=e.split("/"),t=!1,r=0;r<i.length;r++)if("p"==i[r]&&void 0!==i[r+1]){t=i[r+1];break}return t},WDIFeed.prototype.avoidDuplicateMedia=function(e){var i=e.data,t=[];void 0===i&&(i=[]);for(var r=0;r<i.length;r++)this.mediaExists(i[r],this.dataStorageList)||this.mediaExists(i[r],t)||this.mediaExists(i[r],this.conditionalFilterBuffer)||t.push(i[r]);return this.conditionalFilterBuffer=this.conditionalFilterBuffer.concat(t),{data:t,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.storeRawData=function(e,i){var t=this;if("object"==typeof this[i]&&"number"==typeof this[i].length)for(var r=0;r<e.length;r++){var a="";wdi_front.isHashtag(e[r].user_id)?void 0!==e[r].pagination.cursors&&(a=e[r].pagination.cursors.after):"liked"==t.feed_row.liked_feed?void 0===(a=e[r].pagination.next_max_like_id)&&(a=""):(null==e[r].pagination&&(e[r].pagination=[]),void 0===(a=e[r].pagination.next_max_id)&&(a="")),void 0===this[i][r]?this[i].push({data:e[r].data,index:0,locked:!1,hash_id:a,usersDataFinished:!1,userId:e[r].user_id,length:function(){return this.data.length-this.index},getData:function(e){var i=this.data.slice(this.index,this.index+e);if(this.index+=Math.min(e,this.length()),this.index==this.data.length&&1==this.locked&&0==this.usersDataFinished)for(var r=0;r<t.usersData.length;r++)if(t.usersData[r].user_id==this.userId){t.usersData[r].finished="finished",this.usersDataFinished=!0;break}return i}}):0==this[i][r].locked&&(a!=this[i][r].hash_id?(this[i][r].data=this[i][r].data.concat(e[r].data),this[i][r].hash_id=a):this[i][r].locked=!0)}},wdi_front.updateUsersIfNecessary=function(e){for(var i=e.feed_users,t=!1,r=0;r<i.length;r++)"#"!=i[r].username.substr(0,1)?""!=i[r].id&&"username"!=i[r].id||(t=!0,e.instagram.searchForUsersByName(i[r].username,{success:function(t){if(void 0!==t.meta&&void 0!==t.meta.error_type&&wdi_front.show_alert(!1,t,e),200==t.meta.code&&t.data.length>0){for(var r=!1,a=0;a<t.data.length;a++)if(t.data[a].username==t.args.username){r=!0;break}if(r)for(var d=0;d<i.length;d++)t.data[a].username==i[d].username&&(i[d].id=t.data[a].id)}for(var o=!1,n=0;n<i.length;n++)if(""==i[n].id||"username"==i[n].id){o=!0;break}o||(e.feed_row.feed_users=JSON.stringify(i),wdi_front.init(e))},username:i[r].username})):i[r].id=i[r].username;return t},void 0!==wdi_ajax.ajax_response?jQuery(document).one("ajaxStop",function(){"not_declared"!=wdi_front.type&&(wdi_front.clickOrTouch=wdi_front.detectEvent(),wdi_front.globalInit())}):jQuery(document).ready(function(){"not_declared"!=wdi_front.type&&(wdi_front.clickOrTouch=wdi_front.detectEvent(),wdi_front.globalInit())});
|
1 |
+
"undefined"==typeof wdi_front&&(wdi_front={type:"not_declared"}),wdi_front.detectEvent=function(){return/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())?"touchend":"click"};var wdi_error_show=!1;function wdi_baseName(e){var i=e.substr(e.lastIndexOf("/"));return e.replace(i,"")}wdi_front.escape_tags=function(e){return void 0===e&&(e=""),e=e.toString().replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""")},wdi_front.show_alert=function(e,i,t){if(t=jQuery("#wdi_feed_"+t.feed_row.wdi_feed_counter),400===i.meta.code&&"APINotAllowedError"===i.meta.error_type){if(void 0!==i.wdi_current_feed_name){var r=i.wdi_current_feed_name;t.find(".wdi_private_feed_names").html(r),t.find(".wdi_private_feed_error").removeClass("wdi_hidden")}t.find(".wdi_spinner").remove()}if(void 0!==t&&"APINotAllowedError"!=i.meta.error_type){t.find(".wdi_spinner").remove(),wdi_error_show=!0;var a=t.find(".wdi_js_error"),d=t.find(".wdi_token_error");0!=i&&null!=typeof i.meta&&"OAuthAccessTokenException"===i.meta.error_type?(d.removeClass("wdi_hidden"),"1"!=wdi_front_messages.wdi_token_error_flag&&jQuery.ajax({type:"POST",url:wdi_url.ajax_url,dataType:"json",data:{action:"wdi_token_flag",wdi_token_flag_nonce:wdi_front_messages.wdi_token_flag_nonce},success:function(e){}})):(a.removeClass("wdi_js_error"),a.addClass("wdi_js_error_no_animate"),jQuery(".wdi_js_error_no_animate").show()),wdi_front_messages.show_alerts||console.log("%c"+e,"color:#cc0000;")}wdi_error_show=!0},wdi_front.globalInit=function(){var e=wdi_front.feed_counter;if(void 0!==wdi_ajax.ajax_response)var i=wdi_feed_counter_init.wdi_feed_counter_init;else i=0;for(var t=i;t<=e;t++)if(0!==jQuery("#wdi_feed_"+t).length){var r=new WDIFeed(window["wdi_feed_"+t]);r.instagram=new WDIInstagram,r.instagram.filterArguments={feed:r},r.instagram.filters=[{where:"getUserRecentMedia",what:function(e,i,t){return i.feed.conditionalFilter(e,t)}},{where:"getTagRecentMedia",what:function(e,i,t){return i.feed.conditionalFilter(e,t)}},{where:"getRecentLikedMedia",what:function(e,i,t){return i.feed.conditionalFilter(e,t)}},{where:"requestByUrl",what:function(e,i,t){return i.feed.conditionalFilter(e,t)}}],r.instagram.addToken(r.feed_row.access_token),wdi_front.access_token=r.feed_row.access_token,r.dataStorageRaw=[],r.dataStorage=[],r.dataStorageList=[],r.allResponseLength=0,r.currentResponseLength=0,r.temproraryUsersData=[],r.removedUsers=0,r.nowLoadingImages=!0,r.imageIndex=0,r.resIndex=0,r.currentPage=1,r.userSortFlags=[],r.customFilterChanged=!1,r.maxConditionalFiltersRequestCount=10,r.instagramRequestCounter=0,r.mediaRequestsDone=!1,r.conditionalFilterBuffer=[],r.stopInfiniteScrollFlag=!1,"masonry"==r.feed_row.feed_type&&(r.displayedData=[]),"pagination"==r.feed_row.feed_display_view?(r.feed_row.resort_after_load_more=0,"image_browser"!=r.feed_row.feed_type?(r.feed_row.load_more_number=parseInt(r.feed_row.pagination_per_page_number),r.feed_row.number_of_photos=(1+parseInt(r.feed_row.pagination_preload_number))*r.feed_row.load_more_number):(r.feed_row.number_of_photos=1+parseInt(r.feed_row.image_browser_preload_number),r.feed_row.load_more_number=parseInt(r.feed_row.image_browser_load_number)),r.freeSpaces=(Math.floor(r.feed_row.pagination_per_page_number/r.feed_row.number_of_columns)+1)*r.feed_row.number_of_columns-r.feed_row.pagination_per_page_number):r.freeSpaces=0,r.galleryBox=function(e){wdi_spider_createpopup(wdi_url.ajax_url+"?gallery_id="+this.feed_row.id+"&image_id="+e,this.feed_row.wdi_feed_counter,this.feed_row.lightbox_width,this.feed_row.lightbox_height,1,"testpopup",5,this,e)},wdi_responsive.columnControl(r),"masonry"==r.feed_row.feed_type&&jQuery(window).trigger("resize"),wdi_front.bindEvents(r),window["wdi_feed_"+t]=r,wdi_front.init(r)}},wdi_front.init=function(e){if(jQuery(".wdi_js_error").hide(),e.photoCounter=e.feed_row.number_of_photos,"liked"==e.feed_row.liked_feed)e.feed_users=["self"];else{if(!wdi_front.isJsonString(e.feed_row.feed_users))return void wdi_front.show_alert(wdi_front_messages.invalid_users_format,!1,e);e.feed_users=JSON.parse(e.feed_row.feed_users)}var i=[];void 0!==window.wdi_all_tags&&(i=window.wdi_all_tags);for(var t=0;t<e.feed_users.length;t++)"#"===e.feed_users[t].username[0]&&void 0!==e.feed_users[t].tag_id&&(i[e.feed_users[t].tag_id]=e.feed_users[t]);window.wdi_all_tags=i,e.dataCount=e.feed_users.length;var r=wdi_front.getFeedItemResolution(e);e.feedImageResolution=r.image,e.feedVideoResolution=r.video;for(var a=0;a<e.dataCount;a++)wdi_front.instagramRequest(a,e);e.feed_row.number_of_photos>0&&wdi_front.ajaxLoader(e),"1"===e.feed_row.display_header&&wdi_front.show("header",e)},wdi_front.getFeedItemResolution=function(e){var i={image:"standard_resolution",video:"standard_resolution"};if("thumbnail"===e.feed_row.feed_resolution)return{image:"thumbnail",video:"low_bandwidth"};if("low"===e.feed_row.feed_resolution)return{image:"low_resolution",video:"low_resolution"};if("standard"===e.feed_row.feed_resolution)return{image:"standard_resolution",video:"standard_resolution"};var t=jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter).find(".wdi_feed_wrapper");t.append('<div class="wdi_feed_item" id="wdi_feed_item_example"></div>'),wdi_responsive.columnControl(e,1);var r=t.attr("wdi-res").split("wdi_col_");if(t.find("#wdi_feed_item_example").remove(),2!==r.length)return i;var a=parseInt(r[1]);if(a<=0)return i;var d=t.width()/a-10,o=i;return d<=150?(o.image="thumbnail",o.video="low_bandwidth"):d>150&&d<=320?(o.image="low_resolution",o.video="low_resolution"):(o.image="standard_resolution",o.video="standard_resolution"),o},wdi_front.isJsonString=function(e){try{JSON.parse(e)}catch(e){return!1}return!0},wdi_front.instagramRequest=function(e,i){var t=i.feed_users,r=this;"string"==typeof t[e]&&"self"===t[e]?i.instagram.getRecentLikedMedia({success:function(e){void 0!==e.meta&&void 0!==e.meta.error_type&&wdi_front.show_alert(!1,e,i),i.mediaRequestsDone=!0,0!=(e=r.checkMediaResponse(e,i))&&r.saveSelfUserData(e,i)}}):"hashtag"==this.getInputType(t[e].username)?i.instagram.getTagRecentMedia(this.stripHashtag(t[e].username),{success:function(t){void 0!==t.meta&&void 0!==t.meta.error_type&&wdi_front.show_alert(!1,t,i),i.mediaRequestsDone=!0,0!=(t=r.checkMediaResponse(t,i))&&r.saveUserData(t,i.feed_users[e],i)}},null,i.feed_row.hashtag_top_recent):"user"==this.getInputType(t[e].username)&&i.instagram.getSelfRecentMedia({success:function(a){void 0!==a.meta&&void 0!==a.meta.error_type&&(a.wdi_current_feed_name=t[e].username,wdi_front.show_alert(!1,a,i)),i.mediaRequestsDone=!0,0!=(a=r.checkMediaResponse(a,i))&&r.saveUserData(a,i.feed_users[e],i)}})},wdi_front.isHashtag=function(e){return"#"===e[0]},wdi_front.saveUserData=function(e,i,t){if(e.username=i.username,e.user_id=i.id,"#"===e.user_id[0]&&(e.data=wdi_front.appendRequestHashtag(e.data,e.user_id)),t.usersData.push(e),t.currentResponseLength=wdi_front.getArrayContentLength(t.usersData,"data"),t.allResponseLength+=t.currentResponseLength,t.dataCount==t.usersData.length)if(t.currentResponseLength<t.feed_row.number_of_photos&&!wdi_front.userHasNoPhoto(t))wdi_front.loadMore("initial-keep",t);else if(wdi_front.displayFeed(t),wdi_front.applyFilters(t),!wdi_front.activeUsersCount(t)&&"load_more_btn"==t.feed_row.feed_display_view){var r=jQuery("#wdi_feed_"+t.feed_row.wdi_feed_counter);r.find(".wdi_load_more").addClass("wdi_hidden"),r.find(".wdi_spinner").addClass("wdi_hidden")}},wdi_front.saveSelfUserData=function(e,i){if(e.username="",e.user_id="",i.usersData.push(e),i.currentResponseLength=wdi_front.getArrayContentLength(i.usersData,"data"),i.allResponseLength+=i.currentResponseLength,i.dataCount==i.usersData.length)if(i.currentResponseLength<i.feed_row.number_of_photos&&!wdi_front.userHasNoPhoto(i))wdi_front.loadMore("initial-keep",i);else if(wdi_front.displayFeed(i),wdi_front.applyFilters(i),!wdi_front.activeUsersCount(i)&&"load_more_btn"==i.feed_row.feed_display_view){var t=jQuery("#wdi_feed_"+i.feed_row.wdi_feed_counter);t.find(".wdi_load_more").addClass("wdi_hidden"),t.find(".wdi_spinner").addClass("wdi_hidden")}},wdi_front.userHasNoPhoto=function(e,i){var t=0,r=e.usersData;void 0!==i&&(r=i);for(var a=0;a<r.length;a++)void 0===r[a].pagination&&(r[a].pagination=[]),"liked"===e.feed_row.liked_feed?void 0===r[a].pagination.next_max_like_id&&t++:void 0===r[a].pagination.next_max_id&&t++;return t==r.length?1:0},wdi_front.appendRequestHashtag=function(e,i){for(var t=0;t<e.length;t++)e[t].wdi_hashtag=i;return e},wdi_front.displayFeed=function(e,i){if(0==e.customFilterChanged)var t=wdi_front.feedSort(e,i);var r=e.customFilterChanged;if(1==e.customFilterChanged){t=e.customFilteredData;e.parsedData=wdi_front.parseLighboxData(e,!0)}"1"!=e.feed_row.resort_after_load_more?0==e.customFilterChanged&&(e.dataStorageList=e.dataStorageList.concat(t)):0==e.customFilterChanged&&(e.dataStorageList=t),"masonry"==e.feed_row.feed_type&&wdi_front.masonryDisplayFeedItems(t,e),"thumbnails"!=e.feed_row.feed_type&&"blog_style"!=e.feed_row.feed_type&&"image_browser"!=e.feed_row.feed_type||wdi_front.displayFeedItems(t,e),wdi_front.getDataLength(e)<e.photoCounter&&!r&&e.instagramRequestCounter<=e.maxConditionalFiltersRequestCount&&!wdi_front.allDataHasFinished(e)?wdi_front.loadMore("",e):wdi_front.allImagesLoaded(e),e.instagramRequestCounter>e.maxConditionalFiltersRequestCount&&(wdi_front.allImagesLoaded(e),0==t.length&&(e.stopInfiniteScrollFlag=!0)),"pagination"==e.feed_row.feed_display_view&&e.currentPage<e.paginator&&jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter).find("#wdi_last_page").removeClass("wdi_disabled"),e.instagramRequestCounter=0,e.conditionalFilterBuffer=[],wdi_front.updateUsersImages(e)},wdi_front.updateUsersImages=function(e){jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter).find(".wdi_single_user .wdi_user_img_wrap img").each(function(){if(jQuery(this).attr("src")==wdi_url.plugin_url+"images/missing.png"||""==jQuery(this).attr("src")){if("liked"==e.feed_row.liked_feed)return;for(var i=0;i<e.usersData.length;i++)e.usersData[i].username==jQuery(this).parent().parent().find("h3").text()&&0!=e.usersData[i].data.length&&jQuery(this).attr("src",e.usersData[i].data[0].images.thumbnail.url)}})},wdi_front.masonryDisplayFeedItems=function(e,i){var t=[],r=[];if(0!=jQuery("#wdi_feed_"+i.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").length){jQuery("#wdi_feed_"+i.feed_row.wdi_feed_counter+" .wdi_masonry_column").each(function(){1==i.feed_row.resort_after_load_more&&(jQuery(this).html(""),i.imageIndex=0),1==i.customFilterChanged&&(jQuery(this).html(""),i.imageIndex=0),"pagination"==i.feed_row.feed_display_view?t.push(0):t.push(jQuery(this).height()),r.push(jQuery(this))}),1==i.customFilterChanged&&(i.customFilterChanged=!1);for(var a=0;a<e.length;a++){if(i.displayedData.push(e[a]),"image"==e[a].type)var d=wdi_front.getPhotoTemplate(i);else if(e[a].hasOwnProperty("videos")||"video"==e[a].type)d=wdi_front.getVideoTemplate(i);else d=wdi_front.getSliderTemplate(i);var o=e[a],n=d(wdi_front.createObject(o,i)),s=wdi_front.array_min(t),_=wdi_front.getImageResolution(e[a]);r[s.index].html(r[s.index].html()+n),t[s.index]+=r[s.index].width()*_,i.imageIndex++,"pagination"==i.feed_row.feed_display_view&&((a+1)%i.feed_row.pagination_per_page_number==0?i.resIndex+=i.freeSpaces+1:i.resIndex++)}i.wdi_loadedImages=0;var f=!1;i.wdi_load_count=a;var l=i.feed_row.wdi_feed_counter;jQuery("#wdi_feed_"+l+" img.wdi_img").on("load",function(){i.wdi_loadedImages++,w(),!1===f&&(wdi_responsive.columnControl(i,1),f=!0)});w(),1==i.paginatorNextFlag&&wdi_front.updatePagination(i,"next"),i.infiniteScrollFlag=!1}function w(){i.wdi_load_count===i.wdi_loadedImages&&0!=i.wdi_loadedImages&&(i.loadedImages=0,i.wdi_load_count=0,wdi_front.allImagesLoaded(i))}},wdi_front.getImageResolution=function(e){var i=e.images.standard_resolution.width;return e.images.standard_resolution.height/i},wdi_front.getDataLength=function(e,i){var t=0;if(void 0===i)for(var r=0;r<e.dataStorage.length;r++)t+=e.dataStorage[r].length;else for(r=0;r<i.length;r++)t+=i[r].length;return t},wdi_front.getArrayContentLength=function(e,i){for(var t=0,r=0;r<e.length;r++)"finished"!=e[r].finished&&(t+=e[r][i].length);return t},wdi_front.displayFeedItems=function(e,i){if(0!=jQuery("#wdi_feed_"+i.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").length){var t=i.feed_row.wdi_feed_counter,r=jQuery("#wdi_feed_"+t+" .wdi_feed_wrapper");"1"===i.feed_row.resort_after_load_more&&(r.html(""),i.imageIndex=0),1==i.customFilterChanged&&(r.html(""),i.imageIndex=0,i.customFilterChanged=!1);wdi_front.getImgCount(i),e.length;if("pagination"==i.feed_row.feed_display_view){var a=i.feed_row.load_more_number;"image_browser"==i.feed_row.feed_type&&(a=1),(jQuery("#wdi_feed_"+i.feed_row.wdi_feed_counter+' [wdi_page="'+(i.currentPage-1)+'"]').length<a||0==e.length)&&(i.currentPage=--i.currentPage<=1?1:i.currentPage)}for(var d=0;d<e.length;d++){if("image"==e[d].type)var o=wdi_front.getPhotoTemplate(i);else if(e[d].hasOwnProperty("videos"))o=wdi_front.getVideoTemplate(i);else o=wdi_front.getSliderTemplate(i);var n=e[d],s=o(wdi_front.createObject(n,i));r.html(r.html()+s),i.imageIndex++,"pagination"==i.feed_row.feed_display_view&&((d+1)%i.feed_row.pagination_per_page_number==0?i.resIndex+=i.freeSpaces+1:i.resIndex++)}i.wdi_loadedImages=0;var _=!1;i.wdi_load_count=d;t=i.feed_row.wdi_feed_counter,r=jQuery("#wdi_feed_"+t+" img.wdi_img").on("load",function(){i.wdi_loadedImages++,i.wdi_load_count===i.wdi_loadedImages&&0!=i.wdi_loadedImages&&(i.loadedImages=0,i.wdi_load_count=0,wdi_front.allImagesLoaded(i)),!1===_&&(wdi_responsive.columnControl(i,1),_=!0)});1==i.paginatorNextFlag&&wdi_front.updatePagination(i,"next"),i.infiniteScrollFlag=!1}},wdi_front.checkFeedFinished=function(e){for(var i=0;i<e.usersData.length;i++)if(void 0===e.usersData[i].finished)return!1;return!0},wdi_front.sortingOperator=function(e,i){var t;switch(e){case"date":switch(i){case"asc":t=function(e,i){return e.created_time>i.created_time?1:-1};break;case"desc":t=function(e,i){return e.created_time>i.created_time?-1:1}}break;case"likes":switch(i){case"asc":t=function(e,i){return e.likes.count<i.likes.count?-1:1};break;case"desc":t=function(e,i){return e.likes.count<i.likes.count?1:-1}}break;case"comments":switch(i){case"asc":t=function(e,i){return e.comments.count<i.comments.count?-1:1};break;case"desc":t=function(e,i){return e.comments.count<i.comments.count?1:-1}}break;case"random":t=function(e,i){return Math.random()>.5?1:-1}}return t},wdi_front.feedSort=function(e,i){var t=e.feed_row.sort_images_by,r=e.feed_row.display_order;"1"===e.feed_row.resort_after_load_more?e.data=e.data.concat(wdi_front.smartPicker(e,i)):e.data=wdi_front.smartPicker(e,i);var a=wdi_front.sortingOperator(t,r);return e.data.sort(a),e.data},wdi_front.smartPicker=function(e,i){var t=[],r=0,a=[],d=Math.ceil(e.feed_row.number_of_photos/e.usersData.length),o=parseInt(e.feed_row.number_of_photos),n=0;""!=i&&void 0!==i&&null!=i&&(o=parseInt(i),d=Math.ceil(o/wdi_front.activeUsersCount(e)));e.storeRawData(e.usersData,"dataStorageRaw");for(var s=e.dataStorageRaw.sort(function(e,i){return e.length()>i.length()?1:-1}),_=e.usersData.sort(function(e,i){return e.data.length>i.data.length?1:-1}),f=0;f<_.length;f++)if(n+=d,s[f].length()<=n)n-=s[f].length(),t.push(s[f].getData(s[f].length())),r+=t[t.length-1].length;else{r+n>o&&(n=o-r);var l=[];!1===e.auto_trigger?l=l.concat(s[f].getData(n)):l.length+wdi_front.getDataLength(e)+wdi_front.getDataLength(e,t)<e.feed_row.number_of_photos&&(l=l.concat(s[f].getData(n))),n=0,r+=l.length,t.push(l)}for(f=0;f<t.length;f++)void 0===e.dataStorage[f]?e.dataStorage.push(t[f]):e.dataStorage[f]=e.dataStorage[f].concat(t[f]);for(e.parsedData=wdi_front.parseLighboxData(e),f=0;f<t.length;f++)a=a.concat(t[f]);return a},wdi_front.createObject=function(e,i){var t=null!=e.caption?e.caption.text:" ",r="";if("video"==e.type&&(r=e.hasOwnProperty("videos")?e.videos[i.feedVideoResolution].url:""),void 0===e.images[i.feedImageResolution])var a=wdi_url.plugin_url+"images/missing.png";else a=e.images[i.feedImageResolution].url;var d=i.imageIndex,o="square",n=e.images.standard_resolution.height,s=e.images.standard_resolution.width;n>s?o="portrait":n<s&&(o="landscape");var _=e.user.username;return""===_&&(_="no_user"),{id:e.id,caption:wdi_front.escape_tags(t),image_url:a,likes:e.likes.count,comments:e.comments.count,wdi_index:d,wdi_res_index:i.resIndex,wdi_media_user:_,link:e.link,video_url:r,wdi_username:_,wdi_shape:o}},wdi_front.setPage=function(e){var i=e.feed_row.feed_display_view,t=e.feed_row.feed_type;if("pagination"!=i)return"";var r=e.imageIndex;if("image_browser"==t)var a=1;else a=Math.abs(e.feed_row.pagination_per_page_number);return e.paginator=Math.ceil((r+1)/a),e.paginator},wdi_front.getPhotoTemplate=function(e){var i=wdi_front.setPage(e),t="",r="",a="",d="",o="tenweb-i-arrows-out",n="";"blog_style"!=e.feed_row.feed_type&&"image_browser"!=e.feed_row.feed_type||(o=""),""!=i?(r='wdi_page="'+i+'"',sourceAttr="src"):sourceAttr="src",""!=i&&1!=i&&(t="wdi_hidden"),"1"==e.feed_row.show_username_on_thumb&&(n='<span class="wdi_media_user">@<%= wdi_username%></span>'),1==e.feed_row.show_full_description&&"masonry"==e.feed_row.feed_type&&(t+=" wdi_full_caption");var s="";switch("blog_style"!==e.feed_row.feed_type&&(s="masonry"==e.feed_row.feed_type?"wdi_responsive.showMasonryCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");":"wdi_responsive.showCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");"),e.feed_row.feed_item_onclick){case"lightbox":a="onclick=wdi_feed_"+e.feed_row.wdi_feed_counter+".galleryBox('<%=id%>')";break;case"instagram":a="onclick=\"window.open ('<%= link%>','_blank')\"",d="wdi_hover_off",o="";break;case"custom_redirect":a="onclick=\"window.open ('"+e.feed_row.redirect_url+"','_self')\"",d="wdi_hover_off",o="";break;case"none":a="",d="wdi_cursor_off wdi_hover_off",o=""}var f='<div class="wdi_feed_item '+t+'" wdi_index=<%= wdi_index%> wdi_res_index=<%= wdi_res_index%> wdi_media_user=<%= wdi_media_user%> '+r+' wdi_type="image" id="wdi_'+e.feed_row.wdi_feed_counter+"_<%=id%>\"><div class=\"wdi_photo_wrap\"><div class=\"wdi_photo_wrap_inner\"><div class=\"wdi_photo_img <%= wdi_shape == 'square' ? 'wdi_shape_square' : (wdi_shape == 'portrait' ? 'wdi_shape_portrait' : (wdi_shape == 'landscape' ? 'wdi_shape_landscape' : 'wdi_shape_square') ) %>\"><img class=\"wdi_img\" "+sourceAttr+'="<%=image_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);"><div class="wdi_photo_overlay '+d+'" >'+n+'<div class="wdi_thumb_icon" '+a+' style="display:table;width:100%;height:100%;"><div style="display:table-cell;vertical-align:middle;text-align:center;color:white;"><i class="tenweb-i '+o+'"></i></div></div></div></div></div></div>';return"1"!==e.feed_row.show_likes&&"1"!==e.feed_row.show_comments&&"1"!==e.feed_row.show_description||(f+='<div class="wdi_photo_meta">',f+='<div class="wdi_clear"></div>',"1"===e.feed_row.show_description&&(f+='<div class="wdi_photo_title" onclick='+s+" ><%=caption%></div>"),f+="</div>"),f+="</div>",_.template(f)},wdi_front.getSliderTemplate=function(e){var i=wdi_front.setPage(e),t="",r="",a="",d="",o="tenweb-i-clone",n="";"blog_style"!=e.feed_row.feed_type&&"image_browser"!=e.feed_row.feed_type||(o=""),""!=i?(r='wdi_page="'+i+'"',sourceAttr="src"):sourceAttr="src",""!=i&&1!=i&&(t="wdi_hidden"),"1"==e.feed_row.show_username_on_thumb&&(n='<span class="wdi_media_user">@<%= wdi_username%></span>'),1==e.feed_row.show_full_description&&"masonry"==e.feed_row.feed_type&&(t+=" wdi_full_caption");var s="";switch("blog_style"!==e.feed_row.feed_type&&(s="masonry"==e.feed_row.feed_type?"wdi_responsive.showMasonryCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");":"wdi_responsive.showCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");"),e.feed_row.feed_item_onclick){case"lightbox":a="onclick=wdi_feed_"+e.feed_row.wdi_feed_counter+".galleryBox('<%=id%>')";break;case"instagram":a="onclick=\"window.open ('<%= link%>','_blank')\"",d="wdi_hover_off",o="tenweb-i-clone";break;case"custom_redirect":a="onclick=\"window.open ('"+e.feed_row.redirect_url+"','_self')\"",d="wdi_hover_off",o="";break;case"none":a="",d="wdi_cursor_off wdi_hover_off",o=""}var f='<div class="wdi_feed_item '+t+'" wdi_index=<%= wdi_index%> wdi_res_index=<%= wdi_res_index%> wdi_media_user=<%= wdi_media_user%> '+r+' wdi_type="slideshow" id="wdi_'+e.feed_row.wdi_feed_counter+"_<%=id%>\"><div class=\"wdi_photo_wrap\"><div class=\"wdi_photo_wrap_inner\"><div class=\"wdi_photo_img <%= wdi_shape == 'square' ? 'wdi_shape_square' : (wdi_shape == 'portrait' ? 'wdi_shape_portrait' : (wdi_shape == 'landscape' ? 'wdi_shape_landscape' : 'wdi_shape_square') ) %>\"><img class=\"wdi_img\" "+sourceAttr+'="<%=image_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);"><div class="wdi_photo_overlay '+d+'" >'+n+'<div class="wdi_thumb_icon" '+a+' style="display:table;width:100%;height:100%;"><div style="display:table-cell;vertical-align:middle;text-align:center;color:white;"><i class="tenweb-i '+o+'"></i></div></div></div></div></div></div>';return"1"!==e.feed_row.show_likes&&"1"!==e.feed_row.show_comments&&"1"!==e.feed_row.show_description||(f+='<div class="wdi_photo_meta">',f+='<div class="wdi_clear"></div>',"1"===e.feed_row.show_description&&(f+='<div class="wdi_photo_title" onclick='+s+" ><%=caption%></div>"),f+="</div>"),f+="</div>",_.template(f)},wdi_front.replaceToVideo=function(e,i,t){overlayHtml="<video style='width:auto !important; height:auto !important; max-width:100% !important; max-height:100% !important; margin:0 !important;' controls=''><source src='"+e+"' type='video/mp4'>Your browser does not support the video tag. </video>",jQuery("#wdi_feed_"+t+' [wdi_index="'+i+'"] .wdi_photo_wrap_inner').html(overlayHtml),jQuery("#wdi_feed_"+t+' [wdi_index="'+i+'"] .wdi_photo_wrap_inner video').get(0).play()},wdi_front.getVideoTemplate=function(e){var i,t=wdi_front.setPage(e),r="",a="",d="tenweb-i-play",o="",n="",s="";""!=t?(a='wdi_page="'+t+'"',i="src"):i="src",""!=t&&1!=t&&(r="wdi_hidden"),"1"==e.feed_row.show_username_on_thumb&&(s='<span class="wdi_media_user">@<%= wdi_username%></span>'),1==e.feed_row.show_full_description&&"masonry"==e.feed_row.feed_type&&(r+=" wdi_full_caption");var f="";switch("blog_style"!==e.feed_row.feed_type&&(f="masonry"==e.feed_row.feed_type?"wdi_responsive.showMasonryCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");":"wdi_responsive.showCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");"),e.feed_row.feed_item_onclick){case"lightbox":o="onclick=wdi_feed_"+e.feed_row.wdi_feed_counter+".galleryBox('<%=id%>')";break;case"instagram":o="onclick=\"window.open ('<%= link%>','_blank')\"",n="wdi_hover_off",d="tenweb-i-play";break;case"custom_redirect":o="onclick=\"window.open ('"+e.feed_row.redirect_url+"','_self')\"",n="wdi_hover_off",d="";break;case"none":n="wdi_cursor_off wdi_hover_off",d="","blog_style"!=e.feed_row.feed_type&&"image_browser"!=e.feed_row.feed_type||(o="onclick=wdi_front.replaceToVideo('<%= video_url%>','<%= wdi_index%>',"+e.feed_row.wdi_feed_counter+")",n="",d="tenweb-i-play")}var l='<div class="wdi_feed_item '+r+'" wdi_index=<%= wdi_index%> wdi_res_index=<%= wdi_res_index%> wdi_media_user=<%= wdi_media_user%> '+a+' wdi_type="image" id="wdi_'+e.feed_row.wdi_feed_counter+"_<%=id%>\"><div class=\"wdi_photo_wrap\"><div class=\"wdi_photo_wrap_inner\"><div class=\"wdi_photo_img <%= wdi_shape == 'square' ? 'wdi_shape_square' : (wdi_shape == 'portrait' ? 'wdi_shape_portrait' : (wdi_shape == 'landscape' ? 'wdi_shape_landscape' : 'wdi_shape_square') ) %>\"><img class=\"wdi_img\" "+i+'="<%=image_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);"><div class="wdi_photo_overlay '+n+'" '+o+">"+s+'<div class="wdi_thumb_icon" style="display:table;width:100%;height:100%;"><div style="display:table-cell;vertical-align:middle;text-align:center;color:white;"><i class="tenweb-i '+d+'"></i></div></div></div></div></div></div>';return"1"!==e.feed_row.show_likes&&"1"!==e.feed_row.show_comments&&"1"!==e.feed_row.show_description||(l+='<div class="wdi_photo_meta">',l+='<div class="wdi_clear"></div>',"1"===e.feed_row.show_description&&(l+='<div class="wdi_photo_title" onclick='+f+" ><%=caption%></div>"),l+="</div>"),l+="</div>",_.template(l)},wdi_front.bindEvents=function(e){0!=jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").length&&("load_more_btn"==e.feed_row.feed_display_view&&jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" .wdi_load_more_container").on(wdi_front.clickOrTouch,function(){wdi_front.loadMore(jQuery(this).find(".wdi_load_more_wrap"))}),"pagination"==e.feed_row.feed_display_view&&(jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_next").on(wdi_front.clickOrTouch,function(){wdi_front.paginatorNext(jQuery(this),e)}),jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_prev").on(wdi_front.clickOrTouch,function(){wdi_front.paginatorPrev(jQuery(this),e)}),jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_last_page").on(wdi_front.clickOrTouch,function(){wdi_front.paginationLastPage(jQuery(this),e)}),jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_first_page").on(wdi_front.clickOrTouch,function(){wdi_front.paginationFirstPage(jQuery(this),e)}),e.paginatorNextFlag=!1),"infinite_scroll"==e.feed_row.feed_display_view&&(jQuery(window).on("scroll",function(){wdi_front.infiniteScroll(e)}),e.infiniteScrollFlag=!1))},wdi_front.infiniteScroll=function(e){jQuery(window).scrollTop()+jQuery(window).height()-100>=jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_infinite_scroll").offset().top&&(!1===e.infiniteScrollFlag&&0==e.stopInfiniteScrollFlag?(e.infiniteScrollFlag=!0,wdi_front.loadMore(jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_infinite_scroll"),e)):e.stopInfiniteScrollFlag&&wdi_front.allImagesLoaded(e))},wdi_front.paginationFirstPage=function(e,i){if(1!=i.paginator&&1!=i.currentPage){var t=i.currentPage;i.currentPage=1,wdi_front.updatePagination(i,"custom",t),e.parent().find("#wdi_last_page").removeClass("wdi_disabled"),e.addClass("wdi_disabled")}else e.addClass("wdi_disabled")},wdi_front.paginationLastPage=function(e,i){if(1!=i.paginator&&i.currentPage!=i.paginator){var t=i.currentPage;i.currentPage=i.paginator,wdi_front.updatePagination(i,"custom",t),e.addClass("wdi_disabled"),e.parent().find("#wdi_first_page").removeClass("wdi_disabled")}},wdi_front.paginatorNext=function(e,i){var t=e.parent().find("#wdi_last_page"),r=e.parent().find("#wdi_first_page");if(i.paginatorNextFlag=!0,i.paginator!=i.currentPage||wdi_front.checkFeedFinished(i))i.paginator>i.currentPage&&(i.currentPage++,wdi_front.updatePagination(i,"next"),i.paginator>i.currentPage?t.removeClass("wdi_disabled"):t.addClass("wdi_disabled"));else{i.currentPage++;var a=i.feed_row.number_of_photos;wdi_front.loadMore(e,i,a),t.addClass("wdi_disabled")}r.removeClass("wdi_disabled")},wdi_front.paginatorPrev=function(e,i){var t=e.parent().find("#wdi_last_page"),r=e.parent().find("#wdi_first_page");1!=i.currentPage?(i.currentPage--,wdi_front.updatePagination(i,"prev"),t.removeClass("wdi_disabled"),1==i.currentPage&&r.addClass("wdi_disabled")):r.addClass("wdi_disabled")},wdi_front.updatePagination=function(e,i,t){var r="#wdi_feed_"+e.feed_row.wdi_feed_counter;switch(jQuery(r+' [wdi_page="'+e.currentPage+'"]').each(function(){jQuery(this).removeClass("wdi_hidden")}),i){case"next":t=e.currentPage-1;jQuery(r+" .wdi_feed_wrapper").height(jQuery(".wdi_feed_wrapper").height()),jQuery(r+' [wdi_page="'+t+'"]').each(function(){jQuery(this).addClass("wdi_hidden")});break;case"prev":t=e.currentPage+1;jQuery(r+" .wdi_feed_wrapper").height(jQuery(".wdi_feed_wrapper").height()),jQuery(r+' [wdi_page="'+t+'"]').each(function(){jQuery(this).addClass("wdi_hidden")});break;case"custom":(t=t)!=e.currentPage&&(jQuery(r+" .wdi_feed_wrapper").height(jQuery(".wdi_feed_wrapper").height()),jQuery(r+' [wdi_page="'+t+'"]').each(function(){jQuery(this).addClass("wdi_hidden")}))}e.paginatorNextFlag=!1,jQuery(r+" .wdi_feed_wrapper").css("height","auto"),jQuery(r+" #wdi_current_page").text(e.currentPage)},wdi_front.loadMore=function(e,i){var t=0;if(""!=e&&void 0!==e&&"initial"!=e&&"initial-keep"!=e)var r=window[e.parent().parent().parent().parent().attr("id")];if(void 0!==i)r=i;for(var a=0,d=0,o=0;o<r.userSortFlags.length;o++)if(!0===r.userSortFlags[o].flag){a++;for(var n=0;n<r.usersData.length;n++)r.userSortFlags[o].id===r.usersData[n].user_id&&"finished"===r.usersData[n].finished&&d++}if(a!==d||0==a){r.auto_trigger=""===e,wdi_front.ajaxLoader(r),"masonry"===r.feed_row.feed_type&&"pagination"==r.feed_row.feed_display_view&&jQuery("#wdi_feed_"+wdi_front.feed_counter+" .wdi_full_caption").each(function(){jQuery(this).find(".wdi_photo_title").trigger(wdi_front.clickOrTouch)});for(o=0;o<r.usersData.length;o++)"finished"===r.usersData[o].finished&&t++;t===r.usersData.length&&(wdi_front.allImagesLoaded(r),jQuery("#wdi_feed_"+r.feed_row.wdi_feed_counter+" .wdi_load_more").remove());var s=r.usersData;r.loadMoreDataCount=r.feed_users.length;for(o=0;o<s.length;o++){var _=s[o].pagination,f={user_id:s[o].user_id,username:s[o].username};if(""!=_.next_url&&null!=_.next_url&&void 0!==_.next_url){var l=_.next_url;wdi_front.loadMoreRequest(f,l,r,e)}else"initial-keep"==e&&(r.temproraryUsersData[o]=r.usersData[o]),r.loadMoreDataCount--,wdi_front.checkForLoadMoreDone(r,e)}}},wdi_front.loadMoreRequest=function(e,i,t,r){if(t.mediaRequestsDone){t.usersData;var a="",d=function(i){if(void 0!==i.meta&&void 0!==i.meta.error_type&&wdi_front.show_alert(!1,i,t),""===i||void 0===i||null==i)return a=wdi_front_messages.network_error,t.loadMoreDataCount--,void wdi_front.show_alert(a,i,t);if(200!=i.meta.code)return a=i.meta.error_message,t.loadMoreDataCount--,void wdi_front.show_alert(a,i,t);i.user_id=e.user_id,i.username=e.username;for(var d=0;d<t.usersData.length;d++)i.user_id===t.usersData[d].user_id&&("#"===i.user_id[0]&&(i.data=wdi_front.appendRequestHashtag(i.data,i.user_id)),"initial-keep"==r&&(t.temproraryUsersData[d]=t.usersData[d]),t.usersData[d]=i,t.loadMoreDataCount--);wdi_front.checkForLoadMoreDone(t,r)};"#"!==e.username[0]?t.instagram.requestByUrl(i,{success:d}):t.instagram.getTagRecentMedia(e.username,{success:d},i,t.feed_row.hashtag_top_recent)}},wdi_front.checkForLoadMoreDone=function(e,i){var t=e.feed_row.load_more_number,r=e.feed_row.number_of_photos;if(0==e.loadMoreDataCount){e.temproraryUsersData=wdi_front.mergeData(e.temproraryUsersData,e.usersData);var a=wdi_front.getArrayContentLength(e.temproraryUsersData,"data");if("initial-keep"==i&&(i="initial"),"initial"==i)a<r&&!wdi_front.userHasNoPhoto(e,e.temproraryUsersData)&&e.instagramRequestCounter<=e.maxConditionalFiltersRequestCount?wdi_front.loadMore("initial",e):(e.usersData=e.temproraryUsersData,wdi_front.displayFeed(e),wdi_front.applyFilters(e),e.temproraryUsersData=[]);else if(a<t&&!wdi_front.userHasNoPhoto(e,e.temproraryUsersData)&&e.instagramRequestCounter<=e.maxConditionalFiltersRequestCount)wdi_front.loadMore(void 0,e);else{if(e.usersData=e.temproraryUsersData,!wdi_front.activeUsersCount(e))return;wdi_front.displayFeed(e,t),wdi_front.applyFilters(e),e.temproraryUsersData=[]}}},wdi_front.allDataHasFinished=function(e){for(var i=0,t=0;t<e.dataStorageRaw.length;t++)0==e.dataStorageRaw[t].length()&&1==e.dataStorageRaw[t].locked&&i++;return i==e.dataStorageRaw.length},wdi_front.mergeData=function(e,i){for(var t=0;t<i.length;t++)if(void 0!==e[t]){if("finished"==i[t].finished)continue;if(void 0===e[t].pagination.next_max_id&&void 0===e[t].pagination.next_max_like_id)continue;e[t].data=e[t].data.concat(i[t].data),e[t].pagination=i[t].pagination,e[t].user_id=i[t].user_id,e[t].username=i[t].username,e[t].meta=i[t].meta}else e.push(i[t]);return e},wdi_front.brokenImageHandler=function(e){var i=e.src.split("/p/");if(void 0!==i[0]&&void 0!==i[1]&&"https://www.instagram.com"!==i[0]){var t=wdi_baseName(i[0])+"/p/"+i[1];e.src=t}else e.src=wdi_url.plugin_url+"images/missing.png";return e.onerror="",!0},wdi_front.ajaxLoader=function(e){var i,t=e.feed_row.wdi_feed_counter,r=jQuery("#wdi_feed_"+t);("load_more_btn"==e.feed_row.feed_display_view&&(r.find(".wdi_load_more").addClass("wdi_hidden"),r.find(".wdi_spinner").removeClass("wdi_hidden")),"infinite_scroll"==e.feed_row.feed_display_view)&&(0==r.find(".wdi_ajax_loading").length?(i=jQuery('<div class="wdi_ajax_loading"><div><div><img class="wdi_load_more_spinner" src="'+wdi_url.plugin_url+'images/ajax_loader.png"></div></div></div>'),r.append(i)):i=r.find(".wdi_ajax_loading"),i.removeClass("wdi_hidden"))},wdi_front.allImagesLoaded=function(e){var i=wdi_front.getDataLength(e);e.mediaRequestsDone||jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").remove("wdi_nomedia"),0!=i||!e.mediaRequestsDone||0!=e.feed_row.conditional_filters.length&&0!=e.feed_row.conditional_filter_enable||jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").append("<p class='wdi_nomedia'>"+wdi_front_messages.feed_nomedia+"</p>");var t=e.feed_row.wdi_feed_counter,r=jQuery("#wdi_feed_"+t);"load_more_btn"==e.feed_row.feed_display_view&&(r.find(".wdi_load_more").removeClass("wdi_hidden"),r.find(".wdi_spinner").addClass("wdi_hidden")),"infinite_scroll"==e.feed_row.feed_display_view&&jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" .wdi_ajax_loading").addClass("wdi_hidden"),r.trigger("wdi_feed_loaded")},wdi_front.show=function(e,i){var t,r,a,d=i.feed_row.wdi_feed_counter,o=jQuery("#wdi_feed_"+d+" .wdi_feed_container");switch(e){case"header":t={feed_thumb:i.feed_row.feed_thumb,feed_name:i.feed_row.feed_name},r=wdi_front.getHeaderTemplate()(t),a=o.find(".wdi_feed_header").html(),o.find(".wdi_feed_header").html(a+r)}},wdi_front.getUserTemplate=function(e,i){var t,r,a=e.dataCount;switch(i[0]){case"#":t="//instagram.com/explore/tags/"+i.substr(1,i.length);break;default:t="//instagram.com/"+i}r="onclick='"+('window.open("'+t+'","_blank")')+"'";var d='<div class="wdi_single_user" user_index="<%=user_index%>"><div class="wdi_header_user_text <%=hashtagClass%>"><div class="wdi_user_img_wrap"><img onerror="wdi_front.brokenImageHandler(this);" src="<%= user_img_url%>">';return a>1&&(d+='<div title="'+wdi_front_messages.filter_title+'" class="wdi_filter_overlay"><div class="wdi_filter_icon"><span onclick="wdi_front.addFilter(<%=user_index%>,<%=feed_counter%>);" class="tenweb-i tenweb-i-filter"></span></div></div>'),d+="</div>",d+="<h3 "+r+"><%= user_name%></h3>","#"!==i[0]?("1"==e.feed_row.follow_on_instagram_btn&&(d+='<div class="wdi_user_controls"><div class="wdi_follow_btn" onclick="window.open(\'//instagram.com/<%= user_name%>\',\'_blank\')"><span> '+wdi_front_messages.follow+"</span></div></div>"),d+='<div class="wdi_media_info"><p class="wdi_posts"><span class="tenweb-i tenweb-i-camera-retro"></span><%= counts.media%></p><p class="wdi_followers"><span class="tenweb-i tenweb-i-user"></span><%= counts.followed_by%></p></div>'):d+='<div class="wdi_user_controls"></div><div class="wdi_media_info"><p class="wdi_posts"><span class="tenweb-i tenweb-i-camera-retro"></span><%= counts.media%></p><p class="wdi_followers"><span></span></p></div>',d+='<div class="wdi_clear"></div>',1==a&&"#"!==i[0]&&"1"==e.feed_row.display_user_info&&(d+='<div class="wdi_bio"><%= bio%></div>',d+='<div class="wdi_website"><a target="_blank" href="<%= website_url%>" ><%= website%></a></div>'),d+="</div></div>",_.template(d)},wdi_front.getHeaderTemplate=function(){return _.template('<div class="wdi_header_wrapper"><div class="wdi_header_img_wrap"><img src="<%=feed_thumb%>"></div><div class="wdi_header_text"><%=feed_name%></div><div class="wdi_clear"></div>')},wdi_front.addFilter=function(e,i){var t=window["wdi_feed_"+i];if(!(t.dataCount<2)&&0==t.nowLoadingImages){var r=jQuery("#wdi_feed_"+t.feed_row.wdi_feed_counter+'_users [user_index="'+e+'"]');r.find(".wdi_filter_overlay").toggleClass("wdi_filter_active_bg"),r.find(".wdi_header_user_text h3").toggleClass("wdi_filter_active_col"),r.find(".wdi_media_info").toggleClass("wdi_filter_active_col"),r.find(".wdi_follow_btn").toggleClass("wdi_filter_active_col"),t.customFilterChanged=!0,0==t.userSortFlags[e].flag?t.userSortFlags[e].flag=!0:t.userSortFlags[e].flag=!1;for(var a=0,d=0;d<t.userSortFlags.length;d++)1==t.userSortFlags[d].flag&&a++;"pagination"==t.feed_row.feed_display_view&&(t.resIndex=0),0!=a?(wdi_front.filterData(t),wdi_front.displayFeed(t)):(t.customFilteredData=t.dataStorageList,wdi_front.displayFeed(t)),"pagination"==t.feed_row.feed_display_view&&(t.paginator=Math.ceil(t.imageIndex/parseInt(t.feed_row.pagination_per_page_number)),t.currentPage=t.paginator,wdi_front.updatePagination(t,"custom",1),jQuery("#wdi_first_page").removeClass("wdi_disabled"),jQuery("#wdi_last_page").addClass("wdi_disabled"))}},wdi_front.filterData=function(e){var i=e.userSortFlags;e.customFilteredData=[];for(var t=0;t<e.dataStorageList.length;t++)for(var r=0;r<i.length;r++)(void 0!==e.dataStorageList[t].user.id&&e.dataStorageList[t].user.id==i[r].id||e.dataStorageList[t].wdi_hashtag==i[r].name)&&1==i[r].flag&&e.customFilteredData.push(e.dataStorageList[t])},wdi_front.applyFilters=function(e){for(var i=0;i<e.userSortFlags.length;i++)if(1==e.userSortFlags[i].flag){jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+'[user_index="'+i+'"]');wdi_front.addFilter(i,e.feed_row.wdi_feed_counter),wdi_front.addFilter(i,e.feed_row.wdi_feed_counter)}},wdi_front.getImgCount=function(e){for(var i=e.dataStorage,t=0,r=0;r<i.length;r++)t+=i[r].length;return t},wdi_front.parseLighboxData=function(e,i){var t=e.dataStorage,r=e.feed_row.sort_images_by,a=e.feed_row.display_order,d=wdi_front.sortingOperator(r,a),o=[],n=[],s={};if(1==i)o=e.customFilteredData;else{for(var _=0;_<t.length;_++)for(var f=0;f<t[_].length;f++)o.push(t[_][f]);o.sort(d)}for(_=0;_<o.length;_++)s={alt:"",avg_rating:"",comment_count:o[_].comments.count,date:wdi_front.convertUnixDate(o[_].created_time),description:wdi_front.getDescription(null!==o[_].caption?wdi_front.escape_tags(o[_].caption.text):""),filename:wdi_front.getFileName(o[_]),filetype:wdi_front.getFileType(o[_]),hit_count:"0",id:o[_].id,image_url:o[_].link,number:0,rate:"",rate_count:"0",username:o[_].user.username,profile_picture:o[_].user.profile_picture,thumb_url:o[_].link+"media/?size=t",comments_data:o[_].comments.data,images:o[_].images,carousel_media:void 0!==o[_].carousel_media?o[_].carousel_media:null},n.push(s);return n},wdi_front.convertUnixDate=function(e){var i=parseInt(e),t=new Date(0);t.setUTCSeconds(i);var r=t.getFullYear()+"-"+t.getMonth()+"-"+t.getDate();return r+=" "+t.getHours()+":"+t.getMinutes()},wdi_front.getDescription=function(e){return e=e.replace(/\r?\n|\r/g," ")},wdi_front.getFileName=function(e){var i=e.link;if("video"===e.type&&e.hasOwnProperty("videos"))return e.videos.standard_resolution.url;var t=i.split("/");return t[t.length-2]},wdi_front.getFileType=function(e){return"video"==e.type&&e.hasOwnProperty("videos")?"EMBED_OEMBED_INSTAGRAM_VIDEO":"EMBED_OEMBED_INSTAGRAM_IMAGE"},wdi_front.array_max=function(e){for(var i=e[0],t=0,r=1;r<e.length;r++)i<e[r]&&(i=e[r],t=r);return{value:i,index:t}},wdi_front.array_min=function(e){for(var i=e[0],t=0,r=1;r<e.length;r++)i>e[r]&&(i=e[r],t=r);return{value:i,index:t}},wdi_front.activeUsersCount=function(e){for(var i=0,t=0;t<e.usersData.length;t++)"finished"!=e.usersData[t].finished&&i++;return i},wdi_front.checkMediaResponse=function(e,i){return""!=e&&void 0!==e&&null!=e&&400===e.meta.code&&"APINotAllowedError"===e.meta.error_type?e:""==e||void 0===e||null==e?(errorMessage=wdi_front_messages.connection_error,wdi_front.show_alert(errorMessage,e,i),!1):200!=e.meta.code?(errorMessage=e.meta.error_message,wdi_front.show_alert(errorMessage,e,i),!1):e},wdi_front.stripHashtag=function(e){switch(e[0]){case"#":return e.substr(1,e.length);default:return e}},wdi_front.getInputType=function(e){switch(e[0]){case"#":return"hashtag";case"%":return"location";default:return"user"}},wdi_front.regexpTestCaption=function(e,i){var t=!1,r=!1,a=i.replace(/[-[\]{}()*+?.,\\^$|]/g,"\\$&"),d=new RegExp("(?:^|\\s)"+a+"(?:^|\\s)"),o=new RegExp("(?:^|\\s)"+a,"g");for(null!=d.exec(e)&&(t=!0);null!=(match=o.exec(e));)match.index==e.length-i.length-1&&(r=!0);return 1==t||1==r},wdi_front.replaceNewLines=function(e){var i,t=[];for(e=e.replace(/\r?\n|\r/g,"vUkCJvN2ps3t"),i=new RegExp("vUkCJvN2ps3t","g");null!=(match=i.exec(e));)t.push(match.index);for(var r=e.split("vUkCJvN2ps3t"),a=0,d=0;d<r.length;d++)""==r[d]?a++:a=0,a>0&&(r.splice(d,1),a--,d--);return e=r.join(" ")},wdi_front.isEmptyObject=function(e){for(var i in e)if(e.hasOwnProperty(i))return!1;return!0};var WDIFeed=function(e){this.data=e.data,this.dataCount=e.dataCount,this.feed_row=e.feed_row,this.usersData=e.usersData,_this=this,this.set_images_loading_flag=function(e){window.addEventListener("load",function(){e.nowLoadingImages=!1})},this.set_images_loading_flag(_this)};function wdi_extractHostname(e){return void 0===e||""===e?"":e.replace(/(^\w+:|^)\/\//,"")}WDIFeed.prototype.conditionalFilter=function(e,i){var t=this.feed_row.conditional_filter_type,r=this.feed_row.conditional_filters;if(1==i.ignoreFiltering||(e=this.avoidDuplicateMedia(e)),!wdi_front.isJsonString(r))return e;if(0==(r=JSON.parse(r)).length)return e;if("0"==this.feed_row.conditional_filter_enable)return e;switch(this.instagramRequestCounter++,t){case"AND":e=this.applyANDLogic(e,r,this);break;case"OR":e=this.applyORLogic(e,r,this);break;case"NOR":e=this.applyNORLogic(e,r,this)}return e},WDIFeed.prototype.applyANDLogic=function(e,i){for(var t=0;t<i.length;t++)e=this.filterResponse(e,i[t]);return e},WDIFeed.prototype.applyORLogic=function(e,i){for(var t,r,a=[],d=[],o=0;o<i.length;o++)t=this.filterResponse(e,i[o]),a=a.concat(t.data),t={};for(o=0;o<a.length;o++)r=a[o],this.mediaExists(r,d)||this.mediaExists(r,this.dataStorageList)||d.push(r);return{data:d,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.applyNORLogic=function(e,i){for(var t=e,r=this.applyORLogic(e,i,this),a=[],d=0;d<t.data.length;d++)this.mediaExists(t.data[d],r.data)||a.push(t.data[d]);return{data:a,meta:t.meta,pagination:t.pagination}},WDIFeed.prototype.mediaExists=function(e,i){for(var t=0;t<i.length;t++)if(e.id==i[t].id)return!0;return!1},WDIFeed.prototype.filterResponse=function(e,i){switch(i.filter_type){case"hashtag":return this.filterByHashtag(e,i);case"username":return this.filterByUsername(e,i);case"mention":return this.filterByMention(e,i);case"description":return this.filterByDescription(e,i);case"location":return this.filterByLocation(e,i);case"url":return this.filterByUrl(e,i)}},WDIFeed.prototype.filterByHashtag=function(e,i){for(var t,r=[],a=0;a<e.data.length;a++){t=e.data[a];for(var d=0;d<t.tags.length;d++)tag=t.tags[d],tag.toLowerCase()==i.filter_by.toLowerCase()&&r.push(t)}return{data:r,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByUsername=function(e,i){for(var t,r=[],a=0;a<e.data.length;a++)(t=e.data[a]).user.username.toLowerCase()==i.filter_by.toLowerCase()&&r.push(t);return{data:r,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByMention=function(e,i){for(var t,r=[],a=0;a<e.data.length;a++)null!==(t=e.data[a]).caption&&-1!=t.caption.text.toLowerCase().indexOf("@"+i.filter_by.toLowerCase())&&r.push(t);return{data:r,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByDescription=function(e,i){for(var t,r,a=[],d=0;d<e.data.length;d++)if(null!==(t=e.data[d]).caption){r=t.caption.text.toLowerCase(),r=wdi_front.replaceNewLines(r);var o=i.filter_by.toLowerCase();wdi_front.regexpTestCaption(r,o)&&a.push(t)}return{data:a,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByLocation=function(e,i){for(var t,r=[],a=0;a<e.data.length;a++)null!==(t=e.data[a]).location&&t.location.id==i.filter_by&&r.push(t);return{data:r,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByUrl=function(e,i){var t,r=[];i.filter_by=this.getIdFromUrl(i.filter_by);for(var a=0;a<e.data.length;a++)null!==(t=e.data[a]).link&&this.getIdFromUrl(t.link)==i.filter_by&&r.push(t);return{data:r,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.getIdFromUrl=function(e){for(var i=e.split("/"),t=!1,r=0;r<i.length;r++)if("p"==i[r]&&void 0!==i[r+1]){t=i[r+1];break}return t},WDIFeed.prototype.avoidDuplicateMedia=function(e){var i=e.data,t=[];void 0===i&&(i=[]);for(var r=0;r<i.length;r++)this.mediaExists(i[r],this.dataStorageList)||this.mediaExists(i[r],t)||this.mediaExists(i[r],this.conditionalFilterBuffer)||t.push(i[r]);return this.conditionalFilterBuffer=this.conditionalFilterBuffer.concat(t),{data:t,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.storeRawData=function(e,i){var t=this;if("object"==typeof this[i]&&"number"==typeof this[i].length)for(var r=0;r<e.length;r++){var a="";wdi_front.isHashtag(e[r].user_id)?void 0!==e[r].pagination.cursors&&(a=e[r].pagination.cursors.after):"liked"==t.feed_row.liked_feed?void 0===(a=e[r].pagination.next_max_like_id)&&(a=""):(null==e[r].pagination&&(e[r].pagination=[]),void 0===(a=e[r].pagination.next_max_id)&&(a="")),void 0===this[i][r]?this[i].push({data:e[r].data,index:0,locked:!1,hash_id:a,usersDataFinished:!1,userId:e[r].user_id,length:function(){return this.data.length-this.index},getData:function(e){var i=this.data.slice(this.index,this.index+e);if(this.index+=Math.min(e,this.length()),this.index==this.data.length&&1==this.locked&&0==this.usersDataFinished)for(var r=0;r<t.usersData.length;r++)if(t.usersData[r].user_id==this.userId){t.usersData[r].finished="finished",this.usersDataFinished=!0;break}return i}}):0==this[i][r].locked&&(a!=this[i][r].hash_id?(this[i][r].data=this[i][r].data.concat(e[r].data),this[i][r].hash_id=a):this[i][r].locked=!0)}},wdi_front.updateUsersIfNecessary=function(e){for(var i=e.feed_users,t=!1,r=0;r<i.length;r++)"#"!=i[r].username.substr(0,1)?""!=i[r].id&&"username"!=i[r].id||(t=!0,e.instagram.searchForUsersByName(i[r].username,{success:function(t){if(void 0!==t.meta&&void 0!==t.meta.error_type&&wdi_front.show_alert(!1,t,e),200==t.meta.code&&t.data.length>0){for(var r=!1,a=0;a<t.data.length;a++)if(t.data[a].username==t.args.username){r=!0;break}if(r)for(var d=0;d<i.length;d++)t.data[a].username==i[d].username&&(i[d].id=t.data[a].id)}for(var o=!1,n=0;n<i.length;n++)if(""==i[n].id||"username"==i[n].id){o=!0;break}o||(e.feed_row.feed_users=JSON.stringify(i),wdi_front.init(e))},username:i[r].username})):i[r].id=i[r].username;return t},void 0!==wdi_ajax.ajax_response?jQuery(document).one("ajaxStop",function(){"not_declared"!=wdi_front.type&&(wdi_front.clickOrTouch=wdi_front.detectEvent(),wdi_front.globalInit())}):jQuery(document).ready(function(){"not_declared"!=wdi_front.type&&(wdi_front.clickOrTouch=wdi_front.detectEvent(),wdi_front.globalInit())});
|
js/wdi_instagram.js
CHANGED
@@ -159,7 +159,7 @@ function WDIInstagram(args)
|
|
159 |
|
160 |
this.resetTokens = function ()
|
161 |
{
|
162 |
-
|
163 |
}
|
164 |
|
165 |
/**
|
@@ -339,7 +339,7 @@ function WDIInstagram(args)
|
|
339 |
} else {
|
340 |
alert(response.error.message);
|
341 |
return;
|
342 |
-
|
343 |
|
344 |
if (typeof next_url === "undefined" || next_url === null) {
|
345 |
baseUrl = baseUrl.replace('{tagid}', wdiTagId);
|
@@ -371,15 +371,9 @@ function WDIInstagram(args)
|
|
371 |
baseUrl = next_url;
|
372 |
}
|
373 |
|
374 |
-
|
375 |
|
376 |
}
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
}
|
384 |
|
385 |
this.getTagId = function (tagname) {
|
@@ -417,14 +411,15 @@ function WDIInstagram(args)
|
|
417 |
data: [],
|
418 |
pagination: {}
|
419 |
};
|
420 |
-
|
|
|
421 |
converted_data.pagination = {
|
422 |
cursors: {after: data.paging.cursors.after},
|
423 |
next_url: data.paging.next
|
424 |
}
|
425 |
}
|
426 |
|
427 |
-
|
428 |
var media = data.data[i];
|
429 |
|
430 |
var media_type;
|
@@ -1879,9 +1874,6 @@ function WDIInstagram(args)
|
|
1879 |
action:"wdi_get_cache_data",
|
1880 |
},
|
1881 |
success: function(data){
|
1882 |
-
if(data["wdi_debugging"]){
|
1883 |
-
console.log(data["wdi_debugging_data"]);
|
1884 |
-
}
|
1885 |
if(data["success"]){
|
1886 |
if(typeof data["cache_data"] !== "undefined" && data["cache_data"] !== null){
|
1887 |
var json_data = JSON.parse(data["cache_data"]);
|
159 |
|
160 |
this.resetTokens = function ()
|
161 |
{
|
162 |
+
_this.access_tokens = [];
|
163 |
}
|
164 |
|
165 |
/**
|
339 |
} else {
|
340 |
alert(response.error.message);
|
341 |
return;
|
342 |
+
}
|
343 |
|
344 |
if (typeof next_url === "undefined" || next_url === null) {
|
345 |
baseUrl = baseUrl.replace('{tagid}', wdiTagId);
|
371 |
baseUrl = next_url;
|
372 |
}
|
373 |
|
374 |
+
_this.getDataFromCache(wdi_callback, baseUrl);
|
375 |
|
376 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
377 |
}
|
378 |
|
379 |
this.getTagId = function (tagname) {
|
411 |
data: [],
|
412 |
pagination: {}
|
413 |
};
|
414 |
+
|
415 |
+
if(typeof data.paging !== "undefined"){
|
416 |
converted_data.pagination = {
|
417 |
cursors: {after: data.paging.cursors.after},
|
418 |
next_url: data.paging.next
|
419 |
}
|
420 |
}
|
421 |
|
422 |
+
for (var i in data.data) {
|
423 |
var media = data.data[i];
|
424 |
|
425 |
var media_type;
|
1874 |
action:"wdi_get_cache_data",
|
1875 |
},
|
1876 |
success: function(data){
|
|
|
|
|
|
|
1877 |
if(data["success"]){
|
1878 |
if(typeof data["cache_data"] !== "undefined" && data["cache_data"] !== null){
|
1879 |
var json_data = JSON.parse(data["cache_data"]);
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: custom instagram feed, feed, instagram, hashtag, Instagram feed, instagram
|
|
4 |
Requires at least: 3.9
|
5 |
Requires PHP: 5.2
|
6 |
Tested up to: 5.4
|
7 |
-
Stable tag: 1.3.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -506,6 +506,10 @@ Please make sure you don't have any important information before you proceed.
|
|
506 |
|
507 |
== Changelog ==
|
508 |
|
|
|
|
|
|
|
|
|
509 |
= 1.3.24 =
|
510 |
Removed: Banner to install Image optimizer.
|
511 |
|
4 |
Requires at least: 3.9
|
5 |
Requires PHP: 5.2
|
6 |
Tested up to: 5.4
|
7 |
+
Stable tag: 1.3.25
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
506 |
|
507 |
== Changelog ==
|
508 |
|
509 |
+
= 1.3.25 =
|
510 |
+
Fixed: Hashtag exclude.
|
511 |
+
Fixed: Privacy policy text structure.
|
512 |
+
|
513 |
= 1.3.24 =
|
514 |
Removed: Banner to install Image optimizer.
|
515 |
|
wd-instagram-feed.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: 10Web Social Photo Feed
|
4 |
Plugin URI: https://10web.io/plugins/wordpress-instagram-feed/?utm_source=instagram_feed&utm_medium=free_plugin
|
5 |
Description: 10Web Social Photo Feed is a user-friendly tool for displaying user or hashtag-based feeds on your website. You can create feeds with one of the available layouts. It allows displaying image metadata, open up images in lightbox, download them and even share in social networking websites.
|
6 |
-
Version: 1.3.
|
7 |
Author: 10Web
|
8 |
Author URI: https://10Web.io/plugins/?utm_source=instagram_feed&utm_medium=free_plugin
|
9 |
License: GPLv2 or later
|
@@ -21,7 +21,7 @@ define("WDI_META", "_" . WDI_VAR . "_meta");
|
|
21 |
//define("wdi",'wdi');
|
22 |
define('WDI_FEED_TABLE', 'wdi_feeds');
|
23 |
define('WDI_THEME_TABLE', 'wdi_themes');
|
24 |
-
define('WDI_VERSION', '1.3.
|
25 |
define('WD_WDI_PREFIX', 'wdi' );
|
26 |
define('WDI_IS_PRO', false );
|
27 |
$wdi_minify = ( isset($_GET['wdi_no_minify']) && $_GET['wdi_no_minify'] == "true" ) ? FALSE : TRUE;
|
@@ -351,7 +351,12 @@ function wdi_create_sample_feed($new_options) {
|
|
351 |
return $new_options;
|
352 |
}
|
353 |
|
354 |
-
add_action(
|
|
|
|
|
|
|
|
|
|
|
355 |
|
356 |
function wdi_register_settings(){
|
357 |
|
@@ -387,8 +392,6 @@ function wdi_register_settings(){
|
|
387 |
|
388 |
wdi_get_options();
|
389 |
}
|
390 |
-
|
391 |
-
|
392 |
//adding menues
|
393 |
add_action('admin_menu', 'WDI_instagram_menu', 9);
|
394 |
add_action('admin_head-toplevel_page_wdi_feeds', 'wdi_check_necessary_params');
|
@@ -518,7 +521,7 @@ function wdi_load_scripts($hook){
|
|
518 |
'hashtag_no_data' => __('This hashtag has no media published within last 24 hours. Are you sure you want to add it? Try to display its top media.', 'wd-instagram-feed'),
|
519 |
'only_one_user_or_hashtag'=> __('You can add only one username or hashtag in FREE Version', "wd-instagram-feed"),
|
520 |
'available_in_pro' => __('Available in Premium','wd-instagram-feed'),
|
521 |
-
'username_hashtag_multiple' => __('Combined
|
522 |
'theme_save_message_free' => __('Customizing Themes is available only in Premium version','wd-instagram-feed'),
|
523 |
'invalid_url' => __('URL is not valid','wd-instagram-feed'),
|
524 |
'selectConditionType' => __('Please Select Condition Type','wd-instagram-feed'),
|
@@ -922,23 +925,24 @@ function wdi_filter_var_notice(){
|
|
922 |
}
|
923 |
}
|
924 |
|
925 |
-
|
926 |
-
|
927 |
-
|
|
|
928 |
|
929 |
-
$
|
930 |
-
$
|
931 |
-
$text
|
932 |
-
$text .= sprintf(__('"Instagram Feed plugin uses Instagram API on website front end. All the data received from Instagram via API is cached in WordPress database for some short period to provide front end optimization. You may request us to delete your Instagram data if it is accidentally cached in our website database with hashtag feed data. Instagram saves some cookies in browsers of website visitors via API data. These cookies are mostly used for security purposes. They are regulated under terms of Instagram’s %s."', "wd-instagram-feed"), $pp_link);
|
933 |
$text .= "<br/>";
|
934 |
$text .= __('10Web Disclaimer: The above text is for informational purposes only and is not a legal advice. You must not rely on it as an alternative to legal advice. You should contact your legal counsel to obtain advice with respect to your particular case.', "wd-instagram-feed");
|
935 |
-
$
|
936 |
|
937 |
-
|
938 |
-
|
|
|
|
|
939 |
}
|
940 |
|
941 |
-
|
942 |
/*ELEMENTOR*/
|
943 |
add_action('plugins_loaded', 'wdi_elementor');
|
944 |
function wdi_elementor(){
|
3 |
Plugin Name: 10Web Social Photo Feed
|
4 |
Plugin URI: https://10web.io/plugins/wordpress-instagram-feed/?utm_source=instagram_feed&utm_medium=free_plugin
|
5 |
Description: 10Web Social Photo Feed is a user-friendly tool for displaying user or hashtag-based feeds on your website. You can create feeds with one of the available layouts. It allows displaying image metadata, open up images in lightbox, download them and even share in social networking websites.
|
6 |
+
Version: 1.3.25
|
7 |
Author: 10Web
|
8 |
Author URI: https://10Web.io/plugins/?utm_source=instagram_feed&utm_medium=free_plugin
|
9 |
License: GPLv2 or later
|
21 |
//define("wdi",'wdi');
|
22 |
define('WDI_FEED_TABLE', 'wdi_feeds');
|
23 |
define('WDI_THEME_TABLE', 'wdi_themes');
|
24 |
+
define('WDI_VERSION', '1.3.25');
|
25 |
define('WD_WDI_PREFIX', 'wdi' );
|
26 |
define('WDI_IS_PRO', false );
|
27 |
$wdi_minify = ( isset($_GET['wdi_no_minify']) && $_GET['wdi_no_minify'] == "true" ) ? FALSE : TRUE;
|
351 |
return $new_options;
|
352 |
}
|
353 |
|
354 |
+
add_action('admin_init', 'wdi_admin_init');
|
355 |
+
|
356 |
+
function wdi_admin_init() {
|
357 |
+
wdi_register_settings();
|
358 |
+
wdi_privacy_policy();
|
359 |
+
}
|
360 |
|
361 |
function wdi_register_settings(){
|
362 |
|
392 |
|
393 |
wdi_get_options();
|
394 |
}
|
|
|
|
|
395 |
//adding menues
|
396 |
add_action('admin_menu', 'WDI_instagram_menu', 9);
|
397 |
add_action('admin_head-toplevel_page_wdi_feeds', 'wdi_check_necessary_params');
|
521 |
'hashtag_no_data' => __('This hashtag has no media published within last 24 hours. Are you sure you want to add it? Try to display its top media.', 'wd-instagram-feed'),
|
522 |
'only_one_user_or_hashtag'=> __('You can add only one username or hashtag in FREE Version', "wd-instagram-feed"),
|
523 |
'available_in_pro' => __('Available in Premium','wd-instagram-feed'),
|
524 |
+
'username_hashtag_multiple' => __('Combined Hashtags are available only in Premium version'),
|
525 |
'theme_save_message_free' => __('Customizing Themes is available only in Premium version','wd-instagram-feed'),
|
526 |
'invalid_url' => __('URL is not valid','wd-instagram-feed'),
|
527 |
'selectConditionType' => __('Please Select Condition Type','wd-instagram-feed'),
|
925 |
}
|
926 |
}
|
927 |
|
928 |
+
function wdi_privacy_policy() {
|
929 |
+
if ( ! function_exists( 'wp_add_privacy_policy_content' ) ) {
|
930 |
+
return;
|
931 |
+
}
|
932 |
|
933 |
+
$title = __('Instagram Feed', "wd-instagram-feed");
|
934 |
+
$link = '<a target="_blank" href="https://instagram.com/legal/privacy">' . __('Privacy Policy', "wd-instagram-feed") . '</a>';
|
935 |
+
$text = sprintf(__('Instagram Feed plugin uses Instagram API on website front end. All the data received from Instagram via API is cached in WordPress database for some short period to provide front end optimization. You may request us to delete your Instagram data if it is accidentally cached in our website database with hashtag feed data. Instagram saves some cookies in browsers of website visitors via API data. These cookies are mostly used for security purposes. They are regulated under terms of Instagram’s %s.', "wd-instagram-feed"), $link);
|
|
|
936 |
$text .= "<br/>";
|
937 |
$text .= __('10Web Disclaimer: The above text is for informational purposes only and is not a legal advice. You must not rely on it as an alternative to legal advice. You should contact your legal counsel to obtain advice with respect to your particular case.', "wd-instagram-feed");
|
938 |
+
$text .= "<br/> ";
|
939 |
|
940 |
+
wp_add_privacy_policy_content(
|
941 |
+
$title,
|
942 |
+
$text
|
943 |
+
);
|
944 |
}
|
945 |
|
|
|
946 |
/*ELEMENTOR*/
|
947 |
add_action('plugins_loaded', 'wdi_elementor');
|
948 |
function wdi_elementor(){
|