WD Instagram Feed – Instagram Gallery - Version 1.3.13

Version Description

New: Option to get hashtag top media Improved: Notices during Facebook Log in Fixed: Occasional JS error on front end

Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 WD Instagram Feed – Instagram Gallery
Version 1.3.13
Comparing to
See all releases

Code changes from version 1.3.12 to 1.3.13

admin-functions.php CHANGED
@@ -175,6 +175,8 @@ function wdi_install(){
175
  mobile_breakpoint varchar(10) NOT NULL,
176
  redirect_url varchar(255) NOT NULL,
177
  feed_resolution varchar(255) NOT NULL,
 
 
178
 
179
  UNIQUE KEY id (id)
180
  ) $charset_collate;";
175
  mobile_breakpoint varchar(10) NOT NULL,
176
  redirect_url varchar(255) NOT NULL,
177
  feed_resolution varchar(255) NOT NULL,
178
+ hashtag_top_recent varchar(10) NOT NULL,
179
+
180
 
181
  UNIQUE KEY id (id)
182
  ) $charset_collate;";
admin/models/WDIModelFeeds_wdi.php CHANGED
@@ -163,7 +163,8 @@ class WDIModelFeeds_wdi {
163
  'mobile_breakpoint' => '640',
164
  'redirect_url' => '',
165
  'feed_resolution' => 'optimal',
166
- );
 
167
  return $settings;
168
  }
169
 
@@ -236,7 +237,8 @@ class WDIModelFeeds_wdi {
236
  'mobile_breakpoint' => 'number',
237
  'redirect_url' => 'string',
238
  'feed_resolution' => 'string',
239
- );
 
240
  return $sanitize_types;
241
  }
242
 
163
  'mobile_breakpoint' => '640',
164
  'redirect_url' => '',
165
  'feed_resolution' => 'optimal',
166
+ 'hashtag_top_recent' => '1',
167
+ );
168
  return $settings;
169
  }
170
 
237
  'mobile_breakpoint' => 'number',
238
  'redirect_url' => 'string',
239
  'feed_resolution' => 'string',
240
+ 'hashtag_top_recent' => 'bool',
241
+ );
242
  return $sanitize_types;
243
  }
244
 
admin/views/WDIViewFeeds_wdi.php CHANGED
@@ -273,6 +273,7 @@ class WDIViewFeeds_wdi
273
  //'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'))),
274
  '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'))),
275
  'feed_users' => array('name' => 'feed_users', 'title' => __('Feed Usernames and Hashtags', "wd-instagram-feed"), 'type' => 'input', 'input_type' => 'hidden', 'tooltip' => sprintf('%s', __('Add usernames or hashtags to your feed. Hashtags must start with #, usernames shouldn\'t start with @.', "wd-instagram-feed")), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
 
276
  ),
277
  array(
278
  'sort_images_by' => array('name' => 'sort_images_by', 'title' => __('Sort Media By', "wd-instagram-feed"), 'valid_options' => array('date' => __('Date', "wd-instagram-feed"), 'likes' => __('Likes', "wd-instagram-feed"), 'comments' => __('Comments', "wd-instagram-feed"), 'random' => __('Random', "wd-instagram-feed")), 'type' => 'select', 'tooltip' => "", 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
273
  //'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'))),
274
  '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'))),
275
  'feed_users' => array('name' => 'feed_users', 'title' => __('Feed Usernames and Hashtags', "wd-instagram-feed"), 'type' => 'input', 'input_type' => 'hidden', 'tooltip' => sprintf('%s', __('Add usernames or hashtags to your feed. Hashtags must start with #, usernames shouldn\'t start with @.', "wd-instagram-feed")), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
276
+ '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')),
277
  ),
278
  array(
279
  'sort_images_by' => array('name' => 'sort_images_by', 'title' => __('Sort Media By', "wd-instagram-feed"), 'valid_options' => array('date' => __('Date', "wd-instagram-feed"), 'likes' => __('Likes', "wd-instagram-feed"), 'comments' => __('Comments', "wd-instagram-feed"), 'random' => __('Random', "wd-instagram-feed")), 'type' => 'select', 'tooltip' => "", 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
changelog.txt CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
1
  = 1.3.12 =
2
  Fixed: Conflict with Gutenberg.
3
 
1
+ = 1.3.13 =
2
+ New: Option to get hashtag top media
3
+ Improved: Notices during Facebook login
4
+ Fixed: Occasional JS error on front end
5
+
6
  = 1.3.12 =
7
  Fixed: Conflict with Gutenberg.
8
 
css/wdi_backend.css CHANGED
@@ -311,6 +311,11 @@ border: 1px solid rgb(185, 185, 185);
311
  padding-bottom: 5px;
312
  }
313
 
 
 
 
 
 
314
  /*
315
  .wdi_multiple_accounts_section tr:not(:first-child) th{
316
  font-style: italic;
311
  padding-bottom: 5px;
312
  }
313
 
314
+ .wdi_element_name_hashtag_top_recent{
315
+ display: none;
316
+ }
317
+
318
+
319
  /*
320
  .wdi_multiple_accounts_section tr:not(:first-child) th{
321
  font-style: italic;
css/wdi_backend.min.css CHANGED
@@ -1 +1 @@
1
- .wdi_clear{clear:both}.wdi_clear_tag:after{content:"";display:table;clear:both}#wdi_unistall{background-color:#d82121;border-color:#d31818;box-shadow:inset 0 1px 0 rgba(230,120,120,0.5),0 1px 0 rgba(0,0,0,.15)}#wdi_unistall:hover{background-color:#da1313}#wdi_unistall_table th{width:45%}.display_type_content{background:#fff;border:1px solid #dedede;margin-bottom:15px}.wdi_tooltip,.wdi_settings_link{display:block;font-size:14px !important;font-weight:bold;line-height:20px;margin-bottom:5px;color:#444;text-decoration:none}p.wdi_about_filed{font-size:13px;font-style:italic}.wdi_tooltip:hover,.wdi_settings_link:hover{color:#23282d;position:relative}.wdi_tooltip:hover:after{content:attr(wdi-tooltip);padding:4px 8px;color:#dbdbe0;position:absolute;left:0;top:100%;white-space:nowrap;z-index:20;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:2px;-moz-box-shadow:0 0 4px #222;-webkit-box-shadow:0 0 4px #222;box-shadow:0 0 4px rgba(0,0,0,0.5);background-color:rgba(0,0,0,0.75);font-size:12px}.wdi_pro_only{font-style:italic;color:#4e4e4e !important;background-color:#ccc !important;text-decoration:none}.wdi_pro_only_op{opacity:.6}.wdi_pro_notice{text-align:right;color:#15699f;font-size:20px !important;padding:10px}.wdi_pro_only_btn{background-color:#c5c0c0 !important;border-top-color:#c5c0c0 !important}.wdi-pro-overlay img{opacity:.7}#wdi_feed_users{width:100%;margin-top:2px}#wdi_feed_tabs .wdi_feed_tabs{border:1px solid #f1f1f1;color:#444;cursor:pointer;font-size:13px;font-weight:bold;padding:12px;background:#fff;text-decoration:none;display:inline-block}#wdi_feed_tabs{margin:16px 0}#wdi_feed_tabs .wdi_feed_tab_active,#wdi_feed_tabs .wdi_feed_tabs:hover{background:none repeat scroll 0 0 #fff;color:#9a2465}#how_to_publish_tab .wdi_howto_container .wdi_howto_content .wdi_howto_wrapper{max-width:270px;margin:0 auto}#how_to_publish_tab .wdi_howto_container .wdi_howto_content .wdi_howto_wrapper img{max-width:100%}#wdi_feed_tabs .wdi_feed_tab_title{margin-top:1px;display:inline-block}.wdi_border_wrapper [scope='row']+td,.wdi_border_wrapper [scope='row']{padding:8px}.display_type_container.wdi_clear_tag{display:table;margin:10px auto}.display_type_container>div{float:left;margin-right:15px}.wdi_user{border:1px solid #b9b9b9;background-color:rgba(0,0,0,.05);margin:0 4px 0 0;border-radius:5px;height:28px;position:relative;display:inline-block}.wdi_user:hover{background-color:rgba(0,0,0,.08)}.wdi_user a{text-decoration:none;color:black;line-height:28px;width:70%;margin-left:12%;margin-right:18%;height:100%;display:table-row;padding-right:3px}.wdi_user .wdi_profile_pic{width:20px;height:20px;top:4px;left:30px;padding:5px;vertical-align:middle;display:table-cell}.wdi_user span{display:table-cell;vertical-align:middle;left:55px;font-weight:bold;font-size:14px}.wdi_user .wdi_remove_user,.wdi_user .wdi_check_thumb_user{position:absolute;right:4px;width:15px;height:15px;top:6.5px;transition:all .1s ease}.wdi_user .wdi_remove_user:hover{cursor:pointer;transform:rotate(180deg)}.wdi_user .wdi_check_thumb_user:hover{cursor:pointer}.wdi_user .wdi_check_thumb_user{left:4px}.wdi_border_wrapper [scope='row']{padding:2px;font-size:13px;min-width:250px}.wdi_border_wrapper [scope='row']+td,.wdi_border_wrapper [scope='row']{padding:2px}.small_input{width:60px;text-align:center}.display_type{text-align:center}.wdi_access_token_missing{font-size:14px;color:#000;clear:both;max-width:720px}.instagram-feed_page_wdi_settings form{width:65%}.instagram-feed_page_wdi_settings table td{padding-left:0;padding-right:0}.instagram-feed_page_wdi_settings table th{padding-left:4px}.instagram-feed_page_wdi_settings table input{float:right}#login_with_instagram{height:43px}#login_with_instagram .wdi_sign_in_button{background-image:url('../images/sign_in_with_instagram.png');background-repeat:no-repeat;background-position:left top;width:234px;height:43px;display:inline-block;float:left}#login_with_instagram .wdi_default_feed_button,#login_with_instagram .wdi_edit_default_feed_button{width:234px;height:43px;background-repeat:no-repeat;background-position:center top;display:inline-block}#login_with_instagram .wdi_default_feed_button{background-image:url('../images/default_feed_button.png');float:left;margin-right:10px}#login_with_instagram .wdi_edit_default_feed_button{background-image:url('../images/edit_feed_button.png');float:left}#wdwt_wrap_wdi_authenticated_users_list{display:inline-block;width:100%}#wdwt_wrap_wdi_authenticated_users_list .wdi_sign_in_button{background-image:url(../images/multiple_accounts.png);background-repeat:no-repeat;background-position:left top;width:228px;height:36px;display:inline-block;float:right;margin-top:2px;padding-bottom:5px}.wdi_advanced_option_open tr:nth-child(9),.wdi_advanced_option_open tr:nth-child(10),.wdi_advanced_option_open tr:nth-child(11){display:none}.instagram-feed_page_wdi_settings table #wdwt_wrap_wdi_fb_auth{margin-left:115px}#wdwt_wrap_wdi_fb_auth .block a{background-color:#4267b2;color:#fff}.wdi_advanced_option .optioninput,#wdwt_wrap_wdi_reset_cache .block,#wdwt_wrap_wdi_authenticated_users_list .block{display:inline-block}#wdi_options_page_buttons_wrapper .submit{display:inline;margin-left:15px}#wdi_reset_access_token{margin-top:0;float:left;width:232px;text-align:center}.wdi_advanced_option{width:100%;position:relative;font-weight:600}.wdi_advanced_option{background-color:#fff;cursor:pointer;border:1px solid #e3e3e3;border-radius:10px;border-collapse:separate;border-spacing:0}.wdi_advanced_option .wdi_advanced_option_head{border-bottom:1px solid #e3e3e3}.wdi_advanced_option .wdi_advanced_option_head th{padding-top:10px;padding-bottom:10px}.wdi_advanced_option.wdi_advanced_option_open .wdi_advanced_option_head th{border-bottom:1px solid #e3e3e3;border-bottom-left-radius:10px}.wdi_advanced_option.wdi_advanced_option_open .wdi_advanced_option_head td{border-bottom:1px solid #e3e3e3;border-bottom-right-radius:10px}.instagram-feed_page_wdi_settings table.wdi_advanced_option th{padding-left:12px}.instagram-feed_page_wdi_settings table.wdi_advanced_option td .wdwt_param{margin-left:15px}.instagram-feed_page_wdi_settings #wdwt_wrap_wdi_disable_fa .optioninput{display:inline-block}.wdi_advanced_option .wdi_advanced_option_icon{background-repeat:no-repeat;background-position:left top;width:20px;height:20px;display:inline-block;position:absolute;top:16px;right:10px}.wdi_advanced_option.wdi_advanced_option_close .wdi_advanced_option_icon{background-image:url('../images/arrow_1.png')}.wdi_advanced_option.wdi_advanced_option_open .wdi_advanced_option_icon{background-image:url('../images/arrow_2.png')}.wdi_advanced_option.wdi_advanced_option_close tbody tr:not(.wdi_advanced_option_head){display:none}.instagram-feed_page_wdi_settings form h2{display:none}#wdi_options_page_buttons_wrapper{margin-top:10px;width:700px}.wdi_hide{display:none}.wdi_hidden{display:none !important}.selectoff{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.wdi_filter_radio{margin:5px;display:inline-block}.wdi_filter_radio label{vertical-align:text-bottom}.wdi_filter_input{margin-top:10px}.wdi_filter_input input{height:28px;width:250px;margin-right:0;padding-right:0;line-height:28px}#wdi_filter_type{line-height:28px;margin:0;padding:0;position:relative;right:2px;top:-1px;font-weight:400}.wdi_filter_item{display:inline-block;padding:6px;margin-top:5px;border-radius:5px}.wdi_filter_by_username{background-color:#00a0d2;color:white}.wdi_filter_by_hashtag{background-color:#e08d11;color:white}.wdi_logic{display:inline-block;padding:5px;font-weight:bold}.wdi_filter_by_location{background-color:#509833;color:white}.wdi_filter_by_mention{background-color:#833888;color:white}.wdi_filter_by_description{background-color:#bd242b;color:white}.wdi_filter_by_url{background-color:#004eff;color:white}.wdi_remove_filter{padding-left:5px;color:white;font-size:13px}.wdi_remove_filter:hover{cursor:pointer}.wdi_source_user{display:inline-block;padding:5px}.wdi_source_img{display:inline-block}.wdi_source_img img{width:30px;height:30px;border-radius:15px;display:block}.wdi_source_username{display:inline-block;line-height:25px;font-size:15px !important;height:30px;vertical-align:bottom;padding:0 5px;font-weight:bold}#login_with_instagram>a:focus{-webkit-box-shadow:none;box-shadow:none}.wdi_help_bar_wrap{background-color:#fff;border:0;box-sizing:border-box;clear:both;color:#6e7990;font-size:14px;font-weight:bold;line-height:30px;padding:15px;vertical-align:middle;width:100%;margin:20px 0 0 0}.wdi_help_bar_text{float:left}.wdi_help_bar_text>a{color:#0073aa;text-decoration:none}.wdi_hb_buy_pro{float:right;padding:0}.wdi_hb_buy_pro a,.wdi_hb_buy_pro a:active,.wdi_hb_buy_pro a:visited,.wdi_hb_buy_pro a:hover{display:inline-block;font-weight:bold;font-size:14px;vertical-align:middle;border:0;box-shadow:none !important;text-decoration:none}.wdi_hb_buy_pro .wdi_support_link{color:#72777c !important;padding:0 10px}.wdi_hb_buy_pro .wdi_update_pro_link{background:#45a6b7;font-weight:bold;line-height:30px;padding:0 18px 0 18px;color:#fff !important}.wdi_hb_buy_pro img{border:0;display:inline-block;vertical-align:middle}#bullets_images_type,#bullets_images_color,#bull_style,#rl_butt_type,#rl_butt_color,#rl_butt_style{margin:0 10px 0 0;width:100px}.wds_ctrl_btn_upload{display:block !important;margin:5px 0 !important;text-align:center;vertical-align:middle;width:95%}.wds_reverse{margin:0 5px !important}.wds_free_button,.wds_free_button:hover{background:linear-gradient(to bottom,#e5e5e5,#e5e5e5) repeat scroll 0 0 #f3f3f3 !important;border-color:#bbb !important;color:#888 !important}.wdi_spider_free_version_label,.wdi_spider_free_version_label *{color:#808080 !important}.wdi_spider_free_version{background-color:#dfdfdf;border:1px solid #797979;border-radius:2px;padding:2px;width:210px}.wds_more{font-size:12px}.wrap .button{border-radius:3px !important;text-shadow:none !important}.wdi_spider_message_cont{display:none;width:99%}.wdi_spider_load{display:none}.wdi_spider_load_cont{background-color:rgba(0,0,0,0.2);left:0;height:100%;position:fixed;top:0;width:100%;z-index:99998}.wdi_spider_load_icon{left:0;height:100%;position:fixed;text-align:center;top:0;width:100%;z-index:99999}.wdi_spider_ajax_loading{border:none !important;margin-top:200px;width:50px;-webkit-animation:spin 2.5s infinite linear;-moz-animation:spin 2.5s infinite linear;-o-animation:spin 2.5s infinite linear;animation:spin 2.5s infinite linear}@-moz-keyframes spin{0{-moz-transform:rotate(0)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0{-webkit-transform:rotate(0)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0{-o-transform:rotate(0)}100%{-o-transform:rotate(359deg)}}@-ms-keyframes spin{0{-ms-transform:rotate(0)}100%{-ms-transform:rotate(359deg)}}@keyframes spin{0{transform:rotate(0)}100%{transform:rotate(359deg)}}#TB_window,#TB_iframeContent{width:800px !important;height:500px !important}#TB_window{margin-left:-400px !important}.input_th{margin-left:0 !important;width:160px !important;font-family:sans-serif}.input_th2{margin-left:0 !important;width:160px !important;margin-top:5px;height:19px}.edit_input{height:28px !important;padding-bottom:7px !important}.add_tag_th{padding-left:21px;font-size:12px;font-family:sans-serif}.pointer{cursor:pointer}.non_selectable{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.wds_position_table td,.wds_position_table input{border:1px solid #ccc;margin:2px}.wds_position_table .wds_position_td{background-color:#f4f4f4;display:inline-block;line-height:1;padding:0 !important}.wdi_spider_div_options{background:none repeat scroll 0 0 #f4f4f4;border:1px solid #8f8d8d;border-radius:8px 8px 8px 8px;display:none;margin:2px 0 0 190px;padding:13px;min-height:300px;min-width:600px;vertical-align:top}.table_medium_col{text-align:center !important;width:70px}.table_medium_col_uncenter{width:80px}.table_extra_large_col{padding:4px !important;width:150px !important}.first-page,.prev-page,.next-page,.last-page,.table_extra_large_col a,.table_medium_col a,.table_big_col a,.table_small_col a{cursor:pointer}.wdi_spider_word_wrap{word-wrap:normal}.wdi_spider_description{color:#666;font-size:.923em;line-height:1.231em}.handle{background:url("../images/draggable.png") no-repeat transparent;border:0;cursor:move;display:inline-block;height:15px;margin:0 auto;vertical-align:middle;width:15px}.slider-icon{background-image:url("../images/slider-icon.png");background-repeat:no-repeat;border:0;float:left;height:32px;margin:7px 8px 0 0;width:32px}.uninstall-icon{background-image:url("../images/uninstall-icon.png");background-repeat:no-repeat;border:0;float:left;height:32px;margin:7px 8px 0 0;width:32px}.wdi_spider_label{font-weight:bold;width:100px}.wdi_spider_label_top{font-weight:bold;padding-top:3px;vertical-align:top;width:100px}.wdi_spider_fieldset .wdi_spider_label{font-weight:bold;vertical-align:top;width:150px}.wdi_spider_label_options{font-weight:bold;vertical-align:top;width:150px}.wdi_spider_choose_option{display:table;box-shadow:0 0 1px 1px #d2d2d2;margin-bottom:5px;border-radius:2px;padding:2px;box-sizing:border-box;cursor:pointer;width:100%}.wdi_spider_options_cont,.wdi_spider_bull_options_cont,.wdi_spider_pp_options_cont,.wdi_spider_options_color_cont,.wdi_spider_bull_options_color_cont,.wdi_spider_pp_options_color_cont{display:none;width:180px;height:150px;overflow:scroll;overflow-x:hidden;overflow-y:scroll}.wdi_spider_option_cont{display:block;border-bottom:1px solid #d3d3d3;padding:3px 0 3px 0;box-sizing:content-box;width:98%;border-radius:0;cursor:pointer}.wdi_spider_option_cont_title{display:table-cell;vertical-align:middle;padding:0 0 0 4px}.wdi_spider_option_cont_img{display:table-cell;width:23%;height:15px;text-align:right;padding:5px 4px 0 0;box-sizing:border-box;background-color:#eee}.wdi_spider_option_main_title{display:table-cell;width:65%;vertical-align:middle;padding:0 0 0 4px;color:#555}.wdi_spider_sel_option_ic{display:table-cell;width:20%;height:15px;text-align:right;padding:0 6px 0 0;box-sizing:border-box}.wdi_spider_int_input{width:45px}.wdi_spider_char_input{width:115px}.wdi_spider_text_input{width:190px}.wdi_spider_slider_div{display:inline-block;vertical-align:middle;width:140px}.wdi_spider_slider_percentage,.wdi_spider_slider_percentage input,.wdi_spider_slider_percentage input :focus{background:transparent;border:0;color:#00aeef;display:inline;font-weight:bold;text-align:right;vertical-align:middle;width:30px}.updated,.error{margin:5px 0 2px !important}.buttons_div{clear:both;float:right;margin:5px 0}.buttons_div_left{float:left;margin:5px 0}.buttons_div_right{float:right;margin:5px 0}.wdi_spider_delete_img{background-image:url("../images/delete.png");border:0;cursor:pointer;display:inline-block;vertical-align:middle;height:14px;width:14px}.wdi_spider_delete_img_small{background-image:url("../images/delete.png");background-size:10px auto;border:medium none;cursor:pointer;display:inline-block;height:10px;margin-top:2px;vertical-align:middle;width:10px}.wdi_spider_fieldset{background:none repeat scroll 0 0 #f4f4f4;border:1px solid #8f8d8d;border-radius:8px 8px 8px 8px;display:none;float:left;margin:4px;padding:13px;width:97%}.wdi_spider_type_fieldset{background:none repeat scroll 0 0 #f4f4f4;border-radius:8px 8px 8px 8px;display:none;float:left;width:100%}.wdi_spider_child_fieldset{background:none repeat scroll 0 0 #f4f4f4;border:1px solid #8f8d8d;border-radius:8px 8px 8px 8px;float:left;margin:4px;width:30%;padding:13px;display:block}.wdi_spider_table td{padding:0;vertical-align:middle}.wdi_spider_ctrls{padding:4px;text-align:center;width:40px}.theme_type{background-color:#f4f4f4;border:1px solid #8f8d8d;border-radius:8px 8px 8px 8px;cursor:pointer;display:inline-block;font-size:16px;height:24px;padding-top:5px;text-align:center;vertical-align:middle;width:123px;margin:2px 0 2px 0}.ui-slider-handle{cursor:pointer !important}.thumb{border:1px solid #ccc;max-height:120px;max-width:120px}.fileDescription{color:#666;cursor:pointer;font-family:sans-serif;font-size:12px}.filename{font-size:13px}.tag_div{background-clip:padding-box;background-color:#f3f3f3;border:1px solid #aaa;border-radius:3px 3px 3px 3px;box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,0.05);color:#666;line-height:13px;margin:2px 0;padding:2px 5px 2px 5px;width:132px}.tags_div{overflow-y:auto;height:65px}.tag_name{width:118px}.edit_thumb{cursor:pointer}.wdi_spider_rotate{border-radius:2px;border:1px solid #fff;height:30px}.wdi_spider_search_value{height:2em;margin:0 0 4px}#th_order,.wdi_spider_order{display:none}.wds_add_video,.wds_resize_image,.wds_import,.wds_exports{display:none;padding:10px;height:60px;background-color:#fff;border:1px solid #999;top:50%;position:fixed;left:50%;text-align:left;z-index:100000;border-radius:3px;margin-top:-45px}.wds_add_video,.wds_resize_image{margin-left:-340px}.wds_exports{margin-left:-240px}.wds_import{margin-left:-185px}.wds_add_video input[type="text"],.wds_resize_image input[type="text"]{width:500px}.wds_opacity_video,.wds_opacity_import,.wds_opacity_export{background-color:#000;display:none;opacity:.75;filter:Alpha(opacity=75);position:fixed;top:0;left:0;width:100%;height:100%;z-index:99998}.wds_tabs{clear:both;display:none;position:relative;z-index:1}.wds_tabs a.wds_sub_active,.wds_tabs a.wds_active{background-color:#f5f5f5;border-bottom:1px solid #f5f5f5;color:#333}.wds_tabs a{background-color:#f9f9f9;border:1px solid #dfdfdf;border-top-left-radius:3px;border-top-right-radius:3px;color:#c7c7c7;display:block !important;float:left;font:bold 17px/32px Arial,serif;height:30px;margin:3px 3px 0 0;padding:0 10px;position:relative;text-decoration:none;width:130px}.wbs_subtab a{font:bold 14px/26px Arial,serif;height:26px;padding:0 5px;width:105px}.wds_add_layer{font:normal 20px/28px Arial,serif !important;width:initial !important;padding:0 9px !important}.wds_tab_title{background:none repeat scroll 0 0 transparent !important;border:none !important;cursor:pointer;opacity:.5;filter:Alpha(opacity=50);padding:1px;vertical-align:middle;width:50px}.wds_sub_active .wds_tab_title,.wds_layer_title{background-color:#fff !important;border-color:#dfdfdf !important;border-radius:3px !important;border-style:solid !important;border-width:1px !important;cursor:pointer;opacity:1;filter:Alpha(opacity=100)}.wds_tab_remove{background-image:url("../images/close.png");background-repeat:no-repeat;background-size:100% 100%;display:inline-block;width:9px;height:9px;opacity:.5;filter:Alpha(opacity=50);vertical-align:middle}.wds_layer_remove{background-image:url("../images/close.png");background-repeat:no-repeat;background-size:100% 100%;display:inline-block;width:15px;height:15px;margin:5px;float:right}.wds_layer_dublicate{background-image:url("../images/duplicate.png");background-repeat:no-repeat;background-size:100% 100%;display:inline-block;width:15px;height:15px;margin:5px;float:right}.wds_slide_dublicate{background-image:url("../images/duplicate.png");background-repeat:no-repeat;background-size:100% 100%;display:inline-block;width:12px;height:12px;vertical-align:middle}.wds_layer_depth{float:right;font-size:13px;line-height:15px;margin:1px 5px;text-align:left;width:40px}.wds_layer_label{display:inline-block;font-size:13px;width:80%}.wds_sub_active .wds_tab_remove{cursor:pointer !important;opacity:1;filter:Alpha(opacity=100)}.wds_box.wds_sub_active,.wds_box.wds_active{display:block}.wds_tab_label{display:block;width:inherit}.wds_box{display:none;margin-top:0 !important;position:relative;top:-1px}.wds_box{border:1px solid #dfdfdf;border-radius:3px;box-shadow:0 0 10px #f2f2f2;margin-top:15px;position:relative}.wds_clear{clear:both;float:none !important}.wds_box thead td{border-bottom:0 none !important}.wds_box tbody{background-color:#fff;border-top:0 none;padding-left:10px}.wds_box thead{background:-webkit-linear-gradient(#f5f5f5,#fff);background:-o-linear-gradient(#f5f5f5,#fff);background:-moz-linear-gradient(#f5f5f5,#fff);background:linear-gradient(#f5f5f5,#fff);border-top:0 none;border-bottom:0 none;color:#333;font:bold 12px/29px Arial,serif;height:29px;margin:0;padding:0 10px;text-align:left;text-shadow:0 1px 0 #fff}.wds_box table{border-collapse:collapse;border-spacing:0;width:100%}.wds_nav_tabs{background-color:#f5f5f5;border-right:1px solid #dfdfdf;float:left;height:640px;margin:0;width:150px}.wds_nav_tabs ul{list-style:none outside none;margin:10px 0;padding:0}.wds_nav_tabs .wds_sub_active,.wds_nav_tabs .wds_sub_active a,.wds_nav_tabs .wds_sub_active a:hover,.wds_nav_tabs .wds_active,.wds_nav_tabs .wds_active a,.wds_nav_tabs .wds_active a:hover{background:none repeat scroll 0 0 #fff;color:#333}.wds_nav_tabs .wds_active{border-color:#dfdfdf;border-width:1px 0 1px 1px;border-style:solid;margin:0 -1px 0 -4px;padding:0}.wds_nav_tabs li{border-color:transparent;border-style:solid;border-width:1px 0;list-style-type:none;margin-bottom:0}.wds_nav_tabs a{display:block;line-height:18px;padding:5px 5px 5px 12px;text-decoration:none}.wds_nav_box{background:none repeat scroll 0 0 #fff;display:none;height:610px;overflow:auto;padding:15px}.wds_nav_box.wds_active{display:block}.wds_layer_head{background-color:#f5f5f5;border-bottom:1px solid #dfdfdf;border-top:1px solid #dfdfdf;cursor:pointer;padding:5px}.wds_layer_head .handle{cursor:move;display:inline-block;margin:5px}.wds_box td{padding:10px !important}.wds_draggable{box-sizing:border-box;cursor:move}.wds_box .color{width:60px}.wds_active_layer{box-shadow:#2c2424 0 0 5px;border-radius:3px}.wds_draggable a,.wds_draggable a:hover{color:inherit !important;font-size:inherit !important;font-style:inherit !important;font-weight:inherit !important;text-decoration:none}#add_embed_help{height:200px;width:672px;top:40%}#add_embed input[type="text"]{width:500px}.wds_buttons{float:right;font-weight:normal;position:relative}.wds_reset_button{display:none;font-weight:normal;margin:10px 0;position:absolute;right:40px;z-index:1}#wdi_save_feed .two .section_col{width:47%;float:left;margin:0 1.5% 18px}#wdi_save_feed .wdi_element{margin:0 0 18px}#wdi_save_feed .half .wdi_element,#wdi_save_feed .one .wdi_element{width:96%;float:none;margin:0 2% 20px}.wdi_element_name_liked_feed{display:none !important}#wdi_save_feed .wdi_element p{margin:2px 0 0}.wdi_section_name{font-size:19px;margin:0 auto 15px;width:100%;box-sizing:border-box;padding:15px;border-bottom:1px solid #f1f1f1;color:#444;cursor:pointer}.wdi_section{border:1px solid #dedede;margin-bottom:20px;background:#fff}.wdi_section .optioninput *{text-align:left}.wdi_section.half{width:49%;float:left;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wdi_buttons{text-align:right;margin-top:7px}.wdi_tab .wdi_section.half:last-child{margin-left:2%}#how_to_publish_tab .wdi_howto_container{display:flex;flex-wrap:wrap}#how_to_publish_tab .wdi_howto_content{border:1px #ddd solid;display:flex;flex:1;flex-direction:column;margin:5px;min-width:250px;max-width:calc(25% - 20px);padding:20px 10px;text-align:center}#how_to_publish_tab .wdi_howto_container h2{font-size:23px;font-weight:normal;line-height:29px;margin:0;padding:11px 15px 4px 0}#how_to_publish_tab .wdi_howto_container .wdi_howto_content input{margin:0 auto;text-align:center;width:100%}.wdi_buttons button.button.preview-button{height:28px}@media(max-width:782px){.wdi_buttons button.button.preview-button{height:auto}}@media(min-width:768px){.wdi_border_wrapper .wdi_element_content{width:100%;display:block}.wdi_border_wrapper .wdi_element_title{display:block}.wdi_border_wrapper .wdi_element_content input[type=text]:not(.wp-color-picker){width:calc(100% - 30px);height:28px}.wdi_border_wrapper .wdi_element_content input#wdi_add_user_ajax_input{width:calc(100% - 78px)}.wdi_border_wrapper .wdi_element_content input[type=number]{width:calc(100% - 30px)}.wdi_border_wrapper .wdi_element_content select{width:calc(100% - 30px)}}@media(max-width:768px){#wdi_save_feed .two .section_col{width:96%;float:none;margin:0 2% 18px}.wdi_section.half{width:100%;float:none;margin:0 0 20px 0 !important}}.wdi_section_close::before{content:"\f142";display:inline-block;font:400 20px/1 dashicons;speak:none;float:right;cursor:pointer}.wdi_section_open::before{content:"\f140";display:inline-block;font:400 20px/1 dashicons;speak:none;float:right;cursor:pointer}.wdi-page-header{width:98%;padding:10px}.wdi-page-header .wdi_buttons{float:right}.wdi-page-header .WDI_title_input{padding:3px 8px;font-size:1.7em;line-height:100%;height:1.5em;width:30%;outline:0;margin:0 0 3px;background-color:#fff}.wdi_demo_img{margin-top:20px}#wdi_feed_form .wd-page-title.wd-header{width:100%;padding:10px 0}@media screen and (max-width:782px){#wdi_feed_form p.search-box{margin-bottom:0}#wdi_feed_form p.search-box input[type="search"]{width:100%;height:auto !important}#wdi_feed_form p.search-box input[type="button"]{margin-bottom:10px;padding:6px 14px;line-height:normal;font-size:14px;height:auto}.wdi-page-header .WDI_title_input{width:60%}.wdi-page-header .wdi_buttons{float:none;text-align:center}}.wdi_reset_cache_success{float:right}#wdi_reset_cache{float:right}body.toplevel_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(4),body.toplevel_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(5){display:none}body.instagram-feed_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(3){display:table-row !important}body.instagram-feed_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(4){display:table-row !important}
1
+ .wdi_clear{clear:both}.wdi_clear_tag:after{content:"";display:table;clear:both}#wdi_unistall{background-color:#d82121;border-color:#d31818;box-shadow:inset 0 1px 0 rgba(230,120,120,0.5),0 1px 0 rgba(0,0,0,.15)}#wdi_unistall:hover{background-color:#da1313}#wdi_unistall_table th{width:45%}.display_type_content{background:#fff;border:1px solid #dedede;margin-bottom:15px}.wdi_tooltip,.wdi_settings_link{display:block;font-size:14px !important;font-weight:bold;line-height:20px;margin-bottom:5px;color:#444;text-decoration:none}p.wdi_about_filed{font-size:13px;font-style:italic}.wdi_tooltip:hover,.wdi_settings_link:hover{color:#23282d;position:relative}.wdi_tooltip:hover:after{content:attr(wdi-tooltip);padding:4px 8px;color:#dbdbe0;position:absolute;left:0;top:100%;white-space:nowrap;z-index:20;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:2px;-moz-box-shadow:0 0 4px #222;-webkit-box-shadow:0 0 4px #222;box-shadow:0 0 4px rgba(0,0,0,0.5);background-color:rgba(0,0,0,0.75);font-size:12px}.wdi_pro_only{font-style:italic;color:#4e4e4e !important;background-color:#ccc !important;text-decoration:none}.wdi_pro_only_op{opacity:.6}.wdi_pro_notice{text-align:right;color:#15699f;font-size:20px !important;padding:10px}.wdi_pro_only_btn{background-color:#c5c0c0 !important;border-top-color:#c5c0c0 !important}.wdi-pro-overlay img{opacity:.7}#wdi_feed_users{width:100%;margin-top:2px}#wdi_feed_tabs .wdi_feed_tabs{border:1px solid #f1f1f1;color:#444;cursor:pointer;font-size:13px;font-weight:bold;padding:12px;background:#fff;text-decoration:none;display:inline-block}#wdi_feed_tabs{margin:16px 0}#wdi_feed_tabs .wdi_feed_tab_active,#wdi_feed_tabs .wdi_feed_tabs:hover{background:none repeat scroll 0 0 #fff;color:#9a2465}#how_to_publish_tab .wdi_howto_container .wdi_howto_content .wdi_howto_wrapper{max-width:270px;margin:0 auto}#how_to_publish_tab .wdi_howto_container .wdi_howto_content .wdi_howto_wrapper img{max-width:100%}#wdi_feed_tabs .wdi_feed_tab_title{margin-top:1px;display:inline-block}.wdi_border_wrapper [scope='row']+td,.wdi_border_wrapper [scope='row']{padding:8px}.display_type_container.wdi_clear_tag{display:table;margin:10px auto}.display_type_container>div{float:left;margin-right:15px}.wdi_user{border:1px solid #b9b9b9;background-color:rgba(0,0,0,.05);margin:0 4px 0 0;border-radius:5px;height:28px;position:relative;display:inline-block}.wdi_user:hover{background-color:rgba(0,0,0,.08)}.wdi_user a{text-decoration:none;color:black;line-height:28px;width:70%;margin-left:12%;margin-right:18%;height:100%;display:table-row;padding-right:3px}.wdi_user .wdi_profile_pic{width:20px;height:20px;top:4px;left:30px;padding:5px;vertical-align:middle;display:table-cell}.wdi_user span{display:table-cell;vertical-align:middle;left:55px;font-weight:bold;font-size:14px}.wdi_user .wdi_remove_user,.wdi_user .wdi_check_thumb_user{position:absolute;right:4px;width:15px;height:15px;top:6.5px;transition:all .1s ease}.wdi_user .wdi_remove_user:hover{cursor:pointer;transform:rotate(180deg)}.wdi_user .wdi_check_thumb_user:hover{cursor:pointer}.wdi_user .wdi_check_thumb_user{left:4px}.wdi_border_wrapper [scope='row']{padding:2px;font-size:13px;min-width:250px}.wdi_border_wrapper [scope='row']+td,.wdi_border_wrapper [scope='row']{padding:2px}.small_input{width:60px;text-align:center}.display_type{text-align:center}.wdi_access_token_missing{font-size:14px;color:#000;clear:both;max-width:720px}.instagram-feed_page_wdi_settings form{width:65%}.instagram-feed_page_wdi_settings table td{padding-left:0;padding-right:0}.instagram-feed_page_wdi_settings table th{padding-left:4px}.instagram-feed_page_wdi_settings table input{float:right}#login_with_instagram{height:43px}#login_with_instagram .wdi_sign_in_button{background-image:url('../images/sign_in_with_instagram.png');background-repeat:no-repeat;background-position:left top;width:234px;height:43px;display:inline-block;float:left}#login_with_instagram .wdi_default_feed_button,#login_with_instagram .wdi_edit_default_feed_button{width:234px;height:43px;background-repeat:no-repeat;background-position:center top;display:inline-block}#login_with_instagram .wdi_default_feed_button{background-image:url('../images/default_feed_button.png');float:left;margin-right:10px}#login_with_instagram .wdi_edit_default_feed_button{background-image:url('../images/edit_feed_button.png');float:left}#wdwt_wrap_wdi_authenticated_users_list{display:inline-block;width:100%}#wdwt_wrap_wdi_authenticated_users_list .wdi_sign_in_button{background-image:url(../images/multiple_accounts.png);background-repeat:no-repeat;background-position:left top;width:228px;height:36px;display:inline-block;float:right;margin-top:2px;padding-bottom:5px}.wdi_element_name_hashtag_top_recent{display:none}.wdi_advanced_option_open tr:nth-child(9),.wdi_advanced_option_open tr:nth-child(10),.wdi_advanced_option_open tr:nth-child(11){display:none}.instagram-feed_page_wdi_settings table #wdwt_wrap_wdi_fb_auth{margin-left:115px}#wdwt_wrap_wdi_fb_auth .block a{background-color:#4267b2;color:#fff}.wdi_advanced_option .optioninput,#wdwt_wrap_wdi_reset_cache .block,#wdwt_wrap_wdi_authenticated_users_list .block{display:inline-block}#wdi_options_page_buttons_wrapper .submit{display:inline;margin-left:15px}#wdi_reset_access_token{margin-top:0;float:left;width:232px;text-align:center}.wdi_advanced_option{width:100%;position:relative;font-weight:600}.wdi_advanced_option{background-color:#fff;cursor:pointer;border:1px solid #e3e3e3;border-radius:10px;border-collapse:separate;border-spacing:0}.wdi_advanced_option .wdi_advanced_option_head{border-bottom:1px solid #e3e3e3}.wdi_advanced_option .wdi_advanced_option_head th{padding-top:10px;padding-bottom:10px}.wdi_advanced_option.wdi_advanced_option_open .wdi_advanced_option_head th{border-bottom:1px solid #e3e3e3;border-bottom-left-radius:10px}.wdi_advanced_option.wdi_advanced_option_open .wdi_advanced_option_head td{border-bottom:1px solid #e3e3e3;border-bottom-right-radius:10px}.instagram-feed_page_wdi_settings table.wdi_advanced_option th{padding-left:12px}.instagram-feed_page_wdi_settings table.wdi_advanced_option td .wdwt_param{margin-left:15px}.instagram-feed_page_wdi_settings #wdwt_wrap_wdi_disable_fa .optioninput{display:inline-block}.wdi_advanced_option .wdi_advanced_option_icon{background-repeat:no-repeat;background-position:left top;width:20px;height:20px;display:inline-block;position:absolute;top:16px;right:10px}.wdi_advanced_option.wdi_advanced_option_close .wdi_advanced_option_icon{background-image:url('../images/arrow_1.png')}.wdi_advanced_option.wdi_advanced_option_open .wdi_advanced_option_icon{background-image:url('../images/arrow_2.png')}.wdi_advanced_option.wdi_advanced_option_close tbody tr:not(.wdi_advanced_option_head){display:none}.instagram-feed_page_wdi_settings form h2{display:none}#wdi_options_page_buttons_wrapper{margin-top:10px;width:700px}.wdi_hide{display:none}.wdi_hidden{display:none !important}.selectoff{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.wdi_filter_radio{margin:5px;display:inline-block}.wdi_filter_radio label{vertical-align:text-bottom}.wdi_filter_input{margin-top:10px}.wdi_filter_input input{height:28px;width:250px;margin-right:0;padding-right:0;line-height:28px}#wdi_filter_type{line-height:28px;margin:0;padding:0;position:relative;right:2px;top:-1px;font-weight:400}.wdi_filter_item{display:inline-block;padding:6px;margin-top:5px;border-radius:5px}.wdi_filter_by_username{background-color:#00a0d2;color:white}.wdi_filter_by_hashtag{background-color:#e08d11;color:white}.wdi_logic{display:inline-block;padding:5px;font-weight:bold}.wdi_filter_by_location{background-color:#509833;color:white}.wdi_filter_by_mention{background-color:#833888;color:white}.wdi_filter_by_description{background-color:#bd242b;color:white}.wdi_filter_by_url{background-color:#004eff;color:white}.wdi_remove_filter{padding-left:5px;color:white;font-size:13px}.wdi_remove_filter:hover{cursor:pointer}.wdi_source_user{display:inline-block;padding:5px}.wdi_source_img{display:inline-block}.wdi_source_img img{width:30px;height:30px;border-radius:15px;display:block}.wdi_source_username{display:inline-block;line-height:25px;font-size:15px !important;height:30px;vertical-align:bottom;padding:0 5px;font-weight:bold}#login_with_instagram>a:focus{-webkit-box-shadow:none;box-shadow:none}.wdi_help_bar_wrap{background-color:#fff;border:0;box-sizing:border-box;clear:both;color:#6e7990;font-size:14px;font-weight:bold;line-height:30px;padding:15px;vertical-align:middle;width:100%;margin:20px 0 0 0}.wdi_help_bar_text{float:left}.wdi_help_bar_text>a{color:#0073aa;text-decoration:none}.wdi_hb_buy_pro{float:right;padding:0}.wdi_hb_buy_pro a,.wdi_hb_buy_pro a:active,.wdi_hb_buy_pro a:visited,.wdi_hb_buy_pro a:hover{display:inline-block;font-weight:bold;font-size:14px;vertical-align:middle;border:0;box-shadow:none !important;text-decoration:none}.wdi_hb_buy_pro .wdi_support_link{color:#72777c !important;padding:0 10px}.wdi_hb_buy_pro .wdi_update_pro_link{background:#45a6b7;font-weight:bold;line-height:30px;padding:0 18px 0 18px;color:#fff !important}.wdi_hb_buy_pro img{border:0;display:inline-block;vertical-align:middle}#bullets_images_type,#bullets_images_color,#bull_style,#rl_butt_type,#rl_butt_color,#rl_butt_style{margin:0 10px 0 0;width:100px}.wds_ctrl_btn_upload{display:block !important;margin:5px 0 !important;text-align:center;vertical-align:middle;width:95%}.wds_reverse{margin:0 5px !important}.wds_free_button,.wds_free_button:hover{background:linear-gradient(to bottom,#e5e5e5,#e5e5e5) repeat scroll 0 0 #f3f3f3 !important;border-color:#bbb !important;color:#888 !important}.wdi_spider_free_version_label,.wdi_spider_free_version_label *{color:#808080 !important}.wdi_spider_free_version{background-color:#dfdfdf;border:1px solid #797979;border-radius:2px;padding:2px;width:210px}.wds_more{font-size:12px}.wrap .button{border-radius:3px !important;text-shadow:none !important}.wdi_spider_message_cont{display:none;width:99%}.wdi_spider_load{display:none}.wdi_spider_load_cont{background-color:rgba(0,0,0,0.2);left:0;height:100%;position:fixed;top:0;width:100%;z-index:99998}.wdi_spider_load_icon{left:0;height:100%;position:fixed;text-align:center;top:0;width:100%;z-index:99999}.wdi_spider_ajax_loading{border:none !important;margin-top:200px;width:50px;-webkit-animation:spin 2.5s infinite linear;-moz-animation:spin 2.5s infinite linear;-o-animation:spin 2.5s infinite linear;animation:spin 2.5s infinite linear}@-moz-keyframes spin{0{-moz-transform:rotate(0)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0{-webkit-transform:rotate(0)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0{-o-transform:rotate(0)}100%{-o-transform:rotate(359deg)}}@-ms-keyframes spin{0{-ms-transform:rotate(0)}100%{-ms-transform:rotate(359deg)}}@keyframes spin{0{transform:rotate(0)}100%{transform:rotate(359deg)}}#TB_window,#TB_iframeContent{width:800px !important;height:500px !important}#TB_window{margin-left:-400px !important}.input_th{margin-left:0 !important;width:160px !important;font-family:sans-serif}.input_th2{margin-left:0 !important;width:160px !important;margin-top:5px;height:19px}.edit_input{height:28px !important;padding-bottom:7px !important}.add_tag_th{padding-left:21px;font-size:12px;font-family:sans-serif}.pointer{cursor:pointer}.non_selectable{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.wds_position_table td,.wds_position_table input{border:1px solid #ccc;margin:2px}.wds_position_table .wds_position_td{background-color:#f4f4f4;display:inline-block;line-height:1;padding:0 !important}.wdi_spider_div_options{background:none repeat scroll 0 0 #f4f4f4;border:1px solid #8f8d8d;border-radius:8px 8px 8px 8px;display:none;margin:2px 0 0 190px;padding:13px;min-height:300px;min-width:600px;vertical-align:top}.table_medium_col{text-align:center !important;width:70px}.table_medium_col_uncenter{width:80px}.table_extra_large_col{padding:4px !important;width:150px !important}.first-page,.prev-page,.next-page,.last-page,.table_extra_large_col a,.table_medium_col a,.table_big_col a,.table_small_col a{cursor:pointer}.wdi_spider_word_wrap{word-wrap:normal}.wdi_spider_description{color:#666;font-size:.923em;line-height:1.231em}.handle{background:url("../images/draggable.png") no-repeat transparent;border:0;cursor:move;display:inline-block;height:15px;margin:0 auto;vertical-align:middle;width:15px}.slider-icon{background-image:url("../images/slider-icon.png");background-repeat:no-repeat;border:0;float:left;height:32px;margin:7px 8px 0 0;width:32px}.uninstall-icon{background-image:url("../images/uninstall-icon.png");background-repeat:no-repeat;border:0;float:left;height:32px;margin:7px 8px 0 0;width:32px}.wdi_spider_label{font-weight:bold;width:100px}.wdi_spider_label_top{font-weight:bold;padding-top:3px;vertical-align:top;width:100px}.wdi_spider_fieldset .wdi_spider_label{font-weight:bold;vertical-align:top;width:150px}.wdi_spider_label_options{font-weight:bold;vertical-align:top;width:150px}.wdi_spider_choose_option{display:table;box-shadow:0 0 1px 1px #d2d2d2;margin-bottom:5px;border-radius:2px;padding:2px;box-sizing:border-box;cursor:pointer;width:100%}.wdi_spider_options_cont,.wdi_spider_bull_options_cont,.wdi_spider_pp_options_cont,.wdi_spider_options_color_cont,.wdi_spider_bull_options_color_cont,.wdi_spider_pp_options_color_cont{display:none;width:180px;height:150px;overflow:scroll;overflow-x:hidden;overflow-y:scroll}.wdi_spider_option_cont{display:block;border-bottom:1px solid #d3d3d3;padding:3px 0 3px 0;box-sizing:content-box;width:98%;border-radius:0;cursor:pointer}.wdi_spider_option_cont_title{display:table-cell;vertical-align:middle;padding:0 0 0 4px}.wdi_spider_option_cont_img{display:table-cell;width:23%;height:15px;text-align:right;padding:5px 4px 0 0;box-sizing:border-box;background-color:#eee}.wdi_spider_option_main_title{display:table-cell;width:65%;vertical-align:middle;padding:0 0 0 4px;color:#555}.wdi_spider_sel_option_ic{display:table-cell;width:20%;height:15px;text-align:right;padding:0 6px 0 0;box-sizing:border-box}.wdi_spider_int_input{width:45px}.wdi_spider_char_input{width:115px}.wdi_spider_text_input{width:190px}.wdi_spider_slider_div{display:inline-block;vertical-align:middle;width:140px}.wdi_spider_slider_percentage,.wdi_spider_slider_percentage input,.wdi_spider_slider_percentage input :focus{background:transparent;border:0;color:#00aeef;display:inline;font-weight:bold;text-align:right;vertical-align:middle;width:30px}.updated,.error{margin:5px 0 2px !important}.buttons_div{clear:both;float:right;margin:5px 0}.buttons_div_left{float:left;margin:5px 0}.buttons_div_right{float:right;margin:5px 0}.wdi_spider_delete_img{background-image:url("../images/delete.png");border:0;cursor:pointer;display:inline-block;vertical-align:middle;height:14px;width:14px}.wdi_spider_delete_img_small{background-image:url("../images/delete.png");background-size:10px auto;border:medium none;cursor:pointer;display:inline-block;height:10px;margin-top:2px;vertical-align:middle;width:10px}.wdi_spider_fieldset{background:none repeat scroll 0 0 #f4f4f4;border:1px solid #8f8d8d;border-radius:8px 8px 8px 8px;display:none;float:left;margin:4px;padding:13px;width:97%}.wdi_spider_type_fieldset{background:none repeat scroll 0 0 #f4f4f4;border-radius:8px 8px 8px 8px;display:none;float:left;width:100%}.wdi_spider_child_fieldset{background:none repeat scroll 0 0 #f4f4f4;border:1px solid #8f8d8d;border-radius:8px 8px 8px 8px;float:left;margin:4px;width:30%;padding:13px;display:block}.wdi_spider_table td{padding:0;vertical-align:middle}.wdi_spider_ctrls{padding:4px;text-align:center;width:40px}.theme_type{background-color:#f4f4f4;border:1px solid #8f8d8d;border-radius:8px 8px 8px 8px;cursor:pointer;display:inline-block;font-size:16px;height:24px;padding-top:5px;text-align:center;vertical-align:middle;width:123px;margin:2px 0 2px 0}.ui-slider-handle{cursor:pointer !important}.thumb{border:1px solid #ccc;max-height:120px;max-width:120px}.fileDescription{color:#666;cursor:pointer;font-family:sans-serif;font-size:12px}.filename{font-size:13px}.tag_div{background-clip:padding-box;background-color:#f3f3f3;border:1px solid #aaa;border-radius:3px 3px 3px 3px;box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,0.05);color:#666;line-height:13px;margin:2px 0;padding:2px 5px 2px 5px;width:132px}.tags_div{overflow-y:auto;height:65px}.tag_name{width:118px}.edit_thumb{cursor:pointer}.wdi_spider_rotate{border-radius:2px;border:1px solid #fff;height:30px}.wdi_spider_search_value{height:2em;margin:0 0 4px}#th_order,.wdi_spider_order{display:none}.wds_add_video,.wds_resize_image,.wds_import,.wds_exports{display:none;padding:10px;height:60px;background-color:#fff;border:1px solid #999;top:50%;position:fixed;left:50%;text-align:left;z-index:100000;border-radius:3px;margin-top:-45px}.wds_add_video,.wds_resize_image{margin-left:-340px}.wds_exports{margin-left:-240px}.wds_import{margin-left:-185px}.wds_add_video input[type="text"],.wds_resize_image input[type="text"]{width:500px}.wds_opacity_video,.wds_opacity_import,.wds_opacity_export{background-color:#000;display:none;opacity:.75;filter:Alpha(opacity=75);position:fixed;top:0;left:0;width:100%;height:100%;z-index:99998}.wds_tabs{clear:both;display:none;position:relative;z-index:1}.wds_tabs a.wds_sub_active,.wds_tabs a.wds_active{background-color:#f5f5f5;border-bottom:1px solid #f5f5f5;color:#333}.wds_tabs a{background-color:#f9f9f9;border:1px solid #dfdfdf;border-top-left-radius:3px;border-top-right-radius:3px;color:#c7c7c7;display:block !important;float:left;font:bold 17px/32px Arial,serif;height:30px;margin:3px 3px 0 0;padding:0 10px;position:relative;text-decoration:none;width:130px}.wbs_subtab a{font:bold 14px/26px Arial,serif;height:26px;padding:0 5px;width:105px}.wds_add_layer{font:normal 20px/28px Arial,serif !important;width:initial !important;padding:0 9px !important}.wds_tab_title{background:none repeat scroll 0 0 transparent !important;border:none !important;cursor:pointer;opacity:.5;filter:Alpha(opacity=50);padding:1px;vertical-align:middle;width:50px}.wds_sub_active .wds_tab_title,.wds_layer_title{background-color:#fff !important;border-color:#dfdfdf !important;border-radius:3px !important;border-style:solid !important;border-width:1px !important;cursor:pointer;opacity:1;filter:Alpha(opacity=100)}.wds_tab_remove{background-image:url("../images/close.png");background-repeat:no-repeat;background-size:100% 100%;display:inline-block;width:9px;height:9px;opacity:.5;filter:Alpha(opacity=50);vertical-align:middle}.wds_layer_remove{background-image:url("../images/close.png");background-repeat:no-repeat;background-size:100% 100%;display:inline-block;width:15px;height:15px;margin:5px;float:right}.wds_layer_dublicate{background-image:url("../images/duplicate.png");background-repeat:no-repeat;background-size:100% 100%;display:inline-block;width:15px;height:15px;margin:5px;float:right}.wds_slide_dublicate{background-image:url("../images/duplicate.png");background-repeat:no-repeat;background-size:100% 100%;display:inline-block;width:12px;height:12px;vertical-align:middle}.wds_layer_depth{float:right;font-size:13px;line-height:15px;margin:1px 5px;text-align:left;width:40px}.wds_layer_label{display:inline-block;font-size:13px;width:80%}.wds_sub_active .wds_tab_remove{cursor:pointer !important;opacity:1;filter:Alpha(opacity=100)}.wds_box.wds_sub_active,.wds_box.wds_active{display:block}.wds_tab_label{display:block;width:inherit}.wds_box{display:none;margin-top:0 !important;position:relative;top:-1px}.wds_box{border:1px solid #dfdfdf;border-radius:3px;box-shadow:0 0 10px #f2f2f2;margin-top:15px;position:relative}.wds_clear{clear:both;float:none !important}.wds_box thead td{border-bottom:0 none !important}.wds_box tbody{background-color:#fff;border-top:0 none;padding-left:10px}.wds_box thead{background:-webkit-linear-gradient(#f5f5f5,#fff);background:-o-linear-gradient(#f5f5f5,#fff);background:-moz-linear-gradient(#f5f5f5,#fff);background:linear-gradient(#f5f5f5,#fff);border-top:0 none;border-bottom:0 none;color:#333;font:bold 12px/29px Arial,serif;height:29px;margin:0;padding:0 10px;text-align:left;text-shadow:0 1px 0 #fff}.wds_box table{border-collapse:collapse;border-spacing:0;width:100%}.wds_nav_tabs{background-color:#f5f5f5;border-right:1px solid #dfdfdf;float:left;height:640px;margin:0;width:150px}.wds_nav_tabs ul{list-style:none outside none;margin:10px 0;padding:0}.wds_nav_tabs .wds_sub_active,.wds_nav_tabs .wds_sub_active a,.wds_nav_tabs .wds_sub_active a:hover,.wds_nav_tabs .wds_active,.wds_nav_tabs .wds_active a,.wds_nav_tabs .wds_active a:hover{background:none repeat scroll 0 0 #fff;color:#333}.wds_nav_tabs .wds_active{border-color:#dfdfdf;border-width:1px 0 1px 1px;border-style:solid;margin:0 -1px 0 -4px;padding:0}.wds_nav_tabs li{border-color:transparent;border-style:solid;border-width:1px 0;list-style-type:none;margin-bottom:0}.wds_nav_tabs a{display:block;line-height:18px;padding:5px 5px 5px 12px;text-decoration:none}.wds_nav_box{background:none repeat scroll 0 0 #fff;display:none;height:610px;overflow:auto;padding:15px}.wds_nav_box.wds_active{display:block}.wds_layer_head{background-color:#f5f5f5;border-bottom:1px solid #dfdfdf;border-top:1px solid #dfdfdf;cursor:pointer;padding:5px}.wds_layer_head .handle{cursor:move;display:inline-block;margin:5px}.wds_box td{padding:10px !important}.wds_draggable{box-sizing:border-box;cursor:move}.wds_box .color{width:60px}.wds_active_layer{box-shadow:#2c2424 0 0 5px;border-radius:3px}.wds_draggable a,.wds_draggable a:hover{color:inherit !important;font-size:inherit !important;font-style:inherit !important;font-weight:inherit !important;text-decoration:none}#add_embed_help{height:200px;width:672px;top:40%}#add_embed input[type="text"]{width:500px}.wds_buttons{float:right;font-weight:normal;position:relative}.wds_reset_button{display:none;font-weight:normal;margin:10px 0;position:absolute;right:40px;z-index:1}#wdi_save_feed .two .section_col{width:47%;float:left;margin:0 1.5% 18px}#wdi_save_feed .wdi_element{margin:0 0 18px}#wdi_save_feed .half .wdi_element,#wdi_save_feed .one .wdi_element{width:96%;float:none;margin:0 2% 20px}.wdi_element_name_liked_feed{display:none !important}#wdi_save_feed .wdi_element p{margin:2px 0 0}.wdi_section_name{font-size:19px;margin:0 auto 15px;width:100%;box-sizing:border-box;padding:15px;border-bottom:1px solid #f1f1f1;color:#444;cursor:pointer}.wdi_section{border:1px solid #dedede;margin-bottom:20px;background:#fff}.wdi_section .optioninput *{text-align:left}.wdi_section.half{width:49%;float:left;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wdi_buttons{text-align:right;margin-top:7px}.wdi_tab .wdi_section.half:last-child{margin-left:2%}#how_to_publish_tab .wdi_howto_container{display:flex;flex-wrap:wrap}#how_to_publish_tab .wdi_howto_content{border:1px #ddd solid;display:flex;flex:1;flex-direction:column;margin:5px;min-width:250px;max-width:calc(25% - 20px);padding:20px 10px;text-align:center}#how_to_publish_tab .wdi_howto_container h2{font-size:23px;font-weight:normal;line-height:29px;margin:0;padding:11px 15px 4px 0}#how_to_publish_tab .wdi_howto_container .wdi_howto_content input{margin:0 auto;text-align:center;width:100%}.wdi_buttons button.button.preview-button{height:28px}@media(max-width:782px){.wdi_buttons button.button.preview-button{height:auto}}@media(min-width:768px){.wdi_border_wrapper .wdi_element_content{width:100%;display:block}.wdi_border_wrapper .wdi_element_title{display:block}.wdi_border_wrapper .wdi_element_content input[type=text]:not(.wp-color-picker){width:calc(100% - 30px);height:28px}.wdi_border_wrapper .wdi_element_content input#wdi_add_user_ajax_input{width:calc(100% - 78px)}.wdi_border_wrapper .wdi_element_content input[type=number]{width:calc(100% - 30px)}.wdi_border_wrapper .wdi_element_content select{width:calc(100% - 30px)}}@media(max-width:768px){#wdi_save_feed .two .section_col{width:96%;float:none;margin:0 2% 18px}.wdi_section.half{width:100%;float:none;margin:0 0 20px 0 !important}}.wdi_section_close::before{content:"\f142";display:inline-block;font:400 20px/1 dashicons;speak:none;float:right;cursor:pointer}.wdi_section_open::before{content:"\f140";display:inline-block;font:400 20px/1 dashicons;speak:none;float:right;cursor:pointer}.wdi-page-header{width:98%;padding:10px}.wdi-page-header .wdi_buttons{float:right}.wdi-page-header .WDI_title_input{padding:3px 8px;font-size:1.7em;line-height:100%;height:1.5em;width:30%;outline:0;margin:0 0 3px;background-color:#fff}.wdi_demo_img{margin-top:20px}#wdi_feed_form .wd-page-title.wd-header{width:100%;padding:10px 0}@media screen and (max-width:782px){#wdi_feed_form p.search-box{margin-bottom:0}#wdi_feed_form p.search-box input[type="search"]{width:100%;height:auto !important}#wdi_feed_form p.search-box input[type="button"]{margin-bottom:10px;padding:6px 14px;line-height:normal;font-size:14px;height:auto}.wdi-page-header .WDI_title_input{width:60%}.wdi-page-header .wdi_buttons{float:none;text-align:center}}.wdi_reset_cache_success{float:right}#wdi_reset_cache{float:right}body.toplevel_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(4),body.toplevel_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(5){display:none}body.instagram-feed_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(3){display:table-row !important}body.instagram-feed_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(4){display:table-row !important}
js/wdi_admin.js CHANGED
@@ -663,6 +663,7 @@ wdi_controller.makeInstagramUserRequest = function(user_input, ignoreConfirm) {
663
 
664
  var tagname = user_input.substr(1, user_input.length);
665
  tagname = tagname.replace(" ",'');
 
666
  this.instagram.getTagRecentMedia(tagname, {
667
  success: function(response) {
668
  jQuery('#wdi_add_user_ajax').removeAttr('disabled');
@@ -713,7 +714,7 @@ wdi_controller.makeInstagramUserRequest = function(user_input, ignoreConfirm) {
713
  }
714
 
715
  }
716
- });
717
 
718
  break;
719
  }
@@ -850,6 +851,7 @@ wdi_controller.removeFeedUser = function($this) {
850
  }
851
  }
852
 
 
853
  }
854
 
855
 
@@ -1106,8 +1108,27 @@ wdi_controller.addHashtag = function(tagname, response) {
1106
 
1107
  wdi_controller.saveFeedAfterAjaxWait(true);
1108
 
 
 
1109
  }
1110
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1111
 
1112
  /**
1113
  * Adds given user to internal array wdi_controller.feed_users and also updates GUI
663
 
664
  var tagname = user_input.substr(1, user_input.length);
665
  tagname = tagname.replace(" ",'');
666
+ var radio = jQuery("input[name='wdi_feed_settings[hashtag_top_recent]']:checked").val();
667
  this.instagram.getTagRecentMedia(tagname, {
668
  success: function(response) {
669
  jQuery('#wdi_add_user_ajax').removeAttr('disabled');
714
  }
715
 
716
  }
717
+ },null,radio);
718
 
719
  break;
720
  }
851
  }
852
  }
853
 
854
+ wdi_controller.changed_users();
855
  }
856
 
857
 
1108
 
1109
  wdi_controller.saveFeedAfterAjaxWait(true);
1110
 
1111
+ wdi_controller.changed_users();
1112
+
1113
  }
1114
 
1115
+ wdi_controller.changed_users = function () {
1116
+ var has_hashtag = false;
1117
+ for (var i = 0; i < this.feed_users.length; i++) {
1118
+ if (this.feed_users[i].username[0] === '#') {
1119
+ has_hashtag = true;
1120
+ break;
1121
+ }
1122
+ }
1123
+
1124
+ if(has_hashtag){
1125
+ jQuery('.wdi_element_name_hashtag_top_recent').show();
1126
+ }else{
1127
+ jQuery('.wdi_element_name_hashtag_top_recent').hide();
1128
+ }
1129
+ };
1130
+
1131
+
1132
 
1133
  /**
1134
  * Adds given user to internal array wdi_controller.feed_users and also updates GUI
js/wdi_admin.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(){jQuery("#wdi_reset_cache").click(function(c){jQuery(".wdi_reset_cache_success").remove();c.preventDefault();jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_nonce:wdi_ajax.wdi_nonce,action:"wdi_set_reset_cache"},success:function(d){if(d.success===false){jQuery("#wdi_reset_cache").before("<span class='wdi_reset_cache_success' style='color: #fc0000; margin-left: 15px; line-height: 2;'>Failed</span>")}else{jQuery("#wdi_reset_cache").before("<span class='wdi_reset_cache_success' style='color: #029117; margin-left: 15px; line-height: 2;'>Success</span>")}}})});wdi_controller.bindSaveFeedEvent();wdi_controller.bindAddNewUserOrHashtagEvent();jQuery(".display_type input").on("click",function(){wdi_controller.displaySettingsSection(jQuery(this))});wdi_controller.conditionalFiltersTabInit();wdi_controller.bindSaveThemeEvent();jQuery("#wdi_add_user_ajax").after(jQuery("<br><label class='wdi_pro_only' for='wdi_add_user_ajax_input'>"+wdi_messages.username_hashtag_multiple+"</label>"));if(jQuery("body").hasClass("instagram-feed_page_wdi_settings")){wdi_multiple_accounts_option_controller();wdi_advanced_option_controller()}jQuery(".wdi_section_name").click(function(){b(jQuery(this))});b(false);function b(f){if(f===false){var d={wdi_layout_section:"show",wdi_media:"show",wdi_layout:"hide",wdi_advanced:"hide",wdi_lightbox_general:"show",wdi_lightbox_advanced:"hide",wdi_conditional_filters:"show",wdi_how_to_publish:"show"};var g=JSON.parse(localStorage.getItem("wdi_sections"));if(g===null||g===false){g=d;localStorage.setItem("wdi_sections",JSON.stringify(g))}for(i in g){var j=jQuery("#wdi_save_feed").find("[data-section_name='"+i+"']");a(g[i],j)}}else{var c=jQuery(f).data("section_name");var h=null;if(f.hasClass("wdi_section_open")){a("show",f);h="show"}else{if(f.hasClass("wdi_section_close")){a("hide",f);h="hide"}}if(h!=null){var e=JSON.parse(localStorage.getItem("wdi_sections"))||{};e[c]=h;localStorage.setItem("wdi_sections",JSON.stringify(e))}}}function a(e,d){if(e==="show"){var c=d.closest(".wdi_section").find(".wdi_elements");if(c.data("display")==="table"){c.css({display:"table"})}else{c.css({display:"block"})}d.css({"border-bottom":"1px solid #f1f1f1",margin:"0 auto 15px"});d.removeClass("wdi_section_open");d.addClass("wdi_section_close")}else{d.closest(".wdi_section").find(".wdi_elements").css({display:"none"});d.css({"border-bottom":"0px",margin:"0 auto 0px"});d.removeClass("wdi_section_close");d.addClass("wdi_section_open")}}});function wdi_multiple_accounts_option_controller(){var b=jQuery(jQuery("#wdi_user_id").closest("form").find(".form-table").get(1));b.addClass("wdi_multiple_accounts_section");var d="";var e=JSON.parse(wdi_options.wdi_authenticated_users_list);var a=0;for(var c in e){d+="<tr data-multiple-account='"+a+"'>";d+="<th>Access Token</th>";d+='<td><input type="text" name="wdi_instagram_options[wdi_authenticated_users_list][access_token][]" size="53" required="" value="'+e[c].access_token+'"></td>';d+="</tr>";d+="<tr data-multiple-account='"+a+"' class='wdi_username_tr'>";d+="<th>Username</th>";d+='<td><div class="wdi_input_wrapper"><input type="text" name="wdi_instagram_options[wdi_authenticated_users_list][user_name][]" size="53" required="" value="'+e[c].user_name+'"></div><div class="wdi_remove_auth_user">Delete</div></td>';d+='<input type="hidden" name="wdi_instagram_options[wdi_authenticated_users_list][user_id][]" size="53" required="" value="'+e[c].user_id+'">';d+="</tr>";a++}b.append(d);jQuery(".wdi_remove_auth_user").on("click",function(g){g.preventDefault();var f=jQuery(this).closest(".wdi_username_tr").data("multiple-account");jQuery(this).closest(".wdi_multiple_accounts_section").find('tr[data-multiple-account="'+f+'"]').remove();return false})}function wdi_advanced_option_controller(){var a=jQuery(jQuery("#wdi_user_id").closest("form").find(".form-table").get(1));a.addClass("wdi_advanced_option wdi_advanced_option_close");var b="<tr class='wdi_advanced_option_head'><th style='width: 100%;'>ADVANCED OPTIONS AND MULTIPLE INSTAGRAM ACCOUNTS</th><td><div class='wdi_advanced_option_icon'></div></td></tr>";$tr=jQuery(b);a.prepend($tr);$tr.on("click",function(){if(a.hasClass("wdi_advanced_option_open")){a.removeClass("wdi_advanced_option_open");a.addClass("wdi_advanced_option_close")}else{a.removeClass("wdi_advanced_option_close");a.addClass("wdi_advanced_option_open")}})}function wdi_controller(){}wdi_controller.getParameterByName=function(a){a=a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var c=new RegExp("[\\?&]"+a+"=([^&#]*)"),b=c.exec(location.search);return b===null?"":decodeURIComponent(b[1].replace(/\+/g," "))};wdi_controller.apiRedirected=function(){var d=this.getParameterByName("access_token");var a=d.split(".");var b=/^[^\\\/&?><"']*$/;for(i=0;i<a.length;i++){if(a[i].match(b)===null){return}}var c=a.join(".");jQuery(document).ready(function(){if(wdi_options.wdi_access_token===""){jQuery("#wdi_access_token").attr("value",c)}else{jQuery(".wdi_more_token_template .wdi_more_access_token").prop("disabled",false);jQuery(".wdi_more_token_template .wdi_more_access_token").attr("value",c)}});wdi_controller.instagram.addToken(c);wdi_controller.getUserInfo(c)};wdi_controller.getUserInfo=function(a){this.instagram.getSelfInfo({success:function(b){if(wdi_options.wdi_access_token===""){jQuery("#wdi_user_name").attr("value",b.data["username"]);jQuery("#wdi_user_id").attr("value",b.data["id"])}else{jQuery(".wdi_more_token_template .wdi_more_user_name").prop("disabled",false);jQuery(".wdi_more_token_template .wdi_more_user_id").prop("disabled",false);jQuery(".wdi_more_token_template .wdi_more_user_name").attr("value",b.data["username"]);jQuery(".wdi_more_token_template .wdi_more_user_id").attr("value",b.data["id"])}jQuery(document).trigger("wdi_settings_filled")}})};wdi_controller.oldDisplayType={};wdi_controller.displayTypeMemory={};wdi_controller.switchFeedTabs=function(d,b){jQuery("#wdi_refresh_tab").attr("value",d);jQuery(".wdi_tab").hide();jQuery("#"+d+"_tab").show();jQuery(".display_type").css("display","none");jQuery('.display_type[tab="'+d+'"]').css("display","block");if(!jQuery('.display_type[tab="'+d+'"]').length){jQuery(".display_type_content").hide()}else{jQuery(".display_type_content").show()}jQuery(".wdi_feed_tabs").filter(".wdi_feed_tab_active").each(function(){jQuery(this).removeClass("wdi_feed_tab_active")});jQuery("#wdi_"+d).addClass("wdi_feed_tab_active");var a=jQuery();var c=false;if(b!=undefined&&b!=""){a=jQuery(".display_type #"+b).prop("checked",true);jQuery("#wdi_feed_type").attr("value",b)}if(!c){a=jQuery('.display_type[tab="'+d+'"] input[name="feed_type"]:checked');if(a.length!=0){c=true}}if(!c){a=jQuery('.display_type[tab="'+d+'"] #thumbnails');if(a.length!=0){c=true;a.prop("checked",true);jQuery("#wdi_feed_type").attr("value","thumbnails")}}if(c){wdi_controller.displaySettingsSection(a)}if(d!="conditional_filters"){jQuery("#wdi-conditional-filters-ui").addClass("wdi_hidden")}else{jQuery("#wdi-conditional-filters-ui").removeClass("wdi_hidden")}};wdi_controller.displaySettingsSection=function(h){var d=h.attr("id").toLowerCase().trim();var g=h.parent().parent().attr("tab");var a=jQuery("#wdi_refresh_section");wdi_controller.oldDisplayType={section:d,tab:g};wdi_controller.displayTypeMemory[g]=wdi_controller.oldDisplayType;if(a!=undefined){a.attr("value",d)}var f=jQuery(".wdi_border_wrapper .form-table");jQuery("#wdi_feed_type").attr("value",d);var e=0,c=0;var b=false;f.find(".wdi_element").each(function(){e++;var j=jQuery(this).find(".wdwt_param").children().children().children().attr("section");if(j!==undefined){b=false;var k=j.toLowerCase().trim().split(",");for(c=0;c<k.length;c++){if(k[c]===d){jQuery(this).css("display","block");b=true}}if(b===false){jQuery(this).css("display","none")}}})};wdi_controller.switchThemeTabs=function(b,a){jQuery(".wdi_feed_tabs").filter(".wdi_feed_tab_active").each(function(){jQuery(this).removeClass("wdi_feed_tab_active")});jQuery("#wdi_"+b).addClass("wdi_feed_tab_active");jQuery("[tab]").each(function(){if(jQuery(this).attr("tab")!=b){jQuery(this).parent().parent().parent().parent().parent().filter("tr").css("display","none")}else{jQuery(this).parent().parent().parent().parent().parent().filter("tr").css("display","block")}});jQuery(".display_type").css("display","none");jQuery('.display_type[tab="'+b+'"]').css("display","block");jQuery("#wdi_refresh_tab").attr("value",b);if(a!=undefined&&a!=""){jQuery("#wdi_refresh_section").attr("value",a)}if(a==undefined&&a!=""){if(wdi_controller.displayTypeMemory[b]!=undefined){jQuery(".display_type #"+wdi_controller.displayTypeMemory[b]["section"]).trigger("click")}else{jQuery('.display_type[tab="'+b+'"]').first().find("input").trigger("click")}}else{jQuery(".display_type #"+a).trigger("click")}};wdi_controller.bindSaveFeedEvent=function(){var a=this;jQuery("#wdi_save_feed_submit").on("click",function(){a.save_feed("save_feed")});jQuery("#wdi_save_feed_apply").on("click",function(){a.save_feed("apply_changes")});jQuery("#wdi_cancel_changes").on("click",function(){a.save_feed("cancel")})};wdi_controller.save_feed=function(d){if("cancel"==d){window.location=window.location.href}wdi_controller.checkIfUserNotSaved(d);if(wdi_controller.waitingAjaxRequestEnd.button!=0){return}jQuery("#task").attr("value",d);var a=this.feed_users,b,c,f,j,h,e={username:jQuery("#wdi_default_user").val(),id:jQuery("#wdi_default_user_id").val()};if(a.length==0){a.push(e);this.updateFeaturedImageSelect(e.username,"add","selected")}b=this.stringifyUserData(a);jQuery("#WDI_feed_users").val(b);if(d=="apply_changes"||d=="save_feed"){c=jQuery("#wdi_add_or_edit").attr("value");jQuery("#wdi_current_id").attr("value",c)}f=jQuery("#WDI_thumb_user").val();h=this.getUserProfilePic(f);if("false"==h||typeof h=="undefined"){var g=this;this.instagram.getSelfInfo({success:function(m){var l=g.isValidResponse(m),k=m.data,n;if(l.valid&&g.hasData(m)&&k){n=k.profile_picture}else{n=""}}});jQuery("#wdi_feed_thumb").attr("value",h);jQuery("#wdi_save_feed").submit()}else{jQuery("#wdi_feed_thumb").attr("value",h);jQuery("#wdi_save_feed").submit()}};wdi_controller.makeInstagramUserRequest=function(d,b){var l,a,h=this,e;a=this.getInputType(d);if(wdi_version.is_pro=="false"){if(jQuery(".wdi_user").length==1){alert(wdi_messages.only_one_user_or_hashtag);return false}}var k=a==="hashtag";var g=a==="user";for(var f in h.feed_users){if(h.feed_users[f].username.charAt(0)==="#"){k=true}else{g=true}if(g&&k){alert("You can add only username or hashtags.");return false}}switch(a){case"user":if(typeof wdi_options.wdi_access_token==="undefined"||wdi_options.wdi_access_token===""){alert("To display your feed media , get Instagram API token from settings page.");return false}if(h.feed_users.length>0){alert("You can add only one username");return false}var c="";if(d===wdi_options.wdi_user_name){c=wdi_options.wdi_access_token}else{if(typeof h.users_list[d]!=="undefined"){c=h.users_list[d].access_token}else{alert("You can add only your usernames ( "+h.usersnames.join(", ")+" )");return false}}this.instagram.resetTokens();this.instagram.addToken(c);this.instagram.getSelfInfo({success:function(o){jQuery("#wdi_add_user_ajax").removeAttr("disabled");var n=h.isValidResponse(o);if(n.valid==false){alert(n.msg);return}var m=o.data;if(n.valid&&h.hasData(o)){h.addUser(m)}else{if(!m){alert(wdi_messages.user_not_exist.replace("%s",'"'+d+'"'))}else{alert(n.msg)}}}});break;case"hashtag":if(typeof wdi_options.fb_token==="undefined"||wdi_options.fb_token===""){alert("To display hashtag media , get Facebook API token from settings page.");return false}var j=d.substr(1,d.length);j=j.replace(" ","");this.instagram.getTagRecentMedia(j,{success:function(n){jQuery("#wdi_add_user_ajax").removeAttr("disabled");var m=h.isValidResponse(n);if(m.valid&&h.hasData(n)){h.addHashtag(j,n);if(wdi_version.is_pro=="false"){if(jQuery(".wdi_user").length==1){jQuery("#wdi_add_user_ajax_input").attr("disabled","disabled");jQuery("#wdi_add_user_ajax_input").attr("placeholder",wdi_messages.available_in_pro)}}}else{if(!h.hasData(n)&&m.msg=="success"){if(b!=true){if(confirm(wdi_messages.hashtag_no_data)){h.addHashtag(j,n);if(wdi_version.is_pro=="false"){if(jQuery(".wdi_user").length==1){jQuery("#wdi_add_user_ajax_input").attr("disabled","disabled");jQuery("#wdi_add_user_ajax_input").attr("placeholder",wdi_messages.available_in_pro)}}}else{jQuery("#wdi_add_user_ajax_input").val("")}}else{h.addHashtag(j,n);if(wdi_version.is_pro=="false"){if(jQuery(".wdi_user").length==1){jQuery("#wdi_add_user_ajax_input").attr("disabled","disabled");jQuery("#wdi_add_user_ajax_input").attr("placeholder",wdi_messages.available_in_pro)}}}}else{alert(m.msg)}}}});break}};wdi_controller.checkForDuplicateUser=function(b){for(var a=0;a<this.feed_users.length;a++){if(b==this.feed_users[a]["username"]){return true}}return false};wdi_controller.getInputType=function(a){switch(a[0]){case"#":return"hashtag";break;case"%":return"location";break;default:return"user";break}};wdi_controller.stringifyUserData=function(a){var c=[];for(var b=0;b<a.length;b++){c.push({username:a[b]["username"],id:a[b]["id"],tag_id:(typeof a[b]["tag_id"]!=="undefined")?a[b]["tag_id"]:""})}return JSON.stringify(c)};wdi_controller.bindAddNewUserOrHashtagEvent=function(){jQuery("#wdi_add_user_ajax").on("click",function(){if(typeof jQuery(this).attr("disabled")!=="undefined"){return}else{jQuery(this).attr("disabled","disabled")}var a=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase();if(wdi_controller.makeInstagramUserRequest(a)===false){jQuery(this).removeAttr("disabled","disabled")}});jQuery("#wdi_add_user_ajax_input").on("keypress",function(b){if(b.keyCode==13){var a=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase();if(typeof jQuery("#wdi_add_user_ajax").attr("disabled")!=="undefined"){return}else{jQuery("#wdi_add_user_ajax").attr("disabled","disabled")}if(wdi_controller.makeInstagramUserRequest(a)===false){jQuery("#wdi_add_user_ajax").removeAttr("disabled","disabled")}return false}})};wdi_controller.removeFeedUser=function(b){var c=b.parent().find("a span").text();if(b.parent().find("a span").hasClass("wdi_hashtag")){c="#"+c}for(var a=0;a<this.feed_users.length;a++){if(this.feed_users[a]["username"]==c){this.feed_users.splice(a,1);break}}b.parent().remove();if(c!==jQuery("#wdi_default_user").val()){wdi_controller.updateFeaturedImageSelect(c,"remove")}if(wdi_version.is_pro=="false"){if(jQuery(".wdi_user").length==0){jQuery("#wdi_add_user_ajax_input").removeAttr("disabled");jQuery("#wdi_add_user_ajax_input").attr("placeholder","")}}};wdi_controller.updateFeaturedImageSelect=function(f,e,d){var a=jQuery("#WDI_thumb_user");if(d!="selected"){d=""}switch(e){case"add":var b=a.find('option[value="'+f+'"]').length;if(!b){var c=jQuery("<option "+d+' value="'+f+'">'+f+"</option>");a.append(c)}break;case"remove":a.find('option[value="'+f+'"]').remove();if(this.feed_users.length>0){a.val(this.feed_users[0].username)}break}};wdi_controller.bindSaveThemeEvent=function(){jQuery("#wdi_save_theme_submit").on("click",function(){jQuery("#task").attr("value","save_feed");jQuery("#wdi_save_feed").submit()});jQuery("#wdi_save_theme_apply").on("click",function(){jQuery("#task").attr("value","apply_changes");var a=jQuery("#wdi_add_or_edit").attr("value");jQuery("#wdi_current_id").attr("value",a);jQuery("#wdi_save_feed").submit()});jQuery("#wdi_save_theme_reset").on("click",function(){jQuery("#task").attr("value","reset_changes");var a=jQuery("#wdi_add_or_edit").attr("value");jQuery("#wdi_current_id").attr("value",a);jQuery("#wdi_save_feed").submit()})};wdi_controller.checkIfUserNotSaved=function(b){switch(b){case"save_feed":b="submit";break;case"apply_changes":b="apply";break;case"reset_changes":b="reset";break}if(jQuery("#wdi_add_user_ajax_input").val().trim()!=""){var a=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase();wdi_controller.waitingAjaxRequestEnd={button:b};wdi_controller.makeInstagramUserRequest(a);return 1}else{wdi_controller.waitingAjaxRequestEnd={button:0};return 0}};wdi_controller.saveFeedAfterAjaxWait=function(b){if(wdi_controller.waitingAjaxRequestEnd!=undefined){var a=wdi_controller.waitingAjaxRequestEnd.button;if(b&&a!=0){jQuery("#wdi_save_feed_"+a).trigger("click")}wdi_controller.waitingAjaxRequestEnd=undefined}};wdi_controller.getCookie=function(a){var b="; "+document.cookie;var c=b.split("; "+a+"=");if(c.length==2){return c.pop().split(";").shift()}};wdi_controller.isValidResponse=function(a){var b={};if(typeof a=="undefined"||typeof a.meta["code"]=="undefined"||a.meta["code"]!=200){b.valid=false;if(typeof a=="undefined"){b.msg=wdi_messages.instagram_server_error}else{if(a.meta["code"]!==200){b.msg=a.meta["error_message"]}else{b.msg=""}}}else{b.valid=true;b.msg="success"}return b};wdi_controller.hasData=function(a){if(typeof a!="undefined"&&typeof a.data!="undefined"&&a.data.length!=0){return true}else{return false}};wdi_controller.thumbUser=function(a){return(this.feed_users.length>0&&this.feed_users[0].username===a)};wdi_controller.findUser=function(d,a){var c=[];if(typeof a!="undefined"&&typeof a.data!="undefined"){c=a.data}for(var b=0;b<c.length;b++){if(c[b]["username"]==d){return c[b]}}return false};wdi_controller.addHashtag=function(e,c){if(e.match(/[~!@$%&*#^()<>?]/)==null){if(this.checkForDuplicateUser("#"+e)==false){var b=jQuery('<div class="wdi_user"><a target="_blank" href="https://instagram.com/explore/tags/'+e+'"><img class="wdi_profile_pic" src="'+wdi_url.plugin_url+'/images/hashtag.png"><span class="wdi_hashtag">'+e+'</span><i style="display:table-cell;width:25px;"></i></a><img class="wdi_remove_user" onclick="wdi_controller.removeFeedUser(jQuery(this))" src="'+wdi_url.plugin_url+'/images/delete_user.png"></div>');jQuery("#wdi_feed_users").append(b);jQuery("#wdi_add_user_ajax_input").attr("value","");var d;if(typeof c!="undefined"){d=(c.data.length!=0&&typeof c.data[0]["images"]["thumbnail"]!=="undefined")?c.data[0]["images"]["thumbnail"]["url"]:""}else{d=""}this.feed_users.push({username:"#"+e,id:"#"+e,profile_picture:d,tag_id:c.tag_id});var a="#"+e;selected=this.thumbUser(a)?"selected":"";wdi_controller.updateFeaturedImageSelect(a,"add",selected)}else{alert("#"+e+" "+wdi_messages.already_added)}}else{alert(wdi_messages.invalid_hashtag)}this.updateConditionalFiltersUi();wdi_controller.saveFeedAfterAjaxWait(true)};wdi_controller.addUser=function(a){if(this.checkForDuplicateUser(a.username)==false){newUser=jQuery('<div class="wdi_user"><a target="_blank" href="http://www.instagram.com/'+a.username+'"><img class="wdi_profile_pic" src="'+a.profile_picture+'"><span class="wdi_username">'+a.username+'</span><i style="display:table-cell;width:25px;"></i></a><img class="wdi_remove_user" onclick="wdi_controller.removeFeedUser(jQuery(this))" src="'+wdi_url.plugin_url+'/images/delete_user.png"></div>');jQuery("#wdi_feed_users").append(newUser);jQuery("#wdi_add_user_ajax_input").attr("value","");this.feed_users.push({username:a.username,id:a.id,profile_picture:a.profile_picture})}else{alert(a.username+" "+wdi_messages.already_added)}selected=this.thumbUser(a.username)?"selected":"";this.updateFeaturedImageSelect(a.username,"add",selected);this.updateConditionalFiltersUi();wdi_controller.saveFeedAfterAjaxWait(true)};wdi_controller.getUserProfilePic=function(b){for(var a=0;a<this.feed_users.length;a++){if(b==this.feed_users[a]["username"]){return this.feed_users[a]["profile_picture"]}}return"false"};wdi_controller.conditionalFiltersTabInit=function(){this.setInitialFilters();this.updateFiltersUi();var b=this;jQuery("#wdi_add_filter").on("click",function(){b.addConditionalFilter();jQuery("#wdi_filter_input").val("")});jQuery(".wdi_filter_radio").on("click",function(){jQuery("#wdi_filter_input").trigger("focus")});jQuery("#wdi_filter_input").on("keypress",function(c){if(c.keyCode==13){b.addConditionalFilter();jQuery(this).val("");return false}});a();jQuery("#WDI_wrap_conditional_filter_enable input").on("change",function(){a()});function a(){switch(jQuery("#WDI_wrap_conditional_filter_enable input:checked").val()){case"0":jQuery("#WDI_conditional_filters").parent().parent().addClass("wdi_hidden");jQuery("#WDI_conditional_filter_type").parent().parent().parent().parent().parent().addClass("wdi_hidden");jQuery("#wdi_final_condition").addClass("wdi_hidden");jQuery("#WDI_filter_source").addClass("wdi_hidden");break;case"1":jQuery("#WDI_conditional_filters").parent().parent().removeClass("wdi_hidden");jQuery("#WDI_conditional_filter_type").parent().parent().parent().parent().parent().removeClass("wdi_hidden");jQuery("#wdi_final_condition").removeClass("wdi_hidden");jQuery("#WDI_filter_source").removeClass("wdi_hidden");break}}jQuery("#WDI_conditional_filter_type").on("change",function(){if(jQuery(this).val()=="none"){}else{jQuery("#WDI_conditional_filters").css("display","block")}jQuery(this).parent().find("label").css({"line-height":"24px",height:"24px",padding:"2px 5px",display:"inline-block","font-size":"15px",color:"black","font-weight":"500","-webkit-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","-o-user-select":"none","user-select":"none"});switch(jQuery(this).val()){case"AND":jQuery("#WDI_conditional_filters").css("display","block");jQuery(this).parent().find("label").html(wdi_messages.and_descr);break;case"OR":jQuery("#WDI_conditional_filters").css("display","block");jQuery(this).parent().find("label").html(wdi_messages.or_descr);break;case"NOR":jQuery("#WDI_conditional_filters").css("display","block");jQuery(this).parent().find("label").html(wdi_messages.nor_descr);break}wdi_controller.updateFiltersUi()});jQuery("#WDI_conditional_filter_type").trigger("change")};wdi_controller.addConditionalFilter=function(){var b=jQuery("#wdi_filter_input").val(),a=jQuery("#wdi_filter_type").val(),c={};if(b==""){return}b=b.trim();switch(a){case"username":if(b[0]=="@"){b=b.substr(1,b.length)}break;case"mention":if(b[0]=="@"){b=b.substr(1,b.length)}break;case"hashtag":if(b[0]=="#"){b=b.substr(1,b.length)}break;case"url":var d=/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i;if(!d.test(b)){alert(wdi_messages.invalid_url);return}break}c={filter_type:a,filter_by:b,id:this.randomId()};if(a!=null){if(!this.filterExists(c)){this.conditionalFilters.push(c);this.updateFiltersUi()}else{alert(b+" "+wdi_messages.already_added)}}else{alert(wdi_messages.selectConditionType)}};wdi_controller.filterExists=function(b){for(var a=0;a<this.conditionalFilters.length;a++){if(this.conditionalFilters[a].filter_type==b.filter_type&&this.conditionalFilters[a].filter_by==b.filter_by){return true}}return false};wdi_controller.updateFiltersUi=function(){var a=jQuery("#wdi_filters_ui").html("");for(var b=0;b<this.conditionalFilters.length;b++){if(b==0){if(this.conditionalFilters.length!=1){switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":break;case"OR":a.append(jQuery('<span class="wdi_logic">'+wdi_messages.either+"</span>"));break;case"NOR":a.append(jQuery('<span class="wdi_logic">'+wdi_messages.neither+"</span>"));break}}else{switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":break;case"OR":break;case"NOR":a.append(jQuery('<span class="wdi_logic">'+wdi_messages.not+"</span>"));break}}}var c;switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":c=wdi_messages.and;break;case"OR":c=wdi_messages.or;break;case"NOR":c=wdi_messages.nor;break}if(b>=1){a.append(jQuery('<span class="wdi_logic">'+c+"</span>"))}a.append(this.createUiElement(this.conditionalFilters[b]))}this.updateFilterTextarea()};wdi_controller.createUiElement=function(b){var c;switch(b.filter_type){case"mention":c="@";break;case"hashtag":c="#";break;case"location":c="%";break;default:c="";break}var a=jQuery('<span data-id="'+b.id+'" class="wdi_filter_item wdi_filter_by_'+b.filter_type+'"></span>').html(c+b.filter_by+'<span onclick="wdi_controller.removeConditionalFilter(jQuery(this));" class="wdi_remove_filter">X</span>');return a};wdi_controller.randomId=function(){var c="";var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(var b=0;b<5;b++){c+=a.charAt(Math.floor(Math.random()*a.length))}return c};wdi_controller.removeConditionalFilter=function(b){var c=b.parent().attr("data-id");for(var a=0;a<this.conditionalFilters.length;a++){if(this.conditionalFilters[a]["id"]==c){this.conditionalFilters.splice(a,1)}}this.updateFiltersUi()};wdi_controller.updateFilterTextarea=function(){var a,b=this.conditionalFilters;a=JSON.stringify(b);jQuery("#wdi_conditional_filters_textarea").val(a)};wdi_controller.setInitialFilters=function(){var b=[],a=jQuery("#wdi_conditional_filters_textarea").val();if(this.isJsonString(a)){b=JSON.parse(a)}this.conditionalFilters=b};wdi_controller.updateConditionalFiltersUi=function(){wdi_controller.updateFilterSource()};wdi_controller.updateFilterSource=function(){if(jQuery('input[name="wdi_feed_settings[liked_feed]"]:checked').val()=="liked"){var a=jQuery("#wdi_filter_source").html("");var d="<div class='wdi_source_user'><span class='wdi_source_username'>Media I liked</span></div>";a.html(a.html()+d);return}var f=[],e,c;jQuery(".wdi_user").each(function(){if(jQuery(this).find(".wdi_username").length!=0){e=jQuery(this).find(".wdi_username").text()}else{e=jQuery(this).find(".wdi_hashtag").text()}c=jQuery(this).find("img").attr("src");f.push({username:e,image:c})});var a=jQuery("#wdi_filter_source").html("");for(var b=0;b<f.length;b++){var d="<div class='wdi_source_user'><span class='wdi_source_img'><img src='"+f[b].image+"'></span><span class='wdi_source_username'>"+f[b].username+"</span></div>";a.html(a.html()+d)}};wdi_controller.isJsonString=function(b){try{JSON.parse(b)}catch(a){return false}return true};function wdi_spider_select_value(a){a.focus();a.select()}function wdi_spider_set_input_value(b,a){if(a==="add"){if(jQuery("#wdi_access_token").attr("value")==""){alert("Please get your access token")}}if(document.getElementById(b)){document.getElementById(b).value=a}}function wdi_spider_form_submit(b,a){if(document.getElementById(a)){document.getElementById(a).submit()}if(b.preventDefault){b.preventDefault()}else{b.returnValue=false}}function wdi_bulk_actions(a){var b=jQuery(a).val();if(b!=""){if(b=="delete_all"){if(!confirm(wdi_messages.do_you_want_to_delete_selected_items)){return false}}wdi_spider_set_input_value("task",b);jQuery("#wdi_feed_form").submit()}else{return false}return true}function wdi_spider_check_all_items(){wdi_spider_check_all_items_checkbox();jQuery("#check_all").trigger("click")}function wdi_spider_check_all_items_checkbox(){if(jQuery("#check_all_items").attr("checked")){jQuery("#check_all_items").attr("checked",false);jQuery("#draganddrop").hide()}else{var b=(parseInt(jQuery(".displaying-num").html())?parseInt(jQuery(".displaying-num").html()):0);var a=(jQuery('input[id^="check_pr_"]').length?parseInt(jQuery('input[id^="check_pr_"]').length):0);var c=a+b;jQuery("#check_all_items").attr("checked",true);if(c){jQuery("#draganddrop").html("<strong><p>Selected "+c+" item"+(c>1?"s":"")+".</p></strong>");jQuery("#draganddrop").show()}}}function wdi_spider_check_all(a){if(!jQuery(a).attr("checked")){jQuery("#check_all_items").attr("checked",false);jQuery("#draganddrop").hide()}}function wdi_spider_set_input_value(b,a){if(a==="add"){if(jQuery("#wdi_access_token").attr("value")==""){alert("Please get your access token")}}if(document.getElementById(b)){document.getElementById(b).value=a}};
1
+ jQuery(document).ready(function(){jQuery("#wdi_reset_cache").click(function(c){jQuery(".wdi_reset_cache_success").remove();c.preventDefault();jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_nonce:wdi_ajax.wdi_nonce,action:"wdi_set_reset_cache"},success:function(d){if(d.success===false){jQuery("#wdi_reset_cache").before("<span class='wdi_reset_cache_success' style='color: #fc0000; margin-left: 15px; line-height: 2;'>Failed</span>")}else{jQuery("#wdi_reset_cache").before("<span class='wdi_reset_cache_success' style='color: #029117; margin-left: 15px; line-height: 2;'>Success</span>")}}})});wdi_controller.bindSaveFeedEvent();wdi_controller.bindAddNewUserOrHashtagEvent();jQuery(".display_type input").on("click",function(){wdi_controller.displaySettingsSection(jQuery(this))});wdi_controller.conditionalFiltersTabInit();wdi_controller.bindSaveThemeEvent();jQuery("#wdi_add_user_ajax").after(jQuery("<br><label class='wdi_pro_only' for='wdi_add_user_ajax_input'>"+wdi_messages.username_hashtag_multiple+"</label>"));if(jQuery("body").hasClass("instagram-feed_page_wdi_settings")){wdi_multiple_accounts_option_controller();wdi_advanced_option_controller()}jQuery(".wdi_section_name").click(function(){b(jQuery(this))});b(false);function b(f){if(f===false){var d={wdi_layout_section:"show",wdi_media:"show",wdi_layout:"hide",wdi_advanced:"hide",wdi_lightbox_general:"show",wdi_lightbox_advanced:"hide",wdi_conditional_filters:"show",wdi_how_to_publish:"show"};var g=JSON.parse(localStorage.getItem("wdi_sections"));if(g===null||g===false){g=d;localStorage.setItem("wdi_sections",JSON.stringify(g))}for(i in g){var j=jQuery("#wdi_save_feed").find("[data-section_name='"+i+"']");a(g[i],j)}}else{var c=jQuery(f).data("section_name");var h=null;if(f.hasClass("wdi_section_open")){a("show",f);h="show"}else{if(f.hasClass("wdi_section_close")){a("hide",f);h="hide"}}if(h!=null){var e=JSON.parse(localStorage.getItem("wdi_sections"))||{};e[c]=h;localStorage.setItem("wdi_sections",JSON.stringify(e))}}}function a(e,d){if(e==="show"){var c=d.closest(".wdi_section").find(".wdi_elements");if(c.data("display")==="table"){c.css({display:"table"})}else{c.css({display:"block"})}d.css({"border-bottom":"1px solid #f1f1f1",margin:"0 auto 15px"});d.removeClass("wdi_section_open");d.addClass("wdi_section_close")}else{d.closest(".wdi_section").find(".wdi_elements").css({display:"none"});d.css({"border-bottom":"0px",margin:"0 auto 0px"});d.removeClass("wdi_section_close");d.addClass("wdi_section_open")}}});function wdi_multiple_accounts_option_controller(){var b=jQuery(jQuery("#wdi_user_id").closest("form").find(".form-table").get(1));b.addClass("wdi_multiple_accounts_section");var d="";var e=JSON.parse(wdi_options.wdi_authenticated_users_list);var a=0;for(var c in e){d+="<tr data-multiple-account='"+a+"'>";d+="<th>Access Token</th>";d+='<td><input type="text" name="wdi_instagram_options[wdi_authenticated_users_list][access_token][]" size="53" required="" value="'+e[c].access_token+'"></td>';d+="</tr>";d+="<tr data-multiple-account='"+a+"' class='wdi_username_tr'>";d+="<th>Username</th>";d+='<td><div class="wdi_input_wrapper"><input type="text" name="wdi_instagram_options[wdi_authenticated_users_list][user_name][]" size="53" required="" value="'+e[c].user_name+'"></div><div class="wdi_remove_auth_user">Delete</div></td>';d+='<input type="hidden" name="wdi_instagram_options[wdi_authenticated_users_list][user_id][]" size="53" required="" value="'+e[c].user_id+'">';d+="</tr>";a++}b.append(d);jQuery(".wdi_remove_auth_user").on("click",function(g){g.preventDefault();var f=jQuery(this).closest(".wdi_username_tr").data("multiple-account");jQuery(this).closest(".wdi_multiple_accounts_section").find('tr[data-multiple-account="'+f+'"]').remove();return false})}function wdi_advanced_option_controller(){var a=jQuery(jQuery("#wdi_user_id").closest("form").find(".form-table").get(1));a.addClass("wdi_advanced_option wdi_advanced_option_close");var b="<tr class='wdi_advanced_option_head'><th style='width: 100%;'>ADVANCED OPTIONS AND MULTIPLE INSTAGRAM ACCOUNTS</th><td><div class='wdi_advanced_option_icon'></div></td></tr>";$tr=jQuery(b);a.prepend($tr);$tr.on("click",function(){if(a.hasClass("wdi_advanced_option_open")){a.removeClass("wdi_advanced_option_open");a.addClass("wdi_advanced_option_close")}else{a.removeClass("wdi_advanced_option_close");a.addClass("wdi_advanced_option_open")}})}function wdi_controller(){}wdi_controller.getParameterByName=function(a){a=a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var c=new RegExp("[\\?&]"+a+"=([^&#]*)"),b=c.exec(location.search);return b===null?"":decodeURIComponent(b[1].replace(/\+/g," "))};wdi_controller.apiRedirected=function(){var d=this.getParameterByName("access_token");var a=d.split(".");var b=/^[^\\\/&?><"']*$/;for(i=0;i<a.length;i++){if(a[i].match(b)===null){return}}var c=a.join(".");jQuery(document).ready(function(){if(wdi_options.wdi_access_token===""){jQuery("#wdi_access_token").attr("value",c)}else{jQuery(".wdi_more_token_template .wdi_more_access_token").prop("disabled",false);jQuery(".wdi_more_token_template .wdi_more_access_token").attr("value",c)}});wdi_controller.instagram.addToken(c);wdi_controller.getUserInfo(c)};wdi_controller.getUserInfo=function(a){this.instagram.getSelfInfo({success:function(b){if(wdi_options.wdi_access_token===""){jQuery("#wdi_user_name").attr("value",b.data["username"]);jQuery("#wdi_user_id").attr("value",b.data["id"])}else{jQuery(".wdi_more_token_template .wdi_more_user_name").prop("disabled",false);jQuery(".wdi_more_token_template .wdi_more_user_id").prop("disabled",false);jQuery(".wdi_more_token_template .wdi_more_user_name").attr("value",b.data["username"]);jQuery(".wdi_more_token_template .wdi_more_user_id").attr("value",b.data["id"])}jQuery(document).trigger("wdi_settings_filled")}})};wdi_controller.oldDisplayType={};wdi_controller.displayTypeMemory={};wdi_controller.switchFeedTabs=function(d,b){jQuery("#wdi_refresh_tab").attr("value",d);jQuery(".wdi_tab").hide();jQuery("#"+d+"_tab").show();jQuery(".display_type").css("display","none");jQuery('.display_type[tab="'+d+'"]').css("display","block");if(!jQuery('.display_type[tab="'+d+'"]').length){jQuery(".display_type_content").hide()}else{jQuery(".display_type_content").show()}jQuery(".wdi_feed_tabs").filter(".wdi_feed_tab_active").each(function(){jQuery(this).removeClass("wdi_feed_tab_active")});jQuery("#wdi_"+d).addClass("wdi_feed_tab_active");var a=jQuery();var c=false;if(b!=undefined&&b!=""){a=jQuery(".display_type #"+b).prop("checked",true);jQuery("#wdi_feed_type").attr("value",b)}if(!c){a=jQuery('.display_type[tab="'+d+'"] input[name="feed_type"]:checked');if(a.length!=0){c=true}}if(!c){a=jQuery('.display_type[tab="'+d+'"] #thumbnails');if(a.length!=0){c=true;a.prop("checked",true);jQuery("#wdi_feed_type").attr("value","thumbnails")}}if(c){wdi_controller.displaySettingsSection(a)}if(d!="conditional_filters"){jQuery("#wdi-conditional-filters-ui").addClass("wdi_hidden")}else{jQuery("#wdi-conditional-filters-ui").removeClass("wdi_hidden")}};wdi_controller.displaySettingsSection=function(h){var d=h.attr("id").toLowerCase().trim();var g=h.parent().parent().attr("tab");var a=jQuery("#wdi_refresh_section");wdi_controller.oldDisplayType={section:d,tab:g};wdi_controller.displayTypeMemory[g]=wdi_controller.oldDisplayType;if(a!=undefined){a.attr("value",d)}var f=jQuery(".wdi_border_wrapper .form-table");jQuery("#wdi_feed_type").attr("value",d);var e=0,c=0;var b=false;f.find(".wdi_element").each(function(){e++;var j=jQuery(this).find(".wdwt_param").children().children().children().attr("section");if(j!==undefined){b=false;var k=j.toLowerCase().trim().split(",");for(c=0;c<k.length;c++){if(k[c]===d){jQuery(this).css("display","block");b=true}}if(b===false){jQuery(this).css("display","none")}}})};wdi_controller.switchThemeTabs=function(b,a){jQuery(".wdi_feed_tabs").filter(".wdi_feed_tab_active").each(function(){jQuery(this).removeClass("wdi_feed_tab_active")});jQuery("#wdi_"+b).addClass("wdi_feed_tab_active");jQuery("[tab]").each(function(){if(jQuery(this).attr("tab")!=b){jQuery(this).parent().parent().parent().parent().parent().filter("tr").css("display","none")}else{jQuery(this).parent().parent().parent().parent().parent().filter("tr").css("display","block")}});jQuery(".display_type").css("display","none");jQuery('.display_type[tab="'+b+'"]').css("display","block");jQuery("#wdi_refresh_tab").attr("value",b);if(a!=undefined&&a!=""){jQuery("#wdi_refresh_section").attr("value",a)}if(a==undefined&&a!=""){if(wdi_controller.displayTypeMemory[b]!=undefined){jQuery(".display_type #"+wdi_controller.displayTypeMemory[b]["section"]).trigger("click")}else{jQuery('.display_type[tab="'+b+'"]').first().find("input").trigger("click")}}else{jQuery(".display_type #"+a).trigger("click")}};wdi_controller.bindSaveFeedEvent=function(){var a=this;jQuery("#wdi_save_feed_submit").on("click",function(){a.save_feed("save_feed")});jQuery("#wdi_save_feed_apply").on("click",function(){a.save_feed("apply_changes")});jQuery("#wdi_cancel_changes").on("click",function(){a.save_feed("cancel")})};wdi_controller.save_feed=function(d){if("cancel"==d){window.location=window.location.href}wdi_controller.checkIfUserNotSaved(d);if(wdi_controller.waitingAjaxRequestEnd.button!=0){return}jQuery("#task").attr("value",d);var a=this.feed_users,b,c,f,j,h,e={username:jQuery("#wdi_default_user").val(),id:jQuery("#wdi_default_user_id").val()};if(a.length==0){a.push(e);this.updateFeaturedImageSelect(e.username,"add","selected")}b=this.stringifyUserData(a);jQuery("#WDI_feed_users").val(b);if(d=="apply_changes"||d=="save_feed"){c=jQuery("#wdi_add_or_edit").attr("value");jQuery("#wdi_current_id").attr("value",c)}f=jQuery("#WDI_thumb_user").val();h=this.getUserProfilePic(f);if("false"==h||typeof h=="undefined"){var g=this;this.instagram.getSelfInfo({success:function(m){var l=g.isValidResponse(m),k=m.data,n;if(l.valid&&g.hasData(m)&&k){n=k.profile_picture}else{n=""}}});jQuery("#wdi_feed_thumb").attr("value",h);jQuery("#wdi_save_feed").submit()}else{jQuery("#wdi_feed_thumb").attr("value",h);jQuery("#wdi_save_feed").submit()}};wdi_controller.makeInstagramUserRequest=function(e,c){var m,a,j=this,f;a=this.getInputType(e);if(wdi_version.is_pro=="false"){if(jQuery(".wdi_user").length==1){alert(wdi_messages.only_one_user_or_hashtag);return false}}var l=a==="hashtag";var h=a==="user";for(var g in j.feed_users){if(j.feed_users[g].username.charAt(0)==="#"){l=true}else{h=true}if(h&&l){alert("You can add only username or hashtags.");return false}}switch(a){case"user":if(typeof wdi_options.wdi_access_token==="undefined"||wdi_options.wdi_access_token===""){alert("To display your feed media , get Instagram API token from settings page.");return false}if(j.feed_users.length>0){alert("You can add only one username");return false}var d="";if(e===wdi_options.wdi_user_name){d=wdi_options.wdi_access_token}else{if(typeof j.users_list[e]!=="undefined"){d=j.users_list[e].access_token}else{alert("You can add only your usernames ( "+j.usersnames.join(", ")+" )");return false}}this.instagram.resetTokens();this.instagram.addToken(d);this.instagram.getSelfInfo({success:function(p){jQuery("#wdi_add_user_ajax").removeAttr("disabled");var o=j.isValidResponse(p);if(o.valid==false){alert(o.msg);return}var n=p.data;if(o.valid&&j.hasData(p)){j.addUser(n)}else{if(!n){alert(wdi_messages.user_not_exist.replace("%s",'"'+e+'"'))}else{alert(o.msg)}}}});break;case"hashtag":if(typeof wdi_options.fb_token==="undefined"||wdi_options.fb_token===""){alert("To display hashtag media , get Facebook API token from settings page.");return false}var k=e.substr(1,e.length);k=k.replace(" ","");var b=jQuery("input[name='wdi_feed_settings[hashtag_top_recent]']:checked").val();this.instagram.getTagRecentMedia(k,{success:function(o){jQuery("#wdi_add_user_ajax").removeAttr("disabled");var n=j.isValidResponse(o);if(n.valid&&j.hasData(o)){j.addHashtag(k,o);if(wdi_version.is_pro=="false"){if(jQuery(".wdi_user").length==1){jQuery("#wdi_add_user_ajax_input").attr("disabled","disabled");jQuery("#wdi_add_user_ajax_input").attr("placeholder",wdi_messages.available_in_pro)}}}else{if(!j.hasData(o)&&n.msg=="success"){if(c!=true){if(confirm(wdi_messages.hashtag_no_data)){j.addHashtag(k,o);if(wdi_version.is_pro=="false"){if(jQuery(".wdi_user").length==1){jQuery("#wdi_add_user_ajax_input").attr("disabled","disabled");jQuery("#wdi_add_user_ajax_input").attr("placeholder",wdi_messages.available_in_pro)}}}else{jQuery("#wdi_add_user_ajax_input").val("")}}else{j.addHashtag(k,o);if(wdi_version.is_pro=="false"){if(jQuery(".wdi_user").length==1){jQuery("#wdi_add_user_ajax_input").attr("disabled","disabled");jQuery("#wdi_add_user_ajax_input").attr("placeholder",wdi_messages.available_in_pro)}}}}else{alert(n.msg)}}}},null,b);break}};wdi_controller.checkForDuplicateUser=function(b){for(var a=0;a<this.feed_users.length;a++){if(b==this.feed_users[a]["username"]){return true}}return false};wdi_controller.getInputType=function(a){switch(a[0]){case"#":return"hashtag";break;case"%":return"location";break;default:return"user";break}};wdi_controller.stringifyUserData=function(a){var c=[];for(var b=0;b<a.length;b++){c.push({username:a[b]["username"],id:a[b]["id"],tag_id:(typeof a[b]["tag_id"]!=="undefined")?a[b]["tag_id"]:""})}return JSON.stringify(c)};wdi_controller.bindAddNewUserOrHashtagEvent=function(){jQuery("#wdi_add_user_ajax").on("click",function(){if(typeof jQuery(this).attr("disabled")!=="undefined"){return}else{jQuery(this).attr("disabled","disabled")}var a=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase();if(wdi_controller.makeInstagramUserRequest(a)===false){jQuery(this).removeAttr("disabled","disabled")}});jQuery("#wdi_add_user_ajax_input").on("keypress",function(b){if(b.keyCode==13){var a=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase();if(typeof jQuery("#wdi_add_user_ajax").attr("disabled")!=="undefined"){return}else{jQuery("#wdi_add_user_ajax").attr("disabled","disabled")}if(wdi_controller.makeInstagramUserRequest(a)===false){jQuery("#wdi_add_user_ajax").removeAttr("disabled","disabled")}return false}})};wdi_controller.removeFeedUser=function(b){var c=b.parent().find("a span").text();if(b.parent().find("a span").hasClass("wdi_hashtag")){c="#"+c}for(var a=0;a<this.feed_users.length;a++){if(this.feed_users[a]["username"]==c){this.feed_users.splice(a,1);break}}b.parent().remove();if(c!==jQuery("#wdi_default_user").val()){wdi_controller.updateFeaturedImageSelect(c,"remove")}if(wdi_version.is_pro=="false"){if(jQuery(".wdi_user").length==0){jQuery("#wdi_add_user_ajax_input").removeAttr("disabled");jQuery("#wdi_add_user_ajax_input").attr("placeholder","")}}wdi_controller.changed_users()};wdi_controller.updateFeaturedImageSelect=function(f,e,d){var a=jQuery("#WDI_thumb_user");if(d!="selected"){d=""}switch(e){case"add":var b=a.find('option[value="'+f+'"]').length;if(!b){var c=jQuery("<option "+d+' value="'+f+'">'+f+"</option>");a.append(c)}break;case"remove":a.find('option[value="'+f+'"]').remove();if(this.feed_users.length>0){a.val(this.feed_users[0].username)}break}};wdi_controller.bindSaveThemeEvent=function(){jQuery("#wdi_save_theme_submit").on("click",function(){jQuery("#task").attr("value","save_feed");jQuery("#wdi_save_feed").submit()});jQuery("#wdi_save_theme_apply").on("click",function(){jQuery("#task").attr("value","apply_changes");var a=jQuery("#wdi_add_or_edit").attr("value");jQuery("#wdi_current_id").attr("value",a);jQuery("#wdi_save_feed").submit()});jQuery("#wdi_save_theme_reset").on("click",function(){jQuery("#task").attr("value","reset_changes");var a=jQuery("#wdi_add_or_edit").attr("value");jQuery("#wdi_current_id").attr("value",a);jQuery("#wdi_save_feed").submit()})};wdi_controller.checkIfUserNotSaved=function(b){switch(b){case"save_feed":b="submit";break;case"apply_changes":b="apply";break;case"reset_changes":b="reset";break}if(jQuery("#wdi_add_user_ajax_input").val().trim()!=""){var a=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase();wdi_controller.waitingAjaxRequestEnd={button:b};wdi_controller.makeInstagramUserRequest(a);return 1}else{wdi_controller.waitingAjaxRequestEnd={button:0};return 0}};wdi_controller.saveFeedAfterAjaxWait=function(b){if(wdi_controller.waitingAjaxRequestEnd!=undefined){var a=wdi_controller.waitingAjaxRequestEnd.button;if(b&&a!=0){jQuery("#wdi_save_feed_"+a).trigger("click")}wdi_controller.waitingAjaxRequestEnd=undefined}};wdi_controller.getCookie=function(a){var b="; "+document.cookie;var c=b.split("; "+a+"=");if(c.length==2){return c.pop().split(";").shift()}};wdi_controller.isValidResponse=function(a){var b={};if(typeof a=="undefined"||typeof a.meta["code"]=="undefined"||a.meta["code"]!=200){b.valid=false;if(typeof a=="undefined"){b.msg=wdi_messages.instagram_server_error}else{if(a.meta["code"]!==200){b.msg=a.meta["error_message"]}else{b.msg=""}}}else{b.valid=true;b.msg="success"}return b};wdi_controller.hasData=function(a){if(typeof a!="undefined"&&typeof a.data!="undefined"&&a.data.length!=0){return true}else{return false}};wdi_controller.thumbUser=function(a){return(this.feed_users.length>0&&this.feed_users[0].username===a)};wdi_controller.findUser=function(d,a){var c=[];if(typeof a!="undefined"&&typeof a.data!="undefined"){c=a.data}for(var b=0;b<c.length;b++){if(c[b]["username"]==d){return c[b]}}return false};wdi_controller.addHashtag=function(e,c){if(e.match(/[~!@$%&*#^()<>?]/)==null){if(this.checkForDuplicateUser("#"+e)==false){var b=jQuery('<div class="wdi_user"><a target="_blank" href="https://instagram.com/explore/tags/'+e+'"><img class="wdi_profile_pic" src="'+wdi_url.plugin_url+'/images/hashtag.png"><span class="wdi_hashtag">'+e+'</span><i style="display:table-cell;width:25px;"></i></a><img class="wdi_remove_user" onclick="wdi_controller.removeFeedUser(jQuery(this))" src="'+wdi_url.plugin_url+'/images/delete_user.png"></div>');jQuery("#wdi_feed_users").append(b);jQuery("#wdi_add_user_ajax_input").attr("value","");var d;if(typeof c!="undefined"){d=(c.data.length!=0&&typeof c.data[0]["images"]["thumbnail"]!=="undefined")?c.data[0]["images"]["thumbnail"]["url"]:""}else{d=""}this.feed_users.push({username:"#"+e,id:"#"+e,profile_picture:d,tag_id:c.tag_id});var a="#"+e;selected=this.thumbUser(a)?"selected":"";wdi_controller.updateFeaturedImageSelect(a,"add",selected)}else{alert("#"+e+" "+wdi_messages.already_added)}}else{alert(wdi_messages.invalid_hashtag)}this.updateConditionalFiltersUi();wdi_controller.saveFeedAfterAjaxWait(true);wdi_controller.changed_users()};wdi_controller.changed_users=function(){var b=false;for(var a=0;a<this.feed_users.length;a++){if(this.feed_users[a].username[0]==="#"){b=true;break}}if(b){jQuery(".wdi_element_name_hashtag_top_recent").show()}else{jQuery(".wdi_element_name_hashtag_top_recent").hide()}};wdi_controller.addUser=function(a){if(this.checkForDuplicateUser(a.username)==false){newUser=jQuery('<div class="wdi_user"><a target="_blank" href="http://www.instagram.com/'+a.username+'"><img class="wdi_profile_pic" src="'+a.profile_picture+'"><span class="wdi_username">'+a.username+'</span><i style="display:table-cell;width:25px;"></i></a><img class="wdi_remove_user" onclick="wdi_controller.removeFeedUser(jQuery(this))" src="'+wdi_url.plugin_url+'/images/delete_user.png"></div>');jQuery("#wdi_feed_users").append(newUser);jQuery("#wdi_add_user_ajax_input").attr("value","");this.feed_users.push({username:a.username,id:a.id,profile_picture:a.profile_picture})}else{alert(a.username+" "+wdi_messages.already_added)}selected=this.thumbUser(a.username)?"selected":"";this.updateFeaturedImageSelect(a.username,"add",selected);this.updateConditionalFiltersUi();wdi_controller.saveFeedAfterAjaxWait(true)};wdi_controller.getUserProfilePic=function(b){for(var a=0;a<this.feed_users.length;a++){if(b==this.feed_users[a]["username"]){return this.feed_users[a]["profile_picture"]}}return"false"};wdi_controller.conditionalFiltersTabInit=function(){this.setInitialFilters();this.updateFiltersUi();var b=this;jQuery("#wdi_add_filter").on("click",function(){b.addConditionalFilter();jQuery("#wdi_filter_input").val("")});jQuery(".wdi_filter_radio").on("click",function(){jQuery("#wdi_filter_input").trigger("focus")});jQuery("#wdi_filter_input").on("keypress",function(c){if(c.keyCode==13){b.addConditionalFilter();jQuery(this).val("");return false}});a();jQuery("#WDI_wrap_conditional_filter_enable input").on("change",function(){a()});function a(){switch(jQuery("#WDI_wrap_conditional_filter_enable input:checked").val()){case"0":jQuery("#WDI_conditional_filters").parent().parent().addClass("wdi_hidden");jQuery("#WDI_conditional_filter_type").parent().parent().parent().parent().parent().addClass("wdi_hidden");jQuery("#wdi_final_condition").addClass("wdi_hidden");jQuery("#WDI_filter_source").addClass("wdi_hidden");break;case"1":jQuery("#WDI_conditional_filters").parent().parent().removeClass("wdi_hidden");jQuery("#WDI_conditional_filter_type").parent().parent().parent().parent().parent().removeClass("wdi_hidden");jQuery("#wdi_final_condition").removeClass("wdi_hidden");jQuery("#WDI_filter_source").removeClass("wdi_hidden");break}}jQuery("#WDI_conditional_filter_type").on("change",function(){if(jQuery(this).val()=="none"){}else{jQuery("#WDI_conditional_filters").css("display","block")}jQuery(this).parent().find("label").css({"line-height":"24px",height:"24px",padding:"2px 5px",display:"inline-block","font-size":"15px",color:"black","font-weight":"500","-webkit-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","-o-user-select":"none","user-select":"none"});switch(jQuery(this).val()){case"AND":jQuery("#WDI_conditional_filters").css("display","block");jQuery(this).parent().find("label").html(wdi_messages.and_descr);break;case"OR":jQuery("#WDI_conditional_filters").css("display","block");jQuery(this).parent().find("label").html(wdi_messages.or_descr);break;case"NOR":jQuery("#WDI_conditional_filters").css("display","block");jQuery(this).parent().find("label").html(wdi_messages.nor_descr);break}wdi_controller.updateFiltersUi()});jQuery("#WDI_conditional_filter_type").trigger("change")};wdi_controller.addConditionalFilter=function(){var b=jQuery("#wdi_filter_input").val(),a=jQuery("#wdi_filter_type").val(),c={};if(b==""){return}b=b.trim();switch(a){case"username":if(b[0]=="@"){b=b.substr(1,b.length)}break;case"mention":if(b[0]=="@"){b=b.substr(1,b.length)}break;case"hashtag":if(b[0]=="#"){b=b.substr(1,b.length)}break;case"url":var d=/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i;if(!d.test(b)){alert(wdi_messages.invalid_url);return}break}c={filter_type:a,filter_by:b,id:this.randomId()};if(a!=null){if(!this.filterExists(c)){this.conditionalFilters.push(c);this.updateFiltersUi()}else{alert(b+" "+wdi_messages.already_added)}}else{alert(wdi_messages.selectConditionType)}};wdi_controller.filterExists=function(b){for(var a=0;a<this.conditionalFilters.length;a++){if(this.conditionalFilters[a].filter_type==b.filter_type&&this.conditionalFilters[a].filter_by==b.filter_by){return true}}return false};wdi_controller.updateFiltersUi=function(){var a=jQuery("#wdi_filters_ui").html("");for(var b=0;b<this.conditionalFilters.length;b++){if(b==0){if(this.conditionalFilters.length!=1){switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":break;case"OR":a.append(jQuery('<span class="wdi_logic">'+wdi_messages.either+"</span>"));break;case"NOR":a.append(jQuery('<span class="wdi_logic">'+wdi_messages.neither+"</span>"));break}}else{switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":break;case"OR":break;case"NOR":a.append(jQuery('<span class="wdi_logic">'+wdi_messages.not+"</span>"));break}}}var c;switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":c=wdi_messages.and;break;case"OR":c=wdi_messages.or;break;case"NOR":c=wdi_messages.nor;break}if(b>=1){a.append(jQuery('<span class="wdi_logic">'+c+"</span>"))}a.append(this.createUiElement(this.conditionalFilters[b]))}this.updateFilterTextarea()};wdi_controller.createUiElement=function(b){var c;switch(b.filter_type){case"mention":c="@";break;case"hashtag":c="#";break;case"location":c="%";break;default:c="";break}var a=jQuery('<span data-id="'+b.id+'" class="wdi_filter_item wdi_filter_by_'+b.filter_type+'"></span>').html(c+b.filter_by+'<span onclick="wdi_controller.removeConditionalFilter(jQuery(this));" class="wdi_remove_filter">X</span>');return a};wdi_controller.randomId=function(){var c="";var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(var b=0;b<5;b++){c+=a.charAt(Math.floor(Math.random()*a.length))}return c};wdi_controller.removeConditionalFilter=function(b){var c=b.parent().attr("data-id");for(var a=0;a<this.conditionalFilters.length;a++){if(this.conditionalFilters[a]["id"]==c){this.conditionalFilters.splice(a,1)}}this.updateFiltersUi()};wdi_controller.updateFilterTextarea=function(){var a,b=this.conditionalFilters;a=JSON.stringify(b);jQuery("#wdi_conditional_filters_textarea").val(a)};wdi_controller.setInitialFilters=function(){var b=[],a=jQuery("#wdi_conditional_filters_textarea").val();if(this.isJsonString(a)){b=JSON.parse(a)}this.conditionalFilters=b};wdi_controller.updateConditionalFiltersUi=function(){wdi_controller.updateFilterSource()};wdi_controller.updateFilterSource=function(){if(jQuery('input[name="wdi_feed_settings[liked_feed]"]:checked').val()=="liked"){var a=jQuery("#wdi_filter_source").html("");var d="<div class='wdi_source_user'><span class='wdi_source_username'>Media I liked</span></div>";a.html(a.html()+d);return}var f=[],e,c;jQuery(".wdi_user").each(function(){if(jQuery(this).find(".wdi_username").length!=0){e=jQuery(this).find(".wdi_username").text()}else{e=jQuery(this).find(".wdi_hashtag").text()}c=jQuery(this).find("img").attr("src");f.push({username:e,image:c})});var a=jQuery("#wdi_filter_source").html("");for(var b=0;b<f.length;b++){var d="<div class='wdi_source_user'><span class='wdi_source_img'><img src='"+f[b].image+"'></span><span class='wdi_source_username'>"+f[b].username+"</span></div>";a.html(a.html()+d)}};wdi_controller.isJsonString=function(b){try{JSON.parse(b)}catch(a){return false}return true};function wdi_spider_select_value(a){a.focus();a.select()}function wdi_spider_set_input_value(b,a){if(a==="add"){if(jQuery("#wdi_access_token").attr("value")==""){alert("Please get your access token")}}if(document.getElementById(b)){document.getElementById(b).value=a}}function wdi_spider_form_submit(b,a){if(document.getElementById(a)){document.getElementById(a).submit()}if(b.preventDefault){b.preventDefault()}else{b.returnValue=false}}function wdi_bulk_actions(a){var b=jQuery(a).val();if(b!=""){if(b=="delete_all"){if(!confirm(wdi_messages.do_you_want_to_delete_selected_items)){return false}}wdi_spider_set_input_value("task",b);jQuery("#wdi_feed_form").submit()}else{return false}return true}function wdi_spider_check_all_items(){wdi_spider_check_all_items_checkbox();jQuery("#check_all").trigger("click")}function wdi_spider_check_all_items_checkbox(){if(jQuery("#check_all_items").attr("checked")){jQuery("#check_all_items").attr("checked",false);jQuery("#draganddrop").hide()}else{var b=(parseInt(jQuery(".displaying-num").html())?parseInt(jQuery(".displaying-num").html()):0);var a=(jQuery('input[id^="check_pr_"]').length?parseInt(jQuery('input[id^="check_pr_"]').length):0);var c=a+b;jQuery("#check_all_items").attr("checked",true);if(c){jQuery("#draganddrop").html("<strong><p>Selected "+c+" item"+(c>1?"s":"")+".</p></strong>");jQuery("#draganddrop").show()}}}function wdi_spider_check_all(a){if(!jQuery(a).attr("checked")){jQuery("#check_all_items").attr("checked",false);jQuery("#draganddrop").hide()}}function wdi_spider_set_input_value(b,a){if(a==="add"){if(jQuery("#wdi_access_token").attr("value")==""){alert("Please get your access token")}}if(document.getElementById(b)){document.getElementById(b).value=a}};
js/wdi_frontend.js CHANGED
@@ -311,7 +311,7 @@ wdi_front.init = function (currentFeed)
311
  all_tags = window["wdi_all_tags"];
312
  }
313
 
314
- for (var k in currentFeed.feed_users) {
315
  if (currentFeed.feed_users[k].username[0] === "#" && typeof currentFeed.feed_users[k].tag_id !== "undefined") {
316
  all_tags[currentFeed.feed_users[k].tag_id] = currentFeed.feed_users[k];
317
  }
@@ -454,7 +454,7 @@ wdi_front.instagramRequest = function (id, currentFeed)
454
  _this.saveUserData(response, currentFeed.feed_users[id], currentFeed);
455
  }
456
  }
457
- });
458
  }
459
  else
460
  if (this.getInputType(feed_users[id]['username']) == 'user') {
@@ -2236,7 +2236,7 @@ wdi_front.loadMoreRequest = function (user, next_url, currentFeed, button)
2236
  });
2237
  }else{
2238
  currentFeed.instagram.getTagRecentMedia(user.username, {success
2239
- :success_function}, next_url)
2240
  }
2241
 
2242
 
311
  all_tags = window["wdi_all_tags"];
312
  }
313
 
314
+ for (var k =0; k < currentFeed.feed_users.length; k++) {
315
  if (currentFeed.feed_users[k].username[0] === "#" && typeof currentFeed.feed_users[k].tag_id !== "undefined") {
316
  all_tags[currentFeed.feed_users[k].tag_id] = currentFeed.feed_users[k];
317
  }
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') {
2236
  });
2237
  }else{
2238
  currentFeed.instagram.getTagRecentMedia(user.username, {success
2239
+ :success_function}, next_url, currentFeed.feed_row.hashtag_top_recent)
2240
  }
2241
 
2242
 
js/wdi_frontend.min.js CHANGED
@@ -1 +1 @@
1
- if(typeof wdi_front=="undefined"){wdi_front={type:"not_declared"}}wdi_front.detectEvent=function(){var a=(/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));if(a){return"touchend"}else{return"click"}};var wdi_error_show=false;wdi_front.escape_tags=function(e){var b=/</g,c=/>/g,d=/'/g,a=/"/g;if(typeof e=="undefined"){e=""}e=e.toString().replace(b,"&lt;").replace(c,"&gt;").replace(d,"&#39;").replace(a,"&#34;");return e};wdi_front.show_alert=function(e,b,f){f=jQuery("#wdi_feed_"+f.feed_row.wdi_feed_counter);if(b.meta["code"]===400&&b.meta["error_type"]==="APINotAllowedError"){if(typeof b.wdi_current_feed_name!="undefined"){var a=b.wdi_current_feed_name;var d=f.find(".wdi_private_feed_names");d.html(a);f.find(".wdi_private_feed_error").removeClass("wdi_hidden")}f.find(".wdi_spinner").remove()}if(typeof f!="undefined"&&b.meta["error_type"]!="APINotAllowedError"){f.find(".wdi_spinner").remove();wdi_error_show=true;var c=f.find(".wdi_js_error");var g=f.find(".wdi_token_error");if(b!=false&&typeof b.meta!=undefined&&b.meta.error_type==="OAuthAccessTokenException"){g.removeClass("wdi_hidden");if(wdi_front_messages.wdi_token_error_flag!="1"){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(h){}})}}else{c.removeClass("wdi_js_error");c.addClass("wdi_js_error_no_animate");jQuery(".wdi_js_error_no_animate").show()}if(wdi_front_messages.show_alerts){}else{console.log("%c"+e,"color:#cc0000;")}}wdi_error_show=true};wdi_front.globalInit=function(){var a=wdi_front.feed_counter;if(typeof wdi_ajax.ajax_response!="undefined"){var c=wdi_feed_counter_init.wdi_feed_counter_init}else{var c=0}for(var b=c;b<=a;b++){if(jQuery("#wdi_feed_"+b).length===0){continue}var d=new WDIFeed(window["wdi_feed_"+b]);d.instagram=new WDIInstagram();d.instagram.filterArguments={feed:d};d.instagram.filters=[{where:"getUserRecentMedia",what:function(f,g,e){return g.feed.conditionalFilter(f,e)}},{where:"getTagRecentMedia",what:function(f,g,e){return g.feed.conditionalFilter(f,e)}},{where:"getRecentLikedMedia",what:function(f,g,e){return g.feed.conditionalFilter(f,e)}},{where:"requestByUrl",what:function(f,g,e){return g.feed.conditionalFilter(f,e)}}];d.instagram.addToken(d.feed_row["access_token"]);wdi_front.access_token=d.feed_row["access_token"];d.dataStorageRaw=[];d.dataStorage=[];d.dataStorageList=[];d.allResponseLength=0;d.currentResponseLength=0;d.temproraryUsersData=[];d.removedUsers=0;d.nowLoadingImages=true;d.imageIndex=0;d.resIndex=0;d.currentPage=1;d.userSortFlags=[];d.customFilterChanged=false;d.maxConditionalFiltersRequestCount=10;d.instagramRequestCounter=0;d.mediaRequestsDone=false;d.conditionalFilterBuffer=[];d.stopInfiniteScrollFlag=false;if(d.feed_row.feed_type=="masonry"){d.displayedData=[]}if(d.feed_row.feed_display_view=="pagination"){d.feed_row.resort_after_load_more=0;if(d.feed_row.feed_type!="image_browser"){d.feed_row.load_more_number=parseInt(d.feed_row.pagination_per_page_number);d.feed_row.number_of_photos=(1+parseInt(d.feed_row.pagination_preload_number))*d.feed_row.load_more_number}else{d.feed_row.number_of_photos=1+parseInt(d.feed_row.image_browser_preload_number);d.feed_row.load_more_number=parseInt(d.feed_row.image_browser_load_number)}d.freeSpaces=(Math.floor(d.feed_row.pagination_per_page_number/d.feed_row.number_of_columns)+1)*d.feed_row.number_of_columns-d.feed_row.pagination_per_page_number}else{d.freeSpaces=0}d.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(d);if(d.feed_row.feed_type=="masonry"){jQuery(window).trigger("resize")}wdi_front.bindEvents(d);window["wdi_feed_"+b]=d;wdi_front.init(d)}};wdi_front.init=function(d){jQuery(".wdi_js_error").hide();d.photoCounter=d.feed_row.number_of_photos;if(d.feed_row.liked_feed=="liked"){d.feed_users=["self"]}else{if(wdi_front.isJsonString(d.feed_row.feed_users)){d.feed_users=JSON.parse(d.feed_row.feed_users)}else{wdi_front.show_alert(wdi_front_messages.invalid_users_format,false,d);return}}var e=[];if(typeof window.wdi_all_tags!=="undefined"){e=window.wdi_all_tags}for(var a in d.feed_users){if(d.feed_users[a].username[0]==="#"&&typeof d.feed_users[a].tag_id!=="undefined"){e[d.feed_users[a].tag_id]=d.feed_users[a]}}window.wdi_all_tags=e;d.dataCount=d.feed_users.length;var b=wdi_front.getFeedItemResolution(d);d.feedImageResolution=b.image;d.feedVideoResolution=b.video;for(var c=0;c<d.dataCount;c++){wdi_front.instagramRequest(c,d)}if(d.feed_row.number_of_photos>0){wdi_front.ajaxLoader(d)}if(d.feed_row["display_header"]==="1"){wdi_front.show("header",d)}if(d.feed_row["show_usernames"]==="1"){wdi_front.show("users",d)}};wdi_front.getFeedItemResolution=function(g){var d={image:"standard_resolution",video:"standard_resolution"};if(g.feed_row.feed_resolution==="thumbnail"){return{image:"thumbnail",video:"low_bandwidth"}}else{if(g.feed_row.feed_resolution==="low"){return{image:"low_resolution",video:"low_resolution"}}else{if(g.feed_row.feed_resolution==="standard"){return{image:"standard_resolution",video:"standard_resolution"}}}}var c=jQuery("#wdi_feed_"+g.feed_row.wdi_feed_counter).find(".wdi_feed_wrapper");c.append('<div class="wdi_feed_item" id="wdi_feed_item_example"></div>');wdi_responsive.columnControl(g,1);var b=c.attr("wdi-res").split("wdi_col_");c.find("#wdi_feed_item_example").remove();if(b.length!==2){return d}var a=parseInt(b[1]);if(a<=0){return d}var f=(c.width()/a)-10;var e=d;if(f<=150){e.image="thumbnail";e.video="low_bandwidth"}else{if(f>150&&f<=320){e.image="low_resolution";e.video="low_resolution"}else{e.image="standard_resolution";e.video="standard_resolution"}}return e};wdi_front.isJsonString=function(b){try{JSON.parse(b)}catch(a){return false}return true};wdi_front.instagramRequest=function(d,b){var a=b.feed_users,c=this;if(typeof a[d]==="string"&&a[d]==="self"){b.instagram.getRecentLikedMedia({success:function(e){if(typeof e.meta!="undefined"&&typeof e.meta.error_type!="undefined"){wdi_front.show_alert(false,e,b)}b.mediaRequestsDone=true;e=c.checkMediaResponse(e,b);if(e!=false){c.saveSelfUserData(e,b)}}})}else{if(this.getInputType(a[d]["username"])=="hashtag"){b.instagram.getTagRecentMedia(this.stripHashtag(a[d]["username"]),{success:function(e){if(typeof e.meta!="undefined"&&typeof e.meta.error_type!="undefined"){wdi_front.show_alert(false,e,b)}b.mediaRequestsDone=true;e=c.checkMediaResponse(e,b);if(e!=false){c.saveUserData(e,b.feed_users[d],b)}}})}else{if(this.getInputType(a[d]["username"])=="user"){b.instagram.getSelfRecentMedia({success:function(e){if(typeof e.meta!="undefined"&&typeof e.meta.error_type!="undefined"){e.wdi_current_feed_name=a[d].username;wdi_front.show_alert(false,e,b)}b.mediaRequestsDone=true;e=c.checkMediaResponse(e,b);if(e!=false){c.saveUserData(e,b.feed_users[d],b)}}})}}}};wdi_front.isHashtag=function(a){return(a[0]==="#")};wdi_front.saveUserData=function(d,a,b){d.username=a.username;d.user_id=a.id;if(d.user_id[0]==="#"){d.data=wdi_front.appendRequestHashtag(d.data,d.user_id)}b.usersData.push(d);b.currentResponseLength=wdi_front.getArrayContentLength(b.usersData,"data");b.allResponseLength+=b.currentResponseLength;if(b.dataCount==b.usersData.length){if(b.currentResponseLength<b.feed_row.number_of_photos&&!wdi_front.userHasNoPhoto(b)){wdi_front.loadMore("initial-keep",b)}else{wdi_front.displayFeed(b);wdi_front.applyFilters(b);if(!wdi_front.activeUsersCount(b)){if(b.feed_row.feed_display_view=="load_more_btn"){var c=jQuery("#wdi_feed_"+b.feed_row.wdi_feed_counter);c.find(".wdi_load_more").addClass("wdi_hidden");c.find(".wdi_spinner").addClass("wdi_hidden")}}}}};wdi_front.saveSelfUserData=function(c,a){c.username="";c.user_id="";a.usersData.push(c);a.currentResponseLength=wdi_front.getArrayContentLength(a.usersData,"data");a.allResponseLength+=a.currentResponseLength;if(a.dataCount==a.usersData.length){if(a.currentResponseLength<a.feed_row.number_of_photos&&!wdi_front.userHasNoPhoto(a)){wdi_front.loadMore("initial-keep",a)}else{wdi_front.displayFeed(a);wdi_front.applyFilters(a);if(!wdi_front.activeUsersCount(a)){if(a.feed_row.feed_display_view=="load_more_btn"){var b=jQuery("#wdi_feed_"+a.feed_row.wdi_feed_counter);b.find(".wdi_load_more").addClass("wdi_hidden");b.find(".wdi_spinner").addClass("wdi_hidden")}}}}};wdi_front.userHasNoPhoto=function(c,e){var a=0;var d=c.usersData;if(typeof e!="undefined"){d=e}for(var b=0;b<d.length;b++){if(typeof d[b]["pagination"]=="undefined"){d[b]["pagination"]=[]}if(c.feed_row.liked_feed==="liked"){if(typeof d[b]["pagination"]["next_max_like_id"]=="undefined"){a++}}else{if(typeof d[b]["pagination"]["next_max_id"]=="undefined"){a++}}}if(a==d.length){return 1}else{return 0}};wdi_front.appendRequestHashtag=function(c,b){for(var a=0;a<c.length;a++){c[a]["wdi_hashtag"]=b}return c};wdi_front.displayFeed=function(c,b){if(c.customFilterChanged==false){var d=wdi_front.feedSort(c,b)}var a=c.customFilterChanged;if(c.customFilterChanged==true){var d=c.customFilteredData;c.parsedData=wdi_front.parseLighboxData(c,true)}if(c.feed_row.resort_after_load_more!="1"){if(c.customFilterChanged==false){c.dataStorageList=c.dataStorageList.concat(d)}}else{if(c.customFilterChanged==false){c.dataStorageList=d}}if(c.feed_row.feed_type=="masonry"){wdi_front.masonryDisplayFeedItems(d,c)}if(c.feed_row.feed_type=="thumbnails"||c.feed_row.feed_type=="blog_style"||c.feed_row.feed_type=="image_browser"){wdi_front.displayFeedItems(d,c)}var e=wdi_front.getDataLength(c);if(e<c.photoCounter&&!a&&c.instagramRequestCounter<=c.maxConditionalFiltersRequestCount&&!wdi_front.allDataHasFinished(c)){wdi_front.loadMore("",c)}else{wdi_front.allImagesLoaded(c)}if(c.instagramRequestCounter>c.maxConditionalFiltersRequestCount){wdi_front.allImagesLoaded(c);if(d.length==0){c.stopInfiniteScrollFlag=true}}if(c.feed_row.feed_display_view=="pagination"&&c.currentPage<c.paginator){jQuery("#wdi_feed_"+c.feed_row.wdi_feed_counter).find("#wdi_last_page").removeClass("wdi_disabled")}c.instagramRequestCounter=0;c.conditionalFilterBuffer=[];wdi_front.updateUsersImages(c)};wdi_front.updateUsersImages=function(a){var b=jQuery("#wdi_feed_"+a.feed_row.wdi_feed_counter).find(".wdi_single_user .wdi_user_img_wrap img");b.each(function(){if(jQuery(this).attr("src")==wdi_url.plugin_url+"images/missing.png"||jQuery(this).attr("src")==""){if(a.feed_row.liked_feed=="liked"){return}for(var c=0;c<a.usersData.length;c++){if(a.usersData[c]["username"]==jQuery(this).parent().parent().find("h3").text()){if(a.usersData[c]["data"].length!=0){jQuery(this).attr("src",a.usersData[c]["data"][0]["images"]["thumbnail"]["url"])}}}}})};wdi_front.masonryDisplayFeedItems=function(d,h){var b=[];var p=[];if(jQuery("#wdi_feed_"+h.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").length==0){return}jQuery("#wdi_feed_"+h.feed_row.wdi_feed_counter+" .wdi_masonry_column").each(function(){if(h.feed_row.resort_after_load_more==1){jQuery(this).html("");h.imageIndex=0}if(h.customFilterChanged==true){jQuery(this).html("");h.imageIndex=0}if(h.feed_row.feed_display_view=="pagination"){b.push(0)}else{b.push(jQuery(this).height())}p.push(jQuery(this))});if(h.customFilterChanged==true){h.customFilterChanged=false}for(var e=0;e<d.length;e++){h.displayedData.push(d[e]);if(d[e]["type"]=="image"){var n=wdi_front.getPhotoTemplate(h)}else{if(d[e].hasOwnProperty("videos")||d[e]["type"]=="video"){var n=wdi_front.getVideoTemplate(h)}else{var n=wdi_front.getSliderTemplate(h)}}var g=d[e];var o=wdi_front.createObject(g,h);var f=n(o);var m=wdi_front.array_min(b);var l=wdi_front.getImageResolution(d[e]);p[m.index].html(p[m.index].html()+f);b[m.index]+=p[m.index].width()*l;h.imageIndex++;if(h.feed_row.feed_display_view=="pagination"){if((e+1)%h.feed_row.pagination_per_page_number===0){h.resIndex+=h.freeSpaces+1}else{h.resIndex++}}}h.wdi_loadedImages=0;var j=false;h.wdi_load_count=e;var a=h.feed_row.wdi_feed_counter;var k=jQuery("#wdi_feed_"+a+" img.wdi_img").on("load",function(){h.wdi_loadedImages++;c();if(j===false){wdi_responsive.columnControl(h,1);j=true}});c();function c(){if(h.wdi_load_count===h.wdi_loadedImages&&h.wdi_loadedImages!=0){h.loadedImages=0;h.wdi_load_count=0;wdi_front.allImagesLoaded(h)}}if(h.paginatorNextFlag==true){wdi_front.updatePagination(h,"next")}h.infiniteScrollFlag=false};wdi_front.getImageResolution=function(c){var d=c.images["standard_resolution"]["width"];var b=c.images["standard_resolution"]["height"];var a=b/d;return a};wdi_front.getDataLength=function(b,d){var c=0;if(typeof d==="undefined"){for(var a=0;a<b.dataStorage.length;a++){c+=b.dataStorage[a].length}}else{for(var a=0;a<d.length;a++){c+=d[a].length}}return c};wdi_front.getArrayContentLength=function(d,c){var b=0;for(var a=0;a<d.length;a++){if(d[a]["finished"]=="finished"){continue}b+=d[a][c].length}return b};wdi_front.displayFeedItems=function(d,j){if(jQuery("#wdi_feed_"+j.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").length==0){return}var a=j.feed_row.wdi_feed_counter;var l=jQuery("#wdi_feed_"+a+" .wdi_feed_wrapper");if(j.feed_row.resort_after_load_more==="1"){l.html("");j.imageIndex=0}if(j.customFilterChanged==true){l.html("");j.imageIndex=0;j.customFilterChanged=false}var g=wdi_front.getImgCount(j)-d.length-1;if(j.feed_row.feed_display_view=="pagination"){var b=j.feed_row.load_more_number;if(j.feed_row.feed_type=="image_browser"){b=1}if(jQuery("#wdi_feed_"+j.feed_row.wdi_feed_counter+' [wdi_page="'+(j.currentPage-1)+'"]').length<b||d.length==0){j.currentPage=(--j.currentPage<=1)?1:j.currentPage}}for(var e=0;e<d.length;e++){if(d[e]["type"]=="image"){var m=wdi_front.getPhotoTemplate(j)}else{if(d[e].hasOwnProperty("videos")){var m=wdi_front.getVideoTemplate(j)}else{var m=wdi_front.getSliderTemplate(j)}}var h=d[e];var n=wdi_front.createObject(h,j);var f=m(n);l.html(l.html()+f);j.imageIndex++;if(j.feed_row.feed_display_view=="pagination"){if((e+1)%j.feed_row.pagination_per_page_number===0){j.resIndex+=j.freeSpaces+1}else{j.resIndex++}}}j.wdi_loadedImages=0;var k=false;j.wdi_load_count=e;var a=j.feed_row.wdi_feed_counter;var l=jQuery("#wdi_feed_"+a+" img.wdi_img").on("load",function(){j.wdi_loadedImages++;c();if(k===false){wdi_responsive.columnControl(j,1);k=true}});function c(){if(j.wdi_load_count===j.wdi_loadedImages&&j.wdi_loadedImages!=0){j.loadedImages=0;j.wdi_load_count=0;wdi_front.allImagesLoaded(j)}}if(j.paginatorNextFlag==true){wdi_front.updatePagination(j,"next")}j.infiniteScrollFlag=false};wdi_front.checkFeedFinished=function(b){for(var a=0;a<b.usersData.length;a++){if(typeof b.usersData[a]["finished"]=="undefined"){return false}}return true};wdi_front.sortingOperator=function(c,b){var a;switch(c){case"date":switch(b){case"asc":a=function(e,d){return(e.created_time>d.created_time)?1:-1};break;case"desc":a=function(e,d){return(e.created_time>d.created_time)?-1:1};break}break;case"likes":switch(b){case"asc":a=function(e,d){return(e.likes["count"]<d.likes["count"])?-1:1};break;case"desc":a=function(e,d){return(e.likes["count"]<d.likes["count"])?1:-1};break}break;case"comments":switch(b){case"asc":a=function(e,d){return(e.comments["count"]<d.comments["count"])?-1:1};break;case"desc":a=function(e,d){return(e.comments["count"]<d.comments["count"])?1:-1};break}break;case"random":a=function(e,d){var f=Math.random();return(f>0.5)?1:-1};break}return a};wdi_front.feedSort=function(e,b){var d=e.feed_row.sort_images_by;var c=e.feed_row.display_order;if(e.feed_row.resort_after_load_more==="1"){e.data=e.data.concat(wdi_front.smartPicker(e,b))}else{e.data=wdi_front.smartPicker(e,b)}var a=wdi_front.sortingOperator(d,c);e.data.sort(a);return e.data};wdi_front.smartPicker=function(l,c){var g=[];var a=0;var k=[];var f=Math.ceil(l.feed_row["number_of_photos"]/l.usersData.length);var b=parseInt(l.feed_row["number_of_photos"]);var n=0;if(c!=""&&typeof c!="undefined"&&c!=null){b=parseInt(c);f=Math.ceil(b/wdi_front.activeUsersCount(l))}var j=function(p,i){return(p.data.length>i.data.length)?1:-1};var e=function(p,i){return(p.length()>i.length())?1:-1};l.storeRawData(l.usersData,"dataStorageRaw");var o=l.dataStorageRaw.sort(e);var h=l.usersData.sort(j);for(var d=0;d<h.length;d++){n+=f;if(o[d].length()<=n){n-=o[d].length();g.push(o[d].getData(o[d].length()));a+=g[g.length-1].length}else{if(a+n>b){n=b-a}var m=[];if(l.auto_trigger===false){m=m.concat(o[d].getData(n))}else{if(m.length+wdi_front.getDataLength(l)+wdi_front.getDataLength(l,g)<l.feed_row["number_of_photos"]){m=m.concat(o[d].getData(n))}}n=0;a+=m.length;g.push(m)}}for(d=0;d<g.length;d++){if(typeof l.dataStorage[d]==="undefined"){l.dataStorage.push(g[d])}else{l.dataStorage[d]=l.dataStorage[d].concat(g[d])}}l.parsedData=wdi_front.parseLighboxData(l);for(d=0;d<g.length;d++){k=k.concat(g[d])}return k};wdi_front.createObject=function(e,h){var j=(e.caption!=null)?e.caption["text"]:"&nbsp";var i="";if(e.type=="video"){i=e.hasOwnProperty("videos")?e.videos[h.feedVideoResolution]["url"]:""}if(typeof e.images[h.feedImageResolution]=="undefined"){var f=wdi_url.plugin_url+"images/missing.png"}else{var f=e.images[h.feedImageResolution].url}var a=h.imageIndex;var b="square";var d=e.images["standard_resolution"]["height"];var g=e.images["standard_resolution"]["width"];if(d>g){b="portrait"}else{if(d<g){b="landscape"}}var c={id:e.id,caption:wdi_front.escape_tags(j),image_url:f,likes:e.likes["count"],comments:e.comments["count"],wdi_index:a,wdi_res_index:h.resIndex,wdi_media_user:e.user["username"],link:e.link,video_url:i,wdi_username:e.user["username"],wdi_shape:b};return c};wdi_front.setPage=function(c){var b=c.feed_row.feed_display_view;var e=c.feed_row.feed_type;if(b!="pagination"){return""}var a=c.imageIndex;if(e=="image_browser"){var d=1}else{var d=Math.abs(c.feed_row.pagination_per_page_number)}c.paginator=Math.ceil((a+1)/d);return c.paginator};wdi_front.getPhotoTemplate=function(g){var e=wdi_front.setPage(g);var j="";var k="";var l="";var d="";var m="fa-arrows-alt";var c="";if(g.feed_row.feed_type=="blog_style"||g.feed_row.feed_type=="image_browser"){m=""}if(e!=""){k='wdi_page="'+e+'"';sourceAttr="src"}else{sourceAttr="src"}if(e!=""&&e!=1){j="wdi_hidden"}if(g.feed_row.show_username_on_thumb=="1"){c='<span class="wdi_media_user">@<%= wdi_username%></span>'}if(g.feed_row.show_full_description==1&&g.feed_row.feed_type=="masonry"){j+=" wdi_full_caption"}var f="";if(g.feed_row.feed_type!=="blog_style"){if(g.feed_row.feed_type=="masonry"){f="wdi_responsive.showMasonryCaption(jQuery(this),"+g.feed_row.wdi_feed_counter+");"}else{f="wdi_responsive.showCaption(jQuery(this),"+g.feed_row.wdi_feed_counter+");"}}switch(g.feed_row.feed_item_onclick){case"lightbox":l="onclick=wdi_feed_"+g.feed_row.wdi_feed_counter+".galleryBox('<%=id%>')";break;case"instagram":l="onclick=\"window.open ('<%= link%>','_blank')\"";d="wdi_hover_off";m="";break;case"custom_redirect":l="onclick=\"window.open ('"+g.feed_row.redirect_url+"','_self')\"";d="wdi_hover_off";m="";break;case"none":l="";d="wdi_cursor_off wdi_hover_off";m=""}var h="<%= wdi_shape == 'square' ? 'wdi_shape_square' : (wdi_shape == 'portrait' ? 'wdi_shape_portrait' : (wdi_shape == 'landscape' ? 'wdi_shape_landscape' : 'wdi_shape_square') ) %>";var b=g.feed_row.wdi_feed_counter;var a='<div class="wdi_feed_item '+j+'" wdi_index=<%= wdi_index%> wdi_res_index=<%= wdi_res_index%> wdi_media_user=<%= wdi_media_user%> '+k+' wdi_type="image" id="wdi_'+b+'_<%=id%>"><div class="wdi_photo_wrap"><div class="wdi_photo_wrap_inner"><div class="wdi_photo_img '+h+'"><img class="wdi_img" '+sourceAttr+'="<%=image_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);"><div class="wdi_photo_overlay '+d+'" >'+c+'<div class="wdi_thumb_icon" '+l+' style="display:table;width:100%;height:100%;"><div style="display:table-cell;vertical-align:middle;text-align:center;color:white;"><i class="fa '+m+'"></i></div></div></div></div></div></div>';if(g.feed_row["show_likes"]==="1"||g.feed_row["show_comments"]==="1"||g.feed_row["show_description"]==="1"){a+='<div class="wdi_photo_meta">';if(g.feed_row["show_likes"]==="1"){a+='<div class="wdi_thumb_likes"><i class="fa fa-heart-o">&nbsp;<%= likes%></i></div>'}if(g.feed_row["show_comments"]==="1"){a+='<div class="wdi_thumb_comments"><i class="fa fa-comment-o">&nbsp;<%= comments%></i></div>'}a+='<div class="wdi_clear"></div>';if(g.feed_row["show_description"]==="1"){a+='<div class="wdi_photo_title" onclick='+f+" ><%=caption%></div>"}a+="</div>"}a+="</div>";var i=_.template(a);return i};wdi_front.getSliderTemplate=function(g){var e=wdi_front.setPage(g);var j="";var k="";var l="";var d="";var m="fa-clone";var c="";if(g.feed_row.feed_type=="blog_style"||g.feed_row.feed_type=="image_browser"){m=""}if(e!=""){k='wdi_page="'+e+'"';sourceAttr="src"}else{sourceAttr="src"}if(e!=""&&e!=1){j="wdi_hidden"}if(g.feed_row.show_username_on_thumb=="1"){c='<span class="wdi_media_user">@<%= wdi_username%></span>'}if(g.feed_row.show_full_description==1&&g.feed_row.feed_type=="masonry"){j+=" wdi_full_caption"}var f="";if(g.feed_row.feed_type!=="blog_style"){if(g.feed_row.feed_type=="masonry"){f="wdi_responsive.showMasonryCaption(jQuery(this),"+g.feed_row.wdi_feed_counter+");"}else{f="wdi_responsive.showCaption(jQuery(this),"+g.feed_row.wdi_feed_counter+");"}}switch(g.feed_row.feed_item_onclick){case"lightbox":l="onclick=wdi_feed_"+g.feed_row.wdi_feed_counter+".galleryBox('<%=id%>')";break;case"instagram":l="onclick=\"window.open ('<%= link%>','_blank')\"";d="wdi_hover_off";m="fa-clone";break;case"custom_redirect":l="onclick=\"window.open ('"+g.feed_row.redirect_url+"','_self')\"";d="wdi_hover_off";m="";break;case"none":l="";d="wdi_cursor_off wdi_hover_off";m=""}var h="<%= wdi_shape == 'square' ? 'wdi_shape_square' : (wdi_shape == 'portrait' ? 'wdi_shape_portrait' : (wdi_shape == 'landscape' ? 'wdi_shape_landscape' : 'wdi_shape_square') ) %>";var b=g.feed_row.wdi_feed_counter;var a='<div class="wdi_feed_item '+j+'" wdi_index=<%= wdi_index%> wdi_res_index=<%= wdi_res_index%> wdi_media_user=<%= wdi_media_user%> '+k+' wdi_type="slideshow" id="wdi_'+b+'_<%=id%>"><div class="wdi_photo_wrap"><div class="wdi_photo_wrap_inner"><div class="wdi_photo_img '+h+'"><img class="wdi_img" '+sourceAttr+'="<%=image_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);"><div class="wdi_photo_overlay '+d+'" >'+c+'<div class="wdi_thumb_icon" '+l+' style="display:table;width:100%;height:100%;"><div style="display:table-cell;vertical-align:middle;text-align:center;color:white;"><i class="fa '+m+'"></i></div></div></div></div></div></div>';if(g.feed_row["show_likes"]==="1"||g.feed_row["show_comments"]==="1"||g.feed_row["show_description"]==="1"){a+='<div class="wdi_photo_meta">';if(g.feed_row["show_likes"]==="1"){a+='<div class="wdi_thumb_likes"><i class="fa fa-heart-o">&nbsp;<%= likes%></i></div>'}if(g.feed_row["show_comments"]==="1"){a+='<div class="wdi_thumb_comments"><i class="fa fa-comment-o">&nbsp;<%= comments%></i></div>'}a+='<div class="wdi_clear"></div>';if(g.feed_row["show_description"]==="1"){a+='<div class="wdi_photo_title" onclick='+f+" ><%=caption%></div>"}a+="</div>"}a+="</div>";var i=_.template(a);return i};wdi_front.replaceToVideo=function(b,a,c){overlayHtml="<video style='width:auto !important; height:auto !important; max-width:100% !important; max-height:100% !important; margin:0 !important;' controls=''><source src='"+b+"' type='video/mp4'>Your browser does not support the video tag. </video>";jQuery("#wdi_feed_"+c+' [wdi_index="'+a+'"] .wdi_photo_wrap_inner').html(overlayHtml);jQuery("#wdi_feed_"+c+' [wdi_index="'+a+'"] .wdi_photo_wrap_inner video').get(0).play()};wdi_front.getVideoTemplate=function(h){var f=wdi_front.setPage(h);var k="";var l="";var n="fa-play";var m="";var d="";var e;var c="";if(f!=""){l='wdi_page="'+f+'"';e="src"}else{e="src"}if(f!=""&&f!=1){k="wdi_hidden"}if(h.feed_row.show_username_on_thumb=="1"){c='<span class="wdi_media_user">@<%= wdi_username%></span>'}if(h.feed_row.show_full_description==1&&h.feed_row.feed_type=="masonry"){k+=" wdi_full_caption"}var g="";if(h.feed_row.feed_type!=="blog_style"){if(h.feed_row.feed_type=="masonry"){g="wdi_responsive.showMasonryCaption(jQuery(this),"+h.feed_row.wdi_feed_counter+");"}else{g="wdi_responsive.showCaption(jQuery(this),"+h.feed_row.wdi_feed_counter+");"}}switch(h.feed_row.feed_item_onclick){case"lightbox":m="onclick=wdi_feed_"+h.feed_row.wdi_feed_counter+".galleryBox('<%=id%>')";break;case"instagram":m="onclick=\"window.open ('<%= link%>','_blank')\"";d="wdi_hover_off";n="fa-play";break;case"custom_redirect":m="onclick=\"window.open ('"+h.feed_row.redirect_url+"','_self')\"";d="wdi_hover_off";n="";break;case"none":d="wdi_cursor_off wdi_hover_off";n="";if(h.feed_row.feed_type=="blog_style"||h.feed_row.feed_type=="image_browser"){m="onclick=wdi_front.replaceToVideo('<%= video_url%>','<%= wdi_index%>',"+h.feed_row.wdi_feed_counter+")";d="";n="fa-play"}}var i="<%= wdi_shape == 'square' ? 'wdi_shape_square' : (wdi_shape == 'portrait' ? 'wdi_shape_portrait' : (wdi_shape == 'landscape' ? 'wdi_shape_landscape' : 'wdi_shape_square') ) %>";var b=h.feed_row.wdi_feed_counter;var a='<div class="wdi_feed_item '+k+'" wdi_index=<%= wdi_index%> wdi_res_index=<%= wdi_res_index%> wdi_media_user=<%= wdi_media_user%> '+l+' wdi_type="image" id="wdi_'+b+'_<%=id%>"><div class="wdi_photo_wrap"><div class="wdi_photo_wrap_inner"><div class="wdi_photo_img '+i+'"><img class="wdi_img" '+e+'="<%=image_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);"><div class="wdi_photo_overlay '+d+'" '+m+">"+c+'<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="fa '+n+'"></i></div></div></div></div></div></div>';if(h.feed_row["show_likes"]==="1"||h.feed_row["show_comments"]==="1"||h.feed_row["show_description"]==="1"){a+='<div class="wdi_photo_meta">';if(h.feed_row["show_likes"]==="1"){a+='<div class="wdi_thumb_likes"><i class="fa fa-heart-o">&nbsp;<%= likes%></i></div>'}if(h.feed_row["show_comments"]==="1"){a+='<div class="wdi_thumb_comments"><i class="fa fa-comment-o">&nbsp;<%= comments%></i></div>'}a+='<div class="wdi_clear"></div>';if(h.feed_row["show_description"]==="1"){a+='<div class="wdi_photo_title" onclick='+g+" ><%=caption%></div>"}a+="</div>"}a+="</div>";var j=_.template(a);return j};wdi_front.bindEvents=function(a){if(jQuery("#wdi_feed_"+a.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").length==0){return}if(a.feed_row.feed_display_view=="load_more_btn"){jQuery("#wdi_feed_"+a.feed_row.wdi_feed_counter+" .wdi_load_more_container").on(wdi_front.clickOrTouch,function(){wdi_front.loadMore(jQuery(this).find(".wdi_load_more_wrap"))})}if(a.feed_row.feed_display_view=="pagination"){jQuery("#wdi_feed_"+a.feed_row.wdi_feed_counter+" #wdi_next").on(wdi_front.clickOrTouch,function(){wdi_front.paginatorNext(jQuery(this),a)});jQuery("#wdi_feed_"+a.feed_row.wdi_feed_counter+" #wdi_prev").on(wdi_front.clickOrTouch,function(){wdi_front.paginatorPrev(jQuery(this),a)});jQuery("#wdi_feed_"+a.feed_row.wdi_feed_counter+" #wdi_last_page").on(wdi_front.clickOrTouch,function(){wdi_front.paginationLastPage(jQuery(this),a)});jQuery("#wdi_feed_"+a.feed_row.wdi_feed_counter+" #wdi_first_page").on(wdi_front.clickOrTouch,function(){wdi_front.paginationFirstPage(jQuery(this),a)});a.paginatorNextFlag=false}if(a.feed_row.feed_display_view=="infinite_scroll"){jQuery(window).on("scroll",function(){wdi_front.infiniteScroll(a)});a.infiniteScrollFlag=false}};wdi_front.infiniteScroll=function(a){if((jQuery(window).scrollTop()+jQuery(window).height()-100)>=jQuery("#wdi_feed_"+a.feed_row.wdi_feed_counter+" #wdi_infinite_scroll").offset().top){if(a.infiniteScrollFlag===false&&a.stopInfiniteScrollFlag==false){a.infiniteScrollFlag=true;wdi_front.loadMore(jQuery("#wdi_feed_"+a.feed_row.wdi_feed_counter+" #wdi_infinite_scroll"),a)}else{if(a.stopInfiniteScrollFlag){wdi_front.allImagesLoaded(a)}}}};wdi_front.paginationFirstPage=function(b,c){if(c.paginator==1||c.currentPage==1){b.addClass("wdi_disabled");return}var d=c.currentPage;c.currentPage=1;wdi_front.updatePagination(c,"custom",d);var a=b.parent().find("#wdi_last_page");a.removeClass("wdi_disabled");b.addClass("wdi_disabled")};wdi_front.paginationLastPage=function(a,b){if(b.paginator==1||b.currentPage==b.paginator){return}var d=b.currentPage;b.currentPage=b.paginator;wdi_front.updatePagination(b,"custom",d);a.addClass("wdi_disabled");var c=a.parent().find("#wdi_first_page");c.removeClass("wdi_disabled")};wdi_front.paginatorNext=function(b,c){var a=b.parent().find("#wdi_last_page");var d=b.parent().find("#wdi_first_page");c.paginatorNextFlag=true;if(c.paginator==c.currentPage&&!wdi_front.checkFeedFinished(c)){c.currentPage++;var e=c.feed_row.number_of_photos;wdi_front.loadMore(b,c,e);a.addClass("wdi_disabled")}else{if(c.paginator>c.currentPage){c.currentPage++;wdi_front.updatePagination(c,"next");if(c.paginator>c.currentPage){a.removeClass("wdi_disabled")}else{a.addClass("wdi_disabled")}}}d.removeClass("wdi_disabled")};wdi_front.paginatorPrev=function(b,c){var a=b.parent().find("#wdi_last_page");var d=b.parent().find("#wdi_first_page");if(c.currentPage==1){d.addClass("wdi_disabled");return}c.currentPage--;wdi_front.updatePagination(c,"prev");a.removeClass("wdi_disabled");if(c.currentPage==1){d.addClass("wdi_disabled")}};wdi_front.updatePagination=function(b,a,d){var c="#wdi_feed_"+b.feed_row.wdi_feed_counter;jQuery(c+' [wdi_page="'+b.currentPage+'"]').each(function(){jQuery(this).removeClass("wdi_hidden")});switch(a){case"next":var d=b.currentPage-1;jQuery(c+" .wdi_feed_wrapper").height(jQuery(".wdi_feed_wrapper").height());jQuery(c+' [wdi_page="'+d+'"]').each(function(){jQuery(this).addClass("wdi_hidden")});break;case"prev":var d=b.currentPage+1;jQuery(c+" .wdi_feed_wrapper").height(jQuery(".wdi_feed_wrapper").height());jQuery(c+' [wdi_page="'+d+'"]').each(function(){jQuery(this).addClass("wdi_hidden")});break;case"custom":var d=d;if(d!=b.currentPage){jQuery(c+" .wdi_feed_wrapper").height(jQuery(".wdi_feed_wrapper").height());jQuery(c+' [wdi_page="'+d+'"]').each(function(){jQuery(this).addClass("wdi_hidden")})}break}b.paginatorNextFlag=false;jQuery(c+" .wdi_feed_wrapper").css("height","auto");jQuery(c+" #wdi_current_page").text(b.currentPage)};wdi_front.loadMore=function(f,k){var b=0;if(f!=""&&typeof f!="undefined"&&f!="initial"&&f!="initial-keep"){var l=window[f.parent().parent().parent().parent().attr("id")]}if(typeof k!="undefined"){var l=k}var n=0,g=0;for(var e=0;e<l.userSortFlags.length;e++){if(l.userSortFlags[e].flag===true){n++;for(var d=0;d<l.usersData.length;d++){if(l.userSortFlags[e]["id"]===l.usersData[d]["user_id"]){if(l.usersData[d]["finished"]==="finished"){g++}}}}}if(n===g&&n!=0){return}if(f===""){l.auto_trigger=true}else{l.auto_trigger=false}wdi_front.ajaxLoader(l);if(l.feed_row.feed_type==="masonry"&&l.feed_row.feed_display_view=="pagination"){jQuery("#wdi_feed_"+wdi_front.feed_counter+" .wdi_full_caption").each(function(){jQuery(this).find(".wdi_photo_title").trigger(wdi_front.clickOrTouch)})}for(var e=0;e<l.usersData.length;e++){if(l.usersData[e]["finished"]==="finished"){b++}}if(b===l.usersData.length){wdi_front.allImagesLoaded(l);jQuery("#wdi_feed_"+l.feed_row["wdi_feed_counter"]+" .wdi_load_more").remove()}var h=l.usersData;l.loadMoreDataCount=l.feed_users.length;for(var e=0;e<h.length;e++){var m=h[e]["pagination"];var c={user_id:h[e]["user_id"],username:h[e]["username"]};if(m.next_url!=""&&m.next_url!=null&&typeof m.next_url!="undefined"){var a=m.next_url;wdi_front.loadMoreRequest(c,a,l,f)}else{if(f=="initial-keep"){l.temproraryUsersData[e]=l.usersData[e]}l.loadMoreDataCount--;wdi_front.checkForLoadMoreDone(l,f);continue}}};wdi_front.loadMoreRequest=function(b,a,e,d){if(!e.mediaRequestsDone){return}var f=e.usersData;var c="";var g=function(h){if(typeof h.meta!="undefined"&&typeof h.meta.error_type!="undefined"){wdi_front.show_alert(false,h,e)}if(h===""||typeof h=="undefined"||h==null){c=wdi_front_messages.network_error;e.loadMoreDataCount--;wdi_front.show_alert(c,h,e);return}if(h.meta["code"]!=200){c=h.meta["error_message"];e.loadMoreDataCount--;wdi_front.show_alert(c,h,e);return}h.user_id=b.user_id;h.username=b.username;for(var j=0;j<e.usersData.length;j++){if(h.user_id===e.usersData[j]["user_id"]){if(h.user_id[0]==="#"){h.data=wdi_front.appendRequestHashtag(h.data,h.user_id)}if(d=="initial-keep"){e.temproraryUsersData[j]=e.usersData[j]}e.usersData[j]=h;e.loadMoreDataCount--}}wdi_front.checkForLoadMoreDone(e,d)};if(b.username[0]!=="#"){e.instagram.requestByUrl(a,{success:g})}else{e.instagram.getTagRecentMedia(b.username,{success:g},a)}};wdi_front.checkForLoadMoreDone=function(c,b){var a=c.feed_row.load_more_number;var e=c.feed_row.number_of_photos;if(c.loadMoreDataCount==0){c.temproraryUsersData=wdi_front.mergeData(c.temproraryUsersData,c.usersData);var d=wdi_front.getArrayContentLength(c.temproraryUsersData,"data");if(b=="initial-keep"){b="initial"}if(b=="initial"){if(d<e&&!wdi_front.userHasNoPhoto(c,c.temproraryUsersData)&&c.instagramRequestCounter<=c.maxConditionalFiltersRequestCount){wdi_front.loadMore("initial",c)}else{c.usersData=c.temproraryUsersData;wdi_front.displayFeed(c);wdi_front.applyFilters(c);c.temproraryUsersData=[]}}else{if(d<a&&!wdi_front.userHasNoPhoto(c,c.temproraryUsersData)&&c.instagramRequestCounter<=c.maxConditionalFiltersRequestCount){wdi_front.loadMore(undefined,c)}else{c.usersData=c.temproraryUsersData;if(!wdi_front.activeUsersCount(c)){return}wdi_front.displayFeed(c,a);wdi_front.applyFilters(c);c.temproraryUsersData=[]}}}};wdi_front.allDataHasFinished=function(b){var d=0;for(var a=0;a<b.dataStorageRaw.length;a++){if(b.dataStorageRaw[a].length()==0&&b.dataStorageRaw[a].locked==true){d++}}return(d==b.dataStorageRaw.length)};wdi_front.mergeData=function(c,b){for(var a=0;a<b.length;a++){if(typeof c[a]!="undefined"){if(b[a]["finished"]=="finished"){continue}if(typeof c[a]["pagination"]["next_max_id"]=="undefined"&&typeof c[a]["pagination"]["next_max_like_id"]=="undefined"){continue}c[a]["data"]=c[a]["data"].concat(b[a]["data"]);c[a]["pagination"]=b[a]["pagination"];c[a]["user_id"]=b[a]["user_id"];c[a]["username"]=b[a]["username"];c[a]["meta"]=b[a]["meta"]}else{c.push(b[a])}}return c};wdi_front.brokenImageHandler=function(a){a.src=wdi_url.plugin_url+"images/missing.png";a.onerror="";return true};wdi_front.ajaxLoader=function(a){var d=a.feed_row.wdi_feed_counter;var c=jQuery("#wdi_feed_"+d);if(a.feed_row.feed_display_view=="load_more_btn"){c.find(".wdi_load_more").addClass("wdi_hidden");c.find(".wdi_spinner").removeClass("wdi_hidden")}if(a.feed_row.feed_display_view=="infinite_scroll"){var b;if(c.find(".wdi_ajax_loading").length==0){b=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>');c.append(b)}else{b=c.find(".wdi_ajax_loading")}b.removeClass("wdi_hidden")}};wdi_front.allImagesLoaded=function(a){var d=wdi_front.getDataLength(a);if(!a.mediaRequestsDone){jQuery("#wdi_feed_"+a.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").remove("wdi_nomedia")}if(d==0&&a.mediaRequestsDone&&(a.feed_row.conditional_filters.length==0||a.feed_row.conditional_filter_enable==0)){jQuery("#wdi_feed_"+a.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").append("<p class='wdi_nomedia'>"+wdi_front_messages.feed_nomedia+"</p>")}var c=a.feed_row.wdi_feed_counter;var b=jQuery("#wdi_feed_"+c);if(a.feed_row.feed_display_view=="load_more_btn"){b.find(".wdi_load_more").removeClass("wdi_hidden");b.find(".wdi_spinner").addClass("wdi_hidden")}if(a.feed_row.feed_display_view=="infinite_scroll"){jQuery("#wdi_feed_"+a.feed_row.wdi_feed_counter+" .wdi_ajax_loading").addClass("wdi_hidden")}b.trigger("wdi_feed_loaded")};wdi_front.show=function(b,c){var e=c.feed_row.wdi_feed_counter;var d=jQuery("#wdi_feed_"+e+" .wdi_feed_container");var g=this;switch(b){case"header":f();break;case"users":a(c);break}function f(){var i={feed_thumb:c.feed_row["feed_thumb"],feed_name:c.feed_row["feed_name"]};var k=wdi_front.getHeaderTemplate(),h=k(i),j=d.find(".wdi_feed_header").html();d.find(".wdi_feed_header").html(j+h)}function a(j){d.find(".wdi_feed_users").html("");var n=j.feed_users;var m=j.feed_row["access_token"];var h=0;j.headerUserinfo=[];k();function k(){if(j.headerUserinfo.length==n.length){l(j.headerUserinfo,j);return}var i=n[j.headerUserinfo.length];if(typeof i==="string"&&i==="self"){j.instagram.getSelfInfo({success:function(o){if(typeof o.meta!="undefined"&&typeof o.meta.error_type!="undefined"){wdi_front.show_alert(false,o,j)}o=g.checkMediaResponse(o,j);if(o!=false&&o.meta["code"]===400&&o.meta["error_type"]==="APINotAllowedError"){var p=null;j.headerUserinfo.push(p);h++;k()}if(o!=false&&o.meta["code"]===200){var p={id:o.data["id"],name:o.data["username"],url:o.data["profile_picture"],bio:wdi_front.escape_tags(o.data["bio"]),counts:o.data["counts"],website:wdi_front.escape_tags(o.data["website"]),full_name:wdi_front.escape_tags(o.data["full_name"])};j.headerUserinfo.push(p);h++;k()}},args:{ignoreFiltering:true}})}else{if(false&&g.getInputType(i.username)=="hashtag"){j.instagram.searchForTagsByName(g.stripHashtag(i.username),{success:function(o){if(typeof o.meta!="undefined"&&typeof o.meta.error_type!="undefined"){wdi_front.show_alert(false,o,j)}o=g.checkMediaResponse(o,j);if(o!=false){if(o.data.length==0){var p="";var q={media:""}}else{var p="";var q={media:o.data[0]["media_count"]}}var r={name:n[h]["username"],url:p,counts:q};h++;j.headerUserinfo.push(r);k()}},args:{ignoreFiltering:true}})}else{if(g.getInputType(i.username)=="user"){j.instagram.getSelfInfo({success:function(o){if(typeof o.meta!="undefined"&&typeof o.meta.error_type!="undefined"){wdi_front.show_alert(false,o,j)}o=g.checkMediaResponse(o,j);if(o!=false&&o.meta["code"]===400&&o.meta["error_type"]==="APINotAllowedError"){var p=null;j.headerUserinfo.push(p);h++;k()}if(o!=false&&o.meta["code"]===200){var p={id:o.data["id"],name:o.data["username"],url:o.data["profile_picture"],bio:wdi_front.escape_tags(o.data["bio"]),counts:o.data["counts"],website:wdi_front.escape_tags(o.data["website"]),full_name:wdi_front.escape_tags(o.data["full_name"])};j.headerUserinfo.push(p);h++;k()}},args:{ignoreFiltering:true}})}}}}function l(i,t){d.find(".wdi_feed_users").html("");for(var q=0;q<i.length;q++){if(i[q]===null){continue}var v={flag:false,id:i[q]["id"],name:i[q]["name"]};var p=(i[q]["name"][0]=="#")?"wdi_header_hashtag":"";var u=wdi_extractHostname(i[q]["website"]);var o={user_index:q,user_img_url:i[q]["url"],counts:i[q]["counts"],feed_counter:t.feed_row.wdi_feed_counter,user_name:i[q]["name"],bio:wdi_front.escape_tags(i[q]["bio"]),website:u,website_url:i[q]["website"],usersCount:t.feed_row.feed_users.length,hashtagClass:p};var x=wdi_front.getUserTemplate(t,i[q]["name"]),r=x(o),s=d.find(".wdi_feed_users").html();d.find(".wdi_feed_users").html(s+r);t.userSortFlags.push(v);var w=jQuery('<div class="wdi_clear"></div>')}d.find(".wdi_feed_users").append(w);wdi_front.updateUsersImages(t)}}};wdi_front.getUserTemplate=function(c,h){var a=c.dataCount,d,f,g;switch(h[0]){case"#":d="//instagram.com/explore/tags/"+h.substr(1,h.length);break;default:d="//instagram.com/"+h;break}g='window.open("'+d+'","_blank")';f="onclick='"+g+"'";var e='<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%>">';if(a>1){e+='<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="fa fa-filter"></span></div></div>'}e+="</div>";e+="<h3 "+f+"><%= user_name%></h3>";if(h[0]!=="#"){if(c.feed_row.follow_on_instagram_btn=="1"){e+='<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>"}e+='<div class="wdi_media_info"><p class="wdi_posts"><span class="fa fa-camera-retro"></span><%= counts.media%></p><p class="wdi_followers"><span class="fa fa-user"></span><%= counts.followed_by%></p></div>'}else{e+='<div class="wdi_user_controls"></div><div class="wdi_media_info"><p class="wdi_posts"><span class="fa fa-camera-retro"></span><%= counts.media%></p><p class="wdi_followers"><span></span></p></div>'}e+='<div class="wdi_clear"></div>';if(a==1&&h[0]!=="#"&&c.feed_row.display_user_info=="1"){e+='<div class="wdi_bio"><%= bio%></div>';e+='<div class="wdi_website"><a target="_blank" href="<%= website_url%>" ><%= website%></a></div>'}e+="</div></div>";var b=_.template(e);return b};wdi_front.getHeaderTemplate=function(){var b='<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>';var a=_.template(b);return a};wdi_front.addFilter=function(e,g){var f=window["wdi_feed_"+g];var d=f.dataCount;if(d<2){return}if(f.nowLoadingImages!=false){return}else{var c=jQuery("#wdi_feed_"+f.feed_row.wdi_feed_counter+'_users [user_index="'+e+'"]');c.find(".wdi_filter_overlay").toggleClass("wdi_filter_active_bg");c.find(".wdi_header_user_text h3").toggleClass("wdi_filter_active_col");c.find(".wdi_media_info").toggleClass("wdi_filter_active_col");c.find(".wdi_follow_btn").toggleClass("wdi_filter_active_col");f.customFilterChanged=true;if(f.userSortFlags[e]["flag"]==false){f.userSortFlags[e]["flag"]=true}else{f.userSortFlags[e]["flag"]=false}var a=0;for(var b=0;b<f.userSortFlags.length;b++){if(f.userSortFlags[b]["flag"]==true){a++}}if(f.feed_row.feed_display_view=="pagination"){f.resIndex=0}if(a!=0){wdi_front.filterData(f);wdi_front.displayFeed(f)}else{f.customFilteredData=f.dataStorageList;wdi_front.displayFeed(f)}if(f.feed_row.feed_display_view=="pagination"){f.paginator=Math.ceil((f.imageIndex)/parseInt(f.feed_row.pagination_per_page_number));f.currentPage=f.paginator;wdi_front.updatePagination(f,"custom",1);jQuery("#wdi_first_page").removeClass("wdi_disabled");jQuery("#wdi_last_page").addClass("wdi_disabled")}}};wdi_front.filterData=function(c){var d=c.userSortFlags;c.customFilteredData=[];for(var b=0;b<c.dataStorageList.length;b++){for(var a=0;a<d.length;a++){if(((typeof c.dataStorageList[b]["user"]["id"]!="undefined"&&c.dataStorageList[b]["user"]["id"]==d[a]["id"])||c.dataStorageList[b]["wdi_hashtag"]==d[a]["name"])&&d[a]["flag"]==true){c.customFilteredData.push(c.dataStorageList[b])}}}};wdi_front.applyFilters=function(c){for(var b=0;b<c.userSortFlags.length;b++){if(c.userSortFlags[b]["flag"]==true){var a=jQuery("#wdi_feed_"+c.feed_row.wdi_feed_counter+'[user_index="'+b+'"]');wdi_front.addFilter(b,c.feed_row.wdi_feed_counter);wdi_front.addFilter(b,c.feed_row.wdi_feed_counter)}}};wdi_front.getImgCount=function(b){var d=b.dataStorage;var c=0;for(var a=0;a<d.length;a++){c+=d[a].length}return c};wdi_front.parseLighboxData=function(k,m){var g=k.dataStorage;var l=k.feed_row.sort_images_by;var a=k.feed_row.display_order;var h=wdi_front.sortingOperator(l,a);var f=[];var b=[];var e={};if(m==true){f=k.customFilteredData}else{for(var d=0;d<g.length;d++){for(var c=0;c<g[d].length;c++){f.push(g[d][c])}}f.sort(h)}for(d=0;d<f.length;d++){e={alt:"",avg_rating:"",comment_count:f[d]["comments"]["count"],date:wdi_front.convertUnixDate(f[d]["created_time"]),description:wdi_front.getDescription((f[d]["caption"]!==null)?wdi_front.escape_tags(f[d]["caption"]["text"]):""),filename:wdi_front.getFileName(f[d]),filetype:wdi_front.getFileType(f[d]),hit_count:"0",id:f[d]["id"],image_url:f[d]["link"],number:0,rate:"",rate_count:"0",username:f[d]["user"]["username"],profile_picture:f[d]["user"]["profile_picture"],thumb_url:f[d]["link"]+"media/?size=t",comments_data:f[d]["comments"]["data"],images:f[d]["images"],carousel_media:(typeof f[d]["carousel_media"]!=="undefined")?f[d]["carousel_media"]:null};b.push(e)}return b};wdi_front.convertUnixDate=function(b){var c=parseInt(b);var a=new Date(0);a.setUTCSeconds(c);var d=a.getFullYear()+"-"+a.getMonth()+"-"+a.getDate();d+=" "+a.getHours()+":"+a.getMinutes();return d};wdi_front.getDescription=function(a){a=a.replace(/\r?\n|\r/g," ");return a};wdi_front.getFileName=function(d){var c=d.link;var b=d.type;if(b==="video"&&d.hasOwnProperty("videos")){return d.videos["standard_resolution"]["url"]}else{var a=c.split("/");return a[a.length-2]}};wdi_front.getFileType=function(a){if(a.type=="video"&&a.hasOwnProperty("videos")){return"EMBED_OEMBED_INSTAGRAM_VIDEO"}else{return"EMBED_OEMBED_INSTAGRAM_IMAGE"}};wdi_front.array_max=function(d){var a=d[0];var b=0;for(var c=1;c<d.length;c++){if(a<d[c]){a=d[c];b=c}}return{value:a,index:b}};wdi_front.array_min=function(d){var c=d[0];var a=0;for(var b=1;b<d.length;b++){if(c>d[b]){c=d[b];a=b}}return{value:c,index:a}};wdi_front.activeUsersCount=function(c){var a=0;for(var b=0;b<c.usersData.length;b++){if(c.usersData[b].finished!="finished"){a++}}return a};wdi_front.checkMediaResponse=function(a,b){if(a!=""&&typeof a!="undefined"&&a!=null&&a.meta["code"]===400&&a.meta["error_type"]==="APINotAllowedError"){return a}if(a==""||typeof a=="undefined"||a==null){errorMessage=wdi_front_messages.connection_error;wdi_front.show_alert(errorMessage,a,b);return false}if(a.meta["code"]!=200){errorMessage=a.meta["error_message"];wdi_front.show_alert(errorMessage,a,b);return false}return a};wdi_front.stripHashtag=function(a){switch(a[0]){case"#":return a.substr(1,a.length);break;default:return a;break}};wdi_front.getInputType=function(a){switch(a[0]){case"#":return"hashtag";break;case"%":return"location";break;default:return"user";break}};wdi_front.regexpTestCaption=function(h,e){var d=false,b=false,f=[],g=e.replace(/[-[\]{}()*+?.,\\^$|]/g,"\\$&"),c=new RegExp("(?:^|\\s)"+g+"(?:^|\\s)"),a=new RegExp("(?:^|\\s)"+g,"g");if(c.exec(h)!=null){d=true}while((match=a.exec(h))!=null){if(match.index==h.length-e.length-1){b=true}}if(d==true||b==true){return true}else{return false}};wdi_front.replaceNewLines=function(c){var b="vUkCJvN2ps3t",a=[],g;c=c.replace(/\r?\n|\r/g,b);g=new RegExp(b,"g");while((match=g.exec(c))!=null){a.push(match.index)}var f=c.split(b);var e=0;for(var d=0;d<f.length;d++){if(f[d]==""){e++}else{e=0}if(e>0){f.splice(d,1);e--;d--}}c=f.join(" ");return c};wdi_front.isEmptyObject=function(a){for(var b in a){if(a.hasOwnProperty(b)){return false}}return true};var WDIFeed=function(a){this["data"]=a.data;this["dataCount"]=a.dataCount;this["feed_row"]=a.feed_row;this["usersData"]=a.usersData;_this=this;this.set_images_loading_flag=function(b){window.addEventListener("load",function(){b.nowLoadingImages=false})};this.set_images_loading_flag(_this)};WDIFeed.prototype.conditionalFilter=function(a,c){var d=this,b=d.feed_row.conditional_filter_type,e=d.feed_row.conditional_filters;if(c.ignoreFiltering==true){}else{a=this.avoidDuplicateMedia(a)}if(!wdi_front.isJsonString(e)){return a}else{e=JSON.parse(e);if(e.length==0){return a}}if(d.feed_row.conditional_filter_enable=="0"){return a}d.instagramRequestCounter++;switch(b){case"AND":a=this.applyANDLogic(a,e,d);break;case"OR":a=this.applyORLogic(a,e,d);break;case"NOR":a=this.applyNORLogic(a,e,d);break;default:break}return a};WDIFeed.prototype.applyANDLogic=function(a,d){var c=this;for(var b=0;b<d.length;b++){a=this.filterResponse(a,d[b])}return a};WDIFeed.prototype.applyORLogic=function(d,c){var h=this;var a=[],g,j=[],f,b;for(var e=0;e<c.length;e++){g=this.filterResponse(d,c[e]);a=a.concat(g.data);g={}}for(e=0;e<a.length;e++){b=a[e];if(!this.mediaExists(b,j)&&!this.mediaExists(b,h.dataStorageList)){j.push(b)}}f={data:j,meta:d.meta,pagination:d.pagination};return f};WDIFeed.prototype.applyNORLogic=function(c,h){var f=c,g=this,b=this.applyORLogic(c,h,g),d=[],a;for(var e=0;e<f.data.length;e++){if(!this.mediaExists(f.data[e],b.data)){d.push(f.data[e])}}a={data:d,meta:f.meta,pagination:f.pagination};return a};WDIFeed.prototype.mediaExists=function(b,c){for(var a=0;a<c.length;a++){if(b.id==c[a]["id"]){return true}}return false};WDIFeed.prototype.filterResponse=function(a,b){switch(b.filter_type){case"hashtag":return this.filterByHashtag(a,b);break;case"username":return this.filterByUsername(a,b);break;case"mention":return this.filterByMention(a,b);break;case"description":return this.filterByDescription(a,b);break;case"location":return this.filterByLocation(a,b);break;case"url":return this.filterByUrl(a,b);break}};WDIFeed.prototype.filterByHashtag=function(b,g){var d=[],f,h,a;for(var e=0;e<b.data.length;e++){h=b.data[e];for(var c=0;c<h.tags.length;c++){tag=h.tags[c];if(tag.toLowerCase()==g.filter_by.toLowerCase()){d.push(h)}}}a={data:d,meta:b.meta,pagination:b.pagination};return a};WDIFeed.prototype.filterByUsername=function(b,e){var c=[],f,a;for(var d=0;d<b.data.length;d++){f=b.data[d];if(f.user.username.toLowerCase()==e.filter_by.toLowerCase()){c.push(f)}}a={data:c,meta:b.meta,pagination:b.pagination};return a};WDIFeed.prototype.filterByMention=function(b,e){var c=[],f,g,a;for(var d=0;d<b.data.length;d++){f=b.data[d];if(f.caption!==null){g=f.caption["text"].toLowerCase();if(g.indexOf("@"+e.filter_by.toLowerCase())!=-1){c.push(f)}}}a={data:c,meta:b.meta,pagination:b.pagination};return a};WDIFeed.prototype.filterByDescription=function(c,f){var d=[],g,h,b;for(var e=0;e<c.data.length;e++){g=c.data[e];if(g.caption!==null){h=g.caption["text"].toLowerCase();h=wdi_front.replaceNewLines(h);var a=f.filter_by.toLowerCase();if(wdi_front.regexpTestCaption(h,a)){d.push(g)}}}b={data:d,meta:c.meta,pagination:c.pagination};return b};WDIFeed.prototype.filterByLocation=function(b,f){var c=[],g,e,a;for(var d=0;d<b.data.length;d++){g=b.data[d];if(g.location!==null){e=g.location["id"];if(e==f.filter_by){c.push(g)}}}a={data:c,meta:b.meta,pagination:b.pagination};return a};WDIFeed.prototype.filterByUrl=function(b,e){var c=[],g,h,a,f;e.filter_by=this.getIdFromUrl(e.filter_by);for(var d=0;d<b.data.length;d++){g=b.data[d];if(g.link!==null){h=this.getIdFromUrl(g.link);if(h==e.filter_by){c.push(g)}}}a={data:c,meta:b.meta,pagination:b.pagination};return a};WDIFeed.prototype.getIdFromUrl=function(a){var c=a.split("/"),d=false;for(var b=0;b<c.length;b++){if(c[b]=="p"){if(typeof c[b+1]!="undefined"){d=c[b+1];break}}}return d};WDIFeed.prototype.avoidDuplicateMedia=function(b){var e=b.data,d=[],a={};if(typeof e=="undefined"){e=[]}for(var c=0;c<e.length;c++){if(!this.mediaExists(e[c],this.dataStorageList)&&!this.mediaExists(e[c],d)&&!this.mediaExists(e[c],this.conditionalFilterBuffer)){d.push(e[c])}}this.conditionalFilterBuffer=this.conditionalFilterBuffer.concat(d);a={data:d,meta:b.meta,pagination:b.pagination};return a};WDIFeed.prototype.storeRawData=function(c,a){var e=this;if(typeof this[a]=="object"&&typeof this[a].length=="number"){for(var b=0;b<c.length;b++){var d="";if(wdi_front.isHashtag(c[b].user_id)){if(typeof c[b].pagination.cursors!=="undefined"){d=c[b].pagination.cursors.after}}else{if(e.feed_row.liked_feed=="liked"){d=c[b].pagination.next_max_like_id;if(typeof d=="undefined"){d=""}}else{if(c[b].pagination==null){c[b].pagination=[]}d=c[b].pagination.next_max_id;if(typeof d=="undefined"){d=""}}}if(typeof this[a][b]=="undefined"){this[a].push({data:c[b].data,index:0,locked:false,hash_id:d,usersDataFinished:false,userId:c[b].user_id,length:function(){return this.data.length-this.index},getData:function(g){var h=this.data.slice(this.index,this.index+g);this.index+=Math.min(g,this.length());if(this.index==this.data.length&&this.locked==true&&this.usersDataFinished==false){for(var f=0;f<e.usersData.length;f++){if(e.usersData[f]["user_id"]==this.userId){e.usersData[f].finished="finished";this.usersDataFinished=true;break}}}return h}})}else{if(this[a][b].locked==false){if(d!=this[a][b].hash_id){this[a][b].data=this[a][b].data.concat(c[b].data);this[a][b].hash_id=d}else{this[a][b].locked=true}}}}}};wdi_front.updateUsersIfNecessary=function(c){var d=c.feed_users;var a=false;for(var b=0;b<d.length;b++){if("#"==d[b].username.substr(0,1)){d[b].id=d[b].username;continue}if(""==d[b].id||"username"==d[b].id){a=true;c.instagram.searchForUsersByName(d[b].username,{success:function(i){if(typeof i.meta!="undefined"&&typeof i.meta.error_type!="undefined"){wdi_front.show_alert(false,i,c)}if(i.meta.code==200&&i.data.length>0){var l=false;for(var g=0;g<i.data.length;g++){if(i.data[g].username==i.args.username){l=true;break}}if(l){for(var h=0;h<d.length;h++){if(i.data[g].username==d[h].username){d[h].id=i.data[g].id}}}}var f=false;for(var e=0;e<d.length;e++){if(d[e].id==""||d[e].id=="username"){f=true;break}}if(!f){c.feed_row.feed_users=JSON.stringify(d);wdi_front.init(c)}},username:d[b].username})}}return a};if(typeof wdi_ajax.ajax_response!="undefined"){jQuery(document).one("ajaxStop",function(){if(wdi_front.type!="not_declared"){wdi_front.clickOrTouch=wdi_front.detectEvent();wdi_front.globalInit()}else{return}})}else{jQuery(document).ready(function(){if(wdi_front.type!="not_declared"){wdi_front.clickOrTouch=wdi_front.detectEvent();wdi_front.globalInit()}else{return}})}jQuery(document).ready(function(){setTimeout(function(){if(wdi_front_messages.show_alerts==="1"&&jQuery(".wdi_check_fontawesome .fa-instagram").prop("tagName")!=="I"){console.log("Font Awesome is not loaded properly. Please ask for support https://wordpress.org/support/plugin/wd-instagram-feed/")}},2000)});function wdi_extractHostname(b){if(typeof b==="undefined"||b===""){return""}var a=b.replace(/(^\w+:|^)\/\//,"");return a};
1
+ if(typeof wdi_front=="undefined"){wdi_front={type:"not_declared"}}wdi_front.detectEvent=function(){var a=(/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));if(a){return"touchend"}else{return"click"}};var wdi_error_show=false;wdi_front.escape_tags=function(e){var b=/</g,c=/>/g,d=/'/g,a=/"/g;if(typeof e=="undefined"){e=""}e=e.toString().replace(b,"&lt;").replace(c,"&gt;").replace(d,"&#39;").replace(a,"&#34;");return e};wdi_front.show_alert=function(e,b,f){f=jQuery("#wdi_feed_"+f.feed_row.wdi_feed_counter);if(b.meta["code"]===400&&b.meta["error_type"]==="APINotAllowedError"){if(typeof b.wdi_current_feed_name!="undefined"){var a=b.wdi_current_feed_name;var d=f.find(".wdi_private_feed_names");d.html(a);f.find(".wdi_private_feed_error").removeClass("wdi_hidden")}f.find(".wdi_spinner").remove()}if(typeof f!="undefined"&&b.meta["error_type"]!="APINotAllowedError"){f.find(".wdi_spinner").remove();wdi_error_show=true;var c=f.find(".wdi_js_error");var g=f.find(".wdi_token_error");if(b!=false&&typeof b.meta!=undefined&&b.meta.error_type==="OAuthAccessTokenException"){g.removeClass("wdi_hidden");if(wdi_front_messages.wdi_token_error_flag!="1"){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(h){}})}}else{c.removeClass("wdi_js_error");c.addClass("wdi_js_error_no_animate");jQuery(".wdi_js_error_no_animate").show()}if(wdi_front_messages.show_alerts){}else{console.log("%c"+e,"color:#cc0000;")}}wdi_error_show=true};wdi_front.globalInit=function(){var a=wdi_front.feed_counter;if(typeof wdi_ajax.ajax_response!="undefined"){var c=wdi_feed_counter_init.wdi_feed_counter_init}else{var c=0}for(var b=c;b<=a;b++){if(jQuery("#wdi_feed_"+b).length===0){continue}var d=new WDIFeed(window["wdi_feed_"+b]);d.instagram=new WDIInstagram();d.instagram.filterArguments={feed:d};d.instagram.filters=[{where:"getUserRecentMedia",what:function(f,g,e){return g.feed.conditionalFilter(f,e)}},{where:"getTagRecentMedia",what:function(f,g,e){return g.feed.conditionalFilter(f,e)}},{where:"getRecentLikedMedia",what:function(f,g,e){return g.feed.conditionalFilter(f,e)}},{where:"requestByUrl",what:function(f,g,e){return g.feed.conditionalFilter(f,e)}}];d.instagram.addToken(d.feed_row["access_token"]);wdi_front.access_token=d.feed_row["access_token"];d.dataStorageRaw=[];d.dataStorage=[];d.dataStorageList=[];d.allResponseLength=0;d.currentResponseLength=0;d.temproraryUsersData=[];d.removedUsers=0;d.nowLoadingImages=true;d.imageIndex=0;d.resIndex=0;d.currentPage=1;d.userSortFlags=[];d.customFilterChanged=false;d.maxConditionalFiltersRequestCount=10;d.instagramRequestCounter=0;d.mediaRequestsDone=false;d.conditionalFilterBuffer=[];d.stopInfiniteScrollFlag=false;if(d.feed_row.feed_type=="masonry"){d.displayedData=[]}if(d.feed_row.feed_display_view=="pagination"){d.feed_row.resort_after_load_more=0;if(d.feed_row.feed_type!="image_browser"){d.feed_row.load_more_number=parseInt(d.feed_row.pagination_per_page_number);d.feed_row.number_of_photos=(1+parseInt(d.feed_row.pagination_preload_number))*d.feed_row.load_more_number}else{d.feed_row.number_of_photos=1+parseInt(d.feed_row.image_browser_preload_number);d.feed_row.load_more_number=parseInt(d.feed_row.image_browser_load_number)}d.freeSpaces=(Math.floor(d.feed_row.pagination_per_page_number/d.feed_row.number_of_columns)+1)*d.feed_row.number_of_columns-d.feed_row.pagination_per_page_number}else{d.freeSpaces=0}d.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(d);if(d.feed_row.feed_type=="masonry"){jQuery(window).trigger("resize")}wdi_front.bindEvents(d);window["wdi_feed_"+b]=d;wdi_front.init(d)}};wdi_front.init=function(d){jQuery(".wdi_js_error").hide();d.photoCounter=d.feed_row.number_of_photos;if(d.feed_row.liked_feed=="liked"){d.feed_users=["self"]}else{if(wdi_front.isJsonString(d.feed_row.feed_users)){d.feed_users=JSON.parse(d.feed_row.feed_users)}else{wdi_front.show_alert(wdi_front_messages.invalid_users_format,false,d);return}}var e=[];if(typeof window.wdi_all_tags!=="undefined"){e=window.wdi_all_tags}for(var a=0;a<d.feed_users.length;a++){if(d.feed_users[a].username[0]==="#"&&typeof d.feed_users[a].tag_id!=="undefined"){e[d.feed_users[a].tag_id]=d.feed_users[a]}}window.wdi_all_tags=e;d.dataCount=d.feed_users.length;var b=wdi_front.getFeedItemResolution(d);d.feedImageResolution=b.image;d.feedVideoResolution=b.video;for(var c=0;c<d.dataCount;c++){wdi_front.instagramRequest(c,d)}if(d.feed_row.number_of_photos>0){wdi_front.ajaxLoader(d)}if(d.feed_row["display_header"]==="1"){wdi_front.show("header",d)}if(d.feed_row["show_usernames"]==="1"){wdi_front.show("users",d)}};wdi_front.getFeedItemResolution=function(g){var d={image:"standard_resolution",video:"standard_resolution"};if(g.feed_row.feed_resolution==="thumbnail"){return{image:"thumbnail",video:"low_bandwidth"}}else{if(g.feed_row.feed_resolution==="low"){return{image:"low_resolution",video:"low_resolution"}}else{if(g.feed_row.feed_resolution==="standard"){return{image:"standard_resolution",video:"standard_resolution"}}}}var c=jQuery("#wdi_feed_"+g.feed_row.wdi_feed_counter).find(".wdi_feed_wrapper");c.append('<div class="wdi_feed_item" id="wdi_feed_item_example"></div>');wdi_responsive.columnControl(g,1);var b=c.attr("wdi-res").split("wdi_col_");c.find("#wdi_feed_item_example").remove();if(b.length!==2){return d}var a=parseInt(b[1]);if(a<=0){return d}var f=(c.width()/a)-10;var e=d;if(f<=150){e.image="thumbnail";e.video="low_bandwidth"}else{if(f>150&&f<=320){e.image="low_resolution";e.video="low_resolution"}else{e.image="standard_resolution";e.video="standard_resolution"}}return e};wdi_front.isJsonString=function(b){try{JSON.parse(b)}catch(a){return false}return true};wdi_front.instagramRequest=function(d,b){var a=b.feed_users,c=this;if(typeof a[d]==="string"&&a[d]==="self"){b.instagram.getRecentLikedMedia({success:function(e){if(typeof e.meta!="undefined"&&typeof e.meta.error_type!="undefined"){wdi_front.show_alert(false,e,b)}b.mediaRequestsDone=true;e=c.checkMediaResponse(e,b);if(e!=false){c.saveSelfUserData(e,b)}}})}else{if(this.getInputType(a[d]["username"])=="hashtag"){b.instagram.getTagRecentMedia(this.stripHashtag(a[d]["username"]),{success:function(e){if(typeof e.meta!="undefined"&&typeof e.meta.error_type!="undefined"){wdi_front.show_alert(false,e,b)}b.mediaRequestsDone=true;e=c.checkMediaResponse(e,b);if(e!=false){c.saveUserData(e,b.feed_users[d],b)}}},null,b.feed_row.hashtag_top_recent)}else{if(this.getInputType(a[d]["username"])=="user"){b.instagram.getSelfRecentMedia({success:function(e){if(typeof e.meta!="undefined"&&typeof e.meta.error_type!="undefined"){e.wdi_current_feed_name=a[d].username;wdi_front.show_alert(false,e,b)}b.mediaRequestsDone=true;e=c.checkMediaResponse(e,b);if(e!=false){c.saveUserData(e,b.feed_users[d],b)}}})}}}};wdi_front.isHashtag=function(a){return(a[0]==="#")};wdi_front.saveUserData=function(d,a,b){d.username=a.username;d.user_id=a.id;if(d.user_id[0]==="#"){d.data=wdi_front.appendRequestHashtag(d.data,d.user_id)}b.usersData.push(d);b.currentResponseLength=wdi_front.getArrayContentLength(b.usersData,"data");b.allResponseLength+=b.currentResponseLength;if(b.dataCount==b.usersData.length){if(b.currentResponseLength<b.feed_row.number_of_photos&&!wdi_front.userHasNoPhoto(b)){wdi_front.loadMore("initial-keep",b)}else{wdi_front.displayFeed(b);wdi_front.applyFilters(b);if(!wdi_front.activeUsersCount(b)){if(b.feed_row.feed_display_view=="load_more_btn"){var c=jQuery("#wdi_feed_"+b.feed_row.wdi_feed_counter);c.find(".wdi_load_more").addClass("wdi_hidden");c.find(".wdi_spinner").addClass("wdi_hidden")}}}}};wdi_front.saveSelfUserData=function(c,a){c.username="";c.user_id="";a.usersData.push(c);a.currentResponseLength=wdi_front.getArrayContentLength(a.usersData,"data");a.allResponseLength+=a.currentResponseLength;if(a.dataCount==a.usersData.length){if(a.currentResponseLength<a.feed_row.number_of_photos&&!wdi_front.userHasNoPhoto(a)){wdi_front.loadMore("initial-keep",a)}else{wdi_front.displayFeed(a);wdi_front.applyFilters(a);if(!wdi_front.activeUsersCount(a)){if(a.feed_row.feed_display_view=="load_more_btn"){var b=jQuery("#wdi_feed_"+a.feed_row.wdi_feed_counter);b.find(".wdi_load_more").addClass("wdi_hidden");b.find(".wdi_spinner").addClass("wdi_hidden")}}}}};wdi_front.userHasNoPhoto=function(c,e){var a=0;var d=c.usersData;if(typeof e!="undefined"){d=e}for(var b=0;b<d.length;b++){if(typeof d[b]["pagination"]=="undefined"){d[b]["pagination"]=[]}if(c.feed_row.liked_feed==="liked"){if(typeof d[b]["pagination"]["next_max_like_id"]=="undefined"){a++}}else{if(typeof d[b]["pagination"]["next_max_id"]=="undefined"){a++}}}if(a==d.length){return 1}else{return 0}};wdi_front.appendRequestHashtag=function(c,b){for(var a=0;a<c.length;a++){c[a]["wdi_hashtag"]=b}return c};wdi_front.displayFeed=function(c,b){if(c.customFilterChanged==false){var d=wdi_front.feedSort(c,b)}var a=c.customFilterChanged;if(c.customFilterChanged==true){var d=c.customFilteredData;c.parsedData=wdi_front.parseLighboxData(c,true)}if(c.feed_row.resort_after_load_more!="1"){if(c.customFilterChanged==false){c.dataStorageList=c.dataStorageList.concat(d)}}else{if(c.customFilterChanged==false){c.dataStorageList=d}}if(c.feed_row.feed_type=="masonry"){wdi_front.masonryDisplayFeedItems(d,c)}if(c.feed_row.feed_type=="thumbnails"||c.feed_row.feed_type=="blog_style"||c.feed_row.feed_type=="image_browser"){wdi_front.displayFeedItems(d,c)}var e=wdi_front.getDataLength(c);if(e<c.photoCounter&&!a&&c.instagramRequestCounter<=c.maxConditionalFiltersRequestCount&&!wdi_front.allDataHasFinished(c)){wdi_front.loadMore("",c)}else{wdi_front.allImagesLoaded(c)}if(c.instagramRequestCounter>c.maxConditionalFiltersRequestCount){wdi_front.allImagesLoaded(c);if(d.length==0){c.stopInfiniteScrollFlag=true}}if(c.feed_row.feed_display_view=="pagination"&&c.currentPage<c.paginator){jQuery("#wdi_feed_"+c.feed_row.wdi_feed_counter).find("#wdi_last_page").removeClass("wdi_disabled")}c.instagramRequestCounter=0;c.conditionalFilterBuffer=[];wdi_front.updateUsersImages(c)};wdi_front.updateUsersImages=function(a){var b=jQuery("#wdi_feed_"+a.feed_row.wdi_feed_counter).find(".wdi_single_user .wdi_user_img_wrap img");b.each(function(){if(jQuery(this).attr("src")==wdi_url.plugin_url+"images/missing.png"||jQuery(this).attr("src")==""){if(a.feed_row.liked_feed=="liked"){return}for(var c=0;c<a.usersData.length;c++){if(a.usersData[c]["username"]==jQuery(this).parent().parent().find("h3").text()){if(a.usersData[c]["data"].length!=0){jQuery(this).attr("src",a.usersData[c]["data"][0]["images"]["thumbnail"]["url"])}}}}})};wdi_front.masonryDisplayFeedItems=function(d,h){var b=[];var p=[];if(jQuery("#wdi_feed_"+h.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").length==0){return}jQuery("#wdi_feed_"+h.feed_row.wdi_feed_counter+" .wdi_masonry_column").each(function(){if(h.feed_row.resort_after_load_more==1){jQuery(this).html("");h.imageIndex=0}if(h.customFilterChanged==true){jQuery(this).html("");h.imageIndex=0}if(h.feed_row.feed_display_view=="pagination"){b.push(0)}else{b.push(jQuery(this).height())}p.push(jQuery(this))});if(h.customFilterChanged==true){h.customFilterChanged=false}for(var e=0;e<d.length;e++){h.displayedData.push(d[e]);if(d[e]["type"]=="image"){var n=wdi_front.getPhotoTemplate(h)}else{if(d[e].hasOwnProperty("videos")||d[e]["type"]=="video"){var n=wdi_front.getVideoTemplate(h)}else{var n=wdi_front.getSliderTemplate(h)}}var g=d[e];var o=wdi_front.createObject(g,h);var f=n(o);var m=wdi_front.array_min(b);var l=wdi_front.getImageResolution(d[e]);p[m.index].html(p[m.index].html()+f);b[m.index]+=p[m.index].width()*l;h.imageIndex++;if(h.feed_row.feed_display_view=="pagination"){if((e+1)%h.feed_row.pagination_per_page_number===0){h.resIndex+=h.freeSpaces+1}else{h.resIndex++}}}h.wdi_loadedImages=0;var j=false;h.wdi_load_count=e;var a=h.feed_row.wdi_feed_counter;var k=jQuery("#wdi_feed_"+a+" img.wdi_img").on("load",function(){h.wdi_loadedImages++;c();if(j===false){wdi_responsive.columnControl(h,1);j=true}});c();function c(){if(h.wdi_load_count===h.wdi_loadedImages&&h.wdi_loadedImages!=0){h.loadedImages=0;h.wdi_load_count=0;wdi_front.allImagesLoaded(h)}}if(h.paginatorNextFlag==true){wdi_front.updatePagination(h,"next")}h.infiniteScrollFlag=false};wdi_front.getImageResolution=function(c){var d=c.images["standard_resolution"]["width"];var b=c.images["standard_resolution"]["height"];var a=b/d;return a};wdi_front.getDataLength=function(b,d){var c=0;if(typeof d==="undefined"){for(var a=0;a<b.dataStorage.length;a++){c+=b.dataStorage[a].length}}else{for(var a=0;a<d.length;a++){c+=d[a].length}}return c};wdi_front.getArrayContentLength=function(d,c){var b=0;for(var a=0;a<d.length;a++){if(d[a]["finished"]=="finished"){continue}b+=d[a][c].length}return b};wdi_front.displayFeedItems=function(d,j){if(jQuery("#wdi_feed_"+j.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").length==0){return}var a=j.feed_row.wdi_feed_counter;var l=jQuery("#wdi_feed_"+a+" .wdi_feed_wrapper");if(j.feed_row.resort_after_load_more==="1"){l.html("");j.imageIndex=0}if(j.customFilterChanged==true){l.html("");j.imageIndex=0;j.customFilterChanged=false}var g=wdi_front.getImgCount(j)-d.length-1;if(j.feed_row.feed_display_view=="pagination"){var b=j.feed_row.load_more_number;if(j.feed_row.feed_type=="image_browser"){b=1}if(jQuery("#wdi_feed_"+j.feed_row.wdi_feed_counter+' [wdi_page="'+(j.currentPage-1)+'"]').length<b||d.length==0){j.currentPage=(--j.currentPage<=1)?1:j.currentPage}}for(var e=0;e<d.length;e++){if(d[e]["type"]=="image"){var m=wdi_front.getPhotoTemplate(j)}else{if(d[e].hasOwnProperty("videos")){var m=wdi_front.getVideoTemplate(j)}else{var m=wdi_front.getSliderTemplate(j)}}var h=d[e];var n=wdi_front.createObject(h,j);var f=m(n);l.html(l.html()+f);j.imageIndex++;if(j.feed_row.feed_display_view=="pagination"){if((e+1)%j.feed_row.pagination_per_page_number===0){j.resIndex+=j.freeSpaces+1}else{j.resIndex++}}}j.wdi_loadedImages=0;var k=false;j.wdi_load_count=e;var a=j.feed_row.wdi_feed_counter;var l=jQuery("#wdi_feed_"+a+" img.wdi_img").on("load",function(){j.wdi_loadedImages++;c();if(k===false){wdi_responsive.columnControl(j,1);k=true}});function c(){if(j.wdi_load_count===j.wdi_loadedImages&&j.wdi_loadedImages!=0){j.loadedImages=0;j.wdi_load_count=0;wdi_front.allImagesLoaded(j)}}if(j.paginatorNextFlag==true){wdi_front.updatePagination(j,"next")}j.infiniteScrollFlag=false};wdi_front.checkFeedFinished=function(b){for(var a=0;a<b.usersData.length;a++){if(typeof b.usersData[a]["finished"]=="undefined"){return false}}return true};wdi_front.sortingOperator=function(c,b){var a;switch(c){case"date":switch(b){case"asc":a=function(e,d){return(e.created_time>d.created_time)?1:-1};break;case"desc":a=function(e,d){return(e.created_time>d.created_time)?-1:1};break}break;case"likes":switch(b){case"asc":a=function(e,d){return(e.likes["count"]<d.likes["count"])?-1:1};break;case"desc":a=function(e,d){return(e.likes["count"]<d.likes["count"])?1:-1};break}break;case"comments":switch(b){case"asc":a=function(e,d){return(e.comments["count"]<d.comments["count"])?-1:1};break;case"desc":a=function(e,d){return(e.comments["count"]<d.comments["count"])?1:-1};break}break;case"random":a=function(e,d){var f=Math.random();return(f>0.5)?1:-1};break}return a};wdi_front.feedSort=function(e,b){var d=e.feed_row.sort_images_by;var c=e.feed_row.display_order;if(e.feed_row.resort_after_load_more==="1"){e.data=e.data.concat(wdi_front.smartPicker(e,b))}else{e.data=wdi_front.smartPicker(e,b)}var a=wdi_front.sortingOperator(d,c);e.data.sort(a);return e.data};wdi_front.smartPicker=function(l,c){var g=[];var a=0;var k=[];var f=Math.ceil(l.feed_row["number_of_photos"]/l.usersData.length);var b=parseInt(l.feed_row["number_of_photos"]);var n=0;if(c!=""&&typeof c!="undefined"&&c!=null){b=parseInt(c);f=Math.ceil(b/wdi_front.activeUsersCount(l))}var j=function(p,i){return(p.data.length>i.data.length)?1:-1};var e=function(p,i){return(p.length()>i.length())?1:-1};l.storeRawData(l.usersData,"dataStorageRaw");var o=l.dataStorageRaw.sort(e);var h=l.usersData.sort(j);for(var d=0;d<h.length;d++){n+=f;if(o[d].length()<=n){n-=o[d].length();g.push(o[d].getData(o[d].length()));a+=g[g.length-1].length}else{if(a+n>b){n=b-a}var m=[];if(l.auto_trigger===false){m=m.concat(o[d].getData(n))}else{if(m.length+wdi_front.getDataLength(l)+wdi_front.getDataLength(l,g)<l.feed_row["number_of_photos"]){m=m.concat(o[d].getData(n))}}n=0;a+=m.length;g.push(m)}}for(d=0;d<g.length;d++){if(typeof l.dataStorage[d]==="undefined"){l.dataStorage.push(g[d])}else{l.dataStorage[d]=l.dataStorage[d].concat(g[d])}}l.parsedData=wdi_front.parseLighboxData(l);for(d=0;d<g.length;d++){k=k.concat(g[d])}return k};wdi_front.createObject=function(e,h){var j=(e.caption!=null)?e.caption["text"]:"&nbsp";var i="";if(e.type=="video"){i=e.hasOwnProperty("videos")?e.videos[h.feedVideoResolution]["url"]:""}if(typeof e.images[h.feedImageResolution]=="undefined"){var f=wdi_url.plugin_url+"images/missing.png"}else{var f=e.images[h.feedImageResolution].url}var a=h.imageIndex;var b="square";var d=e.images["standard_resolution"]["height"];var g=e.images["standard_resolution"]["width"];if(d>g){b="portrait"}else{if(d<g){b="landscape"}}var c={id:e.id,caption:wdi_front.escape_tags(j),image_url:f,likes:e.likes["count"],comments:e.comments["count"],wdi_index:a,wdi_res_index:h.resIndex,wdi_media_user:e.user["username"],link:e.link,video_url:i,wdi_username:e.user["username"],wdi_shape:b};return c};wdi_front.setPage=function(c){var b=c.feed_row.feed_display_view;var e=c.feed_row.feed_type;if(b!="pagination"){return""}var a=c.imageIndex;if(e=="image_browser"){var d=1}else{var d=Math.abs(c.feed_row.pagination_per_page_number)}c.paginator=Math.ceil((a+1)/d);return c.paginator};wdi_front.getPhotoTemplate=function(g){var e=wdi_front.setPage(g);var j="";var k="";var l="";var d="";var m="fa-arrows-alt";var c="";if(g.feed_row.feed_type=="blog_style"||g.feed_row.feed_type=="image_browser"){m=""}if(e!=""){k='wdi_page="'+e+'"';sourceAttr="src"}else{sourceAttr="src"}if(e!=""&&e!=1){j="wdi_hidden"}if(g.feed_row.show_username_on_thumb=="1"){c='<span class="wdi_media_user">@<%= wdi_username%></span>'}if(g.feed_row.show_full_description==1&&g.feed_row.feed_type=="masonry"){j+=" wdi_full_caption"}var f="";if(g.feed_row.feed_type!=="blog_style"){if(g.feed_row.feed_type=="masonry"){f="wdi_responsive.showMasonryCaption(jQuery(this),"+g.feed_row.wdi_feed_counter+");"}else{f="wdi_responsive.showCaption(jQuery(this),"+g.feed_row.wdi_feed_counter+");"}}switch(g.feed_row.feed_item_onclick){case"lightbox":l="onclick=wdi_feed_"+g.feed_row.wdi_feed_counter+".galleryBox('<%=id%>')";break;case"instagram":l="onclick=\"window.open ('<%= link%>','_blank')\"";d="wdi_hover_off";m="";break;case"custom_redirect":l="onclick=\"window.open ('"+g.feed_row.redirect_url+"','_self')\"";d="wdi_hover_off";m="";break;case"none":l="";d="wdi_cursor_off wdi_hover_off";m=""}var h="<%= wdi_shape == 'square' ? 'wdi_shape_square' : (wdi_shape == 'portrait' ? 'wdi_shape_portrait' : (wdi_shape == 'landscape' ? 'wdi_shape_landscape' : 'wdi_shape_square') ) %>";var b=g.feed_row.wdi_feed_counter;var a='<div class="wdi_feed_item '+j+'" wdi_index=<%= wdi_index%> wdi_res_index=<%= wdi_res_index%> wdi_media_user=<%= wdi_media_user%> '+k+' wdi_type="image" id="wdi_'+b+'_<%=id%>"><div class="wdi_photo_wrap"><div class="wdi_photo_wrap_inner"><div class="wdi_photo_img '+h+'"><img class="wdi_img" '+sourceAttr+'="<%=image_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);"><div class="wdi_photo_overlay '+d+'" >'+c+'<div class="wdi_thumb_icon" '+l+' style="display:table;width:100%;height:100%;"><div style="display:table-cell;vertical-align:middle;text-align:center;color:white;"><i class="fa '+m+'"></i></div></div></div></div></div></div>';if(g.feed_row["show_likes"]==="1"||g.feed_row["show_comments"]==="1"||g.feed_row["show_description"]==="1"){a+='<div class="wdi_photo_meta">';if(g.feed_row["show_likes"]==="1"){a+='<div class="wdi_thumb_likes"><i class="fa fa-heart-o">&nbsp;<%= likes%></i></div>'}if(g.feed_row["show_comments"]==="1"){a+='<div class="wdi_thumb_comments"><i class="fa fa-comment-o">&nbsp;<%= comments%></i></div>'}a+='<div class="wdi_clear"></div>';if(g.feed_row["show_description"]==="1"){a+='<div class="wdi_photo_title" onclick='+f+" ><%=caption%></div>"}a+="</div>"}a+="</div>";var i=_.template(a);return i};wdi_front.getSliderTemplate=function(g){var e=wdi_front.setPage(g);var j="";var k="";var l="";var d="";var m="fa-clone";var c="";if(g.feed_row.feed_type=="blog_style"||g.feed_row.feed_type=="image_browser"){m=""}if(e!=""){k='wdi_page="'+e+'"';sourceAttr="src"}else{sourceAttr="src"}if(e!=""&&e!=1){j="wdi_hidden"}if(g.feed_row.show_username_on_thumb=="1"){c='<span class="wdi_media_user">@<%= wdi_username%></span>'}if(g.feed_row.show_full_description==1&&g.feed_row.feed_type=="masonry"){j+=" wdi_full_caption"}var f="";if(g.feed_row.feed_type!=="blog_style"){if(g.feed_row.feed_type=="masonry"){f="wdi_responsive.showMasonryCaption(jQuery(this),"+g.feed_row.wdi_feed_counter+");"}else{f="wdi_responsive.showCaption(jQuery(this),"+g.feed_row.wdi_feed_counter+");"}}switch(g.feed_row.feed_item_onclick){case"lightbox":l="onclick=wdi_feed_"+g.feed_row.wdi_feed_counter+".galleryBox('<%=id%>')";break;case"instagram":l="onclick=\"window.open ('<%= link%>','_blank')\"";d="wdi_hover_off";m="fa-clone";break;case"custom_redirect":l="onclick=\"window.open ('"+g.feed_row.redirect_url+"','_self')\"";d="wdi_hover_off";m="";break;case"none":l="";d="wdi_cursor_off wdi_hover_off";m=""}var h="<%= wdi_shape == 'square' ? 'wdi_shape_square' : (wdi_shape == 'portrait' ? 'wdi_shape_portrait' : (wdi_shape == 'landscape' ? 'wdi_shape_landscape' : 'wdi_shape_square') ) %>";var b=g.feed_row.wdi_feed_counter;var a='<div class="wdi_feed_item '+j+'" wdi_index=<%= wdi_index%> wdi_res_index=<%= wdi_res_index%> wdi_media_user=<%= wdi_media_user%> '+k+' wdi_type="slideshow" id="wdi_'+b+'_<%=id%>"><div class="wdi_photo_wrap"><div class="wdi_photo_wrap_inner"><div class="wdi_photo_img '+h+'"><img class="wdi_img" '+sourceAttr+'="<%=image_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);"><div class="wdi_photo_overlay '+d+'" >'+c+'<div class="wdi_thumb_icon" '+l+' style="display:table;width:100%;height:100%;"><div style="display:table-cell;vertical-align:middle;text-align:center;color:white;"><i class="fa '+m+'"></i></div></div></div></div></div></div>';if(g.feed_row["show_likes"]==="1"||g.feed_row["show_comments"]==="1"||g.feed_row["show_description"]==="1"){a+='<div class="wdi_photo_meta">';if(g.feed_row["show_likes"]==="1"){a+='<div class="wdi_thumb_likes"><i class="fa fa-heart-o">&nbsp;<%= likes%></i></div>'}if(g.feed_row["show_comments"]==="1"){a+='<div class="wdi_thumb_comments"><i class="fa fa-comment-o">&nbsp;<%= comments%></i></div>'}a+='<div class="wdi_clear"></div>';if(g.feed_row["show_description"]==="1"){a+='<div class="wdi_photo_title" onclick='+f+" ><%=caption%></div>"}a+="</div>"}a+="</div>";var i=_.template(a);return i};wdi_front.replaceToVideo=function(b,a,c){overlayHtml="<video style='width:auto !important; height:auto !important; max-width:100% !important; max-height:100% !important; margin:0 !important;' controls=''><source src='"+b+"' type='video/mp4'>Your browser does not support the video tag. </video>";jQuery("#wdi_feed_"+c+' [wdi_index="'+a+'"] .wdi_photo_wrap_inner').html(overlayHtml);jQuery("#wdi_feed_"+c+' [wdi_index="'+a+'"] .wdi_photo_wrap_inner video').get(0).play()};wdi_front.getVideoTemplate=function(h){var f=wdi_front.setPage(h);var k="";var l="";var n="fa-play";var m="";var d="";var e;var c="";if(f!=""){l='wdi_page="'+f+'"';e="src"}else{e="src"}if(f!=""&&f!=1){k="wdi_hidden"}if(h.feed_row.show_username_on_thumb=="1"){c='<span class="wdi_media_user">@<%= wdi_username%></span>'}if(h.feed_row.show_full_description==1&&h.feed_row.feed_type=="masonry"){k+=" wdi_full_caption"}var g="";if(h.feed_row.feed_type!=="blog_style"){if(h.feed_row.feed_type=="masonry"){g="wdi_responsive.showMasonryCaption(jQuery(this),"+h.feed_row.wdi_feed_counter+");"}else{g="wdi_responsive.showCaption(jQuery(this),"+h.feed_row.wdi_feed_counter+");"}}switch(h.feed_row.feed_item_onclick){case"lightbox":m="onclick=wdi_feed_"+h.feed_row.wdi_feed_counter+".galleryBox('<%=id%>')";break;case"instagram":m="onclick=\"window.open ('<%= link%>','_blank')\"";d="wdi_hover_off";n="fa-play";break;case"custom_redirect":m="onclick=\"window.open ('"+h.feed_row.redirect_url+"','_self')\"";d="wdi_hover_off";n="";break;case"none":d="wdi_cursor_off wdi_hover_off";n="";if(h.feed_row.feed_type=="blog_style"||h.feed_row.feed_type=="image_browser"){m="onclick=wdi_front.replaceToVideo('<%= video_url%>','<%= wdi_index%>',"+h.feed_row.wdi_feed_counter+")";d="";n="fa-play"}}var i="<%= wdi_shape == 'square' ? 'wdi_shape_square' : (wdi_shape == 'portrait' ? 'wdi_shape_portrait' : (wdi_shape == 'landscape' ? 'wdi_shape_landscape' : 'wdi_shape_square') ) %>";var b=h.feed_row.wdi_feed_counter;var a='<div class="wdi_feed_item '+k+'" wdi_index=<%= wdi_index%> wdi_res_index=<%= wdi_res_index%> wdi_media_user=<%= wdi_media_user%> '+l+' wdi_type="image" id="wdi_'+b+'_<%=id%>"><div class="wdi_photo_wrap"><div class="wdi_photo_wrap_inner"><div class="wdi_photo_img '+i+'"><img class="wdi_img" '+e+'="<%=image_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);"><div class="wdi_photo_overlay '+d+'" '+m+">"+c+'<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="fa '+n+'"></i></div></div></div></div></div></div>';if(h.feed_row["show_likes"]==="1"||h.feed_row["show_comments"]==="1"||h.feed_row["show_description"]==="1"){a+='<div class="wdi_photo_meta">';if(h.feed_row["show_likes"]==="1"){a+='<div class="wdi_thumb_likes"><i class="fa fa-heart-o">&nbsp;<%= likes%></i></div>'}if(h.feed_row["show_comments"]==="1"){a+='<div class="wdi_thumb_comments"><i class="fa fa-comment-o">&nbsp;<%= comments%></i></div>'}a+='<div class="wdi_clear"></div>';if(h.feed_row["show_description"]==="1"){a+='<div class="wdi_photo_title" onclick='+g+" ><%=caption%></div>"}a+="</div>"}a+="</div>";var j=_.template(a);return j};wdi_front.bindEvents=function(a){if(jQuery("#wdi_feed_"+a.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").length==0){return}if(a.feed_row.feed_display_view=="load_more_btn"){jQuery("#wdi_feed_"+a.feed_row.wdi_feed_counter+" .wdi_load_more_container").on(wdi_front.clickOrTouch,function(){wdi_front.loadMore(jQuery(this).find(".wdi_load_more_wrap"))})}if(a.feed_row.feed_display_view=="pagination"){jQuery("#wdi_feed_"+a.feed_row.wdi_feed_counter+" #wdi_next").on(wdi_front.clickOrTouch,function(){wdi_front.paginatorNext(jQuery(this),a)});jQuery("#wdi_feed_"+a.feed_row.wdi_feed_counter+" #wdi_prev").on(wdi_front.clickOrTouch,function(){wdi_front.paginatorPrev(jQuery(this),a)});jQuery("#wdi_feed_"+a.feed_row.wdi_feed_counter+" #wdi_last_page").on(wdi_front.clickOrTouch,function(){wdi_front.paginationLastPage(jQuery(this),a)});jQuery("#wdi_feed_"+a.feed_row.wdi_feed_counter+" #wdi_first_page").on(wdi_front.clickOrTouch,function(){wdi_front.paginationFirstPage(jQuery(this),a)});a.paginatorNextFlag=false}if(a.feed_row.feed_display_view=="infinite_scroll"){jQuery(window).on("scroll",function(){wdi_front.infiniteScroll(a)});a.infiniteScrollFlag=false}};wdi_front.infiniteScroll=function(a){if((jQuery(window).scrollTop()+jQuery(window).height()-100)>=jQuery("#wdi_feed_"+a.feed_row.wdi_feed_counter+" #wdi_infinite_scroll").offset().top){if(a.infiniteScrollFlag===false&&a.stopInfiniteScrollFlag==false){a.infiniteScrollFlag=true;wdi_front.loadMore(jQuery("#wdi_feed_"+a.feed_row.wdi_feed_counter+" #wdi_infinite_scroll"),a)}else{if(a.stopInfiniteScrollFlag){wdi_front.allImagesLoaded(a)}}}};wdi_front.paginationFirstPage=function(b,c){if(c.paginator==1||c.currentPage==1){b.addClass("wdi_disabled");return}var d=c.currentPage;c.currentPage=1;wdi_front.updatePagination(c,"custom",d);var a=b.parent().find("#wdi_last_page");a.removeClass("wdi_disabled");b.addClass("wdi_disabled")};wdi_front.paginationLastPage=function(a,b){if(b.paginator==1||b.currentPage==b.paginator){return}var d=b.currentPage;b.currentPage=b.paginator;wdi_front.updatePagination(b,"custom",d);a.addClass("wdi_disabled");var c=a.parent().find("#wdi_first_page");c.removeClass("wdi_disabled")};wdi_front.paginatorNext=function(b,c){var a=b.parent().find("#wdi_last_page");var d=b.parent().find("#wdi_first_page");c.paginatorNextFlag=true;if(c.paginator==c.currentPage&&!wdi_front.checkFeedFinished(c)){c.currentPage++;var e=c.feed_row.number_of_photos;wdi_front.loadMore(b,c,e);a.addClass("wdi_disabled")}else{if(c.paginator>c.currentPage){c.currentPage++;wdi_front.updatePagination(c,"next");if(c.paginator>c.currentPage){a.removeClass("wdi_disabled")}else{a.addClass("wdi_disabled")}}}d.removeClass("wdi_disabled")};wdi_front.paginatorPrev=function(b,c){var a=b.parent().find("#wdi_last_page");var d=b.parent().find("#wdi_first_page");if(c.currentPage==1){d.addClass("wdi_disabled");return}c.currentPage--;wdi_front.updatePagination(c,"prev");a.removeClass("wdi_disabled");if(c.currentPage==1){d.addClass("wdi_disabled")}};wdi_front.updatePagination=function(b,a,d){var c="#wdi_feed_"+b.feed_row.wdi_feed_counter;jQuery(c+' [wdi_page="'+b.currentPage+'"]').each(function(){jQuery(this).removeClass("wdi_hidden")});switch(a){case"next":var d=b.currentPage-1;jQuery(c+" .wdi_feed_wrapper").height(jQuery(".wdi_feed_wrapper").height());jQuery(c+' [wdi_page="'+d+'"]').each(function(){jQuery(this).addClass("wdi_hidden")});break;case"prev":var d=b.currentPage+1;jQuery(c+" .wdi_feed_wrapper").height(jQuery(".wdi_feed_wrapper").height());jQuery(c+' [wdi_page="'+d+'"]').each(function(){jQuery(this).addClass("wdi_hidden")});break;case"custom":var d=d;if(d!=b.currentPage){jQuery(c+" .wdi_feed_wrapper").height(jQuery(".wdi_feed_wrapper").height());jQuery(c+' [wdi_page="'+d+'"]').each(function(){jQuery(this).addClass("wdi_hidden")})}break}b.paginatorNextFlag=false;jQuery(c+" .wdi_feed_wrapper").css("height","auto");jQuery(c+" #wdi_current_page").text(b.currentPage)};wdi_front.loadMore=function(f,k){var b=0;if(f!=""&&typeof f!="undefined"&&f!="initial"&&f!="initial-keep"){var l=window[f.parent().parent().parent().parent().attr("id")]}if(typeof k!="undefined"){var l=k}var n=0,g=0;for(var e=0;e<l.userSortFlags.length;e++){if(l.userSortFlags[e].flag===true){n++;for(var d=0;d<l.usersData.length;d++){if(l.userSortFlags[e]["id"]===l.usersData[d]["user_id"]){if(l.usersData[d]["finished"]==="finished"){g++}}}}}if(n===g&&n!=0){return}if(f===""){l.auto_trigger=true}else{l.auto_trigger=false}wdi_front.ajaxLoader(l);if(l.feed_row.feed_type==="masonry"&&l.feed_row.feed_display_view=="pagination"){jQuery("#wdi_feed_"+wdi_front.feed_counter+" .wdi_full_caption").each(function(){jQuery(this).find(".wdi_photo_title").trigger(wdi_front.clickOrTouch)})}for(var e=0;e<l.usersData.length;e++){if(l.usersData[e]["finished"]==="finished"){b++}}if(b===l.usersData.length){wdi_front.allImagesLoaded(l);jQuery("#wdi_feed_"+l.feed_row["wdi_feed_counter"]+" .wdi_load_more").remove()}var h=l.usersData;l.loadMoreDataCount=l.feed_users.length;for(var e=0;e<h.length;e++){var m=h[e]["pagination"];var c={user_id:h[e]["user_id"],username:h[e]["username"]};if(m.next_url!=""&&m.next_url!=null&&typeof m.next_url!="undefined"){var a=m.next_url;wdi_front.loadMoreRequest(c,a,l,f)}else{if(f=="initial-keep"){l.temproraryUsersData[e]=l.usersData[e]}l.loadMoreDataCount--;wdi_front.checkForLoadMoreDone(l,f);continue}}};wdi_front.loadMoreRequest=function(b,a,e,d){if(!e.mediaRequestsDone){return}var f=e.usersData;var c="";var g=function(h){if(typeof h.meta!="undefined"&&typeof h.meta.error_type!="undefined"){wdi_front.show_alert(false,h,e)}if(h===""||typeof h=="undefined"||h==null){c=wdi_front_messages.network_error;e.loadMoreDataCount--;wdi_front.show_alert(c,h,e);return}if(h.meta["code"]!=200){c=h.meta["error_message"];e.loadMoreDataCount--;wdi_front.show_alert(c,h,e);return}h.user_id=b.user_id;h.username=b.username;for(var j=0;j<e.usersData.length;j++){if(h.user_id===e.usersData[j]["user_id"]){if(h.user_id[0]==="#"){h.data=wdi_front.appendRequestHashtag(h.data,h.user_id)}if(d=="initial-keep"){e.temproraryUsersData[j]=e.usersData[j]}e.usersData[j]=h;e.loadMoreDataCount--}}wdi_front.checkForLoadMoreDone(e,d)};if(b.username[0]!=="#"){e.instagram.requestByUrl(a,{success:g})}else{e.instagram.getTagRecentMedia(b.username,{success:g},a,e.feed_row.hashtag_top_recent)}};wdi_front.checkForLoadMoreDone=function(c,b){var a=c.feed_row.load_more_number;var e=c.feed_row.number_of_photos;if(c.loadMoreDataCount==0){c.temproraryUsersData=wdi_front.mergeData(c.temproraryUsersData,c.usersData);var d=wdi_front.getArrayContentLength(c.temproraryUsersData,"data");if(b=="initial-keep"){b="initial"}if(b=="initial"){if(d<e&&!wdi_front.userHasNoPhoto(c,c.temproraryUsersData)&&c.instagramRequestCounter<=c.maxConditionalFiltersRequestCount){wdi_front.loadMore("initial",c)}else{c.usersData=c.temproraryUsersData;wdi_front.displayFeed(c);wdi_front.applyFilters(c);c.temproraryUsersData=[]}}else{if(d<a&&!wdi_front.userHasNoPhoto(c,c.temproraryUsersData)&&c.instagramRequestCounter<=c.maxConditionalFiltersRequestCount){wdi_front.loadMore(undefined,c)}else{c.usersData=c.temproraryUsersData;if(!wdi_front.activeUsersCount(c)){return}wdi_front.displayFeed(c,a);wdi_front.applyFilters(c);c.temproraryUsersData=[]}}}};wdi_front.allDataHasFinished=function(b){var d=0;for(var a=0;a<b.dataStorageRaw.length;a++){if(b.dataStorageRaw[a].length()==0&&b.dataStorageRaw[a].locked==true){d++}}return(d==b.dataStorageRaw.length)};wdi_front.mergeData=function(c,b){for(var a=0;a<b.length;a++){if(typeof c[a]!="undefined"){if(b[a]["finished"]=="finished"){continue}if(typeof c[a]["pagination"]["next_max_id"]=="undefined"&&typeof c[a]["pagination"]["next_max_like_id"]=="undefined"){continue}c[a]["data"]=c[a]["data"].concat(b[a]["data"]);c[a]["pagination"]=b[a]["pagination"];c[a]["user_id"]=b[a]["user_id"];c[a]["username"]=b[a]["username"];c[a]["meta"]=b[a]["meta"]}else{c.push(b[a])}}return c};wdi_front.brokenImageHandler=function(a){a.src=wdi_url.plugin_url+"images/missing.png";a.onerror="";return true};wdi_front.ajaxLoader=function(a){var d=a.feed_row.wdi_feed_counter;var c=jQuery("#wdi_feed_"+d);if(a.feed_row.feed_display_view=="load_more_btn"){c.find(".wdi_load_more").addClass("wdi_hidden");c.find(".wdi_spinner").removeClass("wdi_hidden")}if(a.feed_row.feed_display_view=="infinite_scroll"){var b;if(c.find(".wdi_ajax_loading").length==0){b=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>');c.append(b)}else{b=c.find(".wdi_ajax_loading")}b.removeClass("wdi_hidden")}};wdi_front.allImagesLoaded=function(a){var d=wdi_front.getDataLength(a);if(!a.mediaRequestsDone){jQuery("#wdi_feed_"+a.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").remove("wdi_nomedia")}if(d==0&&a.mediaRequestsDone&&(a.feed_row.conditional_filters.length==0||a.feed_row.conditional_filter_enable==0)){jQuery("#wdi_feed_"+a.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").append("<p class='wdi_nomedia'>"+wdi_front_messages.feed_nomedia+"</p>")}var c=a.feed_row.wdi_feed_counter;var b=jQuery("#wdi_feed_"+c);if(a.feed_row.feed_display_view=="load_more_btn"){b.find(".wdi_load_more").removeClass("wdi_hidden");b.find(".wdi_spinner").addClass("wdi_hidden")}if(a.feed_row.feed_display_view=="infinite_scroll"){jQuery("#wdi_feed_"+a.feed_row.wdi_feed_counter+" .wdi_ajax_loading").addClass("wdi_hidden")}b.trigger("wdi_feed_loaded")};wdi_front.show=function(b,c){var e=c.feed_row.wdi_feed_counter;var d=jQuery("#wdi_feed_"+e+" .wdi_feed_container");var g=this;switch(b){case"header":f();break;case"users":a(c);break}function f(){var i={feed_thumb:c.feed_row["feed_thumb"],feed_name:c.feed_row["feed_name"]};var k=wdi_front.getHeaderTemplate(),h=k(i),j=d.find(".wdi_feed_header").html();d.find(".wdi_feed_header").html(j+h)}function a(j){d.find(".wdi_feed_users").html("");var n=j.feed_users;var m=j.feed_row["access_token"];var h=0;j.headerUserinfo=[];k();function k(){if(j.headerUserinfo.length==n.length){l(j.headerUserinfo,j);return}var i=n[j.headerUserinfo.length];if(typeof i==="string"&&i==="self"){j.instagram.getSelfInfo({success:function(o){if(typeof o.meta!="undefined"&&typeof o.meta.error_type!="undefined"){wdi_front.show_alert(false,o,j)}o=g.checkMediaResponse(o,j);if(o!=false&&o.meta["code"]===400&&o.meta["error_type"]==="APINotAllowedError"){var p=null;j.headerUserinfo.push(p);h++;k()}if(o!=false&&o.meta["code"]===200){var p={id:o.data["id"],name:o.data["username"],url:o.data["profile_picture"],bio:wdi_front.escape_tags(o.data["bio"]),counts:o.data["counts"],website:wdi_front.escape_tags(o.data["website"]),full_name:wdi_front.escape_tags(o.data["full_name"])};j.headerUserinfo.push(p);h++;k()}},args:{ignoreFiltering:true}})}else{if(false&&g.getInputType(i.username)=="hashtag"){j.instagram.searchForTagsByName(g.stripHashtag(i.username),{success:function(o){if(typeof o.meta!="undefined"&&typeof o.meta.error_type!="undefined"){wdi_front.show_alert(false,o,j)}o=g.checkMediaResponse(o,j);if(o!=false){if(o.data.length==0){var p="";var q={media:""}}else{var p="";var q={media:o.data[0]["media_count"]}}var r={name:n[h]["username"],url:p,counts:q};h++;j.headerUserinfo.push(r);k()}},args:{ignoreFiltering:true}})}else{if(g.getInputType(i.username)=="user"){j.instagram.getSelfInfo({success:function(o){if(typeof o.meta!="undefined"&&typeof o.meta.error_type!="undefined"){wdi_front.show_alert(false,o,j)}o=g.checkMediaResponse(o,j);if(o!=false&&o.meta["code"]===400&&o.meta["error_type"]==="APINotAllowedError"){var p=null;j.headerUserinfo.push(p);h++;k()}if(o!=false&&o.meta["code"]===200){var p={id:o.data["id"],name:o.data["username"],url:o.data["profile_picture"],bio:wdi_front.escape_tags(o.data["bio"]),counts:o.data["counts"],website:wdi_front.escape_tags(o.data["website"]),full_name:wdi_front.escape_tags(o.data["full_name"])};j.headerUserinfo.push(p);h++;k()}},args:{ignoreFiltering:true}})}}}}function l(i,t){d.find(".wdi_feed_users").html("");for(var q=0;q<i.length;q++){if(i[q]===null){continue}var v={flag:false,id:i[q]["id"],name:i[q]["name"]};var p=(i[q]["name"][0]=="#")?"wdi_header_hashtag":"";var u=wdi_extractHostname(i[q]["website"]);var o={user_index:q,user_img_url:i[q]["url"],counts:i[q]["counts"],feed_counter:t.feed_row.wdi_feed_counter,user_name:i[q]["name"],bio:wdi_front.escape_tags(i[q]["bio"]),website:u,website_url:i[q]["website"],usersCount:t.feed_row.feed_users.length,hashtagClass:p};var x=wdi_front.getUserTemplate(t,i[q]["name"]),r=x(o),s=d.find(".wdi_feed_users").html();d.find(".wdi_feed_users").html(s+r);t.userSortFlags.push(v);var w=jQuery('<div class="wdi_clear"></div>')}d.find(".wdi_feed_users").append(w);wdi_front.updateUsersImages(t)}}};wdi_front.getUserTemplate=function(c,h){var a=c.dataCount,d,f,g;switch(h[0]){case"#":d="//instagram.com/explore/tags/"+h.substr(1,h.length);break;default:d="//instagram.com/"+h;break}g='window.open("'+d+'","_blank")';f="onclick='"+g+"'";var e='<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%>">';if(a>1){e+='<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="fa fa-filter"></span></div></div>'}e+="</div>";e+="<h3 "+f+"><%= user_name%></h3>";if(h[0]!=="#"){if(c.feed_row.follow_on_instagram_btn=="1"){e+='<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>"}e+='<div class="wdi_media_info"><p class="wdi_posts"><span class="fa fa-camera-retro"></span><%= counts.media%></p><p class="wdi_followers"><span class="fa fa-user"></span><%= counts.followed_by%></p></div>'}else{e+='<div class="wdi_user_controls"></div><div class="wdi_media_info"><p class="wdi_posts"><span class="fa fa-camera-retro"></span><%= counts.media%></p><p class="wdi_followers"><span></span></p></div>'}e+='<div class="wdi_clear"></div>';if(a==1&&h[0]!=="#"&&c.feed_row.display_user_info=="1"){e+='<div class="wdi_bio"><%= bio%></div>';e+='<div class="wdi_website"><a target="_blank" href="<%= website_url%>" ><%= website%></a></div>'}e+="</div></div>";var b=_.template(e);return b};wdi_front.getHeaderTemplate=function(){var b='<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>';var a=_.template(b);return a};wdi_front.addFilter=function(e,g){var f=window["wdi_feed_"+g];var d=f.dataCount;if(d<2){return}if(f.nowLoadingImages!=false){return}else{var c=jQuery("#wdi_feed_"+f.feed_row.wdi_feed_counter+'_users [user_index="'+e+'"]');c.find(".wdi_filter_overlay").toggleClass("wdi_filter_active_bg");c.find(".wdi_header_user_text h3").toggleClass("wdi_filter_active_col");c.find(".wdi_media_info").toggleClass("wdi_filter_active_col");c.find(".wdi_follow_btn").toggleClass("wdi_filter_active_col");f.customFilterChanged=true;if(f.userSortFlags[e]["flag"]==false){f.userSortFlags[e]["flag"]=true}else{f.userSortFlags[e]["flag"]=false}var a=0;for(var b=0;b<f.userSortFlags.length;b++){if(f.userSortFlags[b]["flag"]==true){a++}}if(f.feed_row.feed_display_view=="pagination"){f.resIndex=0}if(a!=0){wdi_front.filterData(f);wdi_front.displayFeed(f)}else{f.customFilteredData=f.dataStorageList;wdi_front.displayFeed(f)}if(f.feed_row.feed_display_view=="pagination"){f.paginator=Math.ceil((f.imageIndex)/parseInt(f.feed_row.pagination_per_page_number));f.currentPage=f.paginator;wdi_front.updatePagination(f,"custom",1);jQuery("#wdi_first_page").removeClass("wdi_disabled");jQuery("#wdi_last_page").addClass("wdi_disabled")}}};wdi_front.filterData=function(c){var d=c.userSortFlags;c.customFilteredData=[];for(var b=0;b<c.dataStorageList.length;b++){for(var a=0;a<d.length;a++){if(((typeof c.dataStorageList[b]["user"]["id"]!="undefined"&&c.dataStorageList[b]["user"]["id"]==d[a]["id"])||c.dataStorageList[b]["wdi_hashtag"]==d[a]["name"])&&d[a]["flag"]==true){c.customFilteredData.push(c.dataStorageList[b])}}}};wdi_front.applyFilters=function(c){for(var b=0;b<c.userSortFlags.length;b++){if(c.userSortFlags[b]["flag"]==true){var a=jQuery("#wdi_feed_"+c.feed_row.wdi_feed_counter+'[user_index="'+b+'"]');wdi_front.addFilter(b,c.feed_row.wdi_feed_counter);wdi_front.addFilter(b,c.feed_row.wdi_feed_counter)}}};wdi_front.getImgCount=function(b){var d=b.dataStorage;var c=0;for(var a=0;a<d.length;a++){c+=d[a].length}return c};wdi_front.parseLighboxData=function(k,m){var g=k.dataStorage;var l=k.feed_row.sort_images_by;var a=k.feed_row.display_order;var h=wdi_front.sortingOperator(l,a);var f=[];var b=[];var e={};if(m==true){f=k.customFilteredData}else{for(var d=0;d<g.length;d++){for(var c=0;c<g[d].length;c++){f.push(g[d][c])}}f.sort(h)}for(d=0;d<f.length;d++){e={alt:"",avg_rating:"",comment_count:f[d]["comments"]["count"],date:wdi_front.convertUnixDate(f[d]["created_time"]),description:wdi_front.getDescription((f[d]["caption"]!==null)?wdi_front.escape_tags(f[d]["caption"]["text"]):""),filename:wdi_front.getFileName(f[d]),filetype:wdi_front.getFileType(f[d]),hit_count:"0",id:f[d]["id"],image_url:f[d]["link"],number:0,rate:"",rate_count:"0",username:f[d]["user"]["username"],profile_picture:f[d]["user"]["profile_picture"],thumb_url:f[d]["link"]+"media/?size=t",comments_data:f[d]["comments"]["data"],images:f[d]["images"],carousel_media:(typeof f[d]["carousel_media"]!=="undefined")?f[d]["carousel_media"]:null};b.push(e)}return b};wdi_front.convertUnixDate=function(b){var c=parseInt(b);var a=new Date(0);a.setUTCSeconds(c);var d=a.getFullYear()+"-"+a.getMonth()+"-"+a.getDate();d+=" "+a.getHours()+":"+a.getMinutes();return d};wdi_front.getDescription=function(a){a=a.replace(/\r?\n|\r/g," ");return a};wdi_front.getFileName=function(d){var c=d.link;var b=d.type;if(b==="video"&&d.hasOwnProperty("videos")){return d.videos["standard_resolution"]["url"]}else{var a=c.split("/");return a[a.length-2]}};wdi_front.getFileType=function(a){if(a.type=="video"&&a.hasOwnProperty("videos")){return"EMBED_OEMBED_INSTAGRAM_VIDEO"}else{return"EMBED_OEMBED_INSTAGRAM_IMAGE"}};wdi_front.array_max=function(d){var a=d[0];var b=0;for(var c=1;c<d.length;c++){if(a<d[c]){a=d[c];b=c}}return{value:a,index:b}};wdi_front.array_min=function(d){var c=d[0];var a=0;for(var b=1;b<d.length;b++){if(c>d[b]){c=d[b];a=b}}return{value:c,index:a}};wdi_front.activeUsersCount=function(c){var a=0;for(var b=0;b<c.usersData.length;b++){if(c.usersData[b].finished!="finished"){a++}}return a};wdi_front.checkMediaResponse=function(a,b){if(a!=""&&typeof a!="undefined"&&a!=null&&a.meta["code"]===400&&a.meta["error_type"]==="APINotAllowedError"){return a}if(a==""||typeof a=="undefined"||a==null){errorMessage=wdi_front_messages.connection_error;wdi_front.show_alert(errorMessage,a,b);return false}if(a.meta["code"]!=200){errorMessage=a.meta["error_message"];wdi_front.show_alert(errorMessage,a,b);return false}return a};wdi_front.stripHashtag=function(a){switch(a[0]){case"#":return a.substr(1,a.length);break;default:return a;break}};wdi_front.getInputType=function(a){switch(a[0]){case"#":return"hashtag";break;case"%":return"location";break;default:return"user";break}};wdi_front.regexpTestCaption=function(h,e){var d=false,b=false,f=[],g=e.replace(/[-[\]{}()*+?.,\\^$|]/g,"\\$&"),c=new RegExp("(?:^|\\s)"+g+"(?:^|\\s)"),a=new RegExp("(?:^|\\s)"+g,"g");if(c.exec(h)!=null){d=true}while((match=a.exec(h))!=null){if(match.index==h.length-e.length-1){b=true}}if(d==true||b==true){return true}else{return false}};wdi_front.replaceNewLines=function(c){var b="vUkCJvN2ps3t",a=[],g;c=c.replace(/\r?\n|\r/g,b);g=new RegExp(b,"g");while((match=g.exec(c))!=null){a.push(match.index)}var f=c.split(b);var e=0;for(var d=0;d<f.length;d++){if(f[d]==""){e++}else{e=0}if(e>0){f.splice(d,1);e--;d--}}c=f.join(" ");return c};wdi_front.isEmptyObject=function(a){for(var b in a){if(a.hasOwnProperty(b)){return false}}return true};var WDIFeed=function(a){this["data"]=a.data;this["dataCount"]=a.dataCount;this["feed_row"]=a.feed_row;this["usersData"]=a.usersData;_this=this;this.set_images_loading_flag=function(b){window.addEventListener("load",function(){b.nowLoadingImages=false})};this.set_images_loading_flag(_this)};WDIFeed.prototype.conditionalFilter=function(a,c){var d=this,b=d.feed_row.conditional_filter_type,e=d.feed_row.conditional_filters;if(c.ignoreFiltering==true){}else{a=this.avoidDuplicateMedia(a)}if(!wdi_front.isJsonString(e)){return a}else{e=JSON.parse(e);if(e.length==0){return a}}if(d.feed_row.conditional_filter_enable=="0"){return a}d.instagramRequestCounter++;switch(b){case"AND":a=this.applyANDLogic(a,e,d);break;case"OR":a=this.applyORLogic(a,e,d);break;case"NOR":a=this.applyNORLogic(a,e,d);break;default:break}return a};WDIFeed.prototype.applyANDLogic=function(a,d){var c=this;for(var b=0;b<d.length;b++){a=this.filterResponse(a,d[b])}return a};WDIFeed.prototype.applyORLogic=function(d,c){var h=this;var a=[],g,j=[],f,b;for(var e=0;e<c.length;e++){g=this.filterResponse(d,c[e]);a=a.concat(g.data);g={}}for(e=0;e<a.length;e++){b=a[e];if(!this.mediaExists(b,j)&&!this.mediaExists(b,h.dataStorageList)){j.push(b)}}f={data:j,meta:d.meta,pagination:d.pagination};return f};WDIFeed.prototype.applyNORLogic=function(c,h){var f=c,g=this,b=this.applyORLogic(c,h,g),d=[],a;for(var e=0;e<f.data.length;e++){if(!this.mediaExists(f.data[e],b.data)){d.push(f.data[e])}}a={data:d,meta:f.meta,pagination:f.pagination};return a};WDIFeed.prototype.mediaExists=function(b,c){for(var a=0;a<c.length;a++){if(b.id==c[a]["id"]){return true}}return false};WDIFeed.prototype.filterResponse=function(a,b){switch(b.filter_type){case"hashtag":return this.filterByHashtag(a,b);break;case"username":return this.filterByUsername(a,b);break;case"mention":return this.filterByMention(a,b);break;case"description":return this.filterByDescription(a,b);break;case"location":return this.filterByLocation(a,b);break;case"url":return this.filterByUrl(a,b);break}};WDIFeed.prototype.filterByHashtag=function(b,g){var d=[],f,h,a;for(var e=0;e<b.data.length;e++){h=b.data[e];for(var c=0;c<h.tags.length;c++){tag=h.tags[c];if(tag.toLowerCase()==g.filter_by.toLowerCase()){d.push(h)}}}a={data:d,meta:b.meta,pagination:b.pagination};return a};WDIFeed.prototype.filterByUsername=function(b,e){var c=[],f,a;for(var d=0;d<b.data.length;d++){f=b.data[d];if(f.user.username.toLowerCase()==e.filter_by.toLowerCase()){c.push(f)}}a={data:c,meta:b.meta,pagination:b.pagination};return a};WDIFeed.prototype.filterByMention=function(b,e){var c=[],f,g,a;for(var d=0;d<b.data.length;d++){f=b.data[d];if(f.caption!==null){g=f.caption["text"].toLowerCase();if(g.indexOf("@"+e.filter_by.toLowerCase())!=-1){c.push(f)}}}a={data:c,meta:b.meta,pagination:b.pagination};return a};WDIFeed.prototype.filterByDescription=function(c,f){var d=[],g,h,b;for(var e=0;e<c.data.length;e++){g=c.data[e];if(g.caption!==null){h=g.caption["text"].toLowerCase();h=wdi_front.replaceNewLines(h);var a=f.filter_by.toLowerCase();if(wdi_front.regexpTestCaption(h,a)){d.push(g)}}}b={data:d,meta:c.meta,pagination:c.pagination};return b};WDIFeed.prototype.filterByLocation=function(b,f){var c=[],g,e,a;for(var d=0;d<b.data.length;d++){g=b.data[d];if(g.location!==null){e=g.location["id"];if(e==f.filter_by){c.push(g)}}}a={data:c,meta:b.meta,pagination:b.pagination};return a};WDIFeed.prototype.filterByUrl=function(b,e){var c=[],g,h,a,f;e.filter_by=this.getIdFromUrl(e.filter_by);for(var d=0;d<b.data.length;d++){g=b.data[d];if(g.link!==null){h=this.getIdFromUrl(g.link);if(h==e.filter_by){c.push(g)}}}a={data:c,meta:b.meta,pagination:b.pagination};return a};WDIFeed.prototype.getIdFromUrl=function(a){var c=a.split("/"),d=false;for(var b=0;b<c.length;b++){if(c[b]=="p"){if(typeof c[b+1]!="undefined"){d=c[b+1];break}}}return d};WDIFeed.prototype.avoidDuplicateMedia=function(b){var e=b.data,d=[],a={};if(typeof e=="undefined"){e=[]}for(var c=0;c<e.length;c++){if(!this.mediaExists(e[c],this.dataStorageList)&&!this.mediaExists(e[c],d)&&!this.mediaExists(e[c],this.conditionalFilterBuffer)){d.push(e[c])}}this.conditionalFilterBuffer=this.conditionalFilterBuffer.concat(d);a={data:d,meta:b.meta,pagination:b.pagination};return a};WDIFeed.prototype.storeRawData=function(c,a){var e=this;if(typeof this[a]=="object"&&typeof this[a].length=="number"){for(var b=0;b<c.length;b++){var d="";if(wdi_front.isHashtag(c[b].user_id)){if(typeof c[b].pagination.cursors!=="undefined"){d=c[b].pagination.cursors.after}}else{if(e.feed_row.liked_feed=="liked"){d=c[b].pagination.next_max_like_id;if(typeof d=="undefined"){d=""}}else{if(c[b].pagination==null){c[b].pagination=[]}d=c[b].pagination.next_max_id;if(typeof d=="undefined"){d=""}}}if(typeof this[a][b]=="undefined"){this[a].push({data:c[b].data,index:0,locked:false,hash_id:d,usersDataFinished:false,userId:c[b].user_id,length:function(){return this.data.length-this.index},getData:function(g){var h=this.data.slice(this.index,this.index+g);this.index+=Math.min(g,this.length());if(this.index==this.data.length&&this.locked==true&&this.usersDataFinished==false){for(var f=0;f<e.usersData.length;f++){if(e.usersData[f]["user_id"]==this.userId){e.usersData[f].finished="finished";this.usersDataFinished=true;break}}}return h}})}else{if(this[a][b].locked==false){if(d!=this[a][b].hash_id){this[a][b].data=this[a][b].data.concat(c[b].data);this[a][b].hash_id=d}else{this[a][b].locked=true}}}}}};wdi_front.updateUsersIfNecessary=function(c){var d=c.feed_users;var a=false;for(var b=0;b<d.length;b++){if("#"==d[b].username.substr(0,1)){d[b].id=d[b].username;continue}if(""==d[b].id||"username"==d[b].id){a=true;c.instagram.searchForUsersByName(d[b].username,{success:function(i){if(typeof i.meta!="undefined"&&typeof i.meta.error_type!="undefined"){wdi_front.show_alert(false,i,c)}if(i.meta.code==200&&i.data.length>0){var l=false;for(var g=0;g<i.data.length;g++){if(i.data[g].username==i.args.username){l=true;break}}if(l){for(var h=0;h<d.length;h++){if(i.data[g].username==d[h].username){d[h].id=i.data[g].id}}}}var f=false;for(var e=0;e<d.length;e++){if(d[e].id==""||d[e].id=="username"){f=true;break}}if(!f){c.feed_row.feed_users=JSON.stringify(d);wdi_front.init(c)}},username:d[b].username})}}return a};if(typeof wdi_ajax.ajax_response!="undefined"){jQuery(document).one("ajaxStop",function(){if(wdi_front.type!="not_declared"){wdi_front.clickOrTouch=wdi_front.detectEvent();wdi_front.globalInit()}else{return}})}else{jQuery(document).ready(function(){if(wdi_front.type!="not_declared"){wdi_front.clickOrTouch=wdi_front.detectEvent();wdi_front.globalInit()}else{return}})}jQuery(document).ready(function(){setTimeout(function(){if(wdi_front_messages.show_alerts==="1"&&jQuery(".wdi_check_fontawesome .fa-instagram").prop("tagName")!=="I"){console.log("Font Awesome is not loaded properly. Please ask for support https://wordpress.org/support/plugin/wd-instagram-feed/")}},2000)});function wdi_extractHostname(b){if(typeof b==="undefined"||b===""){return""}var a=b.replace(/(^\w+:|^)\/\//,"");return a};
js/wdi_instagram.js CHANGED
@@ -191,7 +191,7 @@ function WDIInstagram(args)
191
  *
192
  * @return object of founded media
193
  */
194
- this.getTagRecentMedia = function (tagname, args, next_url)
195
  {
196
 
197
  var hastag_data_url = 'https://graph.facebook.com/ig_hashtag_search/';
@@ -206,9 +206,11 @@ function WDIInstagram(args)
206
  statusCode = this.statusCode,
207
  errorFlag = false,
208
  argFlag = false,
209
- filter = this.getFilter('getTagRecentMedia'),
210
 
211
- baseUrl = 'https://graph.facebook.com/{tagid}/recent_media/?fields=media_url,caption,id,media_type,comments_count,like_count,permalink,children{media_url,id,media_type,permalink}';
 
 
212
 
213
 
214
  if (typeof args == 'undefined' || args.length === 0) {
@@ -339,7 +341,7 @@ function WDIInstagram(args)
339
  return;
340
  }
341
 
342
- if (typeof next_url === "undefined") {
343
  baseUrl = baseUrl.replace('{tagid}', wdiTagId);
344
  } else {
345
  baseUrl = next_url;
@@ -363,7 +365,7 @@ function WDIInstagram(args)
363
  });
364
  } else {
365
 
366
- if (typeof next_url === "undefined") {
367
  baseUrl = baseUrl.replace('{tagid}', wdiTagId);
368
  } else {
369
  baseUrl = next_url;
191
  *
192
  * @return object of founded media
193
  */
194
+ this.getTagRecentMedia = function (tagname, args, next_url, endpoint)
195
  {
196
 
197
  var hastag_data_url = 'https://graph.facebook.com/ig_hashtag_search/';
206
  statusCode = this.statusCode,
207
  errorFlag = false,
208
  argFlag = false,
209
+ filter = this.getFilter('getTagRecentMedia');
210
 
211
+ endpoint = (parseInt(endpoint) === 0) ? "top_media" : "recent_media"
212
+
213
+ var baseUrl = 'https://graph.facebook.com/{tagid}/' + endpoint + '/?fields=media_url,caption,id,media_type,comments_count,like_count,permalink,children{media_url,id,media_type,permalink}';
214
 
215
 
216
  if (typeof args == 'undefined' || args.length === 0) {
341
  return;
342
  }
343
 
344
+ if (typeof next_url === "undefined" || next_url === null) {
345
  baseUrl = baseUrl.replace('{tagid}', wdiTagId);
346
  } else {
347
  baseUrl = next_url;
365
  });
366
  } else {
367
 
368
+ if (typeof next_url === "undefined" || next_url === null) {
369
  baseUrl = baseUrl.replace('{tagid}', wdiTagId);
370
  } else {
371
  baseUrl = next_url;
js/wdi_instagram.min.js CHANGED
@@ -1 +1 @@
1
- function WDIInstagram(b){this.access_tokens=[];this.filters=[];if(typeof b!="undefined"){if(typeof b.access_tokens!="undefined"){this.access_tokens=b.access_tokens}if(typeof b.filters!="undefined"){this.filters=b.filters}}var e=this;this.statusCode={429:function(){console.log(" 429: Too many requests. Try after one hour")}};this.getFilter=function(f){var h=e.filters;if(typeof h=="undefined"){return false}for(var g=0;g<h.length;g++){if(h[g].where==f){if(typeof h[g].what=="object"&&h[g].what.length==2){if(typeof window[h[g].what[0]]!="undefined"){if(typeof window[h[g].what[0]][h[g].what[1]]=="function"){return window[h[g].what[0]][h[g].what[1]]}}}else{if(typeof h[g].what=="string"){if(typeof window[h[g].what]=="function"){return window[h[g].what]}}else{if(typeof h[g].what=="function"){return h[g].what}else{return false}}}}}return false};function c(){var f=e.access_tokens,g=parseInt(Math.random(0,1)*f.length);return f[g]}function d(){if(typeof wdi_options!=="undefined"){return wdi_options.fb_token}else{if(typeof wdi_ajax!=="undefined"){return wdi_ajax.fb_token}else{return""}}}function a(){if(typeof wdi_options!=="undefined"){return wdi_options.business_account_id}else{if(typeof wdi_ajax!=="undefined"){return wdi_ajax.business_account_id}else{return""}}}this.addToken=function(f){if(typeof f=="string"){e.access_tokens.push(f)}};this.resetTokens=function(){e.access_tokens=[]};this.getTagRecentMedia=function(r,o,f){var p="https://graph.facebook.com/ig_hashtag_search/";p+="?user_id="+a();p+="&q="+r;p+="&access_token="+d();var q=this,s=false,h=false,l=this.statusCode,j=false,n=false,g=this.getFilter("getTagRecentMedia"),m="https://graph.facebook.com/{tagid}/recent_media/?fields=media_url,caption,id,media_type,comments_count,like_count,permalink,children{media_url,id,media_type,permalink}";if(typeof o=="undefined"||o.length===0){s=true}else{if("success" in o){h=true}if("statusCode" in o){l=o.statusCode}if("error" in o){j=true}if("args" in o){n=true}else{o.args={}}if("count" in o){o.count=parseInt(o.count);if(!Number.isInteger(o.count)||o.count<=0){o.count=33}}else{o.count=33}m+="&limit="+o.count;if("min_tag_id" in o){m+="&min_tag_id="+o.min_tag_id}if("max_tag_id" in o){m+="&max_tag_id="+o.max_tag_id}m+="&access_token="+d();m+="&user_id="+a()}var i=this.getTagId(r);var k=function(t){if(t===false){jQuery.ajax({type:"POST",url:m,dataType:"jsonp",success:function(v){v=e.convertHashtagData(v);v.meta={code:200};v.tag_id=i;e.setDataToCache(m,v);u(v)},error:function(v){if(j){if(typeof o.error=="object"&&o.error.length==2){if(typeof window[o.error[0]][o.error[1]]=="function"){window[o.error[0]][o.error[1]](v)}}else{if(typeof o.error=="string"){if(typeof window[o.error]=="function"){window[o.error](v)}}else{if(typeof o.error=="function"){o.error(v)}}}}},statusCode:l})}else{u(t)}function u(v){if(typeof v.data==="undefined"){v.data=[]}if(h){if(typeof o.success=="object"&&o.success.length==2){if(typeof window[o.success[0]]!="undefined"){if(typeof window[o.success[0]][o.success[1]]=="function"){if(g){v=g(v,q.filterArguments,o.args)}window[o.success[0]][o.success[1]](v)}}}else{if(typeof o.success=="string"){if(typeof window[o.success]=="function"){if(g){v=g(v,q.filterArguments,o.args)}window[o.success](v)}}else{if(typeof o.success=="function"){if(g){v=g(v,q.filterArguments,o.args)}o.success(v)}}}}}};if(i===false){jQuery.ajax({type:"GET",url:p,dataType:"jsonp"}).done(function(t){if(typeof t.error==="undefined"){i=t.data[0].id}else{alert(t.error.message);return}if(typeof f==="undefined"){m=m.replace("{tagid}",i)}else{m=f}var u=[];if(typeof window.wdi_all_tags!=="undefined"){u=window.wdi_all_tags}u[i]={id:"#"+r,username:"#"+r,tag_id:i};window.wdi_all_tags=u;e.getDataFromCache(k,m)})}else{if(typeof f==="undefined"){m=m.replace("{tagid}",i)}else{m=f}e.getDataFromCache(k,m)}};this.getTagId=function(j){var f=[];if(typeof wdi_controller!=="undefined"){f=wdi_controller.feed_users;if(f.length===0){var h=jQuery("#WDI_feed_users").val();f=JSON.parse(h)}}else{if(typeof window.wdi_all_tags!=="undefined"){f=window.wdi_all_tags}}for(var g in f){if(j===f[g].username||"#"+j===f[g].username){if(typeof f[g].tag_id!=="undefined"){return f[g].tag_id}return false}}return false};this.convertHashtagData=function(k){var h={data:[],pagination:{}};if(typeof k.paging!=="undefined"){h.pagination={cursors:{after:k.paging.cursors.after},next_url:k.paging.next}}for(var g in k.data){var m=k.data[g];var o;if(m.media_type==="IMAGE"){o="image"}else{if(m.media_type==="VIDEO"){o="video"}else{o="carousel"}}var l={id:m.id,user:{id:"",full_name:"",profile_picture:"",username:""},images:{thumbnail:{width:150,height:150,url:m.permalink+"media?size=t"},low_resolution:{width:320,height:320,url:m.permalink+"media?size=m"},standard_resolution:{width:640,height:640,url:m.permalink+"media?size=m"}},created_time:"1543398649",caption:{id:"",text:m.caption,created_time:"",from:{id:"",full_name:"",profile_picture:"",username:""}},user_has_liked:(m.like_count>0),likes:{count:m.like_count},tags:[],filter:"Normal",comments:{count:m.comments_count},type:o,link:m.permalink,location:null,attribution:null,users_in_photo:[]};if(m.media_type==="IMAGE"||m.media_type==="CAROUSEL_ALBUM"){l.images={thumbnail:{width:150,height:150,url:m.permalink+"media?size=t"},low_resolution:{width:320,height:320,url:m.permalink+"media?size=m"},standard_resolution:{width:640,height:640,url:m.permalink+"media?size=m"}}}else{if(m.media_type==="VIDEO"){l.videos={standard_resolution:{width:640,height:800,url:m.media_url},low_bandwidth:{width:480,height:600,url:m.media_url},low_resolution:{width:480,height:600,url:m.media_url}}}}if(m.media_type==="CAROUSEL_ALBUM"){l.carousel_media=[];for(var f in m.children.data){if(m.children.data[f].media_type==="IMAGE"){var n={images:{thumbnail:{width:150,height:150,url:m.children.data[f].media_url+"media?size=t"},low_resolution:{width:320,height:320,url:m.children.data[f].permalink+"media?size=m"},standard_resolution:{width:640,height:640,url:m.children.data[f].media_url}},users_in_photo:[],type:"image"}}else{var n={videos:{standard_resolution:{width:640,height:800,url:m.children.data[f].media_url,id:m.children.data[f].id},low_bandwidth:{width:480,height:600,url:m.children.data[f].media_url,id:m.children.data[f].id},low_resolution:{width:480,height:600,url:m.children.data[f].media_url,id:m.children.data[f].id}},users_in_photo:[],type:"video"}}l.carousel_media.push(n)}}h.data.push(l)}return h};this.searchForTagsByName=function(m,k){var l=this,n=false,f=false,j=this.statusCode,g=false;filter=this.getFilter("searchForTagsByName");if(typeof k=="undefined"||k.length===0){n=true}else{if("success" in k){f=true}if("error" in k){g=true}if("statusCode" in k){j=k.statusCode}}var h="https://api.instagram.com/v1/tags/search?q="+m+"&access_token="+c();var i=function(o){if(o===false){jQuery.ajax({type:"POST",url:h,dataType:"jsonp",success:function(q){e.setDataToCache(h,q);p(q)},error:function(q){if(g){if(typeof k.error=="object"&&k.error.length==2){if(typeof window[k.error[0]][k.error[1]]=="function"){window[k.error[0]][k.error[1]](q)}}else{if(typeof k.error=="string"){if(typeof window[k.error]=="function"){window[k.error](q)}}else{if(typeof k.error=="function"){k.error(q)}}}}},statusCode:j})}else{p(o)}function p(q){if(f){if(typeof k.success=="object"&&k.success.length==2){if(typeof window[k.success[0]]!="undefined"){if(typeof window[k.success[0]][k.success[1]]=="function"){if(filter){q=filter(q,l.filterArguments)}window[k.success[0]][k.success[1]](q)}}}else{if(typeof k.success=="string"){if(typeof window[k.success]=="function"){if(filter){q=filter(q,l.filterArguments)}window[k.success](q)}}else{if(typeof k.success=="function"){if(filter){q=filter(q,l.filterArguments)}k.success(q)}}}}}};e.getDataFromCache(i,h)};this.searchForUsersByName=function(m,i){var f=this,l=false,g=false,k=this.statusCode,h=false,j=this.getFilter("searchForUsersByName");if(typeof i=="undefined"||i.length===0){l=true}else{if("success" in i){g=true}if("error" in i){h=true}if("statusCode" in i){k=i.statusCode}}jQuery.ajax({type:"POST",dataType:"jsonp",url:"https://api.instagram.com/v1/users/search?q="+m+"&access_token="+c(),success:function(n){if(g){if(typeof i.success=="object"&&i.success.length==2){if(typeof window[i.success[0]]!="undefined"){if(typeof window[i.success[0]][i.success[1]]=="function"){if(j){n=j(n,f.filterArguments)}n.args=i;window[i.success[0]][i.success[1]](n)}}}else{if(typeof i.success=="string"){if(typeof window[i.success]=="function"){if(j){n=j(n,f.filterArguments)}n.args=i;window[i.success](n)}}else{if(typeof i.success=="function"){if(j){n=j(n,f.filterArguments)}n.args=i;i.success(n)}}}}},error:function(n){if(h){if(typeof i.error=="object"&&i.error.length==2){if(typeof window[i.error[0]][i.error[1]]=="function"){window[i.error[0]][i.error[1]](n)}}else{if(typeof i.error=="string"){if(typeof window[i.error]=="function"){window[i.error](n)}}else{if(typeof i.error=="function"){i.error(n)}}}}},statusCode:this.statusCode})};this.getRecentLikedMedia=function(i){var f=this,m=false,g=false,k=this.statusCode,h=false,j=this.getFilter("getRecentLikedMedia"),l="https://api.instagram.com/v1/users/self/media/liked?access_token="+c();if(typeof i=="undefined"||i.length===0){m=true}else{if("success" in i){g=true}if("error" in i){h=true}if("statusCode" in i){k=i.statusCode}if("args" in i){argFlag=true}else{i.args={}}if("count" in i){i.count=parseInt(i.count);if(!Number.isInteger(i.count)||i.count<=0){i.count=20}}else{i.count=20}l+="&count="+i.count;if("next_max_like_id" in i){l+="&next_max_like_id="+i.next_max_like_id}}jQuery.ajax({type:"POST",dataType:"jsonp",url:l,success:function(n){if(g){if(typeof i.success=="object"&&i.success.length==2){if(typeof window[i.success[0]]!="undefined"){if(typeof window[i.success[0]][i.success[1]]=="function"){if(j){n=j(n,f.filterArguments,i.args)}window[i.success[0]][i.success[1]](n)}}}else{if(typeof i.success=="string"){if(typeof window[i.success]=="function"){if(j){n=j(n,f.filterArguments,i.args)}window[i.success](n)}}else{if(typeof i.success=="function"){if(j){n=j(n,f.filterArguments,i.args)}i.success(n)}}}}},error:function(n){if(h){if(typeof i.error=="object"&&i.error.length==2){if(typeof window[i.error[0]][i.error[1]]=="function"){window[i.error[0]][i.error[1]](n)}}else{if(typeof i.error=="string"){if(typeof window[i.error]=="function"){window[i.error](n)}}else{if(typeof i.error=="function"){i.error(n)}}}}},statusCode:k})};this.getUserRecentMedia=function(n,l){var m=this,o=false,g=false,k=false,i=this.statusCode,h=false,f=this.getFilter("getUserRecentMedia"),j="https://api.instagram.com/v1/users/"+n+"/media/recent/?access_token="+c();if(typeof l=="undefined"||l.length===0){o=true}else{if("success" in l){g=true}if("statusCode" in l){i=l.statusCode}if("args" in l){k=true}else{l.args={}}if("error" in l){h=true}if("count" in l){l.count=parseInt(l.count);if(!Number.isInteger(l.count)||l.count<=0){l.count=33}}else{l.count=33}j+="&count="+l.count;if("min_id" in l){j+="&min_id="+l.min_id}if("max_id" in l){j+="&max_id="+l.max_id}}jQuery.ajax({type:"POST",dataType:"jsonp",url:j,success:function(p){if(typeof p.data==="undefined"){p.data=[]}if(g){if(typeof l.success=="object"&&l.success.length==2){if(typeof window[l.success[0]]!="undefined"){if(typeof window[l.success[0]][l.success[1]]=="function"){if(f){p=f(p,m.filterArguments,l.args)}window[l.success[0]][l.success[1]](p)}}}else{if(typeof l.success=="string"){if(typeof window[l.success]=="function"){if(f){p=f(p,m.filterArguments,l.args)}window[l.success](p)}}else{if(typeof l.success=="function"){if(f){p=f(p,m.filterArguments,l.args)}l.success(p)}}}}},error:function(p){if(h){if(typeof l.error=="object"&&l.error.length==2){if(typeof window[l.error[0]][l.error[1]]=="function"){window[l.error[0]][l.error[1]](p)}}else{if(typeof l.error=="string"){if(typeof window[l.error]=="function"){window[l.error](p)}}else{if(typeof l.error=="function"){l.error(p)}}}}},statusCode:i})};this.getSelfRecentMedia=function(m){var n=this,o=false,g=false,j=this.statusCode,h=false,l=false,f=this.getFilter("getSelfRecentMedia"),k="https://api.instagram.com/v1/users/self/media/recent/?access_token="+c();if(typeof m=="undefined"||m.length===0){o=true}else{if("success" in m){g=true}if("error" in m){h=true}if("statusCode" in m){j=m.statusCode}if("args" in m){l=true}else{m.args={}}if("count" in m){m.count=parseInt(m.count);if(!Number.isInteger(m.count)||m.count<=0){m.count=20}}else{m.count=20}k+="&count="+m.count;if("min_id" in m){k+="&min_id="+m.min_id}if("max_id" in m){k+="&max_id="+m.max_id}}var i=function(p){if(p===false){jQuery.ajax({type:"POST",dataType:"jsonp",url:k,success:function(r){e.setDataToCache(k,r);q(r)},error:function(r){if(h){if(typeof m.error=="object"&&m.error.length==2){if(typeof window[m.error[0]][m.error[1]]=="function"){window[m.error[0]][m.error[1]](r)}}else{if(typeof m.error=="string"){if(typeof window[m.error]=="function"){window[m.error](r)}}else{if(typeof m.error=="function"){m.error(r)}}}}},statusCode:j})}else{q(p)}function q(r){if(g){if(typeof m.success=="object"&&m.success.length==2){if(typeof window[m.success[0]]!="undefined"){if(typeof window[m.success[0]][m.success[1]]=="function"){if(f){r=f(r,n.filterArguments,m)}window[m.success[0]][m.success[1]](r)}}}else{if(typeof m.success=="string"){if(typeof window[m.success]=="function"){if(f){r=f(r,n.filterArguments,m)}window[m.success](r)}}else{if(typeof m.success=="function"){if(f){r=f(r,n.filterArguments,m)}m.success(r)}}}}}};e.getDataFromCache(i,k)};this.getUserInfo=function(g,j){var f=this,m=false,h=false,l=this.statusCode,i=false,k=this.getFilter("getUserInfo");if(typeof j=="undefined"||j.length===0){m=true}else{if("success" in j){h=true}if("error" in j){i=true}if("statusCode" in j){l=j.statusCode}}jQuery.ajax({type:"POST",dataType:"jsonp",url:"https://api.instagram.com/v1/users/"+g+"/?access_token="+c(),success:function(n){if(h){if(typeof j.success=="object"&&j.success.length==2){if(typeof window[j.success[0]]!="undefined"){if(typeof window[j.success[0]][j.success[1]]=="function"){if(k){n=k(n,f.filterArguments)}window[j.success[0]][j.success[1]](n)}}}else{if(typeof j.success=="string"){if(typeof window[j.success]=="function"){if(k){n=k(n,f.filterArguments)}window[j.success](n)}}else{if(typeof j.success=="function"){if(k){n=k(n,f.filterArguments)}j.success(n)}}}}},error:function(n){if(i){if(typeof j.error=="object"&&j.error.length==2){if(typeof window[j.error[0]][j.error[1]]=="function"){window[j.error[0]][j.error[1]](n)}}else{if(typeof j.error=="string"){if(typeof window[j.error]=="function"){window[j.error](n)}}else{if(typeof j.error=="function"){j.error(n)}}}}},statusCode:l})};this.getSelfInfo=function(l){var m=this,n=false,g=false,k=this.statusCode,h=false,f=this.getFilter("getSelfInfo");if(typeof l=="undefined"||l.length===0){n=true}else{if("success" in l){g=true}if("error" in l){h=true}if("statusCode" in l){k=l.statusCode}}var i="https://api.instagram.com/v1/users/self/?access_token="+c();var j=function(o){if(o===false){jQuery.ajax({type:"POST",dataType:"jsonp",url:i,success:function(q){e.setDataToCache(i,q);if(g){if(typeof l.success=="object"&&l.success.length==2){if(typeof window[l.success[0]]!="undefined"){if(typeof window[l.success[0]][l.success[1]]=="function"){if(f){q=f(q,m.filterArguments)}window[l.success[0]][l.success[1]](q)}}}else{if(typeof l.success=="string"){if(typeof window[l.success]=="function"){if(f){q=f(q,m.filterArguments)}window[l.success](q)}}else{if(typeof l.success=="function"){if(f){q=f(q,m.filterArguments)}l.success(q)}}}}},error:function(q){if(h){if(typeof l.error=="object"&&l.error.length==2){if(typeof window[l.error[0]][l.error[1]]=="function"){window[l.error[0]][l.error[1]](q)}}else{if(typeof l.error=="string"){if(typeof window[l.error]=="function"){window[l.error](q)}}else{if(typeof l.error=="function"){l.error(q)}}}}},statusCode:k})}else{p(o)}function p(q){if(g){if(typeof l.success=="object"&&l.success.length==2){if(typeof window[l.success[0]]!="undefined"){if(typeof window[l.success[0]][l.success[1]]=="function"){if(f){q=f(q,m.filterArguments)}window[l.success[0]][l.success[1]](q)}}}else{if(typeof l.success=="string"){if(typeof window[l.success]=="function"){if(f){q=f(q,m.filterArguments)}window[l.success](q)}}else{if(typeof l.success=="function"){if(f){q=f(q,m.filterArguments)}l.success(q)}}}}}};e.getDataFromCache(j,i)};this.getRecentMediaComments=function(h,m){var n=this,o=false,g=false,l=this.statusCode,j=false,f=this.getFilter("getRecentMediaComments");if(typeof m=="undefined"||m.length===0){o=true}else{if("success" in m){g=true}if("error" in m){j=true}if("statusCode" in m){l=m.statusCode}}var i="https://api.instagram.com/v1/media/"+h+"/comments?access_token="+c();var k=function(p){if(p===false){jQuery.ajax({type:"POST",dataType:"jsonp",url:i,success:function(r){e.setDataToCache(i,r);q(r)},error:function(r){if(j){if(typeof m.error=="object"&&m.error.length==2){if(typeof window[m.error[0]][m.error[1]]=="function"){window[m.error[0]][m.error[1]](r)}}else{if(typeof m.error=="string"){if(typeof window[m.error]=="function"){window[m.error](r)}}else{if(typeof m.error=="function"){m.error(r)}}}}},statusCode:l})}else{q(p)}function q(r){if(g){if(typeof m.success=="object"&&m.success.length==2){if(typeof window[m.success[0]]!="undefined"){if(typeof window[m.success[0]][m.success[1]]=="function"){if(f){r=f(r,n.filterArguments)}window[m.success[0]][m.success[1]](r)}}}else{if(typeof m.success=="string"){if(typeof window[m.success]=="function"){if(f){r=f(r,n.filterArguments)}window[m.success](r)}}else{if(typeof m.success=="function"){if(f){r=f(r,n.filterArguments)}m.success(r)}}}}}};e.getDataFromCache(k,i)};this.getRecentMediaLikes=function(l,i){var f=this,m=false,g=false,k=this.statusCode,h=false,j=this.getFilter("getRecentMediaLikes");if(typeof i=="undefined"||i.length===0){m=true}else{if("success" in i){g=true}if("error" in i){h=true}if("statusCode" in i){k=i.statusCode}}jQuery.ajax({type:"POST",dataType:"jsonp",url:"https://api.instagram.com/v1/media/"+l+"/likes?access_token="+c(),success:function(n){if(g){if(typeof i.success=="object"&&i.success.length==2){if(typeof window[i.success[0]]!="undefined"){if(typeof window[i.success[0]][i.success[1]]=="function"){if(j){n=j(n,f.filterArguments)}window[i.success[0]][i.success[1]](n)}}}else{if(typeof i.success=="string"){if(typeof window[i.success]=="function"){if(j){n=j(n,f.filterArguments)}window[i.success](n)}}else{if(typeof i.success=="function"){if(j){n=j(n,f.filterArguments)}i.success(n)}}}}},error:function(n){if(h){if(typeof i.error=="object"&&i.error.length==2){if(typeof window[i.error[0]][i.error[1]]=="function"){window[i.error[0]][i.error[1]](n)}}else{if(typeof i.error=="string"){if(typeof window[i.error]=="function"){window[i.error](n)}}else{if(typeof i.error=="function"){i.error(n)}}}}},statusCode:k})};this.requestByUrl=function(q,p){var r=this,s=false,h=false,j=false,o=false,m=this.statusCode,g=this.getFilter("requestByUrl"),f,n;f=q.split("?")[1].split("&");for(var l=0;l<f.length;l++){f[l]=f[l].split("=");if(f[l][0]=="access_token"){f[l][1]=c()}f[l]=f[l].join("=")}f=f.join("&");q=q.split("?")[0]+"?"+f;if(typeof p=="undefined"||p.length===0){s=true}else{if("success" in p){h=true}if("args" in p){o=true}else{p.args={}}if("error" in p){j=true}if("statusCode" in p){m=p.statusCode}}var k=function(i){if(i===false){jQuery.ajax({type:"POST",dataType:"jsonp",url:q,success:function(u){e.setDataToCache(q,u);if(h){if(typeof p.success=="object"&&p.success.length==2){if(typeof window[p.success[0]]!="undefined"){if(typeof window[p.success[0]][p.success[1]]=="function"){if(g){u=g(u,r.filterArguments,p.args)}window[p.success[0]][p.success[1]](u)}}}else{if(typeof p.success=="string"){if(typeof window[p.success]=="function"){if(g){u=g(u,r.filterArguments,p.args)}window[p.success](u)}}else{if(typeof p.success=="function"){if(g){u=g(u,r.filterArguments,p.args)}p.success(u)}}}}},error:function(u){if(j){if(typeof p.error=="object"&&p.error.length==2){if(typeof window[p.error[0]][p.error[1]]=="function"){window[p.error[0]][p.error[1]](u)}}else{if(typeof p.error=="string"){if(typeof window[p.error]=="function"){window[p.error](u)}}else{if(typeof p.error=="function"){p.error(u)}}}}},statusCode:m})}else{t(i)}function t(u){if(h){if(typeof p.success=="object"&&p.success.length==2){if(typeof window[p.success[0]]!="undefined"){if(typeof window[p.success[0]][p.success[1]]=="function"){if(g){u=g(u,r.filterArguments,p.args)}window[p.success[0]][p.success[1]](u)}}}else{if(typeof p.success=="string"){if(typeof window[p.success]=="function"){if(g){u=g(u,r.filterArguments,p.args)}window[p.success](u)}}else{if(typeof p.success=="function"){if(g){u=g(u,r.filterArguments,p.args)}p.success(u)}}}}}};e.getDataFromCache(k,q)};this.getDataFromCache=function(h,g,f){if(typeof f==="undefined"){f=true}jQuery.ajax({type:"POST",async:f,url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_cache_name:g,wdi_nonce:wdi_ajax.wdi_nonce,WDI_MINIFY:wdi_ajax.WDI_MINIFY,action:"wdi_get_cache_data"},success:function(j){if(j.wdi_debugging){console.log(j.wdi_debugging_data)}if(j.success){if(typeof j.cache_data!=="undefined"&&j.cache_data!==null){var i=JSON.parse(j.cache_data);h(i)}else{h(false)}}else{h(false)}}})};this.setDataToCache=function(g,f){jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_cache_name:g,wdi_cache_response:JSON.stringify(f),wdi_nonce:wdi_ajax.wdi_nonce,action:"wdi_set_cache_data"},success:function(h){}})}};
1
+ function WDIInstagram(b){this.access_tokens=[];this.filters=[];if(typeof b!="undefined"){if(typeof b.access_tokens!="undefined"){this.access_tokens=b.access_tokens}if(typeof b.filters!="undefined"){this.filters=b.filters}}var e=this;this.statusCode={429:function(){console.log(" 429: Too many requests. Try after one hour")}};this.getFilter=function(f){var h=e.filters;if(typeof h=="undefined"){return false}for(var g=0;g<h.length;g++){if(h[g].where==f){if(typeof h[g].what=="object"&&h[g].what.length==2){if(typeof window[h[g].what[0]]!="undefined"){if(typeof window[h[g].what[0]][h[g].what[1]]=="function"){return window[h[g].what[0]][h[g].what[1]]}}}else{if(typeof h[g].what=="string"){if(typeof window[h[g].what]=="function"){return window[h[g].what]}}else{if(typeof h[g].what=="function"){return h[g].what}else{return false}}}}}return false};function c(){var f=e.access_tokens,g=parseInt(Math.random(0,1)*f.length);return f[g]}function d(){if(typeof wdi_options!=="undefined"){return wdi_options.fb_token}else{if(typeof wdi_ajax!=="undefined"){return wdi_ajax.fb_token}else{return""}}}function a(){if(typeof wdi_options!=="undefined"){return wdi_options.business_account_id}else{if(typeof wdi_ajax!=="undefined"){return wdi_ajax.business_account_id}else{return""}}}this.addToken=function(f){if(typeof f=="string"){e.access_tokens.push(f)}};this.resetTokens=function(){e.access_tokens=[]};this.getTagRecentMedia=function(r,o,f,s){var p="https://graph.facebook.com/ig_hashtag_search/";p+="?user_id="+a();p+="&q="+r;p+="&access_token="+d();var q=this,t=false,h=false,l=this.statusCode,j=false,n=false,g=this.getFilter("getTagRecentMedia");s=(parseInt(s)===0)?"top_media":"recent_media";var m="https://graph.facebook.com/{tagid}/"+s+"/?fields=media_url,caption,id,media_type,comments_count,like_count,permalink,children{media_url,id,media_type,permalink}";if(typeof o=="undefined"||o.length===0){t=true}else{if("success" in o){h=true}if("statusCode" in o){l=o.statusCode}if("error" in o){j=true}if("args" in o){n=true}else{o.args={}}if("count" in o){o.count=parseInt(o.count);if(!Number.isInteger(o.count)||o.count<=0){o.count=33}}else{o.count=33}m+="&limit="+o.count;if("min_tag_id" in o){m+="&min_tag_id="+o.min_tag_id}if("max_tag_id" in o){m+="&max_tag_id="+o.max_tag_id}m+="&access_token="+d();m+="&user_id="+a()}var i=this.getTagId(r);var k=function(u){if(u===false){jQuery.ajax({type:"POST",url:m,dataType:"jsonp",success:function(w){w=e.convertHashtagData(w);w.meta={code:200};w.tag_id=i;e.setDataToCache(m,w);v(w)},error:function(w){if(j){if(typeof o.error=="object"&&o.error.length==2){if(typeof window[o.error[0]][o.error[1]]=="function"){window[o.error[0]][o.error[1]](w)}}else{if(typeof o.error=="string"){if(typeof window[o.error]=="function"){window[o.error](w)}}else{if(typeof o.error=="function"){o.error(w)}}}}},statusCode:l})}else{v(u)}function v(w){if(typeof w.data==="undefined"){w.data=[]}if(h){if(typeof o.success=="object"&&o.success.length==2){if(typeof window[o.success[0]]!="undefined"){if(typeof window[o.success[0]][o.success[1]]=="function"){if(g){w=g(w,q.filterArguments,o.args)}window[o.success[0]][o.success[1]](w)}}}else{if(typeof o.success=="string"){if(typeof window[o.success]=="function"){if(g){w=g(w,q.filterArguments,o.args)}window[o.success](w)}}else{if(typeof o.success=="function"){if(g){w=g(w,q.filterArguments,o.args)}o.success(w)}}}}}};if(i===false){jQuery.ajax({type:"GET",url:p,dataType:"jsonp"}).done(function(u){if(typeof u.error==="undefined"){i=u.data[0].id}else{alert(u.error.message);return}if(typeof f==="undefined"||f===null){m=m.replace("{tagid}",i)}else{m=f}var v=[];if(typeof window.wdi_all_tags!=="undefined"){v=window.wdi_all_tags}v[i]={id:"#"+r,username:"#"+r,tag_id:i};window.wdi_all_tags=v;e.getDataFromCache(k,m)})}else{if(typeof f==="undefined"||f===null){m=m.replace("{tagid}",i)}else{m=f}e.getDataFromCache(k,m)}};this.getTagId=function(j){var f=[];if(typeof wdi_controller!=="undefined"){f=wdi_controller.feed_users;if(f.length===0){var h=jQuery("#WDI_feed_users").val();f=JSON.parse(h)}}else{if(typeof window.wdi_all_tags!=="undefined"){f=window.wdi_all_tags}}for(var g in f){if(j===f[g].username||"#"+j===f[g].username){if(typeof f[g].tag_id!=="undefined"){return f[g].tag_id}return false}}return false};this.convertHashtagData=function(k){var h={data:[],pagination:{}};if(typeof k.paging!=="undefined"){h.pagination={cursors:{after:k.paging.cursors.after},next_url:k.paging.next}}for(var g in k.data){var m=k.data[g];var o;if(m.media_type==="IMAGE"){o="image"}else{if(m.media_type==="VIDEO"){o="video"}else{o="carousel"}}var l={id:m.id,user:{id:"",full_name:"",profile_picture:"",username:""},images:{thumbnail:{width:150,height:150,url:m.permalink+"media?size=t"},low_resolution:{width:320,height:320,url:m.permalink+"media?size=m"},standard_resolution:{width:640,height:640,url:m.permalink+"media?size=m"}},created_time:"1543398649",caption:{id:"",text:m.caption,created_time:"",from:{id:"",full_name:"",profile_picture:"",username:""}},user_has_liked:(m.like_count>0),likes:{count:m.like_count},tags:[],filter:"Normal",comments:{count:m.comments_count},type:o,link:m.permalink,location:null,attribution:null,users_in_photo:[]};if(m.media_type==="IMAGE"||m.media_type==="CAROUSEL_ALBUM"){l.images={thumbnail:{width:150,height:150,url:m.permalink+"media?size=t"},low_resolution:{width:320,height:320,url:m.permalink+"media?size=m"},standard_resolution:{width:640,height:640,url:m.permalink+"media?size=m"}}}else{if(m.media_type==="VIDEO"){l.videos={standard_resolution:{width:640,height:800,url:m.media_url},low_bandwidth:{width:480,height:600,url:m.media_url},low_resolution:{width:480,height:600,url:m.media_url}}}}if(m.media_type==="CAROUSEL_ALBUM"){l.carousel_media=[];for(var f in m.children.data){if(m.children.data[f].media_type==="IMAGE"){var n={images:{thumbnail:{width:150,height:150,url:m.children.data[f].media_url+"media?size=t"},low_resolution:{width:320,height:320,url:m.children.data[f].permalink+"media?size=m"},standard_resolution:{width:640,height:640,url:m.children.data[f].media_url}},users_in_photo:[],type:"image"}}else{var n={videos:{standard_resolution:{width:640,height:800,url:m.children.data[f].media_url,id:m.children.data[f].id},low_bandwidth:{width:480,height:600,url:m.children.data[f].media_url,id:m.children.data[f].id},low_resolution:{width:480,height:600,url:m.children.data[f].media_url,id:m.children.data[f].id}},users_in_photo:[],type:"video"}}l.carousel_media.push(n)}}h.data.push(l)}return h};this.searchForTagsByName=function(m,k){var l=this,n=false,f=false,j=this.statusCode,g=false;filter=this.getFilter("searchForTagsByName");if(typeof k=="undefined"||k.length===0){n=true}else{if("success" in k){f=true}if("error" in k){g=true}if("statusCode" in k){j=k.statusCode}}var h="https://api.instagram.com/v1/tags/search?q="+m+"&access_token="+c();var i=function(o){if(o===false){jQuery.ajax({type:"POST",url:h,dataType:"jsonp",success:function(q){e.setDataToCache(h,q);p(q)},error:function(q){if(g){if(typeof k.error=="object"&&k.error.length==2){if(typeof window[k.error[0]][k.error[1]]=="function"){window[k.error[0]][k.error[1]](q)}}else{if(typeof k.error=="string"){if(typeof window[k.error]=="function"){window[k.error](q)}}else{if(typeof k.error=="function"){k.error(q)}}}}},statusCode:j})}else{p(o)}function p(q){if(f){if(typeof k.success=="object"&&k.success.length==2){if(typeof window[k.success[0]]!="undefined"){if(typeof window[k.success[0]][k.success[1]]=="function"){if(filter){q=filter(q,l.filterArguments)}window[k.success[0]][k.success[1]](q)}}}else{if(typeof k.success=="string"){if(typeof window[k.success]=="function"){if(filter){q=filter(q,l.filterArguments)}window[k.success](q)}}else{if(typeof k.success=="function"){if(filter){q=filter(q,l.filterArguments)}k.success(q)}}}}}};e.getDataFromCache(i,h)};this.searchForUsersByName=function(m,i){var f=this,l=false,g=false,k=this.statusCode,h=false,j=this.getFilter("searchForUsersByName");if(typeof i=="undefined"||i.length===0){l=true}else{if("success" in i){g=true}if("error" in i){h=true}if("statusCode" in i){k=i.statusCode}}jQuery.ajax({type:"POST",dataType:"jsonp",url:"https://api.instagram.com/v1/users/search?q="+m+"&access_token="+c(),success:function(n){if(g){if(typeof i.success=="object"&&i.success.length==2){if(typeof window[i.success[0]]!="undefined"){if(typeof window[i.success[0]][i.success[1]]=="function"){if(j){n=j(n,f.filterArguments)}n.args=i;window[i.success[0]][i.success[1]](n)}}}else{if(typeof i.success=="string"){if(typeof window[i.success]=="function"){if(j){n=j(n,f.filterArguments)}n.args=i;window[i.success](n)}}else{if(typeof i.success=="function"){if(j){n=j(n,f.filterArguments)}n.args=i;i.success(n)}}}}},error:function(n){if(h){if(typeof i.error=="object"&&i.error.length==2){if(typeof window[i.error[0]][i.error[1]]=="function"){window[i.error[0]][i.error[1]](n)}}else{if(typeof i.error=="string"){if(typeof window[i.error]=="function"){window[i.error](n)}}else{if(typeof i.error=="function"){i.error(n)}}}}},statusCode:this.statusCode})};this.getRecentLikedMedia=function(i){var f=this,m=false,g=false,k=this.statusCode,h=false,j=this.getFilter("getRecentLikedMedia"),l="https://api.instagram.com/v1/users/self/media/liked?access_token="+c();if(typeof i=="undefined"||i.length===0){m=true}else{if("success" in i){g=true}if("error" in i){h=true}if("statusCode" in i){k=i.statusCode}if("args" in i){argFlag=true}else{i.args={}}if("count" in i){i.count=parseInt(i.count);if(!Number.isInteger(i.count)||i.count<=0){i.count=20}}else{i.count=20}l+="&count="+i.count;if("next_max_like_id" in i){l+="&next_max_like_id="+i.next_max_like_id}}jQuery.ajax({type:"POST",dataType:"jsonp",url:l,success:function(n){if(g){if(typeof i.success=="object"&&i.success.length==2){if(typeof window[i.success[0]]!="undefined"){if(typeof window[i.success[0]][i.success[1]]=="function"){if(j){n=j(n,f.filterArguments,i.args)}window[i.success[0]][i.success[1]](n)}}}else{if(typeof i.success=="string"){if(typeof window[i.success]=="function"){if(j){n=j(n,f.filterArguments,i.args)}window[i.success](n)}}else{if(typeof i.success=="function"){if(j){n=j(n,f.filterArguments,i.args)}i.success(n)}}}}},error:function(n){if(h){if(typeof i.error=="object"&&i.error.length==2){if(typeof window[i.error[0]][i.error[1]]=="function"){window[i.error[0]][i.error[1]](n)}}else{if(typeof i.error=="string"){if(typeof window[i.error]=="function"){window[i.error](n)}}else{if(typeof i.error=="function"){i.error(n)}}}}},statusCode:k})};this.getUserRecentMedia=function(n,l){var m=this,o=false,g=false,k=false,i=this.statusCode,h=false,f=this.getFilter("getUserRecentMedia"),j="https://api.instagram.com/v1/users/"+n+"/media/recent/?access_token="+c();if(typeof l=="undefined"||l.length===0){o=true}else{if("success" in l){g=true}if("statusCode" in l){i=l.statusCode}if("args" in l){k=true}else{l.args={}}if("error" in l){h=true}if("count" in l){l.count=parseInt(l.count);if(!Number.isInteger(l.count)||l.count<=0){l.count=33}}else{l.count=33}j+="&count="+l.count;if("min_id" in l){j+="&min_id="+l.min_id}if("max_id" in l){j+="&max_id="+l.max_id}}jQuery.ajax({type:"POST",dataType:"jsonp",url:j,success:function(p){if(typeof p.data==="undefined"){p.data=[]}if(g){if(typeof l.success=="object"&&l.success.length==2){if(typeof window[l.success[0]]!="undefined"){if(typeof window[l.success[0]][l.success[1]]=="function"){if(f){p=f(p,m.filterArguments,l.args)}window[l.success[0]][l.success[1]](p)}}}else{if(typeof l.success=="string"){if(typeof window[l.success]=="function"){if(f){p=f(p,m.filterArguments,l.args)}window[l.success](p)}}else{if(typeof l.success=="function"){if(f){p=f(p,m.filterArguments,l.args)}l.success(p)}}}}},error:function(p){if(h){if(typeof l.error=="object"&&l.error.length==2){if(typeof window[l.error[0]][l.error[1]]=="function"){window[l.error[0]][l.error[1]](p)}}else{if(typeof l.error=="string"){if(typeof window[l.error]=="function"){window[l.error](p)}}else{if(typeof l.error=="function"){l.error(p)}}}}},statusCode:i})};this.getSelfRecentMedia=function(m){var n=this,o=false,g=false,j=this.statusCode,h=false,l=false,f=this.getFilter("getSelfRecentMedia"),k="https://api.instagram.com/v1/users/self/media/recent/?access_token="+c();if(typeof m=="undefined"||m.length===0){o=true}else{if("success" in m){g=true}if("error" in m){h=true}if("statusCode" in m){j=m.statusCode}if("args" in m){l=true}else{m.args={}}if("count" in m){m.count=parseInt(m.count);if(!Number.isInteger(m.count)||m.count<=0){m.count=20}}else{m.count=20}k+="&count="+m.count;if("min_id" in m){k+="&min_id="+m.min_id}if("max_id" in m){k+="&max_id="+m.max_id}}var i=function(p){if(p===false){jQuery.ajax({type:"POST",dataType:"jsonp",url:k,success:function(r){e.setDataToCache(k,r);q(r)},error:function(r){if(h){if(typeof m.error=="object"&&m.error.length==2){if(typeof window[m.error[0]][m.error[1]]=="function"){window[m.error[0]][m.error[1]](r)}}else{if(typeof m.error=="string"){if(typeof window[m.error]=="function"){window[m.error](r)}}else{if(typeof m.error=="function"){m.error(r)}}}}},statusCode:j})}else{q(p)}function q(r){if(g){if(typeof m.success=="object"&&m.success.length==2){if(typeof window[m.success[0]]!="undefined"){if(typeof window[m.success[0]][m.success[1]]=="function"){if(f){r=f(r,n.filterArguments,m)}window[m.success[0]][m.success[1]](r)}}}else{if(typeof m.success=="string"){if(typeof window[m.success]=="function"){if(f){r=f(r,n.filterArguments,m)}window[m.success](r)}}else{if(typeof m.success=="function"){if(f){r=f(r,n.filterArguments,m)}m.success(r)}}}}}};e.getDataFromCache(i,k)};this.getUserInfo=function(g,j){var f=this,m=false,h=false,l=this.statusCode,i=false,k=this.getFilter("getUserInfo");if(typeof j=="undefined"||j.length===0){m=true}else{if("success" in j){h=true}if("error" in j){i=true}if("statusCode" in j){l=j.statusCode}}jQuery.ajax({type:"POST",dataType:"jsonp",url:"https://api.instagram.com/v1/users/"+g+"/?access_token="+c(),success:function(n){if(h){if(typeof j.success=="object"&&j.success.length==2){if(typeof window[j.success[0]]!="undefined"){if(typeof window[j.success[0]][j.success[1]]=="function"){if(k){n=k(n,f.filterArguments)}window[j.success[0]][j.success[1]](n)}}}else{if(typeof j.success=="string"){if(typeof window[j.success]=="function"){if(k){n=k(n,f.filterArguments)}window[j.success](n)}}else{if(typeof j.success=="function"){if(k){n=k(n,f.filterArguments)}j.success(n)}}}}},error:function(n){if(i){if(typeof j.error=="object"&&j.error.length==2){if(typeof window[j.error[0]][j.error[1]]=="function"){window[j.error[0]][j.error[1]](n)}}else{if(typeof j.error=="string"){if(typeof window[j.error]=="function"){window[j.error](n)}}else{if(typeof j.error=="function"){j.error(n)}}}}},statusCode:l})};this.getSelfInfo=function(l){var m=this,n=false,g=false,k=this.statusCode,h=false,f=this.getFilter("getSelfInfo");if(typeof l=="undefined"||l.length===0){n=true}else{if("success" in l){g=true}if("error" in l){h=true}if("statusCode" in l){k=l.statusCode}}var i="https://api.instagram.com/v1/users/self/?access_token="+c();var j=function(o){if(o===false){jQuery.ajax({type:"POST",dataType:"jsonp",url:i,success:function(q){e.setDataToCache(i,q);if(g){if(typeof l.success=="object"&&l.success.length==2){if(typeof window[l.success[0]]!="undefined"){if(typeof window[l.success[0]][l.success[1]]=="function"){if(f){q=f(q,m.filterArguments)}window[l.success[0]][l.success[1]](q)}}}else{if(typeof l.success=="string"){if(typeof window[l.success]=="function"){if(f){q=f(q,m.filterArguments)}window[l.success](q)}}else{if(typeof l.success=="function"){if(f){q=f(q,m.filterArguments)}l.success(q)}}}}},error:function(q){if(h){if(typeof l.error=="object"&&l.error.length==2){if(typeof window[l.error[0]][l.error[1]]=="function"){window[l.error[0]][l.error[1]](q)}}else{if(typeof l.error=="string"){if(typeof window[l.error]=="function"){window[l.error](q)}}else{if(typeof l.error=="function"){l.error(q)}}}}},statusCode:k})}else{p(o)}function p(q){if(g){if(typeof l.success=="object"&&l.success.length==2){if(typeof window[l.success[0]]!="undefined"){if(typeof window[l.success[0]][l.success[1]]=="function"){if(f){q=f(q,m.filterArguments)}window[l.success[0]][l.success[1]](q)}}}else{if(typeof l.success=="string"){if(typeof window[l.success]=="function"){if(f){q=f(q,m.filterArguments)}window[l.success](q)}}else{if(typeof l.success=="function"){if(f){q=f(q,m.filterArguments)}l.success(q)}}}}}};e.getDataFromCache(j,i)};this.getRecentMediaComments=function(h,m){var n=this,o=false,g=false,l=this.statusCode,j=false,f=this.getFilter("getRecentMediaComments");if(typeof m=="undefined"||m.length===0){o=true}else{if("success" in m){g=true}if("error" in m){j=true}if("statusCode" in m){l=m.statusCode}}var i="https://api.instagram.com/v1/media/"+h+"/comments?access_token="+c();var k=function(p){if(p===false){jQuery.ajax({type:"POST",dataType:"jsonp",url:i,success:function(r){e.setDataToCache(i,r);q(r)},error:function(r){if(j){if(typeof m.error=="object"&&m.error.length==2){if(typeof window[m.error[0]][m.error[1]]=="function"){window[m.error[0]][m.error[1]](r)}}else{if(typeof m.error=="string"){if(typeof window[m.error]=="function"){window[m.error](r)}}else{if(typeof m.error=="function"){m.error(r)}}}}},statusCode:l})}else{q(p)}function q(r){if(g){if(typeof m.success=="object"&&m.success.length==2){if(typeof window[m.success[0]]!="undefined"){if(typeof window[m.success[0]][m.success[1]]=="function"){if(f){r=f(r,n.filterArguments)}window[m.success[0]][m.success[1]](r)}}}else{if(typeof m.success=="string"){if(typeof window[m.success]=="function"){if(f){r=f(r,n.filterArguments)}window[m.success](r)}}else{if(typeof m.success=="function"){if(f){r=f(r,n.filterArguments)}m.success(r)}}}}}};e.getDataFromCache(k,i)};this.getRecentMediaLikes=function(l,i){var f=this,m=false,g=false,k=this.statusCode,h=false,j=this.getFilter("getRecentMediaLikes");if(typeof i=="undefined"||i.length===0){m=true}else{if("success" in i){g=true}if("error" in i){h=true}if("statusCode" in i){k=i.statusCode}}jQuery.ajax({type:"POST",dataType:"jsonp",url:"https://api.instagram.com/v1/media/"+l+"/likes?access_token="+c(),success:function(n){if(g){if(typeof i.success=="object"&&i.success.length==2){if(typeof window[i.success[0]]!="undefined"){if(typeof window[i.success[0]][i.success[1]]=="function"){if(j){n=j(n,f.filterArguments)}window[i.success[0]][i.success[1]](n)}}}else{if(typeof i.success=="string"){if(typeof window[i.success]=="function"){if(j){n=j(n,f.filterArguments)}window[i.success](n)}}else{if(typeof i.success=="function"){if(j){n=j(n,f.filterArguments)}i.success(n)}}}}},error:function(n){if(h){if(typeof i.error=="object"&&i.error.length==2){if(typeof window[i.error[0]][i.error[1]]=="function"){window[i.error[0]][i.error[1]](n)}}else{if(typeof i.error=="string"){if(typeof window[i.error]=="function"){window[i.error](n)}}else{if(typeof i.error=="function"){i.error(n)}}}}},statusCode:k})};this.requestByUrl=function(q,p){var r=this,s=false,h=false,j=false,o=false,m=this.statusCode,g=this.getFilter("requestByUrl"),f,n;f=q.split("?")[1].split("&");for(var l=0;l<f.length;l++){f[l]=f[l].split("=");if(f[l][0]=="access_token"){f[l][1]=c()}f[l]=f[l].join("=")}f=f.join("&");q=q.split("?")[0]+"?"+f;if(typeof p=="undefined"||p.length===0){s=true}else{if("success" in p){h=true}if("args" in p){o=true}else{p.args={}}if("error" in p){j=true}if("statusCode" in p){m=p.statusCode}}var k=function(i){if(i===false){jQuery.ajax({type:"POST",dataType:"jsonp",url:q,success:function(u){e.setDataToCache(q,u);if(h){if(typeof p.success=="object"&&p.success.length==2){if(typeof window[p.success[0]]!="undefined"){if(typeof window[p.success[0]][p.success[1]]=="function"){if(g){u=g(u,r.filterArguments,p.args)}window[p.success[0]][p.success[1]](u)}}}else{if(typeof p.success=="string"){if(typeof window[p.success]=="function"){if(g){u=g(u,r.filterArguments,p.args)}window[p.success](u)}}else{if(typeof p.success=="function"){if(g){u=g(u,r.filterArguments,p.args)}p.success(u)}}}}},error:function(u){if(j){if(typeof p.error=="object"&&p.error.length==2){if(typeof window[p.error[0]][p.error[1]]=="function"){window[p.error[0]][p.error[1]](u)}}else{if(typeof p.error=="string"){if(typeof window[p.error]=="function"){window[p.error](u)}}else{if(typeof p.error=="function"){p.error(u)}}}}},statusCode:m})}else{t(i)}function t(u){if(h){if(typeof p.success=="object"&&p.success.length==2){if(typeof window[p.success[0]]!="undefined"){if(typeof window[p.success[0]][p.success[1]]=="function"){if(g){u=g(u,r.filterArguments,p.args)}window[p.success[0]][p.success[1]](u)}}}else{if(typeof p.success=="string"){if(typeof window[p.success]=="function"){if(g){u=g(u,r.filterArguments,p.args)}window[p.success](u)}}else{if(typeof p.success=="function"){if(g){u=g(u,r.filterArguments,p.args)}p.success(u)}}}}}};e.getDataFromCache(k,q)};this.getDataFromCache=function(h,g,f){if(typeof f==="undefined"){f=true}jQuery.ajax({type:"POST",async:f,url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_cache_name:g,wdi_nonce:wdi_ajax.wdi_nonce,WDI_MINIFY:wdi_ajax.WDI_MINIFY,action:"wdi_get_cache_data"},success:function(j){if(j.wdi_debugging){console.log(j.wdi_debugging_data)}if(j.success){if(typeof j.cache_data!=="undefined"&&j.cache_data!==null){var i=JSON.parse(j.cache_data);h(i)}else{h(false)}}else{h(false)}}})};this.setDataToCache=function(g,f){jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_cache_name:g,wdi_cache_response:JSON.stringify(f),wdi_nonce:wdi_ajax.wdi_nonce,action:"wdi_set_cache_data"},success:function(h){}})}};
readme.txt CHANGED
@@ -3,67 +3,119 @@ Contributors: webdorado,10web,progmastery
3
  Tags: custom instagram feed, feed, instagram, hashtag, Instagram feed, instagram gallery, instagram posts, Instagram images, Instagram photos, lightbox, photos,instagram account
4
  Requires at least: 3.9
5
  Requires PHP: 5.2
6
- Tested up to: 5.0
7
- Stable tag: 1.3.12
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- 10Web Instagram Feed is a user-friendly plugin to display user or hashtag-based Instagram feeds as a responsive customizable gallery.
12
 
13
  == Description ==
14
 
15
- https://www.youtube.com/watch?v=CgZNya0HZCQ
16
 
17
  = Useful Links: =
18
- [Special Offer for all Premium Plugins](https://10web.io/plugins-bundle-pricing/)
19
- [WordPress 10Web Instagram Feed ](https://10web.io/plugins/wordpress-instagram-feed/)
20
- [Demo](https://demo.10web.io/instagram-feed/)
21
- [User Guide](https://docs.10web.io/docs/wd-instagram-feed/)
22
- [Support Forum](https://wordpress.org/plugins/wd-instagram-feed/)
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
 
25
- 10Web Instagram Feed is a user-friendly WordPress plugin that can help you bring Instagram feeds with the media of your Instagram account to any of your posts and pages. It will take couple of minutes to set up and customize to your needs. 10Web Instagram Feed's settings and features will allow you to take full control over how to display the feeds and the content on your website.
 
 
 
 
26
 
27
- 10Web Instagram Feed is a perfect fit for bloggers, photography websites, travel and food blogs and for WordPress users that want to spice up their posts with the latest images and videos from their Instagram profiles. The plugin is responsive and scales perfectly to screens of all sizes, providing better user experience across the board.
 
28
 
 
 
29
 
30
- == Benefits ==
31
- * **Increase user engagement** - Engagement on Instagram is higher than on any other social platform. Keep your visitors engaged and significantly increase surfing time and visitor retention on your website.
32
- * **Increase brand/blog awareness** - Let your site visitors get into conversation and connect with your blog or brand. Keep your visitors tuned and increase your blog's/brand's awareness.
33
- * **Save your time** – Keep your posts authentic with content from your Instagram account without any manual work involved. Your feeds will be fresh and up to date and synced automatically.
34
- * **Add appeal to your website** - Stunning display views, custom styling features and image lightbox effects will bring vibrancy to your posts and pages, and add to your website's overall look and feel.
35
- * **Control** - Take pure charge of what content to display and how to display it with an extensive list of content and display settings. Specify the number of photos you display on the page and choose what happens when a visitor clicks on an image from the feed. Custom styled display views and filtered Instagram content will be a great addition to any post you publish.
36
- * **Minimal effort** – Set the plugin up and have it up and running in no time and with minimal efforts. Out of box solution that's user-friendly and simple in use.
37
- * **Support** - The team behind 10Web Instagram Feed provides timely and effective support to all its users. We keep standards high and response time low.
38
- * **Resource efficient** - WordPress 10Web Instagram Feed plugin loads the images pretty fast as no feed data is stored in the database. All the images, videos, captions and comments are retrieved directly from the Instagram in the front-end.
39
 
 
 
40
 
 
 
41
 
42
- == What's in it ==
 
43
 
44
- = CUSTOMIZABLE LAYOUTS =
45
- Display the feeds in one of the available layouts Thumbnail, Image Browser, Masonry (Premium version), Blog Style(Premium version). Whether you want to have small sized image thumbnails or larger images displayed you'll find the right layout for that. Customize layouts to get exactly what you need and display the metadata that's most relevant for your niche.
46
 
47
- = INSTAGRAM GALLERY =
48
- Create Instagram galleries on your website by embedding entire timelines to your posts using a shortcode or the plugin's Instagram widget on your sidebar.
49
 
50
- = INDIVIDUAL AND MIXED FEEDS =
51
- You can choose to show a single feed on your pages and posts, but you can make things more interesting and create mixed feeds (Premium version). With single feeds you can show posts from your Instagram account and single hashtag. Mixed feeds, on the other hand, can contain your Instagram account and multiple hashtags. A front end filter is available for mixed feeds (Premium version).
52
 
53
- = FILTERED FEEDS =
54
- Use Conditional Filters of the 10Web Instagram Feed plugin to display or skip certain content from the feeds by setting up a filter logic and condition types. Add custom condition types if necessary and fine-tune your feeds. Conditional Filters option is available for Premium version only.
55
 
56
- = INSTAGRAM WIDGET =
57
- Want to show Instagram feeds on your website sidebar? Do it quick and easy with the help of the Instagram Feed Widget.
 
 
 
58
 
59
- = LIGHTBOX =
60
- 10Web Instagram Feed features a powerful lightbox. It provides support for HTML5 video, 15 transition effects (Premium version), filmstrip (Premium version) and carousel features. The lightbox works great with Instagram touch as well.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
- = SCROLL AND PAGINATION =
63
- The plugin comes with a classic pagination with next and previous buttons. You can also choose the infinite scroll option (Premium version) to bring better user experience. This allows to view more images when scrolling the page down. You can set the the number of images you want to show per page.
64
 
65
- = THEMES =
66
- Choose from the two default themes offered by the plugin or create multifarious themes (Premium version) by customizing the colors, sizes and display styles. 10Web Instagram Feed allows you to have separate layout settings for each theme with custom settings for header, user data and pagination.
67
 
68
  = SETTINGS/CUSTOMIZATION =
69
 
@@ -72,23 +124,6 @@ Choose from the two default themes offered by the plugin or create multifarious
72
  10Web Instagram Feed comes with extensive customization options for the feeds, layouts, themes and content display. Every new feed you add to your website has its own settings for the feed and for the lightbox that pops up when people click on an image or video. Upon clicking on the image you can choose to redirect people to Instagram, open the image in the lightbox, or chose the custom redirect option. There are various image sorting options available based on the date, likes, comments, and on random basis. Media loading options include load more button, infinite Instagram scrolling, or classic pagination with next and previous buttons. You can enable "Follow on Instagram" button from the feed settings and let your visitors follow the displayed Instagram accounts directly from your site. The number of photos you display on the page or post can be specified from the feed settings, as well as the number of the loading images.
73
 
74
 
75
- [Premium version adds](https://10web.io/plugins/wordpress-instagram-feed/)
76
-
77
- * Masonry Layout feeds
78
- * Blog Style Layout feeds
79
- * Image metadata (Instagram tag,image caption, comments, like) display
80
- * Mixed and multiple feeds (Instagram account posts with multiple hashtags)
81
- * Fully Customizable Themes
82
- * Vertical/horizontal filmstrip in lightbox
83
- * HTML5 Video Support in Lightbox
84
- * Blog Style and Image Browser views for displaying Instagram videos
85
- * 15 Lightbox transition effects
86
- * Social sharing buttons (Facebook, Twitter, Google+, LinkedIn and Pinterest)
87
- * Infinite scroll for the feed (Similar to Instagram standard)
88
- * Instagram Comments display in Lightbox
89
- * Instagram Hashtag filtering options
90
- * Conditional Filters
91
-
92
  ###IMPORTANT:
93
  If you think you found a bug in 10Web Instagram Feed or wonder how to add Instagram to your website, or how to get Instagram plugin up and running, please check out [Support Forum](https://wordpress.org/support/plugin/wd-instagram-feed). Additional information on how to download Instagram plugin to your website you can find in our user manual If you do not find a solution in the forum, do not hesitate to [click here to contact us](https://10web.io/contact-us/).
94
 
@@ -502,6 +537,11 @@ Please make sure you don't have any important information before you proceed.
502
 
503
  == Changelog ==
504
 
 
 
 
 
 
505
  = 1.3.12 =
506
  Fixed: Conflict with Gutenberg.
507
 
3
  Tags: custom instagram feed, feed, instagram, hashtag, Instagram feed, instagram gallery, instagram posts, Instagram images, Instagram photos, lightbox, photos,instagram account
4
  Requires at least: 3.9
5
  Requires PHP: 5.2
6
+ Tested up to: 5.1
7
+ Stable tag: 1.3.13
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ 10Web Instagram Feed is the leading plugin for easily presenting a customizable Instagram feed on your website.
12
 
13
  == Description ==
14
 
15
+ 10Web Instagram Feed is the leading plugin for easily presenting a customizable Instagram feed on your website.
16
 
17
  = Useful Links: =
 
 
 
 
 
18
 
19
+ [Live Demo](https://demo.10web.io/instagram-feed/)
20
+
21
+ [Premium Instagram Feed by 10Web](https://10web.io/plugins/wordpress-instagram-feed/)
22
+
23
+ [Special Offer for all Premium Plugins](https://10web.io/plugins-bundle-pricing/)
24
+
25
+
26
+ https://www.youtube.com/watch?v=CgZNya0HZCQ
27
+
28
+ Having a hard time finding the perfect Instagram plugin to showcase your feed?
29
+
30
+ Is it difficult for you to match your website’s design with the default Instagram look?
31
+
32
+ Looking for an alternative to embedding Instagram posts one by one?
33
+
34
+ == Instagram Feed Features ==
35
+
36
+ **Present Content**
37
+ Present images from hashtags or your Instagram accounts.
38
 
39
+ **Mixed Feeds\***
40
+ Merge Instagram accounts with chosen hashtags.
41
+
42
+ **Mobile-Friendly & Responsive**
43
+ Your feeds will look excellent on all types of devices: desktops, tablets, and mobile phones.
44
 
45
+ **Any Number of Feeds**
46
+ Display however many Instagram feeds on one page.
47
 
48
+ **Customizable Layouts**
49
+ Pick one of the four layouts: Thumbnails, Masonry*, Blog Style*, and Image Browser.
50
 
51
+ **Functional Lightbox**
52
+ Use transition effects*, show captions and comments*.
 
 
 
 
 
 
 
53
 
54
+ **Customizable Themes\***
55
+ Choose one of our predefined themes or create a new one.
56
 
57
+ **In-Depth Metadata\***
58
+ Show profile information, captions, comments, and likes.
59
 
60
+ **Infinite Scroll & Pagination**
61
+ Choose the number of displayed images per page or set an infinite scroll.
62
 
63
+ **Instagram Feed Widget**
64
+ Display Instagram feeds on your website’s sidebars.
65
 
66
+ **Downloads and Shares\***
67
+ Your users can download images from the lightbox and share them on social media.
68
 
69
+ **Publish Easily**
70
+ Embed feeds into posts or pages in just a click.
71
 
72
+ _\* Premium version only_
 
73
 
74
+ == World Class Customer Support ==
75
+ * Low response time
76
+ We always respond within a few hours.
77
+ * Quick issue resolution
78
+ Resolving an issue never takes more than 24 hours.
79
 
80
+ == FEATURED REVIEWS ==
81
+
82
+ > Fantastic, outstanding plugin that did exactly what I wanted it to do – show my Instagram feed on my site,
83
+ > increasing traffic flow and improving Google ranking.
84
+ > So easy to install! Perfect!
85
+ > **[by @herm1one](https://wordpress.org/support/topic/working-so-well-for-seo/)**
86
+
87
+ > Good Plugin, my daughter can update her hairdressing photos on Instagram, and the website keeps automatically up to date.
88
+ > Does the job well, and shows that the Salon is up to the minute.
89
+ > **[by @elainekay](https://wordpress.org/support/topic/great-little-plug-in-10/)**
90
+
91
+ > This plugin is great!
92
+ > Very clean layout and easy to use!
93
+ > Will be using this plugin for all my sites that require instagram feeds! Thanks
94
+ > **[by @csmithfcedge](https://wordpress.org/support/topic/clean-layout-2/)**
95
+
96
+ == Steps for integrating an Instagram feed: ==
97
+ 1. Install 10Web Instagram Feed.
98
+ 2. Connect your Instagram account.
99
+ 3. Publish your feed.
100
+
101
+ > **[Premium version adds](https://10web.io/plugins/wordpress-instagram-feed/)**
102
+ >
103
+ > * Masonry Layout feeds
104
+ > * Blog Style Layout feeds
105
+ > * Image metadata (Instagram tags, image captions, comments, likes) displayed
106
+ > * Mixed and multiple feeds (Instagram account posts with multiple hashtags)
107
+ > * Fully customizable themes
108
+ > * Vertical/horizontal filmstrip in lightbox
109
+ > * HTML5 Video support in Lightbox
110
+ > * Blog Style and Image Browser views for displaying Instagram videos
111
+ > * 15 Lightbox transition effects
112
+ > * Social sharing buttons (Facebook, Twitter, Google+, LinkedIn and Pinterest)
113
+ > * Infinite scroll for the feed (Similar to Instagram standard)
114
+ > * Instagram comments displayed in Lightbox
115
+ > * Instagram hashtag filtering options
116
+ > * Conditional filters
117
 
 
 
118
 
 
 
119
 
120
  = SETTINGS/CUSTOMIZATION =
121
 
124
  10Web Instagram Feed comes with extensive customization options for the feeds, layouts, themes and content display. Every new feed you add to your website has its own settings for the feed and for the lightbox that pops up when people click on an image or video. Upon clicking on the image you can choose to redirect people to Instagram, open the image in the lightbox, or chose the custom redirect option. There are various image sorting options available based on the date, likes, comments, and on random basis. Media loading options include load more button, infinite Instagram scrolling, or classic pagination with next and previous buttons. You can enable "Follow on Instagram" button from the feed settings and let your visitors follow the displayed Instagram accounts directly from your site. The number of photos you display on the page or post can be specified from the feed settings, as well as the number of the loading images.
125
 
126
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  ###IMPORTANT:
128
  If you think you found a bug in 10Web Instagram Feed or wonder how to add Instagram to your website, or how to get Instagram plugin up and running, please check out [Support Forum](https://wordpress.org/support/plugin/wd-instagram-feed). Additional information on how to download Instagram plugin to your website you can find in our user manual If you do not find a solution in the forum, do not hesitate to [click here to contact us](https://10web.io/contact-us/).
129
 
537
 
538
  == Changelog ==
539
 
540
+ = 1.3.13 =
541
+ New: Option to get hashtag top media
542
+ Improved: Notices during Facebook Log in
543
+ Fixed: Occasional JS error on front end
544
+
545
  = 1.3.12 =
546
  Fixed: Conflict with Gutenberg.
547
 
update/wdi_update.php CHANGED
@@ -100,6 +100,11 @@ function wdi_update_diff($new_v, $old_v = 0.0){
100
  $wpdb->query("ALTER TABLE " . $wpdb->prefix . WDI_FEED_TABLE . " MODIFY COLUMN feed_thumb varchar(800) NOT NULL");
101
  }
102
 
 
 
 
 
 
103
 
104
 
105
  }
100
  $wpdb->query("ALTER TABLE " . $wpdb->prefix . WDI_FEED_TABLE . " MODIFY COLUMN feed_thumb varchar(800) NOT NULL");
101
  }
102
 
103
+ if(version_compare($old_v, "3.13", '<')){
104
+ $wpdb->query("ALTER TABLE " . $wpdb->prefix . WDI_FEED_TABLE . " ADD `hashtag_top_recent` varchar(10) NOT NULL DEFAULT '1'");
105
+ }
106
+
107
+
108
 
109
 
110
  }
wd-instagram-feed.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Instagram Feed by 10Web
4
  Plugin URI: https://10web.io/plugins/wordpress-instagram-feed/
5
  Description: Instagram Feed by 10Web 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.12
7
  Author: 10Web
8
  Author URI: https://10Web.io
9
  License: GPLv2 or later
@@ -20,7 +20,7 @@ define("WDI_META", "_".WDI_VAR."_meta");
20
  //define("wdi",'wdi');
21
  define('WDI_FEED_TABLE','wdi_feeds');
22
  define('WDI_THEME_TABLE','wdi_themes');
23
- define('WDI_VERSION','1.3.12');
24
  define('WDI_IS_PRO','false');
25
  $wdi_minify = ((isset($_GET['wdi_no_minify']) && $_GET['wdi_no_minify'] == "true") ? false : true);
26
  define('WDI_MINIFY', $wdi_minify);
@@ -65,6 +65,7 @@ function wdi_save_user_access_token(){
65
 
66
  if(!is_array($accounts)) {
67
  //invalid access token
 
68
  return;
69
  }
70
 
@@ -82,6 +83,7 @@ function wdi_save_user_access_token(){
82
 
83
  if(empty($business_accounts)) {
84
  //no business accounts
 
85
  return;
86
  }
87
 
@@ -93,6 +95,14 @@ function wdi_save_user_access_token(){
93
  echo "<script>window.location.href='admin.php?page=wdi_settings';</script>";
94
  }
95
 
 
 
 
 
 
 
 
 
96
  add_action('wp_ajax_wdi_get_cache_data', 'wdi_get_cache_data');
97
  add_action('wp_ajax_nopriv_wdi_get_cache_data', 'wdi_get_cache_data');
98
 
@@ -582,7 +592,7 @@ function wdi_load_scripts($hook){
582
  'user_not_exist' => __('User %s does not exist.', "wd-instagram-feed"),
583
  'network_error' => __("Network Error, please try again later. :(", "wd-instagram-feed"),
584
  'invalid_hashtag' => __('Invalid hashtag', "wd-instagram-feed"),
585
- 'hashtag_no_data' => __('This hashtag currently has no posts. Are you sure you want to add it?','wd-instagram-feed'),
586
  'only_one_user_or_hashtag'=> __('You can add only one username or hashtag in FREE Version', "wd-instagram-feed"),
587
  'available_in_pro' => __('Available in Premium','wd-instagram-feed'),
588
  'username_hashtag_multiple' => __('Combined Usernames/Hashtags are available only in Premium version'),
3
  Plugin Name: Instagram Feed by 10Web
4
  Plugin URI: https://10web.io/plugins/wordpress-instagram-feed/
5
  Description: Instagram Feed by 10Web 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.13
7
  Author: 10Web
8
  Author URI: https://10Web.io
9
  License: GPLv2 or later
20
  //define("wdi",'wdi');
21
  define('WDI_FEED_TABLE','wdi_feeds');
22
  define('WDI_THEME_TABLE','wdi_themes');
23
+ define('WDI_VERSION','1.3.13');
24
  define('WDI_IS_PRO','false');
25
  $wdi_minify = ((isset($_GET['wdi_no_minify']) && $_GET['wdi_no_minify'] == "true") ? false : true);
26
  define('WDI_MINIFY', $wdi_minify);
65
 
66
  if(!is_array($accounts)) {
67
  //invalid access token
68
+ add_action('admin_notices', 'wdi_invalid_fb_token_notice');
69
  return;
70
  }
71
 
83
 
84
  if(empty($business_accounts)) {
85
  //no business accounts
86
+ add_action('admin_notices', 'wdi_no_business_account_notice');
87
  return;
88
  }
89
 
95
  echo "<script>window.location.href='admin.php?page=wdi_settings';</script>";
96
  }
97
 
98
+ function wdi_no_business_account_notice(){
99
+ echo "<div class='notice notice-error'><p>Cannot find connected Instagram business page. Either you do not have Instagram business account or it is not connected to current Facebook user's page. <a href='https://help.10web.io/hc/en-us/articles/360021344111' target='_blank'>See more in documentation.</a> </p></div>";
100
+ }
101
+
102
+ function wdi_invalid_fb_token_notice(){
103
+ echo "<div class='notice notice-error'><p>Could not get Instagram business pages. Either do not have any Facebook page or your token does not have manage_pages permission. Try to remove '10Web Hashtag Feed Plugin' app and reconnect it.</p></div>";
104
+ }
105
+
106
  add_action('wp_ajax_wdi_get_cache_data', 'wdi_get_cache_data');
107
  add_action('wp_ajax_nopriv_wdi_get_cache_data', 'wdi_get_cache_data');
108
 
592
  'user_not_exist' => __('User %s does not exist.', "wd-instagram-feed"),
593
  'network_error' => __("Network Error, please try again later. :(", "wd-instagram-feed"),
594
  'invalid_hashtag' => __('Invalid hashtag', "wd-instagram-feed"),
595
+ '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'),
596
  'only_one_user_or_hashtag'=> __('You can add only one username or hashtag in FREE Version', "wd-instagram-feed"),
597
  'available_in_pro' => __('Available in Premium','wd-instagram-feed'),
598
  'username_hashtag_multiple' => __('Combined Usernames/Hashtags are available only in Premium version'),