WD Instagram Feed – Instagram Gallery - Version 1.4.8

Version Description

Fixed: JS error. Fixed: Broken images. Fixed: Uninstall functionality. Fixed: Requests limitation in API.

Download this release

Release Info

Developer 10web
Plugin Icon 128x128 WD Instagram Feed – Instagram Gallery
Version 1.4.8
Comparing to
See all releases

Code changes from version 1.4.7 to 1.4.8

admin-functions.php CHANGED
@@ -11,51 +11,6 @@ function wdi_check_necessary_params() {
11
  }
12
  }
13
 
14
- /**
15
- * uninstall action callback
16
- * this functions finds and deletes all plugin related tables from wordpress database
17
- * also it deletes from options table plugin options sets uninstalled option as true
18
- */
19
- // add_action('wp_ajax_wdiUninstallPlugin','wdi_uninstall_ajax');
20
- // function wdi_uninstall_ajax(){
21
- // $nonce = isset($_REQUEST['uninstall_nonce']) ? $_REQUEST['uninstall_nonce'] : "";
22
- // if(!wp_verify_nonce( $nonce, 'wdiUninstallPlugin' )){
23
- // wp_die();
24
- // }
25
- // else{
26
- // global $wpdb;
27
- // $removed = false;
28
- // $table_name = $wpdb->prefix.WDI_FEED_TABLE;
29
- // $checktable = $wpdb->query("SHOW TABLES LIKE '$table_name'");
30
- // $table_exists = $checktable > 0;
31
- // if($table_exists){
32
- // $sql = "DROP TABLE ". $table_name;
33
- // $wpdb->query($sql);
34
- // $removed = true;
35
- // }
36
- // $table_name = $wpdb->prefix.WDI_THEME_TABLE;
37
- // $checktable = $wpdb->query("SHOW TABLES LIKE '$table_name'");
38
- // $table_exists = $checktable > 0;
39
- // if($table_exists){
40
- // $sql = "DROP TABLE ". $table_name;
41
- // $wpdb->query($sql);
42
- // $removed = true;
43
- // }
44
- // if($removed == true) {
45
- // wdi_uninstall_notice(1);
46
- // }
47
- // else{
48
- // wdi_uninstall_notice(2);
49
- // };
50
- // delete_option(WDI_OPT);
51
- // $default_option=array();
52
- // $default_option['wdi_plugin_uninstalled'] = 'true';
53
- // add_option(WDI_OPT,$default_option);
54
- // delete_option('wdi_version');
55
- // }
56
- // wp_die();
57
- // }
58
-
59
  /**
60
  * checks if argument is 1 it displays success message on settings page after uninstalling plugin
61
  * else it displays error message already uninstalled
@@ -77,17 +32,6 @@ function wdi_uninstall_notice( $arg ) {
77
  }
78
  }
79
 
80
- /**
81
- * checks if plugin is uninstalled it displays to all users uninstalled screen
82
- */
83
- function wdi_check_uninstalled() {
84
- global $wdi_options;
85
- if ( isset($wdi_options['wdi_plugin_uninstalled']) && $wdi_options['wdi_plugin_uninstalled'] == 'true' ) {
86
- require_once(WDI_DIR . '/templates/plugin-uninstalled.php');
87
- die();
88
- };
89
- }
90
-
91
  /**
92
  * triggered on plugin activation
93
  * adds some plugin related options like plugin version and database version
@@ -870,7 +814,12 @@ function wdi_get_auth_urls() {
870
  'state' => admin_url('admin.php?wdi_settings')
871
  ), $config['basic_authorize_url']);
872
 
873
- $urls['business'] = "";
 
 
 
 
 
874
 
875
  return $urls;
876
  }
@@ -878,7 +827,7 @@ function wdi_get_auth_urls() {
878
  function wdi_parse_old_options( $new_version, $old_version ) {
879
  if ( !empty($old_version) && version_compare($new_version, $old_version, '>') ) {
880
  $options = wdi_get_options();
881
- if ( !empty($options) ) {
882
  $users = array();
883
  $users[$options['wdi_user_name']] = array(
884
  'type' => 'personal',
11
  }
12
  }
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  /**
15
  * checks if argument is 1 it displays success message on settings page after uninstalling plugin
16
  * else it displays error message already uninstalled
32
  }
33
  }
34
 
 
 
 
 
 
 
 
 
 
 
 
35
  /**
36
  * triggered on plugin activation
37
  * adds some plugin related options like plugin version and database version
814
  'state' => admin_url('admin.php?wdi_settings')
815
  ), $config['basic_authorize_url']);
816
 
817
+ $urls['business'] = add_query_arg(array(
818
+ 'client_id' => $config['graph_app_id'],
819
+ 'redirect_uri' => $config['graph_redirect_uri'],
820
+ 'scope' => $config['graph_scope']
821
+ ), $config['graph_authorize_url']);
822
+ $urls['business'] .= '&state=' . base64_encode(json_encode($state));
823
 
824
  return $urls;
825
  }
827
  function wdi_parse_old_options( $new_version, $old_version ) {
828
  if ( !empty($old_version) && version_compare($new_version, $old_version, '>') ) {
829
  $options = wdi_get_options();
830
+ if ( !empty($options) && ( !empty($options['wdi_fb_auth']) || !empty($options['fb_token']) ) ) {
831
  $users = array();
832
  $users[$options['wdi_user_name']] = array(
833
  'type' => 'personal',
admin/controllers/WDIControllerThemes_wdi.php CHANGED
@@ -5,6 +5,7 @@ class WDIControllerThemes_wdi {
5
  private $view,$model;
6
 
7
  public function __construct() {
 
8
  require_once (WDI_DIR . "/admin/models/WDIModelThemes_wdi.php");
9
  $this->model = new WDIModelThemes_wdi();
10
 
@@ -13,7 +14,44 @@ class WDIControllerThemes_wdi {
13
  }
14
 
15
  public function execute() {
16
- $this->display();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  }
18
 
19
  public function display() {
@@ -26,31 +64,261 @@ class WDIControllerThemes_wdi {
26
  }
27
 
28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
 
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
35
  public static function remove_theme_file($theme_id){
36
- $wp_upload_dir = wp_upload_dir();
37
- $wp_upload_dir = $wp_upload_dir['basedir'];
38
- $folder = $wp_upload_dir . '/wd-instagram-feed';
39
- $file = $folder."/wdi_theme_" . $theme_id . '.css';
40
- if(file_exists($file)){
41
- return unlink($file);
42
- }
43
  return null;
44
  }
45
 
46
  public static function remove_all_themes_files(){
47
- $wp_upload_dir = wp_upload_dir();
48
- $wp_upload_dir = $wp_upload_dir['basedir'];
49
- $folder = $wp_upload_dir . '/wd-instagram-feed';
50
-
51
- require_once(WDI_DIR . '/framework/WDILibrary.php');
52
- WDILibrary::remove_folder($folder);
53
  }
54
 
55
  }
56
- ?>
5
  private $view,$model;
6
 
7
  public function __construct() {
8
+ $this->setDataFormat();
9
  require_once (WDI_DIR . "/admin/models/WDIModelThemes_wdi.php");
10
  $this->model = new WDIModelThemes_wdi();
11
 
14
  }
15
 
16
  public function execute() {
17
+ $task = WDILibrary::get('task');
18
+ $id = WDILibrary::get('current_id', 0);
19
+ $message = WDILibrary::get('message');
20
+
21
+ if(!empty($message)){
22
+ $message = explode(',', $message);
23
+ foreach($message as $msg_id){
24
+ echo WDILibrary::message_id($msg_id);
25
+ }
26
+ }
27
+
28
+ $get_method_tasks = array(
29
+ "add",
30
+ "edit",
31
+ "display"
32
+ );
33
+ $get_task = "";
34
+ if ( WDILibrary::get('task') != '' ) {
35
+ $get_task = WDILibrary::get('task');
36
+ }
37
+ if (method_exists($this, $task)) {
38
+ if(!in_array($get_task , $get_method_tasks)){
39
+ check_admin_referer('nonce_wd', 'nonce_wd');
40
+ }
41
+ $this->$task($id);
42
+ }
43
+ else {
44
+ $search_value = WDILibrary::get('search_value');
45
+ if( !empty($search_value) ){
46
+ WDILibrary::wdi_spider_redirect(add_query_arg(array(
47
+ 'page' => WDILibrary::get('page'),
48
+ 'task' => 'display',
49
+ 'search' => $search_value,
50
+ ), admin_url('admin.php')));
51
+ }else{
52
+ $this->display();
53
+ }
54
+ }
55
  }
56
 
57
  public function display() {
64
  }
65
 
66
 
67
+ private function setDataFormat(){
68
+ $this->data_format = array(
69
+ '%s',/*theme_name*/
70
+ '%s',/*default_theme*/
71
+ '%s',/*feed_container_bg_color*/
72
+ '%s',/*feed_wrapper_width*/
73
+ '%s',/*feed_container_width*/
74
+ '%s',/*feed_wrapper_bg_color*/
75
+ '%s',/*active_filter_bg_color*/
76
+ '%s',/*header_margin*/
77
+ '%s',/*header_padding*/
78
+ '%s',/*header_border_size*/
79
+ '%s',/*header_border_color*/
80
+ '%s',/*header_position*/
81
+ '%s',/*header_img_width*/
82
+ '%s',/*header_border_radius*/
83
+ '%s',/*header_text_padding*/
84
+ '%s',/*header_text_color*/
85
+ '%d',/*header_font_weight*/
86
+ '%s',/*header_text_font_size*/
87
+ '%s',/*header_text_font_style*/
88
+ '%s',/*'follow_btn_border_radius'=>'number'*/
89
+ '%s',/*'follow_btn_padding'=>'number'*/
90
+ '%d',/*'follow_btn_margin'=>'number'*/
91
+ '%s',//'follow_btn_bg_color'=>'color',
92
+ '%s',//'follow_btn_border_color'=>'color',
93
+ '%s',//'follow_btn_text_color'=>'color',
94
+ '%d',//'follow_btn_font_size'=>'number',
95
+ '%s',//'follow_btn_border_hover_color'=>'color',
96
+ '%s',//'follow_btn_text_hover_color'=>'color',
97
+ '%s',//'follow_btn_background_hover_color'=>'color',
98
 
99
+ '%s',/*user_horizontal_margin*/
100
+ '%s',/*user_padding*/
101
+ '%s',/*user_border_size*/
102
+ '%s',/*user_border_color*/
103
+ '%d',//'user_img_width'
104
+ '%d',/*user_border_radius*/
105
+ '%s',/*user_background_color*/
106
+ '%s',/*users_border_size*/
107
+ '%s',/*users_border_color*/
108
+ '%s',/*users_background_color*/
109
+ '%s',//users_text_color
110
+ '%d',//users_font_weight
111
+ '%s',//users_text_font_size
112
+ '%s',//users_text_font_style
113
+ '%s',//user_description_font_size
114
+ '%s',//'lightbox_overlay_bg_color'=>'color',
115
+ '%d',//'lightbox_overlay_bg_transparent'=>'number_max_100',
116
+ '%s',//'lightbox_bg_color'=>'color',
117
+ '%d',//'lightbox_ctrl_btn_height'=>'number',
118
+ '%d',//'lightbox_ctrl_btn_margin_top'=>'number',
119
+ '%d',//'lightbox_ctrl_btn_margin_left'=>'number',
120
+ '%s',//'lightbox_ctrl_btn_pos'=>'string',
121
+ '%s',//'lightbox_ctrl_cont_bg_color'=>'color',
122
+ '%d',//'lightbox_ctrl_cont_border_radius'=>'number',
123
+ '%d',//'lightbox_ctrl_cont_transparent'=>'number_max_100',
124
+ '%s',//'lightbox_ctrl_btn_align'=>'position',
125
+ '%s',//'lightbox_ctrl_btn_color'=>'color',
126
+ '%d',//'lightbox_ctrl_btn_transparent'=>'number_max_100',
127
+ '%d',//'lightbox_toggle_btn_height'=>'number',
128
+ '%d',//'lightbox_toggle_btn_width'=>'number',
129
+ '%d',//'lightbox_close_btn_border_radius'=>'number',
130
+ '%d',//'lightbox_close_btn_border_width'=>'number',
131
+ '%s',//'lightbox_close_btn_border_style'=>'string',
132
+ '%s',//'lightbox_close_btn_border_color'=>'color',
133
+ '%s',//'lightbox_close_btn_box_shadow'=>'css_box_shadow',
134
+ '%s',//'lightbox_close_btn_bg_color'=>'color',
135
+ '%d',//'lightbox_close_btn_transparent'=>'number_max_100',
136
+ '%d',//'lightbox_close_btn_width'=>'number',
137
+ '%d',//'lightbox_close_btn_height'=>'number',
138
+ '%d',//'lightbox_close_btn_top'=>'number_neg',
139
+ '%d',//'lightbox_close_btn_right'=>'number_neg',
140
+ '%d',//'lightbox_close_btn_size'=>'number',
141
+ '%s',//'lightbox_close_btn_color'=>'color',
142
+ '%s',//'lightbox_close_btn_full_color'=>'color',
143
+ '%s',//'lightbox_close_btn_hover_color'=>'color'
144
+ '%s',//'lightbox_comment_share_button_color'=>'color',
145
+ '%s',//'lightbox_rl_btn_style'=>'string',
146
+ '%s',//'lightbox_rl_btn_bg_color'=>'color',
147
+ '%d',//'lightbox_rl_btn_transparent'=>'number_max_100',
148
+ '%s',//'lightbox_rl_btn_box_shadow'=>'css_box_shadow',
149
+ '%d',//'lightbox_rl_btn_height'=>'number',
150
+ '%d',//'lightbox_rl_btn_width'=>'number',
151
+ '%d',//'lightbox_rl_btn_size'=>'number',
152
+ '%s',//'lightbox_close_rl_btn_hover_color'=>'color',
153
+ '%s',//'lightbox_rl_btn_color'=>'color',
154
+ '%d',//'lightbox_rl_btn_border_radius'=>'number',
155
+ '%d',//'lightbox_rl_btn_border_width'=>'number',
156
+ '%s',//'lightbox_rl_btn_border_style'=>'string',
157
+ '%s',//'lightbox_rl_btn_border_color'=>'color',
158
+ '%s',//'lightbox_filmstrip_pos'=>'position',
159
+ '%s',//'lightbox_filmstrip_thumb_margin'=>'length_multi',
160
+ '%d',//'lightbox_filmstrip_thumb_border_width'=>'number',
161
+ '%s',//'lightbox_filmstrip_thumb_border_style'=>'string',
162
+ '%s',//'lightbox_filmstrip_thumb_border_color'=>'color',
163
+ '%d',//'lightbox_filmstrip_thumb_border_radius'=>'number',
164
+ '%d',//'lightbox_filmstrip_thumb_active_border_width'=>'number',
165
+ '%s',//'lightbox_filmstrip_thumb_active_border_color'=>'color',
166
+ '%s',//'lightbox_filmstrip_thumb_deactive_transparent'=>'number_max_100',
167
+ '%d',//'lightbox_filmstrip_rl_btn_size'=>'number',
168
+ '%s',//'lightbox_filmstrip_rl_btn_color'=>'color',
169
+ '%s',//'lightbox_filmstrip_rl_bg_color'=>'color',
170
+ '%s',//'lightbox_info_pos'=>'position',
171
+ '%s',//'lightbox_info_align'=>'string',
172
+ '%s',//'lightbox_info_bg_color'=>'color',
173
+ '%d',//'lightbox_info_bg_transparent'=>'number_max_100',
174
+ '%d',//'lightbox_info_border_width'=>'number',
175
+ '%s',//'lightbox_info_border_style'=>'string',
176
+ '%s',//'lightbox_info_border_color'=>'color',
177
+ '%d',//'lightbox_info_border_radius'=>'number',
178
+ '%s',//'lightbox_info_padding'=>'length_multi',
179
+ '%s',//'lightbox_info_margin'=>'length_multi',
180
+ '%s',//'lightbox_title_color'=>'color',
181
+ '%s',//'lightbox_title_font_style'=>'string',
182
+ '%s',//'lightbox_title_font_weight'=>'string',
183
+ '%d',//'lightbox_title_font_size'=>'number',
184
+ '%s',//'lightbox_description_color'=>'color',
185
+ '%s',//'lightbox_description_font_style'=>'string',
186
+ '%s',//'lightbox_description_font_weight'=>'string',
187
+ '%d',//'lightbox_description_font_size'=>'number',
188
+ '%d',//'lightbox_info_height'=>'number_max_100'
189
+ '%d',//'lightbox_comment_width'=>'number',
190
+ '%s',//'lightbox_comment_pos'=>'string',
191
+ '%s',//'lightbox_comment_bg_color'=>'color',
192
+ '%d',//'lightbox_comment_font_size'=>'number',
193
+ '%s',//'lightbox_comment_font_color'=>'color',
194
+ '%s',//'lightbox_comment_font_style'=>'string',
195
+ '%d',//'lightbox_comment_author_font_size'=>'number',
196
+ '%s',//'lightbox_comment_author_font_color'=>'color',
197
+ '%s',//'lightbox_comment_author_font_color_hover'=>'color'
198
+ '%d',//'lightbox_comment_date_font_size'=>'number',
199
+ '%d',//'lightbox_comment_body_font_size'=>'number',
200
+ '%d',//'lightbox_comment_input_border_width'=>'number',
201
+ '%s',//'lightbox_comment_input_border_style'=>'string',
202
+ '%s',//'lightbox_comment_input_border_color'=>'color',
203
+ '%d',//'lightbox_comment_input_border_radius'=>'number',
204
+ '%s',//'lightbox_comment_input_padding'=>'length_multi',
205
+ '%s',//'lightbox_comment_input_bg_color'=>'color',
206
+ '%s',//'lightbox_comment_button_bg_color'=>'color',
207
+ '%s',//'lightbox_comment_button_padding'=>'length_multi',
208
+ '%d',//'lightbox_comment_button_border_width'=>'number',
209
+ '%s',//'lightbox_comment_button_border_style'=>'string',
210
+ '%s',//'lightbox_comment_button_border_color'=>'color',
211
+ '%d',//'lightbox_comment_button_border_radius'=>'number',
212
+ '%d',//'lightbox_comment_separator_width'=>'number',
213
+ '%s',//'lightbox_comment_separator_style'=>'string',
214
+ '%s',//'lightbox_comment_separator_color'=>'color',
215
+ '%s',//'lightbox_comment_load_more_color' =>'color',
216
+ '%s',//'lightbox_comment_load_more_color_hover' =>'color',
217
 
218
+ '%s',/*th_photo_wrap_padding*/
219
+ '%s',/*th_photo_wrap_border_size*/
220
+ '%s',/*th_photo_wrap_border_color*/
221
+ '%s',/*th_photo_img_border_radius*/
222
+ '%s',/*th_photo_wrap_bg_color*/
223
+ '%s',/*th_photo_meta_bg_color*/
224
+ '%s',/*th_photo_meta_one_line*/
225
+ '%s',/*th_like_text_color*/
226
+ '%s',/*th_comment_text_color*/
227
+ '%s',/*th_photo_caption_font_size*/
228
+ '%s',/*th_photo_caption_color*/
229
+ '%s',/*th_feed_item_margin*/
230
+ '%s',/*th_photo_caption_hover_color*/
231
+ '%s',/*th_like_comm_font_size*/
232
+ '%s',//'th_overlay_hover_color'=>'color',
233
+ '%d',//'th_overlay_hover_transparent'=>'number',
234
+ '%s',//'th_overlay_hover_icon_color'=>'color',
235
+ '%s',//'th_overlay_hover_icon_font_size'=>'length',
236
 
237
+ '%s',//th_photo_img_hover_effect
238
 
239
+ '%s',/*mas_photo_wrap_padding*/
240
+ '%s',/*mas_photo_wrap_border_size*/
241
+ '%s',/*mas_photo_wrap_border_color*/
242
+ '%s',/*mas_photo_img_border_radius*/
243
+ '%s',/*mas_photo_wrap_bg_color*/
244
+ '%s',/*mas_photo_meta_bg_color*/
245
+ '%s',/*mas_photo_meta_one_line*/
246
+ '%s',/*mas_like_text_color*/
247
+ '%s',/*mas_comment_text_color*/
248
+ '%s',/*mas_photo_caption_font_size*/
249
+ '%s',/*mas_photo_caption_color*/
250
+ '%s',/*mas_feed_item_margin*/
251
+ '%s',/*mas_photo_caption_hover_color*/
252
+ '%s',/*mas_like_comm_font_size*/
253
+ '%s',//'mas_overlay_hover_color'=>'color',
254
+ '%d',//'mas_overlay_hover_transparent'=>'number',
255
+ '%s',//'mas_overlay_hover_icon_color'=>'color',
256
+ '%s',//'mas_overlay_hover_icon_font_size'=>'length',
257
+ '%s',//mas_photo_img_hover_effect
258
+
259
+ '%s',/*blog_style_photo_wrap_padding*/
260
+ '%s',/*blog_style_photo_wrap_border_size*/
261
+ '%s',/*blog_style_photo_wrap_border_color*/
262
+ '%s',/*blog_style_photo_img_border_radius*/
263
+ '%s',/*blog_style_photo_wrap_bg_color*/
264
+ '%s',/*blog_style_photo_meta_bg_color*/
265
+ '%s',/*blog_style_photo_meta_one_line*/
266
+ '%s',/*blog_style_like_text_color*/
267
+ '%s',/*blog_style_comment_text_color*/
268
+ '%s',/*blog_style_photo_caption_font_size*/
269
+ '%s',/*blog_style_photo_caption_color*/
270
+ '%s',/*blog_style_feed_item_margin*/
271
+ '%s',/*blog_style_photo_caption_hover_color*/
272
+ '%s',/*blog_style_like_comm_font_size*/
273
 
274
+ '%s',/*image_browser_photo_wrap_padding*/
275
+ '%s',/*image_browser_photo_wrap_border_size*/
276
+ '%s',/*image_browser_photo_wrap_border_color*/
277
+ '%s',/*image_browser_photo_img_border_radius*/
278
+ '%s',/*image_browser_photo_wrap_bg_color*/
279
+ '%s',/*image_browser_photo_meta_bg_color*/
280
+ '%s',/*image_browser_photo_meta_one_line*/
281
+ '%s',/*image_browser_like_text_color*/
282
+ '%s',/*image_browser_comment_text_color*/
283
+ '%s',/*image_browser_photo_caption_font_size*/
284
+ '%s',/*image_browser_photo_caption_color*/
285
+ '%s',/*image_browser_feed_item_margin*/
286
+ '%s',/*image_browser_photo_caption_hover_color*/
287
+ '%s',/*image_browser_like_comm_font_size*/
288
+
289
+ '%s',/*load_more_position*/
290
+ '%s',/*load_more_padding*/
291
+ '%s',/*load_more_bg_color*/
292
+ '%s',/*load_more_border_radius*/
293
+ '%s',/*load_more_height*/
294
+ '%s',/*load_more_width*/
295
+ '%s',/*load_more_border_size*/
296
+ '%s',/*load_more_border_color*/
297
+ '%s',/*load_more_text_color*/
298
+ '%s',/*load_more_text_font_size*/
299
+ '%s',/*load_more_wrap_hover_color*/
300
+ '%s',// 'pagination_ctrl_color' => 'color',
301
+ '%s',// 'pagination_size' => 'length',
302
+ '%s',// 'pagination_ctrl_margin' => 'length_multi',
303
+ '%s',// 'pagination_ctrl_hover_color' => 'color'
304
+ '%s',//'pagination_position'=>'position'
305
+ '%s',//'pagination_position_vert'=>'position'
306
+
307
+ /* since v1.0.6. keep order, defaults*/
308
+
309
+ '%s',//'th_thumb_user_bg_color'=>'color',
310
+ '%s',//'th_thumb_user_color'=>'color'
311
+ '%s',//'mas_thumb_user_bg_color'=>'color',
312
+ '%s',//'mas_thumb_user_color'=>'color'
313
+ );
314
+ }
315
 
316
  public static function remove_theme_file($theme_id){
 
 
 
 
 
 
 
317
  return null;
318
  }
319
 
320
  public static function remove_all_themes_files(){
321
+ return;
 
 
 
 
 
322
  }
323
 
324
  }
 
admin/controllers/WDIControllerUninstall_wdi.php CHANGED
@@ -17,9 +17,9 @@ class WDIControllerUninstall_wdi {
17
  }else{
18
  $this->display();
19
  }
20
-
21
  }
22
  }
 
23
  public function display(){
24
  require_once(WDI_DIR . '/admin/models/WDIModelUninstall_wdi.php');
25
  $model = new WDIModelUninstall_wdi();
@@ -38,8 +38,6 @@ class WDIControllerUninstall_wdi {
38
  $view->already_uninstalled();
39
  }
40
 
41
-
42
-
43
  public function succesfully_uninstalled(){
44
  require_once(WDI_DIR . '/admin/models/WDIModelUninstall_wdi.php');
45
  $model = new WDIModelUninstall_wdi();
17
  }else{
18
  $this->display();
19
  }
 
20
  }
21
  }
22
+
23
  public function display(){
24
  require_once(WDI_DIR . '/admin/models/WDIModelUninstall_wdi.php');
25
  $model = new WDIModelUninstall_wdi();
38
  $view->already_uninstalled();
39
  }
40
 
 
 
41
  public function succesfully_uninstalled(){
42
  require_once(WDI_DIR . '/admin/models/WDIModelUninstall_wdi.php');
43
  $model = new WDIModelUninstall_wdi();
admin/controllers/WDIControllerWidget.php CHANGED
@@ -53,7 +53,7 @@ class WDIControllerWidget extends WP_Widget {
53
  $instance['title'] = wp_filter_nohtml_kses($new_instance['title']);
54
  $instance['feed_id'] = intval($new_instance['feed_id']);
55
  $instance['img_number'] = intval($new_instance['img_number']) ? intval($new_instance['img_number']) : 4;
56
- $instance['show_description'] = 0;
57
  $instance['show_likes_comments'] = isset($new_instance['show_likes_comments']) ? 1 : 0;
58
  $instance['number_of_columns'] = intval($new_instance['number_of_columns']) ? intval($new_instance['number_of_columns']) : 1;
59
  $instance['enable_loading_buttons'] = isset($new_instance['enable_loading_buttons']) ? 1 : 0;
53
  $instance['title'] = wp_filter_nohtml_kses($new_instance['title']);
54
  $instance['feed_id'] = intval($new_instance['feed_id']);
55
  $instance['img_number'] = intval($new_instance['img_number']) ? intval($new_instance['img_number']) : 4;
56
+ $instance['show_description'] = isset($new_instance['show_description']) ? 1 : 0;
57
  $instance['show_likes_comments'] = isset($new_instance['show_likes_comments']) ? 1 : 0;
58
  $instance['number_of_columns'] = intval($new_instance['number_of_columns']) ? intval($new_instance['number_of_columns']) : 1;
59
  $instance['enable_loading_buttons'] = isset($new_instance['enable_loading_buttons']) ? 1 : 0;
admin/controllers/feeds.php CHANGED
@@ -215,9 +215,6 @@ class Feeds_controller_wdi {
215
  require_once (WDI_DIR."/framework/WDIInstagram.php");
216
  $WDIInstagram = new WDIInstagram();
217
  $WDIInstagram->wdi_preload_cache(json_decode(stripslashes($posts["feed_users"]), TRUE));
218
-
219
-
220
-
221
  if ( !empty($wdi_options['wdi_authenticated_users_list']) ) {
222
  $authenticated_users = json_decode($wdi_options['wdi_authenticated_users_list'], TRUE);
223
  if ( !empty($authenticated_users[$posts['user_name']]) ) {
215
  require_once (WDI_DIR."/framework/WDIInstagram.php");
216
  $WDIInstagram = new WDIInstagram();
217
  $WDIInstagram->wdi_preload_cache(json_decode(stripslashes($posts["feed_users"]), TRUE));
 
 
 
218
  if ( !empty($wdi_options['wdi_authenticated_users_list']) ) {
219
  $authenticated_users = json_decode($wdi_options['wdi_authenticated_users_list'], TRUE);
220
  if ( !empty($authenticated_users[$posts['user_name']]) ) {
admin/controllers/settings.php CHANGED
@@ -32,9 +32,7 @@ class Settings_controller_wdi {
32
 
33
  $this->reset_access_token();
34
  $this->basic_instagram_api_connect();
35
-
36
- /*is_free*/
37
- //$this->graph_instagram_api_connect();
38
 
39
  $message = WDILibrary::get('message', '');
40
  if ( !empty($message) ) {
@@ -123,67 +121,10 @@ class Settings_controller_wdi {
123
  ), admin_url('admin.php')));
124
  }
125
  }
126
- /*is_free*/
127
- /*private function graph_instagram_api_connect() {
128
- if ( !empty($_REQUEST['wdi_business_access_token']) ) {
129
- $ig_users = json_decode(base64_decode($_REQUEST['ig_user_data']), TRUE);
130
- $facebook_pages = json_decode(base64_decode($_REQUEST['fb_page_data']), TRUE);
131
- // invalid access token
132
- if ( empty($facebook_pages) ) {
133
- WDILibrary::redirect(add_query_arg(array(
134
- 'page' => 'wdi_settings',
135
- 'message' => 26,
136
- ), admin_url('admin.php')));
137
- }
138
- // no business accounts
139
- if ( empty($ig_users) ) {
140
- WDILibrary::redirect(add_query_arg(array(
141
- 'page' => 'wdi_settings',
142
- 'message' => 27,
143
- ), admin_url('admin.php')));
144
- }
145
 
146
- if ( !empty($ig_users) ) {
147
- $wdi_options = wdi_get_options();
148
- $authenticated_users_list = array();
149
- if ( !empty($wdi_options['wdi_authenticated_users_list']) ) {
150
- $authenticated_users_list = json_decode($wdi_options['wdi_authenticated_users_list'], TRUE);
151
- }
152
- $user_facebook_page = array();
153
- foreach ( $facebook_pages as $facebook_page ) {
154
- $user_facebook_page[$facebook_page['id']] = $facebook_page;
155
- }
156
-
157
- foreach ( $ig_users as $business_account_id => $ig_user ) {
158
- $access_token = $user_facebook_page[$business_account_id]['access_token'];
159
- $user = array(
160
- 'type' => 'business',
161
- 'user_id' => $ig_user['id'],
162
- 'user_name' => $ig_user['username'],
163
- 'biography' => !empty($ig_user['biography']) ? $ig_user['biography'] : '',
164
- 'profile_picture_url' => !empty($ig_user['profile_picture_url']) ? $ig_user['profile_picture_url'] : '',
165
- 'followers_count' => !empty($ig_user['followers_count']) ? $ig_user['followers_count'] : '',
166
- 'follows_count' => !empty($ig_user['follows_count']) ? $ig_user['follows_count'] : '',
167
- 'media_count' => !empty($ig_user['media_count']) ? $ig_user['media_count'] : '',
168
- 'website' => !empty($ig_user['website']) ? $ig_user['website'] : '',
169
- 'access_token' => $access_token,
170
- 'start_in' => time(),
171
- 'expires_in' => 5183944, // 60 deys
172
- // 'facebook_page' => $user_facebook_page[$business_account_id]
173
- );
174
- $authenticated_users_list[$ig_user['username']] = $user;
175
- }
176
-
177
- $wdi_options['wdi_authenticated_users_list'] = $authenticated_users_list;
178
- update_option( WDI_OPT, $wdi_options );
179
-
180
- WDILibrary::redirect(add_query_arg(array(
181
- 'page' => 'wdi_settings',
182
- 'message' => 28,
183
- ), admin_url('admin.php')));
184
- }
185
- }
186
- }*/
187
 
188
  function account_refresh() {
189
  $json = array();
32
 
33
  $this->reset_access_token();
34
  $this->basic_instagram_api_connect();
35
+ $this->graph_instagram_api_connect();
 
 
36
 
37
  $message = WDILibrary::get('message', '');
38
  if ( !empty($message) ) {
121
  ), admin_url('admin.php')));
122
  }
123
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
 
125
+ private function graph_instagram_api_connect() {
126
+ return;
127
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
 
129
  function account_refresh() {
130
  $json = array();
admin/controllers/uninstall.php ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class Uninstall Controller.
5
+ */
6
+ class Uninstall_controller_wdi {
7
+
8
+ private $view;
9
+
10
+ /**
11
+ * Uninstall_controller_wdi constructor.
12
+ */
13
+ function __construct() {
14
+ require_once(WDI_DIR . '/admin/views/uninstall.php');
15
+ $this->view = new Uninstall_view_wdi();
16
+ }
17
+
18
+ /**
19
+ * Execute.
20
+ */
21
+ public function execute() {
22
+ $task = WDILibrary::get('task');
23
+ if ( method_exists($this, $task) ) {
24
+ check_admin_referer('wdi_nonce', 'wdi_nonce');
25
+ $this->$task();
26
+ }
27
+ else {
28
+ $this->view->display();
29
+ }
30
+ }
31
+
32
+ /**
33
+ * Display.
34
+ */
35
+ public function display() {
36
+ $this->view->display();
37
+ }
38
+
39
+ /**
40
+ * Uninstall.
41
+ */
42
+ private function uninstall() {
43
+ $verify = WDILibrary::get('wdi_verify', 0, 'intval');
44
+ if ( $verify == '1' ) {
45
+ global $wpdb;
46
+ // remove all tables.
47
+ $tables = array( $wpdb->prefix . WDI_FEED_TABLE, $wpdb->prefix . WDI_THEME_TABLE );
48
+ foreach ( $tables as $table ) {
49
+ $checktable = $wpdb->query('SHOW TABLES LIKE "' . $table . '"');
50
+ if ( $checktable > 0 ) {
51
+ $wpdb->query('DROP TABLE ' . $table);
52
+ }
53
+ }
54
+ $sample_post_id = get_option('wdi_sample_feed_post_id');
55
+ if ( $sample_post_id !== FALSE ) {
56
+ wp_delete_post($sample_post_id, TRUE);
57
+ }
58
+ $row = get_posts(array( 'post_type' => "wdi_instagram" ));
59
+ if ( !empty($row[0]) ) {
60
+ wp_delete_post($row[0]->ID, TRUE);
61
+ }
62
+ // remove all options.
63
+ delete_option(WDI_OPT);
64
+ delete_option('wdi_version');
65
+ delete_option('wdi_sample_feed_id');
66
+ delete_option('wdi_sample_feed_post_id');
67
+ delete_option('wdi_sample_feed_post_url');
68
+ delete_option('wdi_first_user_username');
69
+ delete_option('wdi_theme_keys');
70
+ delete_option('wdi_admin_notice');
71
+ delete_option('wdi_subscribe_done');
72
+ delete_option('wdi_redirect_to_settings');
73
+ delete_option('wdi_do_activation_set_up_redirect');
74
+ delete_option('widget_wdi_instagram_widget');
75
+ $this->remove_theme_files();
76
+
77
+ // remove all cache.
78
+ require_once (WDI_DIR .'/framework/WDICache.php');
79
+ $CacheClass = new WDICache();
80
+ $CacheClass->reset_cache();
81
+
82
+ deactivate_plugins(WDI_MAIN_FILE);
83
+ wp_redirect( admin_url('plugins.php') ); exit;
84
+ }
85
+ else {
86
+ $this->display();
87
+ }
88
+ }
89
+
90
+ /**
91
+ * Remove theme files.
92
+ */
93
+ private function remove_theme_files() {
94
+ require_once WDI_DIR . '/admin/controllers/WDIControllerThemes_wdi.php';
95
+ WDIControllerThemes_wdi::remove_all_themes_files();
96
+ }
97
+ }
admin/models/feeds.php CHANGED
@@ -52,13 +52,6 @@ class Feeds_model_wdi {
52
  return $rows;
53
  }
54
 
55
- public function get_slider_prev_img($slider_id) {
56
- global $wpdb;
57
- $prev_img_url = $wpdb->get_var($wpdb->prepare("SELECT `feed_thumb` FROM " . $wpdb->prefix . WDI_FEED_TABLE . " WHERE id='%d'", $slider_id));
58
- $prev_img_url = $prev_img_url ? $prev_img_url : WDI_URL . '/images/no-image.png';
59
- return $prev_img_url;
60
- }
61
-
62
  public function page_nav() {
63
  global $wpdb;
64
  $where = ((isset($this->search_text) && !empty($this->search_text) && (esc_html(stripslashes($this->search_text)) != '')) ? 'WHERE feed_name LIKE "%' . esc_html(stripslashes($this->search_text)) . '%"' : '');
@@ -145,7 +138,7 @@ class Feeds_model_wdi {
145
  'feed_resolution' => 'optimal',
146
  'hashtag_top_recent' => '1',
147
  );
148
- if(IS_FREE){
149
  $settings["show_description"] = "0";
150
  $settings["show_likes"] = "0";
151
  $settings["show_comments"] = "0";
@@ -161,7 +154,7 @@ class Feeds_model_wdi {
161
  }
162
 
163
  public function get_sanitize_types(){
164
- $sanitize_types = array(
165
  'thumb_user'=>'string',
166
  'feed_name' => 'string',
167
  'feed_thumb'=> 'url',
52
  return $rows;
53
  }
54
 
 
 
 
 
 
 
 
55
  public function page_nav() {
56
  global $wpdb;
57
  $where = ((isset($this->search_text) && !empty($this->search_text) && (esc_html(stripslashes($this->search_text)) != '')) ? 'WHERE feed_name LIKE "%' . esc_html(stripslashes($this->search_text)) . '%"' : '');
138
  'feed_resolution' => 'optimal',
139
  'hashtag_top_recent' => '1',
140
  );
141
+ if(WDI_IS_FREE){
142
  $settings["show_description"] = "0";
143
  $settings["show_likes"] = "0";
144
  $settings["show_comments"] = "0";
154
  }
155
 
156
  public function get_sanitize_types(){
157
+ $sanitize_types = array(
158
  'thumb_user'=>'string',
159
  'feed_name' => 'string',
160
  'feed_thumb'=> 'url',
admin/views/WDIViewEditorShortcode.php CHANGED
@@ -92,25 +92,8 @@ class WDIViewEditorShortcode {
92
  <script>
93
  <?php echo 'var wdi_feed_rows =' . json_encode($rows);?>;
94
  jQuery(document).ready(function(){
95
- wdi_selectChange(jQuery('#wdi_feed_select'));
96
  jQuery('#wdi_editor_insert_btn').on('click',wdi_insert_shortcode);
97
  });
98
- function wdi_selectChange(){
99
- var current = jQuery("#wdi_feed_select").val();
100
- for(var i = 0; i < wdi_feed_rows.length; i++){
101
- if(wdi_feed_rows[i]['id'] == current){
102
- var currentRow = wdi_feed_rows[i];
103
- break;
104
- }
105
- }
106
- var thumbHtml = '<img src="'+currentRow['feed_thumb']+'">';
107
- //var nameHtml = currentRow['feed_name'];
108
- var id_elem = jQuery('<input id="wdi_id" name="wdi_id" type="hidden"/>');
109
- id_elem.val(currentRow['id']);
110
- jQuery('.wdi_feed_thumb').html(thumbHtml);
111
- jQuery('.wdi_feed_thumb').append(id_elem);
112
- //jQuery('.wdi_feed_info .wdi_feed_name').html(nameHtml);
113
- }
114
  function wdi_insert_shortcode() {
115
  if (document.getElementById("wdi_id").value) {
116
  window.parent.send_to_editor('[wdi_feed id="' + document.getElementById('wdi_id').value + '"]');
92
  <script>
93
  <?php echo 'var wdi_feed_rows =' . json_encode($rows);?>;
94
  jQuery(document).ready(function(){
 
95
  jQuery('#wdi_editor_insert_btn').on('click',wdi_insert_shortcode);
96
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  function wdi_insert_shortcode() {
98
  if (document.getElementById("wdi_id").value) {
99
  window.parent.send_to_editor('[wdi_feed id="' + document.getElementById('wdi_id').value + '"]');
admin/views/WDIViewThemes_wdi.php CHANGED
@@ -1,10 +1,12 @@
1
  <?php
2
 
3
- class WDIViewThemes_wdi {
 
4
 
5
  private $model;
6
 
7
- public function __construct($model) {
 
8
  $this->model = $model;
9
  }
10
 
1
  <?php
2
 
3
+ class WDIViewThemes_wdi
4
+ {
5
 
6
  private $model;
7
 
8
+ public function __construct($model)
9
+ {
10
  $this->model = $model;
11
  }
12
 
admin/views/feeds.php CHANGED
@@ -11,6 +11,10 @@ class Feeds_view_wdi {
11
  public function display() {
12
  /*My Edit*/
13
  global $wdi_options;
 
 
 
 
14
  $rows_data = $this->model->get_rows_data();
15
  $page_nav = $this->model->page_nav();
16
  $search_value = "";
@@ -35,13 +39,13 @@ class Feeds_view_wdi {
35
  'duplicate_all' => __('Duplicate', 'wdi'),
36
  'delete_all' => __('Delete', 'wdi'),
37
  );
38
- if(IS_FREE){
39
  WDILibrary::topbar();
40
  }
41
  ?>
42
  <div class="wrap">
43
  <h2 class="wdi_page_title"></h2>
44
- <?php if(!IS_FREE){?>
45
  <div class="update-nag wdi_help_bar_wrap">
46
  <span class="wdi_help_bar_text">
47
  <?php _e('Here You Can Change Feed Parameters.', 'wd-instagram-feed'); ?>
@@ -49,7 +53,7 @@ class Feeds_view_wdi {
49
  href="https://help.10web.io/hc/en-us/articles/360016497251-Creating-Instagram-Feed?utm_source=instagram_feed&utm_medium=free_plugin"><?php _e('Read More in User Guide', 'wd-instagram-feed'); ?></a>
50
  </span>
51
  </div>
52
- <?php }?>
53
  <form class="" id="wdi_feed_form" method="post" action="admin.php?page=wdi_feeds" >
54
  <div class="wd-page-title wd-header">
55
  <h1 class="wp-heading-inline"><?php _e('Feeds', 'wd-instagram-feed'); ?></h1>
@@ -102,13 +106,24 @@ class Feeds_view_wdi {
102
  </thead>
103
  <tbody id="tbody_arr">
104
  <?php
105
- if ($rows_data) {
106
  $instagram_preview_post = $this->model->get_instagram_preview_post();
107
  foreach ($rows_data as $row_data) {
 
 
 
 
 
 
 
 
 
 
 
 
108
  $alternate = (!isset($alternate) || $alternate == 'class="alternate"') ? '' : 'class="alternate"';
109
  $published_image = (($row_data->published) ? 'publish' : 'unpublish');
110
  $published = (($row_data->published) ? 'unpublish' : 'publish');
111
- $prev_img_url = $this->model->get_slider_prev_img($row_data->id);
112
  $edit_page_data = array(
113
  'task' => 'edit',
114
  'current_id' => $row_data->id,
@@ -365,23 +380,7 @@ class Feeds_view_wdi {
365
  'value' => 'thumbnails,masonry,blog_style,image_browser')
366
  )
367
  ),
368
- 'feed_resolution' => array('name' => 'feed_resolution', 'title' => __('Feed Media Resolution', 'wd-instagram-feed'), 'type' => 'select', 'label' => array('text' => '', 'place' => 'after'), 'valid_options' => array('optimal' => 'Optimal', 'standard' => 'Large (1080 pixels)', 'low' => 'Low (320 pixels)', 'thumbnail' => 'Thumbnail (150 pixels)'), 'tooltip' => 'If set optimal, loaded media size is calculated according to container size. Fast loading and no stretched images.', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
369
- 'thumb_user' => array(
370
- 'name' => 'thumb_user',
371
- 'title' => __('Featured Image', 'wd-instagram-feed'),
372
- 'valid_options' => array(),
373
- 'type' => 'select',
374
- 'tooltip' => __('Select featured image for header section', 'wd-instagram-feed'),
375
- 'attr' => array(
376
- array(
377
- 'name' => 'tab',
378
- 'value' => 'feed_settings'
379
- ),
380
- array(
381
- 'name' => 'section',
382
- 'value' => 'thumbnails,masonry,blog_style,image_browser')
383
- )
384
- ),
385
  'display_header' => array('name' => 'display_header', 'title' => __('Show Feed Header', 'wd-instagram-feed'), 'type' => 'checkbox', 'tooltip' => __('Header includes feed title', 'wd-instagram-feed'), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
386
  'show_usernames' => array(
387
  'name' => 'show_usernames',
@@ -532,7 +531,7 @@ class Feeds_view_wdi {
532
  ),
533
  ),
534
  );
535
- if(IS_FREE){
536
  $tabs["conditional_filters"][""]["title"] = __("This is free version, Conditional filters are available only in premium version", "wd-instagram-feed");
537
  $tabs["feed_settings"]["advanced"]["elements"][0]["theme_id"]["switched"]="off";
538
  $tabs["feed_settings"]["advanced"]["elements"][0]["theme_id"]["label"] = array(
@@ -683,8 +682,7 @@ class Feeds_view_wdi {
683
  return $return;
684
  }
685
 
686
- public function genarateFeedViews()
687
- {
688
  ?>
689
  <div class="wdi_border_wrapper">
690
  <div id="wdi_layout_section" class="wdi_layout_section display_type_content wdi_section">
@@ -697,18 +695,18 @@ class Feeds_view_wdi {
697
  <label for="thumbnails"><img src="<?php echo plugins_url('../../images/feed_views/thumbnails.png', __FILE__); ?>"></label>
698
  </div>
699
 
700
- <div class="display_type <?php echo (IS_FREE)?"wdi_tooltip":""; ?>" <?php echo (IS_FREE)?"wdi-tooltip='Available In Premium Version'":""; ?> tab="feed_settings">
701
- <div style="text-align:center;padding:2px;"><input type="radio" <?php echo (IS_FREE)?"disabled":""; ?> id="masonry" name="feed_type"
702
  value="masonry">
703
- <label for="masonry" <?php echo (IS_FREE)?"class='wdi_pro_only'":""; ?>>Masonry</label></div>
704
  <label for="masonry"><img
705
  src="<?php echo plugins_url('../../images/feed_views/masonry.png', __FILE__); ?>"></label>
706
  </div>
707
 
708
- <div class="display_type <?php echo (IS_FREE)?"wdi_tooltip":""; ?>" <?php echo (IS_FREE)?"wdi-tooltip='Available In Premium Version'":""; ?> tab="feed_settings">
709
  <div style="text-align:center;padding:2px;">
710
- <input type="radio" <?php echo (IS_FREE)?"disabled":""; ?> id="blog_style" name="feed_type" value="blog_style">
711
- <label for="blog_style" <?php echo (IS_FREE)?"class='wdi_pro_only'":""; ?>>Blog Style</label>
712
  </div>
713
  <label for="blog_style"><img src="<?php echo plugins_url('../../images/feed_views/blog_style.png', __FILE__); ?>"></label>
714
  </div>
@@ -816,10 +814,8 @@ class Feeds_view_wdi {
816
  ?>
817
  <input type="hidden" id="task" name='task'>
818
  <input type="hidden" id="wdi_feed_type" name='<?php echo WDI_FSN . '[feed_type]' ?>'>
819
- <input type="hidden" id="wdi_feed_thumb" name="<?php echo WDI_FSN . '[feed_thumb]' ?>">
820
  <input type="hidden" id="wdi_access_token" name="access_token" value="<?php echo $wdi_options['wdi_access_token']; ?>">
821
  <input type="hidden" id="wdi_add_or_edit" name="add_or_edit" value="<?php echo $current_id; ?>">
822
- <input type="hidden" id="wdi_thumb_user" value="<?php echo isset($feed_row['thumb_user']) ? $feed_row['thumb_user'] : $wdi_options['wdi_user_name']; ?>">
823
  <input type="hidden" id="wdi_default_user" value="<?php echo $wdi_options['wdi_user_name']; ?>">
824
  <input type="hidden" id="wdi_default_user_id" value="<?php echo $wdi_options['wdi_user_id']; ?>">
825
  <input type="hidden" name="<?php echo WDI_FSN . '[published]' ?>" value="<?php echo isset($feed_row['published']) ? $feed_row['published'] : '1'; ?>">
@@ -841,27 +837,38 @@ class Feeds_view_wdi {
841
  <?php foreach ($section["elements"] as $elements) { ?>
842
  <div class="section_col">
843
  <?php foreach ($elements as $key => $element) {
844
- if (isset($element['status'])) {
845
- if ($element['status'] == 'disabled') {
846
- continue;
847
- }
848
- }
849
- if ($element['name'] == 'conditional_filter_enable') { ?>
850
- <div id="wdi-conditional-filters-ui" class="wdi_demo_img">
851
- <div class="wdi-pro-overlay"><img src="<?php echo WDI_URL . '/demo_images/filters.png'; ?>" alt=""></div>
852
- </div><?php
853
- continue;
854
- }
855
-
856
- if ($element['name'] == 'conditional_filter_type') {
857
- continue;
858
- }
859
-
860
  if (isset($element['status'])) {
861
  if ($element['status'] == 'disabled') {
862
  continue;
863
  }
864
  } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
865
  <div class="wdi_element wdi_element_name_<?php echo $element['name'] ; ?>">
866
  <div class="wdi_element_title">
867
  <span class="wdi_settings_link" ><?php echo $element['title']; ?></span>
@@ -1026,12 +1033,6 @@ class Feeds_view_wdi {
1026
  wdi_controller.instagram = new WDIInstagram();
1027
  wdi_controller.feed_users = [];
1028
  wdi_controller.instagram.addToken(<?php echo '"' . $token . '"'; ?>);
1029
-
1030
- wdi_controller.updateFeaturedImageSelect(<?php echo '"' . $wdi_options['wdi_user_name'] . '"'; ?>, 'add', 'selected');
1031
-
1032
- <?php foreach ( $users as $user ) { ?>
1033
- // wdi_controller.makeInstagramUserRequest(<?php echo '"' . $user->username . '"'?>, true);
1034
- <?php } ?>
1035
  });
1036
  </script>
1037
  <?php
11
  public function display() {
12
  /*My Edit*/
13
  global $wdi_options;
14
+ $authenticated_users_list = array();
15
+ if ( !empty($wdi_options['wdi_authenticated_users_list']) ) {
16
+ $authenticated_users_list = json_decode($wdi_options['wdi_authenticated_users_list'], true);
17
+ }
18
  $rows_data = $this->model->get_rows_data();
19
  $page_nav = $this->model->page_nav();
20
  $search_value = "";
39
  'duplicate_all' => __('Duplicate', 'wdi'),
40
  'delete_all' => __('Delete', 'wdi'),
41
  );
42
+ if(WDI_IS_FREE){
43
  WDILibrary::topbar();
44
  }
45
  ?>
46
  <div class="wrap">
47
  <h2 class="wdi_page_title"></h2>
48
+ <?php if(!WDI_IS_FREE){?>
49
  <div class="update-nag wdi_help_bar_wrap">
50
  <span class="wdi_help_bar_text">
51
  <?php _e('Here You Can Change Feed Parameters.', 'wd-instagram-feed'); ?>
53
  href="https://help.10web.io/hc/en-us/articles/360016497251-Creating-Instagram-Feed?utm_source=instagram_feed&utm_medium=free_plugin"><?php _e('Read More in User Guide', 'wd-instagram-feed'); ?></a>
54
  </span>
55
  </div>
56
+ <?php } ?>
57
  <form class="" id="wdi_feed_form" method="post" action="admin.php?page=wdi_feeds" >
58
  <div class="wd-page-title wd-header">
59
  <h1 class="wp-heading-inline"><?php _e('Feeds', 'wd-instagram-feed'); ?></h1>
106
  </thead>
107
  <tbody id="tbody_arr">
108
  <?php
109
+ if ( $rows_data ) {
110
  $instagram_preview_post = $this->model->get_instagram_preview_post();
111
  foreach ($rows_data as $row_data) {
112
+ $prev_img_url = WDI_URL . '/images/no-image.png';
113
+ $feed_users = json_decode($row_data->feed_users, TRUE);
114
+ foreach ( $feed_users as $user ) {
115
+ if ( empty($users['tag_id']) ) {
116
+ $username = $user['username'];
117
+ if ( !empty($authenticated_users_list[$username]) ) {
118
+ if( !empty($authenticated_users_list[$username]['profile_picture_url']) ) {
119
+ $prev_img_url = $authenticated_users_list[$username]['profile_picture_url'];
120
+ }
121
+ }
122
+ }
123
+ }
124
  $alternate = (!isset($alternate) || $alternate == 'class="alternate"') ? '' : 'class="alternate"';
125
  $published_image = (($row_data->published) ? 'publish' : 'unpublish');
126
  $published = (($row_data->published) ? 'unpublish' : 'publish');
 
127
  $edit_page_data = array(
128
  'task' => 'edit',
129
  'current_id' => $row_data->id,
380
  'value' => 'thumbnails,masonry,blog_style,image_browser')
381
  )
382
  ),
383
+ // 'feed_resolution' => array('name' => 'feed_resolution', 'title' => __('Feed Media Resolution', 'wd-instagram-feed'), 'type' => 'select', 'label' => array('text' => '', 'place' => 'after'), 'valid_options' => array('optimal' => 'Optimal', 'standard' => 'Large (1080 pixels)', 'low' => 'Low (320 pixels)', 'thumbnail' => 'Thumbnail (150 pixels)'), 'tooltip' => 'If set optimal, loaded media size is calculated according to container size. Fast loading and no stretched images.', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
384
  'display_header' => array('name' => 'display_header', 'title' => __('Show Feed Header', 'wd-instagram-feed'), 'type' => 'checkbox', 'tooltip' => __('Header includes feed title', 'wd-instagram-feed'), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
385
  'show_usernames' => array(
386
  'name' => 'show_usernames',
531
  ),
532
  ),
533
  );
534
+ if(WDI_IS_FREE){
535
  $tabs["conditional_filters"][""]["title"] = __("This is free version, Conditional filters are available only in premium version", "wd-instagram-feed");
536
  $tabs["feed_settings"]["advanced"]["elements"][0]["theme_id"]["switched"]="off";
537
  $tabs["feed_settings"]["advanced"]["elements"][0]["theme_id"]["label"] = array(
682
  return $return;
683
  }
684
 
685
+ public function genarateFeedViews() {
 
686
  ?>
687
  <div class="wdi_border_wrapper">
688
  <div id="wdi_layout_section" class="wdi_layout_section display_type_content wdi_section">
695
  <label for="thumbnails"><img src="<?php echo plugins_url('../../images/feed_views/thumbnails.png', __FILE__); ?>"></label>
696
  </div>
697
 
698
+ <div class="display_type <?php echo (WDI_IS_FREE)?"wdi_tooltip":""; ?>" <?php echo (WDI_IS_FREE)?"wdi-tooltip='Available In Premium Version'":""; ?> tab="feed_settings">
699
+ <div style="text-align:center;padding:2px;"><input type="radio" <?php echo (WDI_IS_FREE)?"disabled":""; ?> id="masonry" name="feed_type"
700
  value="masonry">
701
+ <label for="masonry" <?php echo (WDI_IS_FREE)?"class='wdi_pro_only'":""; ?>>Masonry</label></div>
702
  <label for="masonry"><img
703
  src="<?php echo plugins_url('../../images/feed_views/masonry.png', __FILE__); ?>"></label>
704
  </div>
705
 
706
+ <div class="display_type <?php echo (WDI_IS_FREE)?"wdi_tooltip":""; ?>" <?php echo (WDI_IS_FREE)?"wdi-tooltip='Available In Premium Version'":""; ?> tab="feed_settings">
707
  <div style="text-align:center;padding:2px;">
708
+ <input type="radio" <?php echo (WDI_IS_FREE)?"disabled":""; ?> id="blog_style" name="feed_type" value="blog_style">
709
+ <label for="blog_style" <?php echo (WDI_IS_FREE)?"class='wdi_pro_only'":""; ?>>Blog Style</label>
710
  </div>
711
  <label for="blog_style"><img src="<?php echo plugins_url('../../images/feed_views/blog_style.png', __FILE__); ?>"></label>
712
  </div>
814
  ?>
815
  <input type="hidden" id="task" name='task'>
816
  <input type="hidden" id="wdi_feed_type" name='<?php echo WDI_FSN . '[feed_type]' ?>'>
 
817
  <input type="hidden" id="wdi_access_token" name="access_token" value="<?php echo $wdi_options['wdi_access_token']; ?>">
818
  <input type="hidden" id="wdi_add_or_edit" name="add_or_edit" value="<?php echo $current_id; ?>">
 
819
  <input type="hidden" id="wdi_default_user" value="<?php echo $wdi_options['wdi_user_name']; ?>">
820
  <input type="hidden" id="wdi_default_user_id" value="<?php echo $wdi_options['wdi_user_id']; ?>">
821
  <input type="hidden" name="<?php echo WDI_FSN . '[published]' ?>" value="<?php echo isset($feed_row['published']) ? $feed_row['published'] : '1'; ?>">
837
  <?php foreach ($section["elements"] as $elements) { ?>
838
  <div class="section_col">
839
  <?php foreach ($elements as $key => $element) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
840
  if (isset($element['status'])) {
841
  if ($element['status'] == 'disabled') {
842
  continue;
843
  }
844
  } ?>
845
+ <?php if(WDI_IS_FREE && $section['section_name'] == 'wdi_conditional_filters'):?>
846
+ <div id="wdi-conditional-filters-ui" class="wdi_demo_img">
847
+ <div class="wdi-pro-overlay"><img src="<?php echo WDI_URL . '/demo_images/filters.png'; ?>" alt=""></div>
848
+ </div>
849
+ <?php continue;?>
850
+ <?php endif;?>
851
+ <?php
852
+ if ($element['name'] == 'conditional_filter_type'){ ?>
853
+ <!-- CONDITIONAL FILTERS TOP -->
854
+ <div id="WDI_filter_source" class="wdi_element">
855
+ <div class="wdi_element_title">
856
+ <span class="wdi_settings_link"><?php _e('Feeds to Filter', 'wd-instagram-feed'); ?></span>
857
+ </div>
858
+ <div class="wdi_element_content">
859
+ <div>
860
+ <div>
861
+ <div>
862
+ <div tab="conditional_filters"></div>
863
+ </div>
864
+ </div>
865
+ </div>
866
+ <div id="wdi_filter_source" class="wdi_clear_tag"></div>
867
+ <p style="font-size:12px; width: calc(100% - 100px);"><?php _e('Please note that only already retrieved media is filtered. There is also internal limit of 10 requests (200 images) to Instagram API. If no media satisfies filter condition, the plugin will not ask for more.', 'wd-instagram-feed') ?></p>
868
+ </div>
869
+ </div>
870
+ <!-- END CONDITIONAL FILTERS TOP -->
871
+ <?php } ?>
872
  <div class="wdi_element wdi_element_name_<?php echo $element['name'] ; ?>">
873
  <div class="wdi_element_title">
874
  <span class="wdi_settings_link" ><?php echo $element['title']; ?></span>
1033
  wdi_controller.instagram = new WDIInstagram();
1034
  wdi_controller.feed_users = [];
1035
  wdi_controller.instagram.addToken(<?php echo '"' . $token . '"'; ?>);
 
 
 
 
 
 
1036
  });
1037
  </script>
1038
  <?php
admin/views/settings.php CHANGED
@@ -33,7 +33,7 @@ class Settings_view_wdi {
33
  }
34
  ?>
35
  <div class="wdi-settings-page">
36
- <?php if(!IS_FREE){?>
37
  <div class="update-nag wdi_help_bar_wrap">
38
  <p class="wdi_help_bar_text">
39
  <?php _e('This section allows you to set API parameters.', 'wd-instagram-feed'); ?>
@@ -131,11 +131,12 @@ class Settings_view_wdi {
131
  <label><?php _e('Custom JavaScript', 'wd-instagram-feed'); ?></label>
132
  <textarea name="<?php echo WDI_OPT . '[wdi_custom_js]' ?>"><?php echo $options['wdi_custom_js']; ?></textarea>
133
  </p>
134
- <p class="wdi-input-group">
135
  <label><?php _e('Uninstall', 'wd-instagram-feed'); ?></label>
136
  <a href="<?php echo admin_url('admin.php?page=wdi_uninstall'); ?>"
137
  class="button"><?php _e('Uninstall', 'wd-instagram-feed'); ?></a>
138
- </p>
 
139
  </div>
140
  </div>
141
  <input type="hidden" name="<?php echo WDI_OPT . '[wdi_user_id]' ?>" value="<?php echo $options['wdi_user_id']; ?>">
@@ -173,7 +174,7 @@ class Settings_view_wdi {
173
  });
174
  });
175
 
176
- <?php if(!IS_FREE):?>
177
  jQuery('input[name ="wdi-connect-type"]').change(function() {
178
  if(this.checked) {
179
  jQuery(".wdi_input_group").removeClass("wdi_active");
@@ -202,7 +203,7 @@ class Settings_view_wdi {
202
  <i class="wdi-popup-close" onclick="wdi_popup_close()"></i>
203
  <h3><?php _e('Are you connecting a Personal or<br class="wdi_desktop"> Business Instagram Profile?', 'wd-instagram-feed'); ?></h3>
204
  <div class="wdi-radio-button">
205
- <p class="wdi-label-personal wdi_input_group wdi_active <?php echo (IS_FREE)?"wdi_free":"wdi_pro"; ?>">
206
  <label for="wdi-personal">
207
  <input type="radio" id="wdi-personal" name="wdi-connect-type" value="<?php echo $personal_href; ?>"
208
  checked="checked">
@@ -210,13 +211,13 @@ class Settings_view_wdi {
210
  </label>
211
  <span class="wdi_info_text"><?php _e('Used for displaying user feeds from a "Personal"<br class="wdi_desktop"> Instagram account.', 'wd-instagram-feed'); ?></span>
212
  </p>
213
- <p class="wdi-label-business wdi_input_group <?php echo (IS_FREE)?"wdi_free":"wdi_pro"; ?>">
214
  <label for="wdi-business">
215
- <input type="radio" id="wdi-business" <?php echo (IS_FREE)?"disabled":""; ?> name="wdi-connect-type" value="<?php echo $business_href; ?>">
216
  <span class="wdi_account_type"><?php _e('Business', 'wd-instagram-feed'); ?></span>
217
  </label>
218
  <span class="wdi_info_text"><?php _e('Used for displaying user feeds and <span>hashtags</span><br class="wdi_desktop"> from a “Business” Instagram account.', 'wd-instagram-feed'); ?></span>
219
- <?php if ( IS_FREE ) { ?>
220
  <a href="#" class="wdi_paid">This option is available in Premium version</a>
221
  <?php } ?>
222
  </p>
33
  }
34
  ?>
35
  <div class="wdi-settings-page">
36
+ <?php if(!WDI_IS_FREE){?>
37
  <div class="update-nag wdi_help_bar_wrap">
38
  <p class="wdi_help_bar_text">
39
  <?php _e('This section allows you to set API parameters.', 'wd-instagram-feed'); ?>
131
  <label><?php _e('Custom JavaScript', 'wd-instagram-feed'); ?></label>
132
  <textarea name="<?php echo WDI_OPT . '[wdi_custom_js]' ?>"><?php echo $options['wdi_custom_js']; ?></textarea>
133
  </p>
134
+ <div class="wdi-input-group">
135
  <label><?php _e('Uninstall', 'wd-instagram-feed'); ?></label>
136
  <a href="<?php echo admin_url('admin.php?page=wdi_uninstall'); ?>"
137
  class="button"><?php _e('Uninstall', 'wd-instagram-feed'); ?></a>
138
+ <p class="wdi-description"><?php _e('Note, that uninstalling Instagram Feed will completely remove all feeds and other data on the plugin. Please make sure you don\'t have any important information before you proceed.', 'wd-instagram-feed'); ?></p>
139
+ </div>
140
  </div>
141
  </div>
142
  <input type="hidden" name="<?php echo WDI_OPT . '[wdi_user_id]' ?>" value="<?php echo $options['wdi_user_id']; ?>">
174
  });
175
  });
176
 
177
+ <?php if(!WDI_IS_FREE):?>
178
  jQuery('input[name ="wdi-connect-type"]').change(function() {
179
  if(this.checked) {
180
  jQuery(".wdi_input_group").removeClass("wdi_active");
203
  <i class="wdi-popup-close" onclick="wdi_popup_close()"></i>
204
  <h3><?php _e('Are you connecting a Personal or<br class="wdi_desktop"> Business Instagram Profile?', 'wd-instagram-feed'); ?></h3>
205
  <div class="wdi-radio-button">
206
+ <p class="wdi-label-personal wdi_input_group wdi_active <?php echo (WDI_IS_FREE)?"wdi_free":"wdi_pro"; ?>">
207
  <label for="wdi-personal">
208
  <input type="radio" id="wdi-personal" name="wdi-connect-type" value="<?php echo $personal_href; ?>"
209
  checked="checked">
211
  </label>
212
  <span class="wdi_info_text"><?php _e('Used for displaying user feeds from a "Personal"<br class="wdi_desktop"> Instagram account.', 'wd-instagram-feed'); ?></span>
213
  </p>
214
+ <p class="wdi-label-business wdi_input_group <?php echo (WDI_IS_FREE)?"wdi_free":"wdi_pro"; ?>">
215
  <label for="wdi-business">
216
+ <input type="radio" id="wdi-business" <?php echo (WDI_IS_FREE)?"disabled":""; ?> name="wdi-connect-type" value="<?php echo $business_href; ?>">
217
  <span class="wdi_account_type"><?php _e('Business', 'wd-instagram-feed'); ?></span>
218
  </label>
219
  <span class="wdi_info_text"><?php _e('Used for displaying user feeds and <span>hashtags</span><br class="wdi_desktop"> from a “Business” Instagram account.', 'wd-instagram-feed'); ?></span>
220
+ <?php if ( WDI_IS_FREE ) { ?>
221
  <a href="#" class="wdi_paid">This option is available in Premium version</a>
222
  <?php } ?>
223
  </p>
admin/views/uninstall.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Uninstall_view_wdi {
4
+
5
+ public function display() {
6
+ global $wpdb;
7
+ ?>
8
+ <span class="uninstall-icon"></span>
9
+ <h2 class="wdi_page_title"><?php _e('Uninstalling Instagram Feed', "wd-instagram-feed"); ?></h2>
10
+ <p style="color:red;font-size:15px">
11
+ <?php _e('Deactivating Instagram Feed plugin does not remove any data that may have been created. To completely remove this plugin, you can uninstall it here.', 'wd-instagram-feed') ?>
12
+ <br>
13
+ <?php _e('WARNING: Once uninstalled, this can\'t be undone. You should use a Database Backup plugin of WordPress to back up all the data first.', 'wd-instagram-feed') ?>
14
+ </p>
15
+ <p style="color:red;margin-top:10px;font-size:13px;"><?php _e('The following Database Tables will be deleted:', 'wd-instagram-feed') ?></p>
16
+ <div style="background-color:white;border:1px solid #888888">
17
+ <ul style="background-color:white;margin:0">
18
+ <p style="background-color:#F3EFEF;margin: 0;border-bottom: 1px solid #888888;padding:2px;font-size:20px;"><?php _e('Database Tables', 'wd-instagram-feed') ?></p>
19
+ <li style="padding-bottom:5px;padding-left:5px;font-weight: bold;margin:0;">
20
+ 1) <?php echo $wpdb->prefix . WDI_FEED_TABLE ?></li>
21
+ <li style="padding-bottom:5px;padding-left:5px;font-weight: bold;margin:0;">
22
+ 2) <?php echo $wpdb->prefix . WDI_THEME_TABLE ?></li>
23
+ <p style="background-color:#F3EFEF;margin: 0;border-top: 1px solid #888888;border-bottom: 1px solid #888888;padding:2px;font-size:20px;">
24
+ <?php _e('Options From', 'wd-instagram-feed') ?> <?php echo $wpdb->prefix, 'options' ?></p>
25
+ <li style="padding-bottom:5px;padding-left:5px;font-weight: bold;margin:0;">3) wdi_version</li>
26
+ <li style="padding-bottom:5px;padding-left:5px;font-weight: bold;margin:0;">4) wdi_custom_js</li>
27
+ <li style="padding-bottom:5px;padding-left:5px;font-weight: bold;margin:0;">5) wdi_custom_css</li>
28
+ <li style="padding-bottom:5px;padding-left:5px;font-weight: bold;margin:0;">6) wdi_instagram_options</li>
29
+ <li style="padding-bottom:5px;padding-left:5px;font-weight: bold;margin:0;">7) wdi_feeds_min_capability</li>
30
+ </ul>
31
+ </div>
32
+ <form action="admin.php?page=wdi_uninstall" id="wdi_uninstall_form" method="post">
33
+ <div style="margin-top:10px; text-align:center">
34
+ <p style="font-size:15px;"><?php _e('Are you sure you want to uninstall plugin?', 'wd-instagram-feed') ?></p>
35
+ <input type="checkbox" id="wdi_verify" name="wdi_verify" value="1">
36
+ <label for="wdi_verify" style="vertical-align:top"><?php _e('Yes', 'wd-instagram-feed') ?></label>
37
+ <br>
38
+ <div style="margin-top:10px; text-align:center;">
39
+ <input type="hidden" name="task" value="uninstall">
40
+ <?php wp_nonce_field('wdi_nonce', 'wdi_nonce'); ?>
41
+ <input type="submit" name="wdi_submit" id="wdi_submit" class="button button-primary" disabled="disabled" value="<?php _e('Uninstall', 'wd-instagram-feed') ?>">
42
+ </div>
43
+ </div>
44
+ </form>
45
+ <?php
46
+ }
47
+ }
css/wdi_backend.css CHANGED
@@ -22,7 +22,6 @@
22
  width: 45%;
23
  }
24
 
25
-
26
  /*tooltip css*/
27
  .wdi_tooltip,
28
  .wdi_settings_link {
@@ -1880,7 +1879,10 @@ body.instagram-feed_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(4){
1880
  font-size: 15px;
1881
  color: rgba(50, 58, 69, 1);
1882
  }
1883
- .wdi-input-group input[type='text'],
 
 
 
1884
  .wdi-input-group input[readonly],
1885
  .wdi-input-group textarea {
1886
  width: 100%;
22
  width: 45%;
23
  }
24
 
 
25
  /*tooltip css*/
26
  .wdi_tooltip,
27
  .wdi_settings_link {
1879
  font-size: 15px;
1880
  color: rgba(50, 58, 69, 1);
1881
  }
1882
+ .wdi-input-group .wdi-description {
1883
+ font-style: italic;
1884
+ }
1885
+ .wdi-input-group input[type='text'],
1886
  .wdi-input-group input[readonly],
1887
  .wdi-input-group textarea {
1888
  width: 100%;
css/wdi_backend.min.css CHANGED
@@ -1 +1 @@
1
- .wdi_clear{display:block;height:0;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,.5),0 1px 0 rgba(0,0,0,.15)}#wdi_unistall:hover{background-color:#da1313}#wdi_unistall_table th{width:45%}.wdi_settings_link,.wdi_tooltip{display:block;font-size:14px!important;font-weight:700;line-height:20px;margin-bottom:5px;color:#444;text-decoration:none}.wdi_theme.wdi_border_wrapper{background:#fff;padding:5px 0}.wdi_settings_link:hover,.wdi_tooltip: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,.5);background-color:rgba(0,0,0,.75);font-size:12px}.display_type_container>div{float:left;margin-right:15px}#wdi_feed_users_ajax{width:100%;margin-top:2px}#wdi_feed_tabs .wdi_feed_tabs{border:1px solid #f1f1f1;color:#444;cursor:pointer;font-size:13px;font-weight:700;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}#wdi_feed_tabs .wdi_feed_tab_title{margin-top:1px;display:inline-block}.wdi_border_wrapper [scope=row],.wdi_border_wrapper [scope=row]+td{padding:8px}.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)}.display_type_container.wdi_clear_tag{display:table;margin:10px auto}.wdi_user a{text-decoration:none;color:#000;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:700;font-size:14px}.wdi_user .wdi_check_thumb_user,.wdi_user .wdi_remove_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],.wdi_border_wrapper [scope=row]+td{padding:2px}.small_input{width:60px;text-align:center}.display_type{text-align:center}.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}.wdi-settings-page .wdi_help_bar_wrap{background-color:unset;padding:15px 15px 15px 0}.wdi-settings-page .wdi_settings_form{margin-right:20px;padding:30px 20px;background:#fff}.wdi_advanced_option_open tr:nth-child(10),.wdi_advanced_option_open tr:nth-child(11),.wdi_advanced_option_open tr:nth-child(9){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}#wdwt_wrap_wdi_authenticated_users_list .block,#wdwt_wrap_wdi_reset_cache .block,.wdi_advanced_option .optioninput{display:inline-block}#wdi_options_page_buttons_wrapper .submit{display:inline;margin-left:15px}.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}#wdi_options_page_buttons_wrapper{margin-top:10px;width:700px}.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}.filters_description{font-size:13px;font-weight:700;margin-top:8px;display:inline-block}.wdi_filter_input input{width:250px;margin-right:0;padding-right:0}#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:#fff}.wdi_filter_by_hashtag{background-color:#e08d11;color:#fff}.wdi_logic{display:inline-block;padding:5px;font-weight:700}.wdi_filter_by_location{background-color:#509833;color:#fff}.wdi_filter_by_mention{background-color:#833888;color:#fff}.wdi_filter_by_description{background-color:#bd242b;color:#fff}.wdi_filter_by_url{background-color:#004eff;color:#fff}.wdi_remove_filter{padding-left:5px;color:#fff;font-size:13px}.wdi_remove_filter:hover{cursor:pointer}.wdi_source_user{border:1px solid #d4d4d4;background-color:rgba(0,0,0,.03);margin:0 4px 0 0;border-radius:5px;height:29px;display:inline-block;padding:2px 0 0 4px}.wdi_source_img{display:inline-block}.wdi_source_img img{width:22px;height:22px;border-radius:15px;display:block;padding:0}.wdi_source_username{display:inline-block;line-height:25px;font-size:15px!important;height:30px;vertical-align:bottom;padding:0 5px;font-weight:700}#login_with_instagram>a:focus{-webkit-box-shadow:none;box-shadow:none}.wdi_help_bar_wrap{background-color:#fff;border:none;box-sizing:border-box;clear:both;color:#6e7990;font-size:14px;font-weight:700;line-height:30px;padding:15px;vertical-align:middle;width:100%;margin:20px 0 0 0}.wdi_help_bar_wrap a,.wdi_help_bar_wrap span{font-size:14px}.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:hover,.wdi_hb_buy_pro a:visited{display:inline-block;font-weight:700;font-size:14px;vertical-align:middle;border:none;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:700;line-height:30px;padding:0 18px 0 18px;color:#fff!important}.wdi_hb_buy_pro img{border:none;display:inline-block;vertical-align:middle}#bull_style,#bullets_images_color,#bullets_images_type,#rl_butt_color,#rl_butt_style,#rl_butt_type{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:grey!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,.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_iframeContent,#TB_window{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 input,.wds_position_table td{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,.last-page,.next-page,.prev-page,.table_big_col a,.table_extra_large_col a,.table_medium_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:none;cursor:move;display:inline-block;height:15px;margin:0 auto;vertical-align:middle;width:15px}.wdi_page_title{font-size:1.5em;font-weight:500}.slider-icon{background-image:url(../images/slider-icon.png);background-repeat:no-repeat;border:none;float:left;height:32px;margin:7px 8px 0 0;width:32px}.theme-icon{background-image:url(../images/theme-2.png);background-repeat:no-repeat;border:none;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:none;float:left;height:32px;margin:7px 8px 0 0;width:32px}.wdi_spider_label{font-weight:700;width:100px}.wdi_spider_label_top{font-weight:700;padding-top:3px;vertical-align:top;width:100px}.wdi_spider_fieldset .wdi_spider_label{font-weight:700;vertical-align:top;width:150px}.wdi_spider_label_options{font-weight:700;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_bull_options_color_cont,.wdi_spider_bull_options_cont,.wdi_spider_options_color_cont,.wdi_spider_options_cont,.wdi_spider_pp_options_color_cont,.wdi_spider_pp_options_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:0 0;border:none;color:#00aeef;display:inline;font-weight:700;text-align:right;vertical-align:middle;width:30px}.error,.updated{margin:5px 0 2px!important}.buttons_div{clear:both;float:right;margin:5px 0}.buttons_div_left{float:left;margin:5px 0;width:100%}.buttons_div_right{float:right;margin:5px 0}.wdi_spider_delete_img{background-image:url(../images/delete.png);border:none;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,.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_exports,.wds_import,.wds_resize_image{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_export,.wds_opacity_import,.wds_opacity_video{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_active,.wds_tabs a.wds_sub_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_layer_title,.wds_sub_active .wds_tab_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_active,.wds_box.wds_sub_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_active,.wds_nav_tabs .wds_active a,.wds_nav_tabs .wds_active a:hover,.wds_nav_tabs .wds_sub_active,.wds_nav_tabs .wds_sub_active a,.wds_nav_tabs .wds_sub_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:400;position:relative}.wds_reset_button{display:none;font-weight:400;margin:10px 0;position:absolute;right:40px;z-index:1}.wdi_about_filed{font-size:13px;font-style:italic}#wdi_save_feed .two .section_col,.wdi_theme .section_col{width:47%;float:left;margin:0 1.5% 18px}.wdi_theme .section_col{margin-bottom:0}#wdi_save_feed .wdi_element{margin:0 0 18px}.display_type_content{background:#fff;border:1px solid #dedede;margin-bottom:15px}#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 *,.wdwt_param .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%}label[for=WDI_user_padding]{display:block}.wdi_settings_notification{font-size:13px;color:#8b0000}#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:400;line-height:29px;margin:0;padding:11px 15px 4px 0}#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%}#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:820px){#conditional_filters_tab .one .wdi_element{width:70%;float:none;margin:0 2% 20px}.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_element_content .wdi_filter_input input[type=text]:not(.wp-color-picker){width:270px}.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)}.wdi_element_content .wdi_filter_input select{width:calc(100% - 413px)}.wdi_filter_input input{height:28px;line-height:28px}}@media (max-width:768px){.wdi_element_content .wdi_filter_input input[type=text]{width:130px}.wdi_element_content .wdi_filter_input select{width:calc(100% - 144px)}#wdi_save_feed .two .section_col,.wdi_theme .section_col{width:96%;float:none;margin:0 2% 18px}.wdi_section.half{width:100%;float:none;margin:0 0 20px!important}.wdi_theme .section_col{margin-bottom:0}}.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_themes_list td{display:table-cell!important}#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_element_name_hashtag_top_recent{display:none}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}.wdi_settings_form .button{min-height:unset;padding:9px 20px;background:#fff 0 0 no-repeat;border:1px solid #dedede;border-radius:4px;line-height:19px;font-weight:600;font-size:14px;color:#32373c;height:auto!important}.wdi-page-title{margin-bottom:30px;text-align:left;letter-spacing:0;font-size:22px;color:#323a45}.wdi-input-group{margin:0 0 30px 0}.wdi-input-group:last-child{margin:0}.wdi-input-group label{display:block;margin-bottom:15px;font-weight:700;line-height:20px;font-size:15px;color:#323a45}.wdi-input-group input[readonly],.wdi-input-group input[type=text],.wdi-input-group textarea{width:100%;max-height:40px;margin:0;padding:10px 12px;background:#fff;border-radius:4px;border:1px solid #ddd;font-weight:400;font-size:15px;color:#323a45}.wdi-input-group textarea{max-height:100px;min-height:100px}.wdi-input-group select{max-width:unset;width:100%;margin:0;padding:10px 12px;border-radius:4px;border:1px solid #ddd;font-weight:400;font-size:15px;color:#323a45}.wdi-connect-instagram{background-image:url(../images/instagram-connect.png);background-size:cover;width:330px;height:50px;cursor:pointer}.wdi-access-token-missing{max-width:778px;margin:10px 0 50px 0;line-height:17px;font-size:13px;color:#323a45}.wdi-access-token-missing p{margin:0}.wdi-accounts-list li{margin-bottom:20px;padding:20px;background:#f9f9f9}.wdi-accounts-list .wdi-account-block{display:flex;flex-wrap:wrap;justify-content:space-between}.wdi-accounts-list .wdi-account-user-info{float:left;min-width:145px;margin-right:15px}.wdi-accounts-list .wdi-account-name{margin:0;font-weight:700;line-height:24px;font-size:18px;color:#323a45}.wdi-accounts-list .wdi-account-type{margin:0;line-height:16px;text-transform:capitalize;font-size:12px;color:rgba(50,58,69,.8)}.wdi-accounts-list .wdi-account-show-token{float:left;width:27px;height:27px;padding:8px 0 0 8px;background:#fff;border:1px solid #dedede;border-radius:4px;cursor:pointer}.wdi-accounts-list .wdi-account-remove{display:block;padding:9px 20px;background:#fff 0 0 no-repeat padding-box;border:1px solid #dedede;border-radius:4px;font-weight:500;font-size:14px;color:#32373c;cursor:pointer;height:auto!important}.wdi-accounts-list .wdi-account-accesstoken{margin-top:25px;display:none;clear:both}.wdi-account-accesstoken .wdi-account-remove{display:none}.wdi-advanced-options{max-width:752px;padding:20px;margin-top:30px;background:#f9f9f9}.wdi-advanced-options .wdi-advanced-headline{margin-bottom:25px;padding-bottom:16px;border-bottom:1px solid #e5e5e5}.wdi-advanced-options .wdi-advanced-headline .wdi-page-title{float:left;margin:0;font-size:16px}.wdi-advanced-options .wdi-advanced-headline i{float:right;cursor:pointer}.wdi-advanced-options .wdi-advanced-body{display:none}.wdi_settings_form .submit{margin:30px 0 0 0;padding:0}.wdi_settings_form .button-primary{background:#007cba;border-color:#007cba;color:#fff;height:auto!important}.wdi-popup{display:none;position:fixed;height:100%;width:100%;top:0;left:0;background:rgba(0,0,0,.3);z-index:1000000}.wdi-popup .wdi-popup-container{top:50%;transform:translate(0,-50%);width:800px;position:relative;margin:0 auto;padding:30px 30px 25px 30px;background:#fff;border-radius:4px}.wdi-popup .wdi-popup-container .wdi-popup-close{display:block;position:absolute;top:12px;right:11px;width:10px;height:10px;background-image:url(../images/close.svg);background-position:center;background-repeat:no-repeat;cursor:pointer}.wdi-popup .wdi-popup-container h3{margin:0 0 30px 0;line-height:30px;font-weight:700;font-size:20px}#wdi-personal-business-popup .wdi-popup-container{width:570px;height:auto;text-align:center}.wdi_paid{pointer-events:none!important;font-size:12px;text-decoration:none;color:#fff;background:transparent linear-gradient(262deg,#008a62 0,#23b536 100%) 0 0 no-repeat padding-box;border-radius:4px;padding:8px 12px;float:right;margin-top:20px}.wdi-label-business:after{clear:both;display:table;content:""}.wdi-popup-container:after{clear:both;display:table;content:""}#wdi-personal-business-popup .wdi-radio-button{margin:0;font-size:14px}#wdi-personal-business-popup .wdi-radio-button p{margin:0;display:block;width:100%;text-align:left;background:#fff 0 0 no-repeat padding-box;box-shadow:0 0 10px #00000026;margin-bottom:20px;padding:21px 20px 20px 42px;box-sizing:border-box;border-radius:4px}.wdi-radio-button .wdi-label-business label input,.wdi-radio-button .wdi-label-business label span,.wdi-radio-button .wdi-label-personal label input,.wdi-radio-button .wdi-label-personal label span{position:relative;left:-24px}#wdi-personal-business-popup .wdi-radio-button p:first-child{margin-right:50px}#wdi-personal-business-popup .wdi-radio-button p label{font-size:14px;display:block}.wdi_info_text{font-size:14px;line-height:20px;font-weight:400;color:rgba(50,58,69,.5);margin-top:4px;display:block}#wdi-personal-business-popup .dashicons-info{color:#ccc}.wdi-radio-button .wdi-radio-info-text{display:none;position:absolute;max-width:220px;margin:5px 0 0 78px;padding:14px;background:#fff;box-shadow:0 0 8px rgba(0,0,0,.14);border:1px solid #dadcdc;border-radius:4px;line-height:20px;font-size:14px}.wdi-radio-button .wdi-label-business .wdi-radio-info-text{margin:5px 0 0 -152px}.wdi-radio-button .wdi-radio-info-text.active{display:block}#wdi-personal-business-popup .wdi-connect{width:140px;height:37px;margin-top:10px;padding:0;line-height:37px;font-size:14px;background-color:#2160b5;float:right}@media screen and (max-width:1919px){.wdi-advanced-options{max-width:unset}}@media screen and (max-width:767px){br.wdi_desktop{display:none!important}#wdi-personal-business-popup .wdi-connect{margin-top:0}.wdi_paid{width:229px;box-sizing:border-box;padding:8px 7px;font-size:11px}.wdi-radio-button input[type=radio]:checked:before{width:6px;height:6px;margin:4px}input[type=checkbox],input[type=radio]{height:16px;width:12px}#wdi-personal-business-popup .wdi-radio-button p{padding:19px 18px 18px 38px}.wdi-radio-button .wdi-label-business label input,.wdi-radio-button .wdi-label-business label span,.wdi-radio-button .wdi-label-personal label input,.wdi-radio-button .wdi-label-personal label span{position:relative;left:-25px}.wdi-popup .wdi-popup-container{padding:30px 20px 20px 20px}.wdi-settings-page .wdi_settings_form{margin-right:10px;padding:20px 15px}.wdi-connect-instagram{background-image:url(../images/instagram-connect-320.png);width:272px;height:40px}.wdi-account-block>div{width:100%}.wdi-accounts-list li{margin-bottom:15px;padding:20px 15px}.wdi-accounts-list .wdi-account-show-token{float:right}.wdi-account-block .wdi-account-remove{display:none}.wdi-account-accesstoken .wdi-account-remove{display:block;float:right;margin-top:20px}#wdi-personal-business-popup .wdi-popup-container{width:300px;box-sizing:border-box}.wdi-popup .wdi-popup-container h3{max-width:260px;margin:0 auto 20px auto;font-size:16px;line-height:26px}.wdi-radio-button .wdi-label-personal .wdi-radio-info-text{margin:5px 0 0 12px}.wdi-radio-button .wdi-label-business .wdi-radio-info-text{margin:5px 0 0 -147px}.wdi_settings_form .submit{margin-top:25px}}.wdi_pro_only{font-style:italic;color:#4e4e4e!important;background-color:#ccc!important;text-decoration:none;font-weight:700}.wdi-pro-overlay img{opacity:.7}.wdi_pro_notice{text-align:right;color:#15699f;font-size:20px!important;padding:10px}.wdi-radio-button .wdi_account_type{font-weight:700;color:#323A4580}.wdi_input_group{border:1px solid transparent}.wdi_active{border:1px solid #2160b5}.wdi_active .wdi_account_type,.wdi_active .wdi_info_text{color:#323a45}.wdi_free .wdi_info_text span{text-decoration:underline}.wdi_pro .wdi_account_type,.wdi_pro .wdi_info_text{color:#323a45!important}
1
+ .wdi_clear{display:block;height:0;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,.5),0 1px 0 rgba(0,0,0,.15)}#wdi_unistall:hover{background-color:#da1313}#wdi_unistall_table th{width:45%}.wdi_settings_link,.wdi_tooltip{display:block;font-size:14px!important;font-weight:700;line-height:20px;margin-bottom:5px;color:#444;text-decoration:none}.wdi_theme.wdi_border_wrapper{background:#fff;padding:5px 0}.wdi_settings_link:hover,.wdi_tooltip: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,.5);background-color:rgba(0,0,0,.75);font-size:12px}.display_type_container>div{float:left;margin-right:15px}#wdi_feed_users_ajax{width:100%;margin-top:2px}#wdi_feed_tabs .wdi_feed_tabs{border:1px solid #f1f1f1;color:#444;cursor:pointer;font-size:13px;font-weight:700;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}#wdi_feed_tabs .wdi_feed_tab_title{margin-top:1px;display:inline-block}.wdi_border_wrapper [scope=row],.wdi_border_wrapper [scope=row]+td{padding:8px}.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)}.display_type_container.wdi_clear_tag{display:table;margin:10px auto}.wdi_user a{text-decoration:none;color:#000;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:700;font-size:14px}.wdi_user .wdi_check_thumb_user,.wdi_user .wdi_remove_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],.wdi_border_wrapper [scope=row]+td{padding:2px}.small_input{width:60px;text-align:center}.display_type{text-align:center}.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}.wdi-settings-page .wdi_help_bar_wrap{background-color:unset;padding:15px 15px 15px 0}.wdi-settings-page .wdi_settings_form{margin-right:20px;padding:30px 20px;background:#fff}.wdi_advanced_option_open tr:nth-child(10),.wdi_advanced_option_open tr:nth-child(11),.wdi_advanced_option_open tr:nth-child(9){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}#wdwt_wrap_wdi_authenticated_users_list .block,#wdwt_wrap_wdi_reset_cache .block,.wdi_advanced_option .optioninput{display:inline-block}#wdi_options_page_buttons_wrapper .submit{display:inline;margin-left:15px}.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}#wdi_options_page_buttons_wrapper{margin-top:10px;width:700px}.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}.filters_description{font-size:13px;font-weight:700;margin-top:8px;display:inline-block}.wdi_filter_input input{width:250px;margin-right:0;padding-right:0}#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:#fff}.wdi_filter_by_hashtag{background-color:#e08d11;color:#fff}.wdi_logic{display:inline-block;padding:5px;font-weight:700}.wdi_filter_by_location{background-color:#509833;color:#fff}.wdi_filter_by_mention{background-color:#833888;color:#fff}.wdi_filter_by_description{background-color:#bd242b;color:#fff}.wdi_filter_by_url{background-color:#004eff;color:#fff}.wdi_remove_filter{padding-left:5px;color:#fff;font-size:13px}.wdi_remove_filter:hover{cursor:pointer}.wdi_source_user{border:1px solid #d4d4d4;background-color:rgba(0,0,0,.03);margin:0 4px 0 0;border-radius:5px;height:29px;display:inline-block;padding:2px 0 0 4px}.wdi_source_img{display:inline-block}.wdi_source_img img{width:22px;height:22px;border-radius:15px;display:block;padding:0}.wdi_source_username{display:inline-block;line-height:25px;font-size:15px!important;height:30px;vertical-align:bottom;padding:0 5px;font-weight:700}#login_with_instagram>a:focus{-webkit-box-shadow:none;box-shadow:none}.wdi_help_bar_wrap{background-color:#fff;border:none;box-sizing:border-box;clear:both;color:#6e7990;font-size:14px;font-weight:700;line-height:30px;padding:15px;vertical-align:middle;width:100%;margin:20px 0 0 0}.wdi_help_bar_wrap a,.wdi_help_bar_wrap span{font-size:14px}.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:hover,.wdi_hb_buy_pro a:visited{display:inline-block;font-weight:700;font-size:14px;vertical-align:middle;border:none;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:700;line-height:30px;padding:0 18px 0 18px;color:#fff!important}.wdi_hb_buy_pro img{border:none;display:inline-block;vertical-align:middle}#bull_style,#bullets_images_color,#bullets_images_type,#rl_butt_color,#rl_butt_style,#rl_butt_type{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:grey!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,.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_iframeContent,#TB_window{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 input,.wds_position_table td{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,.last-page,.next-page,.prev-page,.table_big_col a,.table_extra_large_col a,.table_medium_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:none;cursor:move;display:inline-block;height:15px;margin:0 auto;vertical-align:middle;width:15px}.wdi_page_title{font-size:1.5em;font-weight:500}.slider-icon{background-image:url(../images/slider-icon.png);background-repeat:no-repeat;border:none;float:left;height:32px;margin:7px 8px 0 0;width:32px}.theme-icon{background-image:url(../images/theme-2.png);background-repeat:no-repeat;border:none;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:none;float:left;height:32px;margin:7px 8px 0 0;width:32px}.wdi_spider_label{font-weight:700;width:100px}.wdi_spider_label_top{font-weight:700;padding-top:3px;vertical-align:top;width:100px}.wdi_spider_fieldset .wdi_spider_label{font-weight:700;vertical-align:top;width:150px}.wdi_spider_label_options{font-weight:700;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_bull_options_color_cont,.wdi_spider_bull_options_cont,.wdi_spider_options_color_cont,.wdi_spider_options_cont,.wdi_spider_pp_options_color_cont,.wdi_spider_pp_options_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:0 0;border:none;color:#00aeef;display:inline;font-weight:700;text-align:right;vertical-align:middle;width:30px}.error,.updated{margin:5px 0 2px!important}.buttons_div{clear:both;float:right;margin:5px 0}.buttons_div_left{float:left;margin:5px 0;width:100%}.buttons_div_right{float:right;margin:5px 0}.wdi_spider_delete_img{background-image:url(../images/delete.png);border:none;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,.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_exports,.wds_import,.wds_resize_image{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_export,.wds_opacity_import,.wds_opacity_video{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_active,.wds_tabs a.wds_sub_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_layer_title,.wds_sub_active .wds_tab_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_active,.wds_box.wds_sub_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_active,.wds_nav_tabs .wds_active a,.wds_nav_tabs .wds_active a:hover,.wds_nav_tabs .wds_sub_active,.wds_nav_tabs .wds_sub_active a,.wds_nav_tabs .wds_sub_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:400;position:relative}.wds_reset_button{display:none;font-weight:400;margin:10px 0;position:absolute;right:40px;z-index:1}.wdi_about_filed{font-size:13px;font-style:italic}#wdi_save_feed .two .section_col,.wdi_theme .section_col{width:47%;float:left;margin:0 1.5% 18px}.wdi_theme .section_col{margin-bottom:0}#wdi_save_feed .wdi_element{margin:0 0 18px}.display_type_content{background:#fff;border:1px solid #dedede;margin-bottom:15px}#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 *,.wdwt_param .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%}label[for=WDI_user_padding]{display:block}.wdi_settings_notification{font-size:13px;color:#8b0000}#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:400;line-height:29px;margin:0;padding:11px 15px 4px 0}#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%}#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:820px){#conditional_filters_tab .one .wdi_element{width:70%;float:none;margin:0 2% 20px}.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_element_content .wdi_filter_input input[type=text]:not(.wp-color-picker){width:270px}.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)}.wdi_element_content .wdi_filter_input select{width:calc(100% - 413px)}.wdi_filter_input input{height:28px;line-height:28px}}@media (max-width:768px){.wdi_element_content .wdi_filter_input input[type=text]{width:130px}.wdi_element_content .wdi_filter_input select{width:calc(100% - 144px)}#wdi_save_feed .two .section_col,.wdi_theme .section_col{width:96%;float:none;margin:0 2% 18px}.wdi_section.half{width:100%;float:none;margin:0 0 20px!important}.wdi_theme .section_col{margin-bottom:0}}.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_themes_list td{display:table-cell!important}#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_element_name_hashtag_top_recent{display:none}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}.wdi_settings_form .button{min-height:unset;padding:9px 20px;background:#fff 0 0 no-repeat;border:1px solid #dedede;border-radius:4px;line-height:19px;font-weight:600;font-size:14px;color:#32373c;height:auto!important}.wdi-page-title{margin-bottom:30px;text-align:left;letter-spacing:0;font-size:22px;color:#323a45}.wdi-input-group{margin:0 0 30px 0}.wdi-input-group:last-child{margin:0}.wdi-input-group label{display:block;margin-bottom:15px;font-weight:700;line-height:20px;font-size:15px;color:#323a45}.wdi-input-group .wdi-description{font-style:italic}.wdi-input-group input[readonly],.wdi-input-group input[type=text],.wdi-input-group textarea{width:100%;max-height:40px;margin:0;padding:10px 12px;background:#fff;border-radius:4px;border:1px solid #ddd;font-weight:400;font-size:15px;color:#323a45}.wdi-input-group textarea{max-height:100px;min-height:100px}.wdi-input-group select{max-width:unset;width:100%;margin:0;padding:10px 12px;border-radius:4px;border:1px solid #ddd;font-weight:400;font-size:15px;color:#323a45}.wdi-connect-instagram{background-image:url(../images/instagram-connect.png);background-size:cover;width:330px;height:50px;cursor:pointer}.wdi-access-token-missing{max-width:778px;margin:10px 0 50px 0;line-height:17px;font-size:13px;color:#323a45}.wdi-access-token-missing p{margin:0}.wdi-accounts-list li{margin-bottom:20px;padding:20px;background:#f9f9f9}.wdi-accounts-list .wdi-account-block{display:flex;flex-wrap:wrap;justify-content:space-between}.wdi-accounts-list .wdi-account-user-info{float:left;min-width:145px;margin-right:15px}.wdi-accounts-list .wdi-account-name{margin:0;font-weight:700;line-height:24px;font-size:18px;color:#323a45}.wdi-accounts-list .wdi-account-type{margin:0;line-height:16px;text-transform:capitalize;font-size:12px;color:rgba(50,58,69,.8)}.wdi-accounts-list .wdi-account-show-token{float:left;width:27px;height:27px;padding:8px 0 0 8px;background:#fff;border:1px solid #dedede;border-radius:4px;cursor:pointer}.wdi-accounts-list .wdi-account-remove{display:block;padding:9px 20px;background:#fff 0 0 no-repeat padding-box;border:1px solid #dedede;border-radius:4px;font-weight:500;font-size:14px;color:#32373c;cursor:pointer;height:auto!important}.wdi-accounts-list .wdi-account-accesstoken{margin-top:25px;display:none;clear:both}.wdi-account-accesstoken .wdi-account-remove{display:none}.wdi-advanced-options{max-width:752px;padding:20px;margin-top:30px;background:#f9f9f9}.wdi-advanced-options .wdi-advanced-headline{margin-bottom:25px;padding-bottom:16px;border-bottom:1px solid #e5e5e5}.wdi-advanced-options .wdi-advanced-headline .wdi-page-title{float:left;margin:0;font-size:16px}.wdi-advanced-options .wdi-advanced-headline i{float:right;cursor:pointer}.wdi-advanced-options .wdi-advanced-body{display:none}.wdi_settings_form .submit{margin:30px 0 0 0;padding:0}.wdi_settings_form .button-primary{background:#007cba;border-color:#007cba;color:#fff;height:auto!important}.wdi-popup{display:none;position:fixed;height:100%;width:100%;top:0;left:0;background:rgba(0,0,0,.3);z-index:1000000}.wdi-popup .wdi-popup-container{top:50%;transform:translate(0,-50%);width:800px;position:relative;margin:0 auto;padding:30px 30px 25px 30px;background:#fff;border-radius:4px}.wdi-popup .wdi-popup-container .wdi-popup-close{display:block;position:absolute;top:12px;right:11px;width:10px;height:10px;background-image:url(../images/close.svg);background-position:center;background-repeat:no-repeat;cursor:pointer}.wdi-popup .wdi-popup-container h3{margin:0 0 30px 0;line-height:30px;font-weight:700;font-size:20px}#wdi-personal-business-popup .wdi-popup-container{width:570px;height:auto;text-align:center}.wdi_paid{pointer-events:none!important;font-size:12px;text-decoration:none;color:#fff;background:transparent linear-gradient(262deg,#008a62 0,#23b536 100%) 0 0 no-repeat padding-box;border-radius:4px;padding:8px 12px;float:right;margin-top:20px}.wdi-label-business:after{clear:both;display:table;content:""}.wdi-popup-container:after{clear:both;display:table;content:""}#wdi-personal-business-popup .wdi-radio-button{margin:0;font-size:14px}#wdi-personal-business-popup .wdi-radio-button p{margin:0;display:block;width:100%;text-align:left;background:#fff 0 0 no-repeat padding-box;box-shadow:0 0 10px #00000026;margin-bottom:20px;padding:21px 20px 20px 42px;box-sizing:border-box;border-radius:4px}.wdi-radio-button .wdi-label-business label input,.wdi-radio-button .wdi-label-business label span,.wdi-radio-button .wdi-label-personal label input,.wdi-radio-button .wdi-label-personal label span{position:relative;left:-24px}#wdi-personal-business-popup .wdi-radio-button p:first-child{margin-right:50px}#wdi-personal-business-popup .wdi-radio-button p label{font-size:14px;display:block}.wdi_info_text{font-size:14px;line-height:20px;font-weight:400;color:rgba(50,58,69,.5);margin-top:4px;display:block}#wdi-personal-business-popup .dashicons-info{color:#ccc}.wdi-radio-button .wdi-radio-info-text{display:none;position:absolute;max-width:220px;margin:5px 0 0 78px;padding:14px;background:#fff;box-shadow:0 0 8px rgba(0,0,0,.14);border:1px solid #dadcdc;border-radius:4px;line-height:20px;font-size:14px}.wdi-radio-button .wdi-label-business .wdi-radio-info-text{margin:5px 0 0 -152px}.wdi-radio-button .wdi-radio-info-text.active{display:block}#wdi-personal-business-popup .wdi-connect{width:140px;height:37px;margin-top:10px;padding:0;line-height:37px;font-size:14px;background-color:#2160b5;float:right}@media screen and (max-width:1919px){.wdi-advanced-options{max-width:unset}}@media screen and (max-width:767px){br.wdi_desktop{display:none!important}#wdi-personal-business-popup .wdi-connect{margin-top:0}.wdi_paid{width:229px;box-sizing:border-box;padding:8px 7px;font-size:11px}.wdi-radio-button input[type=radio]:checked:before{width:6px;height:6px;margin:4px}input[type=checkbox],input[type=radio]{height:16px;width:12px}#wdi-personal-business-popup .wdi-radio-button p{padding:19px 18px 18px 38px}.wdi-radio-button .wdi-label-business label input,.wdi-radio-button .wdi-label-business label span,.wdi-radio-button .wdi-label-personal label input,.wdi-radio-button .wdi-label-personal label span{position:relative;left:-25px}.wdi-popup .wdi-popup-container{padding:30px 20px 20px 20px}.wdi-settings-page .wdi_settings_form{margin-right:10px;padding:20px 15px}.wdi-connect-instagram{background-image:url(../images/instagram-connect-320.png);width:272px;height:40px}.wdi-account-block>div{width:100%}.wdi-accounts-list li{margin-bottom:15px;padding:20px 15px}.wdi-accounts-list .wdi-account-show-token{float:right}.wdi-account-block .wdi-account-remove{display:none}.wdi-account-accesstoken .wdi-account-remove{display:block;float:right;margin-top:20px}#wdi-personal-business-popup .wdi-popup-container{width:300px;box-sizing:border-box}.wdi-popup .wdi-popup-container h3{max-width:260px;margin:0 auto 20px auto;font-size:16px;line-height:26px}.wdi-radio-button .wdi-label-personal .wdi-radio-info-text{margin:5px 0 0 12px}.wdi-radio-button .wdi-label-business .wdi-radio-info-text{margin:5px 0 0 -147px}.wdi_settings_form .submit{margin-top:25px}}.wdi_pro_only{font-style:italic;color:#4e4e4e!important;background-color:#ccc!important;text-decoration:none;font-weight:700}.wdi-pro-overlay img{opacity:.7}.wdi_pro_notice{text-align:right;color:#15699f;font-size:20px!important;padding:10px}.wdi-radio-button .wdi_account_type{font-weight:700;color:#323A4580}.wdi_input_group{border:1px solid transparent}.wdi_active{border:1px solid #2160b5}.wdi_active .wdi_account_type,.wdi_active .wdi_info_text{color:#323a45}.wdi_free .wdi_info_text span{text-decoration:underline}.wdi_pro .wdi_account_type,.wdi_pro .wdi_info_text{color:#323a45!important}
framework/WDICache.php CHANGED
@@ -1,20 +1,29 @@
1
  <?php
 
2
  /**
3
- * Created by PhpStorm.
4
- * User: arshaluys
5
- * Date: 8/26/20
6
- * Time: 3:54 PM
7
  */
 
8
 
9
- class WDICache{
10
  private $wdi_options = NULL;
11
 
 
 
 
12
  function __construct() {
13
  global $wdi_options;
14
  $this->wdi_options = $wdi_options;
15
  }
16
 
17
- public function get_cache_data($name, $debug = FALSE){
 
 
 
 
 
 
 
 
18
  $transient_key = "wdi_cache_" . md5($name);
19
  $cache_data = get_transient($transient_key);
20
  if ( isset($cache_data) && $cache_data != FALSE && isset($cache_data["cache_response"]) ) {
@@ -45,11 +54,22 @@ class WDICache{
45
  "wdi_debugging_data" => $wdi_debugging_data,
46
  "cache_data" => $cache_data,
47
  );
 
48
  return $return_data;
49
  }
50
- return array("success" => FALSE);
 
51
  }
52
- public function set_cache_data($name, $response){
 
 
 
 
 
 
 
 
 
53
  //$response = json_decode(stripslashes($response), TRUE);
54
  //$response["cache"]=TRUE;
55
  //$response = json_encode($response, true);
@@ -74,11 +94,19 @@ class WDICache{
74
  ),
75
  );
76
  $data = set_transient($transient_key, $data, $expiration_time);
 
77
  return $data;
78
  }
79
- public function reset_cache(){
 
 
 
 
 
 
80
  global $wpdb;
81
  $data = $wpdb->query('DELETE FROM ' . $wpdb->prefix . 'options WHERE option_name LIKE "%wdi_cache_%"');
 
82
  return $data;
83
  }
84
  }
1
  <?php
2
+
3
  /**
4
+ * Class WDICache
 
 
 
5
  */
6
+ class WDICache {
7
 
 
8
  private $wdi_options = NULL;
9
 
10
+ /**
11
+ * WDICache constructor.
12
+ */
13
  function __construct() {
14
  global $wdi_options;
15
  $this->wdi_options = $wdi_options;
16
  }
17
 
18
+ /**
19
+ * Get cache data.
20
+ *
21
+ * @param $name
22
+ * @param bool $debug
23
+ *
24
+ * @return array
25
+ */
26
+ public function get_cache_data( $name, $debug = FALSE ) {
27
  $transient_key = "wdi_cache_" . md5($name);
28
  $cache_data = get_transient($transient_key);
29
  if ( isset($cache_data) && $cache_data != FALSE && isset($cache_data["cache_response"]) ) {
54
  "wdi_debugging_data" => $wdi_debugging_data,
55
  "cache_data" => $cache_data,
56
  );
57
+
58
  return $return_data;
59
  }
60
+
61
+ return array( "success" => FALSE );
62
  }
63
+
64
+ /**
65
+ * Set cache data.
66
+ *
67
+ * @param $name
68
+ * @param $response
69
+ *
70
+ * @return array|bool
71
+ */
72
+ public function set_cache_data( $name, $response ) {
73
  //$response = json_decode(stripslashes($response), TRUE);
74
  //$response["cache"]=TRUE;
75
  //$response = json_encode($response, true);
94
  ),
95
  );
96
  $data = set_transient($transient_key, $data, $expiration_time);
97
+
98
  return $data;
99
  }
100
+
101
+ /**
102
+ * Reset cache.
103
+ *
104
+ * @return bool|int
105
+ */
106
+ public function reset_cache() {
107
  global $wpdb;
108
  $data = $wpdb->query('DELETE FROM ' . $wpdb->prefix . 'options WHERE option_name LIKE "%wdi_cache_%"');
109
+
110
  return $data;
111
  }
112
  }
framework/WDIInstagram.php CHANGED
@@ -17,8 +17,6 @@ class WDIInstagram {
17
 
18
  public function getUserMedia( $user_name ) {
19
  if ( isset($this->wdi_authenticated_users_list) && is_array($this->wdi_authenticated_users_list) && isset($this->wdi_authenticated_users_list[$user_name]) ) {
20
-
21
-
22
  $this->account_data = $this->wdi_authenticated_users_list[$user_name];
23
  $user_id = $this->account_data["user_id"];
24
  $access_token = $this->account_data["access_token"];
@@ -28,8 +26,11 @@ class WDIInstagram {
28
  $api_url = 'https://graph.facebook.com/v8.0/';
29
  $media_fields = 'id,media_type,media_url,permalink,thumbnail_url,username,caption,timestamp,ig_id,is_comment_enabled,like_count,owner,shortcode';
30
  }
31
- $baseUrl = $api_url . $user_id . '/media?access_token=' . $access_token;
32
- $media = array();
 
 
 
33
  $cache_data = $this->cache->get_cache_data($baseUrl);
34
  if ( isset($cache_data) && $cache_data["success"] && isset($cache_data["cache_data"]) ) {
35
  return base64_decode($cache_data["cache_data"]);
@@ -37,26 +38,9 @@ class WDIInstagram {
37
  $args = array();
38
  $response = wp_remote_get($baseUrl, $args);
39
  if ( !isset($response->errors) && isset($response["body"]) ) {
40
- if ( isset($response["body"]) ) {
41
- $data = json_decode($response["body"], TRUE);
42
- $return_data = $data;
43
- if ( isset($data["data"]) ) {
44
- $media_ids = $data["data"];
45
- foreach ( $media_ids as $id ) {
46
- if ( isset($id["id"]) ) {
47
- $media_url = $api_url . $id["id"] . '/?fields=' . $media_fields . '&access_token=' . $access_token;
48
- $media_response = wp_remote_get($media_url, array());
49
- if ( isset($media_response["body"]) ) {
50
- $media_data = json_decode($media_response["body"], TRUE);
51
- array_push($media, $media_data);
52
- }
53
- }
54
- }
55
- }
56
- }
57
- if ( isset($return_data) ) {
58
- $return_data["data"] = $media;
59
- $return_data = $this->convertPersonalData($return_data);
60
  $return_data = json_encode($return_data);
61
  $this->cache->set_cache_data($baseUrl, base64_encode($return_data));
62
  return $return_data;
@@ -64,7 +48,6 @@ class WDIInstagram {
64
  }
65
  $return_data = '{"error":{"message":"cURL error","type":"http_request_failed"}}';
66
  return $return_data;
67
-
68
  }
69
  }
70
 
@@ -75,12 +58,6 @@ class WDIInstagram {
75
  $baseUrl = $next_url;
76
  }
77
  else {
78
- if ( $endpoint == 0 ) {
79
- $endpoint = "top_media";
80
- }
81
- else {
82
- $endpoint = "recent_media";
83
- }
84
  $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}&access_token=' . $this->account_data["access_token"] . '&user_id=' . $this->account_data["user_id"];
85
  if ( $wdiTagId !== FALSE ) {
86
  $baseUrl = str_replace("{tagid}", $wdiTagId, $baseUrl);
@@ -97,7 +74,7 @@ class WDIInstagram {
97
  }
98
  }
99
  }
100
- /**********************************************************8*/
101
  $args = array();
102
  //$return_data = '{"error":{"message":"cURL error","type":"http_request_failed"}}';
103
  $cache_data = $this->cache->get_cache_data($baseUrl);
@@ -350,19 +327,19 @@ class WDIInstagram {
350
  "standard_resolution" => array(
351
  "width" => 640,
352
  "height" => 800,
353
- "url" => $media_data["media_url"],
354
  "id" => $media_data["id"],
355
  ),
356
  "low_bandwidth" => array(
357
  "width" => 480,
358
  "height" => 600,
359
- "url" => $media_data["media_url"],
360
  "id" => $media_data["id"],
361
  ),
362
  "low_resolution" => array(
363
  "width" => 640,
364
  "height" => 800,
365
- "url" => $media_data["media_url"],
366
  "id" => $media_data["id"],
367
  ),
368
  ),
17
 
18
  public function getUserMedia( $user_name ) {
19
  if ( isset($this->wdi_authenticated_users_list) && is_array($this->wdi_authenticated_users_list) && isset($this->wdi_authenticated_users_list[$user_name]) ) {
 
 
20
  $this->account_data = $this->wdi_authenticated_users_list[$user_name];
21
  $user_id = $this->account_data["user_id"];
22
  $access_token = $this->account_data["access_token"];
26
  $api_url = 'https://graph.facebook.com/v8.0/';
27
  $media_fields = 'id,media_type,media_url,permalink,thumbnail_url,username,caption,timestamp,ig_id,is_comment_enabled,like_count,owner,shortcode';
28
  }
29
+
30
+ $baseUrl = $api_url . $user_id . '/media/?fields=' . $media_fields . '&limit=100&access_token=' . $access_token;
31
+ if(WDI_IS_FREE){
32
+ $media = array();
33
+ }
34
  $cache_data = $this->cache->get_cache_data($baseUrl);
35
  if ( isset($cache_data) && $cache_data["success"] && isset($cache_data["cache_data"]) ) {
36
  return base64_decode($cache_data["cache_data"]);
38
  $args = array();
39
  $response = wp_remote_get($baseUrl, $args);
40
  if ( !isset($response->errors) && isset($response["body"]) ) {
41
+ $data = json_decode($response["body"], TRUE);
42
+ if ( !empty($data['data']) ) {
43
+ $return_data = $this->convertPersonalData($data);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  $return_data = json_encode($return_data);
45
  $this->cache->set_cache_data($baseUrl, base64_encode($return_data));
46
  return $return_data;
48
  }
49
  $return_data = '{"error":{"message":"cURL error","type":"http_request_failed"}}';
50
  return $return_data;
 
51
  }
52
  }
53
 
58
  $baseUrl = $next_url;
59
  }
60
  else {
 
 
 
 
 
 
61
  $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}&access_token=' . $this->account_data["access_token"] . '&user_id=' . $this->account_data["user_id"];
62
  if ( $wdiTagId !== FALSE ) {
63
  $baseUrl = str_replace("{tagid}", $wdiTagId, $baseUrl);
74
  }
75
  }
76
  }
77
+ /***********************************************************/
78
  $args = array();
79
  //$return_data = '{"error":{"message":"cURL error","type":"http_request_failed"}}';
80
  $cache_data = $this->cache->get_cache_data($baseUrl);
327
  "standard_resolution" => array(
328
  "width" => 640,
329
  "height" => 800,
330
+ "url" => esc_url_raw($media_data["media_url"]),
331
  "id" => $media_data["id"],
332
  ),
333
  "low_bandwidth" => array(
334
  "width" => 480,
335
  "height" => 600,
336
+ "url" => esc_url_raw($media_data["media_url"]),
337
  "id" => $media_data["id"],
338
  ),
339
  "low_resolution" => array(
340
  "width" => 640,
341
  "height" => 800,
342
+ "url" => esc_url_raw($media_data["media_url"]),
343
  "id" => $media_data["id"],
344
  ),
345
  ),
framework/WDILibrary.php CHANGED
@@ -65,6 +65,9 @@ class WDILibrary {
65
  */
66
  private static function validate_data(&$value, $key, $callback) {
67
  $value = stripslashes($value);
 
 
 
68
  if ( $callback && function_exists($callback) ) {
69
  $value = $callback($value);
70
  }
@@ -1427,17 +1430,17 @@ class WDILibrary {
1427
  switch ($page) {
1428
  case 'wdi_feeds': {
1429
  $user_guide_link .= '360016497251-Creating-Instagram-Feed';
1430
- $description .= __('This section allows you to create, edit and delete Feeds.', WD_WDI_PREFIX);
1431
  break;
1432
  }
1433
  case 'wdi_themes': {
1434
  $user_guide_link .= '360016277832';
1435
- $description .= __('This section allows you to create, edit and delete Themes.', WD_WDI_PREFIX);
1436
  break;
1437
  }
1438
  case 'wdi_settings': {
1439
  $user_guide_link .= '360016277532-Configuring-Instagram-Access-Token';
1440
- $description .= __('This section allows you to set API parameters.', WD_WDI_PREFIX);
1441
  break;
1442
  }
1443
  default: {
@@ -1448,27 +1451,27 @@ class WDILibrary {
1448
  $user_guide_link .= '?utm_source=instagram_feed&amp;utm_medium=free_plugin';
1449
  $support_forum_link = 'https://wordpress.org/support/plugin/wd-instagram-feed/#new-post';
1450
  $premium_link = 'https://10web.io/plugins/wordpress-instagram-feed/?utm_source=instagram_feed&amp;utm_medium=free_plugin';
1451
- wp_enqueue_style(WD_WDI_PREFIX . '-roboto');
1452
- wp_enqueue_style(WD_WDI_PREFIX . '-pricing');
1453
  ob_start();
1454
  ?>
1455
  <div class="wrap">
1456
  <h1 class="head-notice">&nbsp;</h1>
1457
  <div class="topbar-container">
1458
  <?php
1459
- if ( IS_FREE ) {
1460
  ?>
1461
  <div class="topbar topbar-content">
1462
  <div class="topbar-content-container">
1463
  <div class="topbar-content-title">
1464
- <?php _e('Instagram Feed by 10Web Premium', WD_WDI_PREFIX); ?>
1465
  </div>
1466
  <div class="topbar-content-body">
1467
  <?php echo $description; ?>
1468
  </div>
1469
  </div>
1470
  <div class="topbar-content-button-container">
1471
- <a href="<?php echo $premium_link; ?>" target="_blank" class="topbar-upgrade-button"><?php _e( 'Upgrade',WD_WDI_PREFIX ); ?></a>
1472
  </div>
1473
  </div>
1474
  <?php
@@ -1482,21 +1485,21 @@ class WDILibrary {
1482
  <div class="topbar-links-container">
1483
  <a href="<?php echo $user_guide_link; ?>" target="_blank" class="topbar_user_guid">
1484
  <div class="topbar-links-item">
1485
- <?php _e('User guide', WD_WDI_PREFIX); ?>
1486
  </div>
1487
  </a>
1488
  </div>
1489
  </div>
1490
  <?php
1491
  }
1492
- if ( IS_FREE ) {
1493
  ?>
1494
  <div class="topbar topbar-links topbar_support_forum">
1495
  <div class="topbar-links-container">
1496
  <a href="<?php echo $support_forum_link; ?>" target="_blank" class="topbar_support_forum">
1497
  <div class="topbar-links-item">
1498
  <img src="<?php echo WDI_URL . '/images/help.svg'; ?>" class="help_icon" />
1499
- <?php _e('Ask a question', WD_WDI_PREFIX); ?>
1500
  </div>
1501
  </a>
1502
  </div>
65
  */
66
  private static function validate_data(&$value, $key, $callback) {
67
  $value = stripslashes($value);
68
+ if($key==="url"){
69
+ $callback = "esc_url_raw";
70
+ }
71
  if ( $callback && function_exists($callback) ) {
72
  $value = $callback($value);
73
  }
1430
  switch ($page) {
1431
  case 'wdi_feeds': {
1432
  $user_guide_link .= '360016497251-Creating-Instagram-Feed';
1433
+ $description .= __('This section allows you to create, edit and delete Feeds.', WDI_PREFIX);
1434
  break;
1435
  }
1436
  case 'wdi_themes': {
1437
  $user_guide_link .= '360016277832';
1438
+ $description .= __('This section allows you to create, edit and delete Themes.', WDI_PREFIX);
1439
  break;
1440
  }
1441
  case 'wdi_settings': {
1442
  $user_guide_link .= '360016277532-Configuring-Instagram-Access-Token';
1443
+ $description .= __('This section allows you to set API parameters.', WDI_PREFIX);
1444
  break;
1445
  }
1446
  default: {
1451
  $user_guide_link .= '?utm_source=instagram_feed&amp;utm_medium=free_plugin';
1452
  $support_forum_link = 'https://wordpress.org/support/plugin/wd-instagram-feed/#new-post';
1453
  $premium_link = 'https://10web.io/plugins/wordpress-instagram-feed/?utm_source=instagram_feed&amp;utm_medium=free_plugin';
1454
+ wp_enqueue_style(WDI_PREFIX . '-roboto');
1455
+ wp_enqueue_style(WDI_PREFIX . '-pricing');
1456
  ob_start();
1457
  ?>
1458
  <div class="wrap">
1459
  <h1 class="head-notice">&nbsp;</h1>
1460
  <div class="topbar-container">
1461
  <?php
1462
+ if ( WDI_IS_FREE ) {
1463
  ?>
1464
  <div class="topbar topbar-content">
1465
  <div class="topbar-content-container">
1466
  <div class="topbar-content-title">
1467
+ <?php _e('Instagram Feed by 10Web Premium', WDI_PREFIX); ?>
1468
  </div>
1469
  <div class="topbar-content-body">
1470
  <?php echo $description; ?>
1471
  </div>
1472
  </div>
1473
  <div class="topbar-content-button-container">
1474
+ <a href="<?php echo $premium_link; ?>" target="_blank" class="topbar-upgrade-button"><?php _e( 'Upgrade',WDI_PREFIX ); ?></a>
1475
  </div>
1476
  </div>
1477
  <?php
1485
  <div class="topbar-links-container">
1486
  <a href="<?php echo $user_guide_link; ?>" target="_blank" class="topbar_user_guid">
1487
  <div class="topbar-links-item">
1488
+ <?php _e('User guide', WDI_PREFIX); ?>
1489
  </div>
1490
  </a>
1491
  </div>
1492
  </div>
1493
  <?php
1494
  }
1495
+ if ( WDI_IS_FREE ) {
1496
  ?>
1497
  <div class="topbar topbar-links topbar_support_forum">
1498
  <div class="topbar-links-container">
1499
  <a href="<?php echo $support_forum_link; ?>" target="_blank" class="topbar_support_forum">
1500
  <div class="topbar-links-item">
1501
  <img src="<?php echo WDI_URL . '/images/help.svg'; ?>" class="help_icon" />
1502
+ <?php _e('Ask a question', WDI_PREFIX); ?>
1503
  </div>
1504
  </a>
1505
  </div>
framework/WDILibraryEmbed.php CHANGED
@@ -4,10 +4,10 @@
4
  */
5
 
6
  class WDILibraryEmbed {
7
-
8
  public function __construct() {
9
  }
10
 
 
11
  /**
12
  * client side analogue is function wdi_spider_display_embed in wdi_embed.js
13
  *
4
  */
5
 
6
  class WDILibraryEmbed {
 
7
  public function __construct() {
8
  }
9
 
10
+
11
  /**
12
  * client side analogue is function wdi_spider_display_embed in wdi_embed.js
13
  *
framework/WDI_form_builder.php CHANGED
@@ -194,7 +194,7 @@ public function __construct() {
194
  $type = isset($element['type']) ? $element['type'] : '';
195
  $label = isset($element['label']) ? $element['label'] : '';
196
  $width = isset($element['width']) ? ($element['width']) : '';
197
- $options = isset($element['valid_options']) ? $element['valid_options'] : '';
198
  $hide_ids = isset($element['hide_ids']) ? $element['hide_ids'] : '';
199
  $defaults = $element['defaults'];
200
  $current_settings = isset($feed_row) ? $feed_row : '';
194
  $type = isset($element['type']) ? $element['type'] : '';
195
  $label = isset($element['label']) ? $element['label'] : '';
196
  $width = isset($element['width']) ? ($element['width']) : '';
197
+ $options = isset($element['valid_options']) ? $element['valid_options'] : array();
198
  $hide_ids = isset($element['hide_ids']) ? $element['hide_ids'] : '';
199
  $defaults = $element['defaults'];
200
  $current_settings = isset($feed_row) ? $feed_row : '';
frontend/shortcode.php CHANGED
@@ -18,6 +18,8 @@ function wdi_feed($atts, $widget_params = '') {
18
  global $wdi_options;
19
  global $wdi_feed_counter;
20
  ob_start();
 
 
21
  // Will access_token refresh in the last 30 dey.
22
  if ( !empty($wdi_options['wdi_access_token']) && !empty($wdi_options['wdi_start_in']) && !empty($wdi_options['wdi_expires_in']) ) {
23
  $expires_time = $wdi_options['wdi_start_in'] + $wdi_options['wdi_expires_in'] - (30 * 24 * 60 * 60);
@@ -25,20 +27,7 @@ function wdi_feed($atts, $widget_params = '') {
25
  $refresh = WDILibrary::refresh_instagram_access_token();
26
  }
27
  }
28
-
29
- // Checking if access token is not set or removed display proper error message
30
- if ( (!isset($wdi_options['wdi_access_token']) || $wdi_options['wdi_access_token'] == '') && empty($wdi_options['fb_token']) ) {
31
- ob_get_clean();
32
-
33
- return __('Access Token is invalid, please get it again', "wd-instagram-feed");
34
- }
35
-
36
- if ( empty($wdi_options['wdi_access_token']) && empty($wdi_options['business_account_id']) ) {
37
- ob_get_clean();
38
-
39
- return __('Error: Access Token not found, please authorize Instagram API.', "wd-instagram-feed");
40
- }
41
-
42
  if ( !empty($wdi_options['wdi_access_token']) && !empty($wdi_options['wdi_start_in']) && !empty($wdi_options['wdi_expires_in']) ) {
43
  $expires_time = $wdi_options['wdi_start_in'] + $wdi_options['wdi_expires_in'] - (10 * 60);
44
  if ( time() >= $expires_time ) {
@@ -47,7 +36,7 @@ function wdi_feed($atts, $widget_params = '') {
47
  return __('Error: Access token session has expired, please reauthorize access token.', "wd-instagram-feed");
48
  }
49
  }
50
-
51
  $feed_id = WDILibrary::get('feed_id', 0, 'intval');
52
  if ( $feed_id != 0 && $post->post_type === "wdi_instagram" && $widget_params === '' ) {
53
  if ( !is_array($atts) ) {
@@ -174,6 +163,22 @@ function wdi_feed($atts, $widget_params = '') {
174
  $wdi_feed_counter++;
175
  break;
176
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
  case 'image_browser': {
178
  // including thumbnails controller
179
  require_once(WDI_DIR . '/frontend/controllers/imagebrowser.php');
@@ -220,24 +225,24 @@ function wdi_register_frontend_scripts(){
220
  global $wdi_feed_item_onclick_type;
221
  if(WDI_MINIFY === true) {
222
  /* gallery fullscreeni het conflict chka ?? arje stugel ete fullscreen script ka, apa el chavelacnel */
223
- wp_register_script('wdi_gallery_box', WDI_FRONT_URL . '/js/gallerybox/wdi_gallery_box.min.js', array('jquery'), wdi_get_pro_version());
224
  if($wdi_feed_item_onclick_type) {
225
- wp_register_style('wdi_mCustomScrollbar', WDI_FRONT_URL . '/css/gallerybox/jquery.mCustomScrollbar.min.css', array(), wdi_get_pro_version());
226
  }
227
  } else {
228
  /* gallery fullscreeni het conflict chka ?? arje stugel ete fullscreen script ka, apa el chavelacnel */
229
- wp_register_script('wdi_gallery_box', WDI_FRONT_URL . '/js/gallerybox/wdi_gallery_box.js', array('jquery'), wdi_get_pro_version());
230
  if($wdi_feed_item_onclick_type) {
231
- wp_register_style('wdi_mCustomScrollbar', WDI_FRONT_URL . '/css/gallerybox/jquery.mCustomScrollbar.css', array(), wdi_get_pro_version());
232
  }
233
  }
234
 
235
  // Styles/Scripts for popup.
236
- wp_register_script('jquery-mobile', WDI_FRONT_URL . '/js/gallerybox/jquery.mobile.js', array('jquery'), wdi_get_pro_version());
237
  if($wdi_feed_item_onclick_type) {
238
- wp_register_script('jquery-mCustomScrollbar', WDI_FRONT_URL . '/js/gallerybox/jquery.mCustomScrollbar.concat.min.js', array('jquery'), wdi_get_pro_version());
239
  }
240
- wp_register_script('jquery-fullscreen', WDI_FRONT_URL . '/js/gallerybox/jquery.fullscreen-0.4.1.js', array('jquery'), wdi_get_pro_version());
241
 
242
  //localize scrips
243
  $user_is_admin = current_user_can('manage_options');
18
  global $wdi_options;
19
  global $wdi_feed_counter;
20
  ob_start();
21
+ /*
22
+ // @Todo. This part must be changed. The update should be for every user.
23
  // Will access_token refresh in the last 30 dey.
24
  if ( !empty($wdi_options['wdi_access_token']) && !empty($wdi_options['wdi_start_in']) && !empty($wdi_options['wdi_expires_in']) ) {
25
  $expires_time = $wdi_options['wdi_start_in'] + $wdi_options['wdi_expires_in'] - (30 * 24 * 60 * 60);
27
  $refresh = WDILibrary::refresh_instagram_access_token();
28
  }
29
  }
30
+ // @Todo. This part must be changed. The expired should be for every user.
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  if ( !empty($wdi_options['wdi_access_token']) && !empty($wdi_options['wdi_start_in']) && !empty($wdi_options['wdi_expires_in']) ) {
32
  $expires_time = $wdi_options['wdi_start_in'] + $wdi_options['wdi_expires_in'] - (10 * 60);
33
  if ( time() >= $expires_time ) {
36
  return __('Error: Access token session has expired, please reauthorize access token.', "wd-instagram-feed");
37
  }
38
  }
39
+ */
40
  $feed_id = WDILibrary::get('feed_id', 0, 'intval');
41
  if ( $feed_id != 0 && $post->post_type === "wdi_instagram" && $widget_params === '' ) {
42
  if ( !is_array($atts) ) {
163
  $wdi_feed_counter++;
164
  break;
165
  }
166
+ case 'masonry': {
167
+ // including masonry controller
168
+ require_once(WDI_DIR . '/frontend/controllers/masonry.php');
169
+ $controller = new WDI_Masonry_controller();
170
+ $controller->execute($feed_row, $wdi_feed_counter);
171
+ $wdi_feed_counter++;
172
+ break;
173
+ }
174
+ case 'blog_style': {
175
+ // including thumbnails controller
176
+ require_once(WDI_DIR . '/frontend/controllers/blogstyle.php');
177
+ $controller = new WDI_BlogStyle_controller();
178
+ $controller->execute($feed_row, $wdi_feed_counter);
179
+ $wdi_feed_counter++;
180
+ break;
181
+ }
182
  case 'image_browser': {
183
  // including thumbnails controller
184
  require_once(WDI_DIR . '/frontend/controllers/imagebrowser.php');
225
  global $wdi_feed_item_onclick_type;
226
  if(WDI_MINIFY === true) {
227
  /* gallery fullscreeni het conflict chka ?? arje stugel ete fullscreen script ka, apa el chavelacnel */
228
+ wp_register_script('wdi_gallery_box', WDI_URL . '/js/gallerybox/wdi_gallery_box.min.js', array('jquery'), wdi_get_pro_version());
229
  if($wdi_feed_item_onclick_type) {
230
+ wp_register_style('wdi_mCustomScrollbar', WDI_URL . '/css/gallerybox/jquery.mCustomScrollbar.min.css', array(), wdi_get_pro_version());
231
  }
232
  } else {
233
  /* gallery fullscreeni het conflict chka ?? arje stugel ete fullscreen script ka, apa el chavelacnel */
234
+ wp_register_script('wdi_gallery_box', WDI_URL . '/js/gallerybox/wdi_gallery_box.js', array('jquery'), wdi_get_pro_version());
235
  if($wdi_feed_item_onclick_type) {
236
+ wp_register_style('wdi_mCustomScrollbar', WDI_URL . '/css/gallerybox/jquery.mCustomScrollbar.css', array(), wdi_get_pro_version());
237
  }
238
  }
239
 
240
  // Styles/Scripts for popup.
241
+ wp_register_script('jquery-mobile', WDI_URL . '/js/gallerybox/jquery.mobile.js', array('jquery'), wdi_get_pro_version());
242
  if($wdi_feed_item_onclick_type) {
243
+ wp_register_script('jquery-mCustomScrollbar', WDI_URL . '/js/gallerybox/jquery.mCustomScrollbar.concat.min.js', array('jquery'), wdi_get_pro_version());
244
  }
245
+ wp_register_script('jquery-fullscreen', WDI_URL . '/js/gallerybox/jquery.fullscreen-0.4.1.js', array('jquery'), wdi_get_pro_version());
246
 
247
  //localize scrips
248
  $user_is_admin = current_user_can('manage_options');
frontend/views/WDIViewGalleryBox.php CHANGED
@@ -17,7 +17,12 @@ class WDIViewGalleryBox {
17
  $feed_id = WDILibrary::get('feed_id', 0, 'intval', 'POST');
18
  $current_feed = $this->model->get_feed_row_data( $feed_id );
19
  $is_hashtag = false;
20
-
 
 
 
 
 
21
  $theme_row = WDILibrary::arrayToObject($this->model->get_theme_row_data($current_feed['theme_id']));
22
  $option_row = WDILibrary::arrayToObject($current_feed);
23
  $option_row->preload_images_count = 0;
@@ -34,8 +39,9 @@ class WDIViewGalleryBox {
34
  $current_image_index = WDILibrary::get('current_image_index', 0, 'intval', 'POST');
35
  $theme_id = (isset($current_feed['theme_id']) ? esc_html($current_feed['theme_id']) : 1);
36
 
37
- $carousel_media_row = WDILibrary::get('carousel_media_row', '', 'sanitize_text_field', 'POST');
38
- $carousel_media = json_decode(stripslashes($carousel_media_row), true);
 
39
  $carousel_media = is_array($carousel_media) ? $carousel_media : array();
40
 
41
  $thumb_width = WDILibrary::get('thumb_width', 90, 'floatval', 'GET');/*watch later*/
@@ -76,6 +82,7 @@ class WDIViewGalleryBox {
76
  $enable_image_google = (isset($current_feed['popup_enable_google']) ? esc_html($current_feed['popup_enable_google']) : 0);
77
  $enable_image_pinterest = (isset($current_feed['popup_enable_pinterest']) ? esc_html($current_feed['popup_enable_pinterest']) : 0);
78
  $enable_image_tumblr = (isset($current_feed['popup_enable_tumblr']) ? esc_html($current_feed['popup_enable_tumblr']) : 0);
 
79
  $image_right_click = (isset($current_feed['popup_image_right_click']) ? esc_html($current_feed['popup_image_right_click']) : 1);
80
 
81
  //$option_row = $this->model->get_option_row_data();
@@ -103,8 +110,9 @@ class WDIViewGalleryBox {
103
  $image_filmstrip_width = 0;
104
  }
105
 
106
-
107
- $json = isset($_POST['image_rows']) ? $_POST['image_rows'] : '';
 
108
  str_replace('"',"&quot;", $json);
109
 
110
  $image_rows = json_decode(stripslashes($json));
@@ -261,12 +269,16 @@ class WDIViewGalleryBox {
261
  }
262
 
263
  .wdi_image_info {
264
- <?php echo ((!$enable_image_filmstrip || $theme_row->lightbox_filmstrip_pos != 'bottom') && $theme_row->lightbox_ctrl_btn_pos == 'bottom' && $theme_row->lightbox_info_pos == 'bottom') ? 'bottom: ' . ($theme_row->lightbox_ctrl_btn_height + 2 * $theme_row->lightbox_ctrl_btn_margin_top) . 'px;' : '' ?>
265
- width: 33%;
266
- margin: <?php echo $theme_row->lightbox_info_margin; ?>;
267
- <?php echo ((!$enable_image_filmstrip || $theme_row->lightbox_filmstrip_pos != 'top') && $theme_row->lightbox_ctrl_btn_pos == 'top' && $theme_row->lightbox_info_pos == 'top') ? 'top: ' . ($theme_row->lightbox_ctrl_btn_height + 2 * $theme_row->lightbox_ctrl_btn_margin_top) . 'px;' : '' ?>
268
- }
269
- </style>
 
 
 
 
270
  <script>
271
  var event_stack = [];
272
  <?php
@@ -332,7 +344,7 @@ class WDIViewGalleryBox {
332
  </div>
333
  <?php
334
  }
335
-
336
  if ($enable_image_ctrl_btn) {
337
  $share_url = add_query_arg(array('action' => 'Share', 'curr_url' => $current_url, 'image_id' => $current_image_id), admin_url('admin-ajax.php')) . '#wdi' . $gallery_id . '/' . $current_image_id;
338
  ?>
@@ -341,7 +353,7 @@ class WDIViewGalleryBox {
341
  if ($option_row->show_image_counts) {
342
  ?>
343
  <span class="wdi_image_count_container wdi_ctrl_btn">
344
- <span class="wdi_image_count"><?php echo $current_image_key + 1; ?></span> /
345
  <span><?php echo $image_rows_count; ?></span>
346
  </span>
347
  <?php
@@ -356,10 +368,13 @@ class WDIViewGalleryBox {
356
  }
357
  ?>
358
  <i title="<?php echo __('Fullscreen', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_fullscreen tenweb-i tenweb-i-arrows-out"></i>
 
 
359
  <?php }
360
  // @TօDօ API Changes 2020
361
- ?>
362
- <?php if ($popup_enable_rate) { ?>
 
363
  <i title="<?php echo __('Show rating', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_rate tenweb-i tenweb-i-star"></i>
364
  <?php }
365
  $is_embed = preg_match('/EMBED/', $current_filetype) == 1 ? TRUE : FALSE;
@@ -393,6 +408,23 @@ class WDIViewGalleryBox {
393
  <?php
394
  }
395
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
396
 
397
  if ($option_row->popup_enable_fullsize_image) {
398
  ?>
@@ -420,7 +452,7 @@ class WDIViewGalleryBox {
420
  $download_href = $current_filename;
421
  }
422
 
423
-
424
  $style = 'inline-block';
425
  }
426
  ?>
@@ -434,11 +466,11 @@ class WDIViewGalleryBox {
434
  <div class="wdi_toggle_container">
435
  <i class="wdi_toggle_btn tenweb-i <?php echo (($theme_row->lightbox_ctrl_btn_pos == 'top') ? 'tenweb-i-angle-up' : 'tenweb-i-angle-down'); ?>"></i>
436
  </div>
437
-
438
  <?php } ?>
439
  </div>
440
- <?php
441
- }
442
  $current_pos = 0;
443
 
444
  if($enable_image_filmstrip) {
@@ -467,23 +499,24 @@ class WDIViewGalleryBox {
467
  </span>
468
  </div>
469
  </div>
470
-
471
  <div class="wdi_slide_container">
472
  <div class="wdi_slide_bg">
473
  <div class="wdi_slider">
474
- <?php
475
- $current_key = -6;
476
- foreach ($image_rows as $key => $image_row) {
477
- if (strpos($image_row->filename, 'https://') === false) {
478
- $image_row->filename = sanitize_text_field($image_row->filename);
479
- } else {
480
- $image_row->filename = esc_url_raw($image_row->filename);
481
- }
482
- $is_embed = preg_match('/EMBED/',sanitize_text_field($image_row->filetype))==1 ? true :false;
483
- if (intval($image_row->id) == intval($current_image_id) ) {
484
- $current_key = $current_image_index;
485
- ?>
486
- <span class="wdi_popup_image_spun" id="wdi_popup_image" image_id="<?php echo intval($image_row->id); ?>">
 
487
  <span class="wdi_popup_image_spun1" style="display: table; width: inherit; height: inherit;">
488
  <span class="wdi_popup_image_spun2" style="display: table-cell; vertical-align: middle; text-align: center;">
489
  <?php
@@ -501,11 +534,11 @@ class WDIViewGalleryBox {
501
  </span>
502
  <?php
503
  }
504
- ?>
505
  </span>
506
  </span>
507
  </span>
508
- <span class="wdi_popup_image_second_spun">
509
  </span>
510
  <input type="hidden" id="wdi_current_image_key" value="<?php echo $current_image_index; ?>" />
511
  <?php
@@ -627,11 +660,11 @@ class WDIViewGalleryBox {
627
  jQuery(this)[0].contentWindow.postMessage('{ "method": "pause" }', "*");
628
  jQuery(this)[0].contentWindow.postMessage('pause', '*');
629
  });
630
-
631
  if (typeof wdi_data[key] != 'undefined') {
632
  if (typeof wdi_data[current_key] != 'undefined') {
633
  if (jQuery('.wdi_ctrl_btn').hasClass('tenweb-i-pause')) {
634
-
635
  wdi_play();
636
  }
637
  if (!from_effect) {
@@ -673,7 +706,7 @@ class WDIViewGalleryBox {
673
  jQuery(".wdi_image_hits span").html(++wdi_data[key]["hit_count"]);
674
  /* Change image id.*/
675
  jQuery("#wdi_popup_image").attr('image_id', wdi_data[key]["id"]);
676
-
677
 
678
  //creating image title template
679
  var wdi_title_div = jQuery('<div class="wdi_title"></div>').on('click',function(){window.open('//instagram.com/'+wdi_data[key]['username'],'_blank');});
@@ -697,7 +730,7 @@ class WDIViewGalleryBox {
697
  for(var i = 0; i < wdi_data[key]['carousel_media'].length; i++){
698
  var attr_class = (i == 0 ? "active" : (i > 9 ? "small" : ""));
699
  carousel += '<span class="' + attr_class + '" data-id="' + i + '"></span>';
700
- }
701
  carousel += '</div></div>';
702
  }
703
  jQuery(".wdi_btn_container").prepend(carousel);
@@ -706,7 +739,7 @@ class WDIViewGalleryBox {
706
  jQuery(".wdi_carousel_btn_container").remove();
707
  }
708
  }
709
-
710
  /* Change image title, description.*/
711
  jQuery(".wdi_image_title").html(jQuery('<span style="display: block;" />').append(wdi_title_div));
712
  jQuery(".wdi_image_description").html(jQuery('<span style="display: block;" />').text(wdi_data[key]["description"]).text());
@@ -731,9 +764,7 @@ class WDIViewGalleryBox {
731
  }
732
  var current_image_class = jQuery(".wdi_popup_image_spun").css("zIndex") == 2 ? ".wdi_popup_image_spun" : ".wdi_popup_image_second_spun";
733
  var next_image_class = current_image_class == ".wdi_popup_image_second_spun" ? ".wdi_popup_image_spun" : ".wdi_popup_image_second_spun";
734
-
735
  var is_embed = wdi_data[key]['filetype'].indexOf("EMBED_") > -1 ? true : false;
736
- var is_embed_instagram_post = wdi_data[key]['filetype'].indexOf('INSTAGRAM_POST') > -1 ? true :false;
737
  var cur_height = jQuery(current_image_class).height();
738
  var cur_width = jQuery(current_image_class).width();
739
  var innhtml = '<span class="wdi_popup_image_spun1" style="display: table; width: inherit; height: inherit;"><span class="wdi_popup_image_spun2" style="display: table-cell; vertical-align: middle; text-align: center;">';
@@ -741,32 +772,14 @@ class WDIViewGalleryBox {
741
  innhtml += '<img style="max-height: ' + cur_height + 'px; max-width: ' + cur_width + 'px;" class="wdi_popup_image wdi_popup_watermark" src="<?php echo site_url() . '/' . $WD_WDI_UPLOAD_DIR; ?>' + jQuery('<span style="display: block;" />').html(wdi_data[key]["image_url"]).text() + '" alt="' + wdi_data[key]["alt"] + '" />';
742
  }
743
  else { /*is_embed*/
744
-
745
  innhtml += '<span style="display:table; table-layout:fixed; height: ' + cur_height + 'px; width: ' + cur_width + 'px;" class="wdi_popup_embed wdi_popup_watermark" >';
746
- if(is_embed_instagram_post){
747
- var post_width = 0;
748
- var post_height = 0;
749
- if(cur_height <cur_width +88 ){
750
- post_height = cur_height;
751
- post_width = post_height -88;
752
- }
753
- else{
754
- post_width = cur_width;
755
- post_height = post_width +88 ;
756
- }
757
- innhtml += wdi_spider_display_embed(wdi_data[key]['filetype'], wdi_data[key]['filename'], wdi_data[key]['src'], {class:"wdi_embed_frame", frameborder:"0", allowfullscreen:"allowfullscreen", style:"width:"+post_width+"px; height:"+post_height+"px; vertical-align:middle; display:inline-block; position:relative; top: "+0.5*(cur_height-post_height)+ "px; " },wdi_data[key]['carousel_media']);
758
- }
759
- else{
760
- innhtml += wdi_spider_display_embed(wdi_data[key]['filetype'], wdi_data[key]['filename'], wdi_data[key]['src'], {class:"wdi_embed_frame", frameborder:"0", allowfullscreen:"allowfullscreen", style:"width:inherit; height:inherit; vertical-align:middle; display:table-cell;" },wdi_data[key]['carousel_media']);
761
- }
762
  innhtml += "</span>";
763
  }
764
  innhtml += '</span></span>';
765
  jQuery(next_image_class).html(innhtml);
766
-
767
- function wdi_afterload() {
768
-
769
 
 
770
  //setting max-heigth for custom scrollbar
771
  var wdi_desc_max_height = jQuery('.wdi_image_info_container1').height()-jQuery(".wdi_ctrl_btn_container").height()-parseInt(jQuery('.wdi_image_info').css('margin-bottom'))-parseInt(jQuery('.wdi_image_info').css('padding-bottom'));
772
  jQuery('.wdi_image_info').css('max-height',wdi_desc_max_height);
@@ -801,7 +814,7 @@ class WDIViewGalleryBox {
801
  jQuery("#wdi_download").attr("download", image_arr[image_arr.length - 1]);
802
  /* Change image social networks urls.*/
803
  var wdi_share_url = encodeURIComponent("<?php echo add_query_arg(array('action' => 'Share', 'curr_url' => $current_url, 'image_id' => ''), admin_url('admin-ajax.php')); ?>") + "=" + wdi_data[key]['id'] + encodeURIComponent('#wdi<?php echo $gallery_id; ?>/') + wdi_data[key]['id'];
804
-
805
  if (is_embed) {
806
  var wdi_share_image_url = encodeURIComponent(wdi_data[key]['thumb_url']);
807
  }
@@ -951,7 +964,7 @@ class WDIViewGalleryBox {
951
  });
952
 
953
  jQuery(".wdi_image_container").css({height: (<?php echo $image_height - ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>)});
954
-
955
  jQuery(".wdi_popup_image").css({
956
  maxHeight: <?php echo $image_height - ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>
957
  });
@@ -973,7 +986,7 @@ class WDIViewGalleryBox {
973
  zIndex: 100000
974
  });
975
  jQuery(".wdi_image_container").css({height: (jQuery(window).height() - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>)});
976
-
977
  jQuery(".wdi_popup_image").css({
978
  maxHeight: jQuery(window).height() - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>
979
  });
@@ -996,7 +1009,7 @@ class WDIViewGalleryBox {
996
  });
997
  jQuery(".wdi_image_wrap").css({width: <?php echo $image_width; ?> - comment_container_width});
998
  jQuery(".wdi_image_container").css({width: (<?php echo $image_width - ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?> - comment_container_width)});
999
-
1000
  jQuery(".wdi_popup_image").css({
1001
  maxWidth: <?php echo $image_width - ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?> - comment_container_width
1002
  });
@@ -1019,7 +1032,7 @@ class WDIViewGalleryBox {
1019
  });
1020
  jQuery(".wdi_image_wrap").css({width: (jQuery(window).width() - comment_container_width)});
1021
  jQuery(".wdi_image_container").css({width: (jQuery(window).width() - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?> - comment_container_width)});
1022
-
1023
  jQuery(".wdi_popup_image").css({
1024
  maxWidth: jQuery(window).width() - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?> - comment_container_width
1025
  });
@@ -1060,7 +1073,7 @@ class WDIViewGalleryBox {
1060
  function wdi_comment() {
1061
 
1062
  if (jQuery(".wdi_comment_container").hasClass("wdi_open")) {
1063
-
1064
  /* Close comment.*/
1065
  var border_width = parseInt(jQuery(".wdi_comment_container").css('borderRightWidth'));
1066
  if (!border_width) {
@@ -1083,7 +1096,7 @@ class WDIViewGalleryBox {
1083
  width: jQuery("#wdi_spider_popup_wrap").width() - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>
1084
  }, {
1085
  duration: 500,
1086
- complete: function () {
1087
  wdi_resize_instagram_post();
1088
  wdi_change_watermark_container(); }
1089
  });
@@ -1128,7 +1141,7 @@ class WDIViewGalleryBox {
1128
  width: jQuery("#wdi_spider_popup_wrap").width() - jQuery(".wdi_comment_container").width() - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>
1129
  }, {
1130
  duration: 500,
1131
- complete: function () {
1132
  wdi_resize_instagram_post();
1133
  wdi_change_watermark_container(); }
1134
  });
@@ -1139,7 +1152,7 @@ class WDIViewGalleryBox {
1139
  jQuery(".wdi_comment_container").attr("class", "wdi_comment_container wdi_open");
1140
  jQuery(".wdi_comment").attr("title", "<?php echo __('Hide Comments', "wd-instagram-feed"); ?>");
1141
  /* Load comments.*/
1142
-
1143
  var cur_image_key = parseInt(jQuery("#wdi_current_image_key").val());
1144
  if (wdi_data[cur_image_key]["comment_count"] != 0) {
1145
  jQuery("#wdi_added_comments").show();/*deprecated*/
@@ -1191,12 +1204,12 @@ class WDIViewGalleryBox {
1191
  wdi_reset_zoom();
1192
  var isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
1193
  var wdi_click = isMobile ? 'touchend' : 'click';
1194
-
1195
  /*Carousel Media*/
1196
  jQuery("body").on(wdi_click, ".wdi_carousel_btn_container span", function () {
1197
  if(jQuery("video.carousel_media.active").length){
1198
  jQuery("video.carousel_media.active").get(0).pause();
1199
- }
1200
  var id = jQuery(this).data("id");
1201
  jQuery(this).closest(".wdi_carousel_btn_container").find("span").removeClass("active");
1202
  jQuery(this).addClass("active");
@@ -1205,10 +1218,10 @@ class WDIViewGalleryBox {
1205
  return false;
1206
  });
1207
  var left = 0;
1208
- var step = 19;
1209
  jQuery("body").on(wdi_click, ".wdi_carousel_btn_container span.small", function () {
1210
- jQuery(".wdi_carousel_btn_content").css({"width":"122px","padding-left":step + "px"});
1211
- var index = jQuery(this).index();
1212
  if(!jQuery(this).next("span").length || jQuery(this).next("span.small").length){
1213
  left = left - step;
1214
  jQuery(".wdi_carousel_btn_container span").css("left", left + "px");
@@ -1221,13 +1234,12 @@ class WDIViewGalleryBox {
1221
  jQuery(this).removeClass("small");
1222
  return false;
1223
  });
1224
-
1225
  jQuery("#wdi_spider_popup_left").on(wdi_click, function () {
1226
  wdi_change_image(parseInt(jQuery('#wdi_current_image_key').val()), (parseInt(jQuery('#wdi_current_image_key').val()) + wdi_data.length - 1) % wdi_data.length, wdi_data);
1227
  return false;
1228
  });
1229
  jQuery("#wdi_spider_popup_right").on(wdi_click, function () {
1230
-
1231
  wdi_change_image(parseInt(jQuery('#wdi_current_image_key').val()), (parseInt(jQuery('#wdi_current_image_key').val()) + 1) % wdi_data.length, wdi_data);
1232
  return false;
1233
  });
@@ -1335,7 +1347,7 @@ class WDIViewGalleryBox {
1335
  if (jQuery(".wdi_image_info_container1").css("display") == 'none') {
1336
  jQuery(".wdi_image_info_container1").css("display", "table-cell");
1337
  jQuery(".wdi_info").attr("title", "<?php echo __('Hide info', "wd-instagram-feed"); ?>");
1338
-
1339
 
1340
 
1341
  if(!jQuery('.wdi_image_info').hasClass('mCustomScrollbar')){
@@ -1343,7 +1355,7 @@ class WDIViewGalleryBox {
1343
  jQuery('.wdi_image_info').css('max-height',wdi_desc_max_height+"px");
1344
  jQuery('.wdi_image_info').mCustomScrollbar({scrollInertia: 250});
1345
  }
1346
-
1347
 
1348
  }
1349
  else {
@@ -1351,7 +1363,7 @@ class WDIViewGalleryBox {
1351
  jQuery(".wdi_info").attr("title", "<?php echo __('Show info', "wd-instagram-feed"); ?>");
1352
  }
1353
 
1354
-
1355
  });
1356
  /* Show/hide image rating.*/
1357
  jQuery(".wdi_rate").on(wdi_click, function() {
@@ -1385,7 +1397,7 @@ class WDIViewGalleryBox {
1385
  jQuery(".wdi_image_info").animate({top: 0}, 500);
1386
  <?php
1387
  }
1388
-
1389
  ?>
1390
  jQuery(".wdi_ctrl_btn_container").animate({<?php echo $theme_row->lightbox_ctrl_btn_pos; ?>: '-' + jQuery(".wdi_ctrl_btn_container").height() - 16}, 500);
1391
  jQuery(".wdi_carousel_btn_container").animate({<?php echo $theme_row->lightbox_ctrl_btn_pos; ?>: '40px'}, 500);
@@ -1409,7 +1421,7 @@ class WDIViewGalleryBox {
1409
  jQuery(".wdi_image_info").animate({top: jQuery(".wdi_ctrl_btn_container").height()}, 500);
1410
  <?php
1411
  }
1412
-
1413
  ?>
1414
  jQuery(".wdi_ctrl_btn_container").animate({<?php echo $theme_row->lightbox_ctrl_btn_pos; ?>: 0}, 500);
1415
  jQuery(".wdi_carousel_btn_container").animate({<?php echo $theme_row->lightbox_ctrl_btn_pos; ?>: jQuery(".wdi_ctrl_btn_container").height() + 25}, 500);
@@ -1513,7 +1525,7 @@ class WDIViewGalleryBox {
1513
  height: jQuery(window).height() - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>
1514
  }, {
1515
  duration: 500,
1516
- complete: function () {
1517
  wdi_resize_instagram_post();
1518
  wdi_change_watermark_container(); }
1519
  });
@@ -1561,7 +1573,7 @@ class WDIViewGalleryBox {
1561
  });
1562
  jQuery(".wdi_image_wrap").css({width: wdi_popup_current_width - comment_container_width});
1563
  jQuery(".wdi_image_container").css({height: wdi_popup_current_height - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>, width: wdi_popup_current_width - comment_container_width - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>});
1564
-
1565
  /*jQuery(".wdi_slide_bg").css({height: wdi_popup_current_height - <?php /*echo $image_filmstrip_height;*/ ?>});
1566
  jQuery(".wdi_popup_image_spun1").css({height: wdi_popup_current_height - <?php /*echo $image_filmstrip_height;*/ ?>});*/
1567
  jQuery(".wdi_popup_image").css({
@@ -1687,7 +1699,12 @@ class WDIViewGalleryBox {
1687
 
1688
  //if info is displayed by defult then double trigger
1689
  //info click for displaying it with proper scrollbar
1690
-
 
 
 
 
 
1691
 
1692
 
1693
  });
17
  $feed_id = WDILibrary::get('feed_id', 0, 'intval', 'POST');
18
  $current_feed = $this->model->get_feed_row_data( $feed_id );
19
  $is_hashtag = false;
20
+ if(isset($current_feed["thumb_user"]) && !empty($current_feed["thumb_user"])){
21
+ $first_char = mb_substr($current_feed["thumb_user"], 0, 1);
22
+ if($first_char === "#"){
23
+ $is_hashtag = true;
24
+ }
25
+ }
26
  $theme_row = WDILibrary::arrayToObject($this->model->get_theme_row_data($current_feed['theme_id']));
27
  $option_row = WDILibrary::arrayToObject($current_feed);
28
  $option_row->preload_images_count = 0;
39
  $current_image_index = WDILibrary::get('current_image_index', 0, 'intval', 'POST');
40
  $theme_id = (isset($current_feed['theme_id']) ? esc_html($current_feed['theme_id']) : 1);
41
 
42
+ $carousel_media_row = $_POST["carousel_media_row"];
43
+ $carousel_media = json_decode(stripslashes($carousel_media_row), true);
44
+ $carousel_media = WDILibrary::get('', $carousel_media, 'sanitize_text_field', '');
45
  $carousel_media = is_array($carousel_media) ? $carousel_media : array();
46
 
47
  $thumb_width = WDILibrary::get('thumb_width', 90, 'floatval', 'GET');/*watch later*/
82
  $enable_image_google = (isset($current_feed['popup_enable_google']) ? esc_html($current_feed['popup_enable_google']) : 0);
83
  $enable_image_pinterest = (isset($current_feed['popup_enable_pinterest']) ? esc_html($current_feed['popup_enable_pinterest']) : 0);
84
  $enable_image_tumblr = (isset($current_feed['popup_enable_tumblr']) ? esc_html($current_feed['popup_enable_tumblr']) : 0);
85
+ $enable_share_buttons = (isset($current_feed['popup_enable_share_buttons']) ? esc_html($current_feed['popup_enable_share_buttons']) : 1);
86
  $image_right_click = (isset($current_feed['popup_image_right_click']) ? esc_html($current_feed['popup_image_right_click']) : 1);
87
 
88
  //$option_row = $this->model->get_option_row_data();
110
  $image_filmstrip_width = 0;
111
  }
112
 
113
+ //$json = (($_POST['image_rows']));
114
+ //$json = WDILibrary::get('image_rows', '', 'sanitize_text_field', 'POST');
115
+ $json = $_POST['image_rows'];
116
  str_replace('"',"&quot;", $json);
117
 
118
  $image_rows = json_decode(stripslashes($json));
269
  }
270
 
271
  .wdi_image_info {
272
+ <?php echo ((!$enable_image_filmstrip || $theme_row->lightbox_filmstrip_pos != 'bottom') && $theme_row->lightbox_ctrl_btn_pos == 'bottom' && $theme_row->lightbox_info_pos == 'bottom') ? 'bottom: ' . ($theme_row->lightbox_ctrl_btn_height + 2 * $theme_row->lightbox_ctrl_btn_margin_top) . 'px;' : '' ?>
273
+ <?php if($params_array['popup_info_full_width']) { ?>
274
+ width: 100%;
275
+ <?php } else { ?>
276
+ width: 33%;
277
+ margin: <?php echo $theme_row->lightbox_info_margin; ?>;
278
+ <?php } ?>
279
+ <?php echo ((!$enable_image_filmstrip || $theme_row->lightbox_filmstrip_pos != 'top') && $theme_row->lightbox_ctrl_btn_pos == 'top' && $theme_row->lightbox_info_pos == 'top') ? 'top: ' . ($theme_row->lightbox_ctrl_btn_height + 2 * $theme_row->lightbox_ctrl_btn_margin_top) . 'px;' : '' ?>
280
+ }
281
+ </style>
282
  <script>
283
  var event_stack = [];
284
  <?php
344
  </div>
345
  <?php
346
  }
347
+
348
  if ($enable_image_ctrl_btn) {
349
  $share_url = add_query_arg(array('action' => 'Share', 'curr_url' => $current_url, 'image_id' => $current_image_id), admin_url('admin-ajax.php')) . '#wdi' . $gallery_id . '/' . $current_image_id;
350
  ?>
353
  if ($option_row->show_image_counts) {
354
  ?>
355
  <span class="wdi_image_count_container wdi_ctrl_btn">
356
+ <span class="wdi_image_count"><?php echo $current_image_key + 1; ?></span> /
357
  <span><?php echo $image_rows_count; ?></span>
358
  </span>
359
  <?php
368
  }
369
  ?>
370
  <i title="<?php echo __('Fullscreen', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_fullscreen tenweb-i tenweb-i-arrows-out"></i>
371
+ <?php } if ($popup_enable_info) { ?>
372
+ <i title="<?php echo __('Show Caption', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_info tenweb-i tenweb-i-info-circle"></i>
373
  <?php }
374
  // @TօDօ API Changes 2020
375
+ if ( $enable_comment_social && !$is_hashtag ) { ?>
376
+ <i title="<?php echo __('Show comments', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_comment tenweb-i tenweb-i-comment-square"></i>
377
+ <?php } if ($popup_enable_rate) { ?>
378
  <i title="<?php echo __('Show rating', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_rate tenweb-i tenweb-i-star"></i>
379
  <?php }
380
  $is_embed = preg_match('/EMBED/', $current_filetype) == 1 ? TRUE : FALSE;
408
  <?php
409
  }
410
 
411
+ if ($enable_share_buttons) {
412
+ ?>
413
+ <span class="wdi_share_btns_container">
414
+ <i onclick="jQuery(this).parent().find('.wdi_share_btns').toggleClass('wdi_share_toggler');jQuery(this).parent().find('.wdi_share_caret').toggleClass('wdi_share_toggler')" title="<?php echo __('Share', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn tenweb-i tenweb-i-share"></i>
415
+ <p class="wdi_share_btns" style="display:none">
416
+ <a id="wdi_popup_fb" href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $current_image_url;?>" target="_blank" class='wdi_share_popup_btn wdi_facebook tenweb-i tenweb-i-facebook-square'></a>
417
+ <a id="wdi_popup_tw" href="https://twitter.com/home?status=<?php echo $current_image_url;?>" target="_blank" class='wdi_share_popup_btn wdi_twitter tenweb-i tenweb-i-twitter-square'></a>
418
+ <a id="wdi_popup_li" href="https://www.linkedin.com/shareArticle?mini=true&url=<?php echo $current_image_url;?>&title=<?php echo $current_image_description?>" target="_blank" class='wdi_share_popup_btn wdi_linkedin tenweb-i tenweb-i-linkedin'></a>
419
+ <a id="wdi_popup_pt" href="https://pinterest.com/pin/create/button/?url=<?php echo $current_image_url;?>&media=<?php echo $current_image_url;?>media/?size=l&description=<?php echo $current_image_description?>" target="_blank" class='wdi_share_popup_btn wdi_pinterest tenweb-i tenweb-i-pinterest-square'></a>
420
+ </p>
421
+ <i class="wdi_share_caret " style="display:none;"></i>
422
+ </span>
423
+
424
+
425
+ <?php
426
+ }
427
+
428
 
429
  if ($option_row->popup_enable_fullsize_image) {
430
  ?>
452
  $download_href = $current_filename;
453
  }
454
 
455
+
456
  $style = 'inline-block';
457
  }
458
  ?>
466
  <div class="wdi_toggle_container">
467
  <i class="wdi_toggle_btn tenweb-i <?php echo (($theme_row->lightbox_ctrl_btn_pos == 'top') ? 'tenweb-i-angle-up' : 'tenweb-i-angle-down'); ?>"></i>
468
  </div>
469
+
470
  <?php } ?>
471
  </div>
472
+ <?php
473
+ }
474
  $current_pos = 0;
475
 
476
  if($enable_image_filmstrip) {
499
  </span>
500
  </div>
501
  </div>
502
+
503
  <div class="wdi_slide_container">
504
  <div class="wdi_slide_bg">
505
  <div class="wdi_slider">
506
+ <?php
507
+ $current_key = -6;
508
+ foreach ($image_rows as $key => $image_row) {
509
+ if (strpos($image_row->filename, 'https://') === false) {
510
+ $image_row->filename = sanitize_text_field($image_row->filename);
511
+ }
512
+ else {
513
+ $image_row->filename = esc_url_raw($image_row->filename);
514
+ }
515
+ $is_embed = preg_match('/EMBED/',sanitize_text_field($image_row->filetype))==1 ? true :false;
516
+ if (intval($image_row->id) == intval($current_image_id) ) {
517
+ $current_key = $current_image_index;
518
+ ?>
519
+ <span class="wdi_popup_image_spun" id="wdi_popup_image" image_id="<?php echo intval($image_row->id); ?>">
520
  <span class="wdi_popup_image_spun1" style="display: table; width: inherit; height: inherit;">
521
  <span class="wdi_popup_image_spun2" style="display: table-cell; vertical-align: middle; text-align: center;">
522
  <?php
534
  </span>
535
  <?php
536
  }
537
+ ?>
538
  </span>
539
  </span>
540
  </span>
541
+ <span class="wdi_popup_image_second_spun">
542
  </span>
543
  <input type="hidden" id="wdi_current_image_key" value="<?php echo $current_image_index; ?>" />
544
  <?php
660
  jQuery(this)[0].contentWindow.postMessage('{ "method": "pause" }', "*");
661
  jQuery(this)[0].contentWindow.postMessage('pause', '*');
662
  });
663
+
664
  if (typeof wdi_data[key] != 'undefined') {
665
  if (typeof wdi_data[current_key] != 'undefined') {
666
  if (jQuery('.wdi_ctrl_btn').hasClass('tenweb-i-pause')) {
667
+
668
  wdi_play();
669
  }
670
  if (!from_effect) {
706
  jQuery(".wdi_image_hits span").html(++wdi_data[key]["hit_count"]);
707
  /* Change image id.*/
708
  jQuery("#wdi_popup_image").attr('image_id', wdi_data[key]["id"]);
709
+
710
 
711
  //creating image title template
712
  var wdi_title_div = jQuery('<div class="wdi_title"></div>').on('click',function(){window.open('//instagram.com/'+wdi_data[key]['username'],'_blank');});
730
  for(var i = 0; i < wdi_data[key]['carousel_media'].length; i++){
731
  var attr_class = (i == 0 ? "active" : (i > 9 ? "small" : ""));
732
  carousel += '<span class="' + attr_class + '" data-id="' + i + '"></span>';
733
+ }
734
  carousel += '</div></div>';
735
  }
736
  jQuery(".wdi_btn_container").prepend(carousel);
739
  jQuery(".wdi_carousel_btn_container").remove();
740
  }
741
  }
742
+
743
  /* Change image title, description.*/
744
  jQuery(".wdi_image_title").html(jQuery('<span style="display: block;" />').append(wdi_title_div));
745
  jQuery(".wdi_image_description").html(jQuery('<span style="display: block;" />').text(wdi_data[key]["description"]).text());
764
  }
765
  var current_image_class = jQuery(".wdi_popup_image_spun").css("zIndex") == 2 ? ".wdi_popup_image_spun" : ".wdi_popup_image_second_spun";
766
  var next_image_class = current_image_class == ".wdi_popup_image_second_spun" ? ".wdi_popup_image_spun" : ".wdi_popup_image_second_spun";
 
767
  var is_embed = wdi_data[key]['filetype'].indexOf("EMBED_") > -1 ? true : false;
 
768
  var cur_height = jQuery(current_image_class).height();
769
  var cur_width = jQuery(current_image_class).width();
770
  var innhtml = '<span class="wdi_popup_image_spun1" style="display: table; width: inherit; height: inherit;"><span class="wdi_popup_image_spun2" style="display: table-cell; vertical-align: middle; text-align: center;">';
772
  innhtml += '<img style="max-height: ' + cur_height + 'px; max-width: ' + cur_width + 'px;" class="wdi_popup_image wdi_popup_watermark" src="<?php echo site_url() . '/' . $WD_WDI_UPLOAD_DIR; ?>' + jQuery('<span style="display: block;" />').html(wdi_data[key]["image_url"]).text() + '" alt="' + wdi_data[key]["alt"] + '" />';
773
  }
774
  else { /*is_embed*/
 
775
  innhtml += '<span style="display:table; table-layout:fixed; height: ' + cur_height + 'px; width: ' + cur_width + 'px;" class="wdi_popup_embed wdi_popup_watermark" >';
776
+ innhtml += wdi_spider_display_embed(wdi_data[key]['filetype'], wdi_data[key]['filename'], wdi_data[key]['src'], {class:"wdi_embed_frame", frameborder:"0", allowfullscreen:"allowfullscreen", style:"width:inherit; height:inherit; vertical-align:middle; display:table-cell;" },wdi_data[key]['carousel_media']);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
777
  innhtml += "</span>";
778
  }
779
  innhtml += '</span></span>';
780
  jQuery(next_image_class).html(innhtml);
 
 
 
781
 
782
+ function wdi_afterload() {
783
  //setting max-heigth for custom scrollbar
784
  var wdi_desc_max_height = jQuery('.wdi_image_info_container1').height()-jQuery(".wdi_ctrl_btn_container").height()-parseInt(jQuery('.wdi_image_info').css('margin-bottom'))-parseInt(jQuery('.wdi_image_info').css('padding-bottom'));
785
  jQuery('.wdi_image_info').css('max-height',wdi_desc_max_height);
814
  jQuery("#wdi_download").attr("download", image_arr[image_arr.length - 1]);
815
  /* Change image social networks urls.*/
816
  var wdi_share_url = encodeURIComponent("<?php echo add_query_arg(array('action' => 'Share', 'curr_url' => $current_url, 'image_id' => ''), admin_url('admin-ajax.php')); ?>") + "=" + wdi_data[key]['id'] + encodeURIComponent('#wdi<?php echo $gallery_id; ?>/') + wdi_data[key]['id'];
817
+
818
  if (is_embed) {
819
  var wdi_share_image_url = encodeURIComponent(wdi_data[key]['thumb_url']);
820
  }
964
  });
965
 
966
  jQuery(".wdi_image_container").css({height: (<?php echo $image_height - ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>)});
967
+
968
  jQuery(".wdi_popup_image").css({
969
  maxHeight: <?php echo $image_height - ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>
970
  });
986
  zIndex: 100000
987
  });
988
  jQuery(".wdi_image_container").css({height: (jQuery(window).height() - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>)});
989
+
990
  jQuery(".wdi_popup_image").css({
991
  maxHeight: jQuery(window).height() - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>
992
  });
1009
  });
1010
  jQuery(".wdi_image_wrap").css({width: <?php echo $image_width; ?> - comment_container_width});
1011
  jQuery(".wdi_image_container").css({width: (<?php echo $image_width - ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?> - comment_container_width)});
1012
+
1013
  jQuery(".wdi_popup_image").css({
1014
  maxWidth: <?php echo $image_width - ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?> - comment_container_width
1015
  });
1032
  });
1033
  jQuery(".wdi_image_wrap").css({width: (jQuery(window).width() - comment_container_width)});
1034
  jQuery(".wdi_image_container").css({width: (jQuery(window).width() - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?> - comment_container_width)});
1035
+
1036
  jQuery(".wdi_popup_image").css({
1037
  maxWidth: jQuery(window).width() - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?> - comment_container_width
1038
  });
1073
  function wdi_comment() {
1074
 
1075
  if (jQuery(".wdi_comment_container").hasClass("wdi_open")) {
1076
+
1077
  /* Close comment.*/
1078
  var border_width = parseInt(jQuery(".wdi_comment_container").css('borderRightWidth'));
1079
  if (!border_width) {
1096
  width: jQuery("#wdi_spider_popup_wrap").width() - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>
1097
  }, {
1098
  duration: 500,
1099
+ complete: function () {
1100
  wdi_resize_instagram_post();
1101
  wdi_change_watermark_container(); }
1102
  });
1141
  width: jQuery("#wdi_spider_popup_wrap").width() - jQuery(".wdi_comment_container").width() - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>
1142
  }, {
1143
  duration: 500,
1144
+ complete: function () {
1145
  wdi_resize_instagram_post();
1146
  wdi_change_watermark_container(); }
1147
  });
1152
  jQuery(".wdi_comment_container").attr("class", "wdi_comment_container wdi_open");
1153
  jQuery(".wdi_comment").attr("title", "<?php echo __('Hide Comments', "wd-instagram-feed"); ?>");
1154
  /* Load comments.*/
1155
+
1156
  var cur_image_key = parseInt(jQuery("#wdi_current_image_key").val());
1157
  if (wdi_data[cur_image_key]["comment_count"] != 0) {
1158
  jQuery("#wdi_added_comments").show();/*deprecated*/
1204
  wdi_reset_zoom();
1205
  var isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
1206
  var wdi_click = isMobile ? 'touchend' : 'click';
1207
+
1208
  /*Carousel Media*/
1209
  jQuery("body").on(wdi_click, ".wdi_carousel_btn_container span", function () {
1210
  if(jQuery("video.carousel_media.active").length){
1211
  jQuery("video.carousel_media.active").get(0).pause();
1212
+ }
1213
  var id = jQuery(this).data("id");
1214
  jQuery(this).closest(".wdi_carousel_btn_container").find("span").removeClass("active");
1215
  jQuery(this).addClass("active");
1218
  return false;
1219
  });
1220
  var left = 0;
1221
+ var step = 19;
1222
  jQuery("body").on(wdi_click, ".wdi_carousel_btn_container span.small", function () {
1223
+ jQuery(".wdi_carousel_btn_content").css({"width":"122px","padding-left":step + "px"});
1224
+ var index = jQuery(this).index();
1225
  if(!jQuery(this).next("span").length || jQuery(this).next("span.small").length){
1226
  left = left - step;
1227
  jQuery(".wdi_carousel_btn_container span").css("left", left + "px");
1234
  jQuery(this).removeClass("small");
1235
  return false;
1236
  });
1237
+
1238
  jQuery("#wdi_spider_popup_left").on(wdi_click, function () {
1239
  wdi_change_image(parseInt(jQuery('#wdi_current_image_key').val()), (parseInt(jQuery('#wdi_current_image_key').val()) + wdi_data.length - 1) % wdi_data.length, wdi_data);
1240
  return false;
1241
  });
1242
  jQuery("#wdi_spider_popup_right").on(wdi_click, function () {
 
1243
  wdi_change_image(parseInt(jQuery('#wdi_current_image_key').val()), (parseInt(jQuery('#wdi_current_image_key').val()) + 1) % wdi_data.length, wdi_data);
1244
  return false;
1245
  });
1347
  if (jQuery(".wdi_image_info_container1").css("display") == 'none') {
1348
  jQuery(".wdi_image_info_container1").css("display", "table-cell");
1349
  jQuery(".wdi_info").attr("title", "<?php echo __('Hide info', "wd-instagram-feed"); ?>");
1350
+
1351
 
1352
 
1353
  if(!jQuery('.wdi_image_info').hasClass('mCustomScrollbar')){
1355
  jQuery('.wdi_image_info').css('max-height',wdi_desc_max_height+"px");
1356
  jQuery('.wdi_image_info').mCustomScrollbar({scrollInertia: 250});
1357
  }
1358
+
1359
 
1360
  }
1361
  else {
1363
  jQuery(".wdi_info").attr("title", "<?php echo __('Show info', "wd-instagram-feed"); ?>");
1364
  }
1365
 
1366
+
1367
  });
1368
  /* Show/hide image rating.*/
1369
  jQuery(".wdi_rate").on(wdi_click, function() {
1397
  jQuery(".wdi_image_info").animate({top: 0}, 500);
1398
  <?php
1399
  }
1400
+
1401
  ?>
1402
  jQuery(".wdi_ctrl_btn_container").animate({<?php echo $theme_row->lightbox_ctrl_btn_pos; ?>: '-' + jQuery(".wdi_ctrl_btn_container").height() - 16}, 500);
1403
  jQuery(".wdi_carousel_btn_container").animate({<?php echo $theme_row->lightbox_ctrl_btn_pos; ?>: '40px'}, 500);
1421
  jQuery(".wdi_image_info").animate({top: jQuery(".wdi_ctrl_btn_container").height()}, 500);
1422
  <?php
1423
  }
1424
+
1425
  ?>
1426
  jQuery(".wdi_ctrl_btn_container").animate({<?php echo $theme_row->lightbox_ctrl_btn_pos; ?>: 0}, 500);
1427
  jQuery(".wdi_carousel_btn_container").animate({<?php echo $theme_row->lightbox_ctrl_btn_pos; ?>: jQuery(".wdi_ctrl_btn_container").height() + 25}, 500);
1525
  height: jQuery(window).height() - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>
1526
  }, {
1527
  duration: 500,
1528
+ complete: function () {
1529
  wdi_resize_instagram_post();
1530
  wdi_change_watermark_container(); }
1531
  });
1573
  });
1574
  jQuery(".wdi_image_wrap").css({width: wdi_popup_current_width - comment_container_width});
1575
  jQuery(".wdi_image_container").css({height: wdi_popup_current_height - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>, width: wdi_popup_current_width - comment_container_width - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>});
1576
+
1577
  /*jQuery(".wdi_slide_bg").css({height: wdi_popup_current_height - <?php /*echo $image_filmstrip_height;*/ ?>});
1578
  jQuery(".wdi_popup_image_spun1").css({height: wdi_popup_current_height - <?php /*echo $image_filmstrip_height;*/ ?>});*/
1579
  jQuery(".wdi_popup_image").css({
1699
 
1700
  //if info is displayed by defult then double trigger
1701
  //info click for displaying it with proper scrollbar
1702
+ if(<?php echo $popup_info_always_show?>){
1703
+ setTimeout(function(){
1704
+ jQuery(".wdi_info").trigger(wdi_click);
1705
+ jQuery(".wdi_info").trigger(wdi_click);
1706
+ },100);
1707
+ }
1708
 
1709
 
1710
  });
frontend/views/imagebrowser.php CHANGED
@@ -85,6 +85,10 @@ class WDI_ImageBrowser_view {
85
 
86
  break;
87
  }
 
 
 
 
88
  }
89
  ?>
90
  </div>
85
 
86
  break;
87
  }
88
+ case 'infinite_scroll': {
89
+ ?>
90
+ <div id="wdi_infinite_scroll" class="wdi_infinite_scroll"></div> <?php
91
+ }
92
  }
93
  ?>
94
  </div>
frontend/views/thumbnails.php CHANGED
@@ -94,6 +94,10 @@ class WDI_Thumbnails_view {
94
 
95
  break;
96
  }
 
 
 
 
97
  }
98
 
99
  ?>
94
 
95
  break;
96
  }
97
+ case 'infinite_scroll': {
98
+ ?>
99
+ <div id="wdi_infinite_scroll" class="wdi_infinite_scroll"></div> <?php
100
+ }
101
  }
102
 
103
  ?>
images/video_missing.png ADDED
Binary file
js/gallerybox/wdi_gallery_box.js CHANGED
@@ -45,12 +45,12 @@ function wdi_spider_createpopup(url, current_view, width, height, duration, desc
45
  },
46
  success: function (response) {
47
  var popup = jQuery(
48
- '<div id="wdi_spider_popup_wrap" class="wdi_spider_popup_wrap wdi_lightbox_theme_' + currentFeed.feed_row.theme_id + '" style="' +
49
- 'width:' + width + 'px;' +
50
- 'height:' + height + 'px;' +
51
- 'margin-top:-' + (height / 2) + 'px;' +
52
- 'margin-left: -' + (width / 2) + 'px; ">' + response +
53
- '</div>');
54
 
55
  var constructor = new wdi_construct_popup(popup, currentFeed, currentFeed.parsedData, image_id);
56
  constructor.construct();
@@ -69,9 +69,97 @@ var wdi_construct_popup = function (popup, currentFeed, image_rows, current_imag
69
  this.theme_row = {};
70
  this.construct = function () {
71
  this.theme_row = window['wdi_theme_' + currentFeed.feed_row.theme_id];
 
 
 
72
  this.set_wdi_data();
73
  };
74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  this.set_wdi_data = function () {
76
 
77
  wdi_data = [];
@@ -183,7 +271,7 @@ function wdi_spider_destroypopup(duration)
183
  Object.size = function (obj)
184
  {
185
  var size = 0,
186
- key;
187
  for (key in obj) {
188
  if (obj.hasOwnProperty(key)) size++;
189
  }
@@ -334,17 +422,17 @@ wdi_comments_manager = {
334
  jQuery('.wdi_comments').append(wdi_comments);
335
  jQuery('.wdi_comments').append(wdi_added_comments);
336
 
337
- if (typeof jQuery().mCustomScrollbar !== 'undefined') {
338
- if (jQuery.isFunction(jQuery().mCustomScrollbar)) {
339
- jQuery(".wdi_comments").mCustomScrollbar({
340
- scrollInertia: 250
341
- });
342
- }
343
- }
344
 
345
- ////
346
- jQuery('.wdi_comments_close_btn').on('click', wdi_comment);
347
- //binding click event for loading more commetn by ajax
348
 
349
 
350
  },
@@ -512,27 +600,27 @@ function wdi_captcha_refresh(id)
512
 
513
  function wdi_play_pause($this)
514
  {
515
- var is_chrome = navigator.userAgent.indexOf('Chrome') > -1;
516
- var is_safari = navigator.userAgent.indexOf("Safari") > -1;
517
- if ((is_chrome)&&(is_safari)) {is_safari=false;}
518
- if(is_safari){
519
- return;
520
- }
521
- var video = $this.get(0);
522
- var regex = /firefox/i;
523
- var firefox = false;
524
- if (navigator.userAgent.match(regex)) {
525
- firefox = true;
526
- }
527
- if (!firefox) {
528
-
529
- if (!video.paused) {
530
- video.pause();
531
- } else {
532
- video.play();
533
  }
 
534
 
535
- }
 
 
 
 
 
 
536
 
537
 
538
  }
@@ -596,6 +684,9 @@ function wdi_spider_display_embed( embed_type, embed_id, src, attrs, carousel_me
596
  ';" data-id="' + i + '" class="carousel_media ' + (i == 0 ? "active" : "") + '">';
597
  }
598
  else if ( carousel_media[i]["type"] == "video" ) {
 
 
 
599
  oembed_instagram_html += '<video onclick="wdi_play_pause(jQuery(this));" style="width:auto !important; height:auto !important; max-width:100% !important; max-height:100% !important; margin:0 !important;" controls data-id="' + i + '" class="carousel_media ' + (i == 0 ? "active" : "") + '">' +
600
  '<source src="' + src +
601
  '" type="video/mp4"> Your browser does not support the video tag. </video>';
@@ -647,7 +738,83 @@ function wdi_testDom(prop) {
647
  return false;
648
  }
649
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
650
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
651
 
652
  /* For browsers that does not support transitions.*/
653
  function wdi_fallback(current_image_class, next_image_class, direction) {
@@ -696,6 +863,200 @@ function wdi_fade(current_image_class, next_image_class, direction) {
696
  jQuery(next_image_class).fadeTo(wdi_transition_duration, 1);
697
  }
698
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
699
  function wdi_pause_stream(parent){
700
  jQuery(parent).find('video').each(function(){
701
  jQuery(this).get(0).pause();
45
  },
46
  success: function (response) {
47
  var popup = jQuery(
48
+ '<div id="wdi_spider_popup_wrap" class="wdi_spider_popup_wrap wdi_lightbox_theme_' + currentFeed.feed_row.theme_id + '" style="' +
49
+ 'width:' + width + 'px;' +
50
+ 'height:' + height + 'px;' +
51
+ 'margin-top:-' + (height / 2) + 'px;' +
52
+ 'margin-left: -' + (width / 2) + 'px; ">' + response +
53
+ '</div>');
54
 
55
  var constructor = new wdi_construct_popup(popup, currentFeed, currentFeed.parsedData, image_id);
56
  constructor.construct();
69
  this.theme_row = {};
70
  this.construct = function () {
71
  this.theme_row = window['wdi_theme_' + currentFeed.feed_row.theme_id];
72
+ if (currentFeed.feed_row.popup_enable_filmstrip && currentFeed.feed_row.popup_enable_filmstrip === "1") {
73
+ this.add_filmstrip();
74
+ }
75
  this.set_wdi_data();
76
  };
77
 
78
+ this.add_filmstrip = function () {
79
+
80
+ var filmstrip_direction = 'horizontal';
81
+ if (this.theme_row.lightbox_filmstrip_pos === 'right' || this.theme_row.lightbox_filmstrip_pos === 'left') {
82
+ filmstrip_direction = 'vertical';
83
+ }
84
+
85
+ var fa_class_name_1 = (filmstrip_direction === "horizontal") ? 'tenweb-i-angle-left' : 'tenweb-i-angle-up';
86
+ var fa_class_name_2 = (filmstrip_direction === "horizontal") ? 'tenweb-i-angle-right' : 'tenweb-i-angle-down';
87
+
88
+ // var thumb_width = 90;
89
+ // var thumb_height = 90;
90
+
91
+ var thumbnails_html = "";
92
+
93
+ var image_filmstrip_height,image_filmstrip_width;
94
+ if (filmstrip_direction === 'horizontal') {
95
+ image_filmstrip_width = image_filmstrip_height = (typeof currentFeed.feed_row['popup_filmstrip_height'] !== "undefined") ? (currentFeed.feed_row['popup_filmstrip_height']) : '20';
96
+ }
97
+ else {
98
+ image_filmstrip_width = image_filmstrip_height = (typeof currentFeed.feed_row['popup_filmstrip_height'] !== "undefined") ? (currentFeed.feed_row['popup_filmstrip_height']) : '50';
99
+ }
100
+
101
+ image_filmstrip_height = image_filmstrip_width = parseInt(image_filmstrip_width);
102
+
103
+ for (var i = 0; i < image_rows.length; i++) {
104
+ var image_row = image_rows[i];
105
+
106
+ var image_thumb_width,image_thumb_height,scale;
107
+ if (image_row.resolution && image_row.resolution !== '') {
108
+ var resolution_arr = image_row.resolution.split(" ");
109
+ var resolution_w = intval($resolution_arr[0]);
110
+ var resolution_h = intval($resolution_arr[2]);
111
+ if (resolution_w !== 0 && resolution_h !== 0) {
112
+ scale = Math.max(image_filmstrip_width / resolution_w, image_filmstrip_height / resolution_h);
113
+ image_thumb_width = resolution_w * scale;
114
+ image_thumb_height = resolution_h * scale;
115
+ }
116
+ else {
117
+ image_thumb_width = image_filmstrip_width;
118
+ image_thumb_height = image_filmstrip_height;
119
+ }
120
+ }
121
+ else {
122
+ image_thumb_width = image_filmstrip_width;
123
+ image_thumb_height = image_filmstrip_height;
124
+ }
125
+
126
+ scale = Math.max(image_filmstrip_width / image_thumb_width, image_filmstrip_height / image_thumb_height);
127
+ image_thumb_width *= scale;
128
+ image_thumb_height *= scale;
129
+ var thumb_left = (image_filmstrip_width - image_thumb_width) / 2;
130
+ var thumb_top = (image_filmstrip_height - image_thumb_height) / 2;
131
+
132
+ var class_name = "wdi_filmstrip_thumbnail " + ((parseInt(image_row.id) === parseInt(current_image_id)) ? 'wdi_thumb_active' : 'wdi_thumb_deactive');
133
+
134
+ var img_style = 'width:' + image_thumb_width + 'px;' +
135
+ 'height:'+image_thumb_height+'px;' +
136
+ 'margin-left:'+thumb_left+'px;' +
137
+ 'margin-top:'+thumb_top+'px;';
138
+ if( image_row.filetype == "EMBED_OEMBED_INSTAGRAM_VIDEO") {
139
+ var src = (typeof image_row.filename !== 'undefined') ? image_row.filename : image_row.thumb_url;
140
+ } else {
141
+ var src = (typeof image_row.images[currentFeed.feedImageResolution] !== 'undefined' && typeof image_row.images[currentFeed.feedImageResolution]['url'] !== "undefined") ? image_row.images[currentFeed.feedImageResolution]['url'] : image_row.thumb_url;
142
+ } var onclick = 'wdi_change_image(parseInt(jQuery(\'#wdi_current_image_key\').val()), \'' + i + '\', wdi_data)';
143
+ var ontouchend = 'wdi_change_image(parseInt(jQuery(\'#wdi_current_image_key\').val()), \'' + i + '\', wdi_data)';
144
+
145
+ var img_html = '<img style="' + img_style + '" class="wdi_filmstrip_thumbnail_img" src="' + src + '" onclick="' + onclick + '" ontouchend="' + ontouchend + '" image_id="' + image_row.id + '" image_key="' + i + '" alt="' + image_row.alt + '" />';
146
+ thumbnails_html += '<div id="wdi_filmstrip_thumbnail_' + i + '" class="' + class_name + '">' + img_html + '</div>';
147
+
148
+
149
+ }
150
+
151
+ var html = '' +
152
+ '<div class="wdi_filmstrip_left"><i class="tenweb-i ' + fa_class_name_1 + '"></i></div>' +
153
+ '<div class="wdi_filmstrip">' +
154
+ '<div class="wdi_filmstrip_thumbnails">' +
155
+ thumbnails_html +
156
+ '</div>' +
157
+ '</div>' +
158
+ '<div class="wdi_filmstrip_right"><i class="tenweb-i ' + fa_class_name_2 + '"></i></div>';
159
+
160
+ popup.find('.wdi_filmstrip_container').append(html);
161
+ };
162
+
163
  this.set_wdi_data = function () {
164
 
165
  wdi_data = [];
271
  Object.size = function (obj)
272
  {
273
  var size = 0,
274
+ key;
275
  for (key in obj) {
276
  if (obj.hasOwnProperty(key)) size++;
277
  }
422
  jQuery('.wdi_comments').append(wdi_comments);
423
  jQuery('.wdi_comments').append(wdi_added_comments);
424
 
425
+ if (typeof jQuery().mCustomScrollbar !== 'undefined') {
426
+ if (jQuery.isFunction(jQuery().mCustomScrollbar)) {
427
+ jQuery(".wdi_comments").mCustomScrollbar({
428
+ scrollInertia: 250
429
+ });
430
+ }
431
+ }
432
 
433
+ ////
434
+ jQuery('.wdi_comments_close_btn').on('click', wdi_comment);
435
+ //binding click event for loading more commetn by ajax
436
 
437
 
438
  },
600
 
601
  function wdi_play_pause($this)
602
  {
603
+ var is_chrome = navigator.userAgent.indexOf('Chrome') > -1;
604
+ var is_safari = navigator.userAgent.indexOf("Safari") > -1;
605
+ if ((is_chrome)&&(is_safari)) {is_safari=false;}
606
+ if(is_safari){
607
+ return;
608
+ }
609
+ var video = $this.get(0);
610
+ var regex = /firefox/i;
611
+ var firefox = false;
612
+ if (navigator.userAgent.match(regex)) {
613
+ firefox = true;
 
 
 
 
 
 
 
614
  }
615
+ if (!firefox) {
616
 
617
+ if (!video.paused) {
618
+ video.pause();
619
+ } else {
620
+ video.play();
621
+ }
622
+
623
+ }
624
 
625
 
626
  }
684
  ';" data-id="' + i + '" class="carousel_media ' + (i == 0 ? "active" : "") + '">';
685
  }
686
  else if ( carousel_media[i]["type"] == "video" ) {
687
+ if(typeof carousel_media[i]["videos"] !== "undefined" && typeof carousel_media[i]["videos"]["standard_resolution"] !== "undefined" && typeof carousel_media[i]["videos"]["standard_resolution"]["url"] !== "undefined"){
688
+ src = carousel_media[i]["videos"]["standard_resolution"]["url"];
689
+ }
690
  oembed_instagram_html += '<video onclick="wdi_play_pause(jQuery(this));" style="width:auto !important; height:auto !important; max-width:100% !important; max-height:100% !important; margin:0 !important;" controls data-id="' + i + '" class="carousel_media ' + (i == 0 ? "active" : "") + '">' +
691
  '<source src="' + src +
692
  '" type="video/mp4"> Your browser does not support the video tag. </video>';
738
  return false;
739
  }
740
 
741
+ function wdi_cube(tz, ntx, nty, nrx, nry, wrx, wry, current_image_class, next_image_class, direction) {
742
+ /* If browser does not support 3d transforms/CSS transitions.*/
743
+ if (!wdi_testBrowser_cssTransitions()) {
744
+ return wdi_fallback(current_image_class, next_image_class, direction);
745
+ }
746
+ if (!wdi_testBrowser_cssTransforms3d()) {
747
+ return wdi_fallback3d(current_image_class, next_image_class, direction);
748
+ }
749
+ wdi_trans_in_progress = true;
750
+ /* Set active thumbnail.*/
751
+ jQuery(".wdi_filmstrip_thumbnail").removeClass("wdi_thumb_active").addClass("wdi_thumb_deactive");
752
+ jQuery("#wdi_filmstrip_thumbnail_" + wdi_current_key).removeClass("wdi_thumb_deactive").addClass("wdi_thumb_active");
753
+ jQuery(".wdi_slide_bg").css('perspective', 1000);
754
+ jQuery(current_image_class).css({
755
+ transform : 'translateZ(' + tz + 'px)',
756
+ backfaceVisibility : 'hidden'
757
+ });
758
+ jQuery(next_image_class).css({
759
+ opacity : 1,
760
+ filter: 'Alpha(opacity=100)',
761
+ backfaceVisibility : 'hidden',
762
+ transform : 'translateY(' + nty + 'px) translateX(' + ntx + 'px) rotateY('+ nry +'deg) rotateX('+ nrx +'deg)'
763
+ });
764
+ jQuery(".wdi_slider").css({
765
+ transform: 'translateZ(-' + tz + 'px)',
766
+ transformStyle: 'preserve-3d'
767
+ });
768
+ /* Execution steps.*/
769
+ setTimeout(function () {
770
+ jQuery(".wdi_slider").css({
771
+ transition: 'all ' + wdi_transition_duration + 'ms ease-in-out',
772
+ transform: 'translateZ(-' + tz + 'px) rotateX('+ wrx +'deg) rotateY('+ wry +'deg)'
773
+ });
774
+ }, 20);
775
+ /* After transition.*/
776
+ jQuery(".wdi_slider").one('webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend', jQuery.proxy(wdi_after_trans));
777
+ function wdi_after_trans() {
778
+ jQuery(current_image_class).removeAttr('style');
779
+ jQuery(next_image_class).removeAttr('style');
780
+ jQuery(".wdi_slider").removeAttr('style');
781
+ jQuery(current_image_class).css({'opacity' : 0, filter: 'Alpha(opacity=0)', 'z-index': 1});
782
+ jQuery(next_image_class).css({'opacity' : 1, filter: 'Alpha(opacity=100)', 'z-index' : 2});
783
+
784
+ wdi_trans_in_progress = false;
785
+ jQuery(current_image_class).html('');
786
+ if (typeof event_stack !== 'undefined') {
787
+ if (event_stack.length > 0) {
788
+ key = event_stack[0].split("-");
789
+ event_stack.shift();
790
+ wdi_change_image(key[0], key[1], wdi_data, true);
791
+ }
792
+ }
793
+ wdi_change_watermark_container();
794
+ }
795
+ }
796
 
797
+ function wdi_cubeH(current_image_class, next_image_class, direction) {
798
+ /* Set to half of image width.*/
799
+ var dimension = jQuery(current_image_class).width() / 2;
800
+ if (direction == 'right') {
801
+ wdi_cube(dimension, dimension, 0, 0, 90, 0, -90, current_image_class, next_image_class, direction);
802
+ }
803
+ else if (direction == 'left') {
804
+ wdi_cube(dimension, -dimension, 0, 0, -90, 0, 90, current_image_class, next_image_class, direction);
805
+ }
806
+ }
807
+ function wdi_cubeV(current_image_class, next_image_class, direction) {
808
+ /* Set to half of image height.*/
809
+ var dimension = jQuery(current_image_class).height() / 2;
810
+ /* If next slide.*/
811
+ if (direction == 'right') {
812
+ wdi_cube(dimension, 0, -dimension, 90, 0, -90, 0, current_image_class, next_image_class, direction);
813
+ }
814
+ else if (direction == 'left') {
815
+ wdi_cube(dimension, 0, dimension, -90, 0, 90, 0, current_image_class, next_image_class, direction);
816
+ }
817
+ }
818
 
819
  /* For browsers that does not support transitions.*/
820
  function wdi_fallback(current_image_class, next_image_class, direction) {
863
  jQuery(next_image_class).fadeTo(wdi_transition_duration, 1);
864
  }
865
  }
866
+
867
+ function wdi_grid(cols, rows, ro, tx, ty, sc, op, current_image_class, next_image_class, direction) {
868
+ /* If browser does not support CSS transitions.*/
869
+ if (!wdi_testBrowser_cssTransitions()) {
870
+ return wdi_fallback(current_image_class, next_image_class, direction);
871
+ }
872
+ wdi_trans_in_progress = true;
873
+ /* Set active thumbnail.*/
874
+ jQuery(".wdi_filmstrip_thumbnail").removeClass("wdi_thumb_active").addClass("wdi_thumb_deactive");
875
+ jQuery("#wdi_filmstrip_thumbnail_" + wdi_current_key).removeClass("wdi_thumb_deactive").addClass("wdi_thumb_active");
876
+ /* The time (in ms) added to/subtracted from the delay total for each new gridlet.*/
877
+ var count = (wdi_transition_duration) / (cols + rows);
878
+ /* Gridlet creator (divisions of the image grid, positioned with background-images to replicate the look of an entire slide image when assembled)*/
879
+ function wdi_gridlet(width, height, top, img_top, left, img_left, src, imgWidth, imgHeight, c, r) {
880
+ var delay = (c + r) * count;
881
+ /* Return a gridlet elem with styles for specific transition.*/
882
+ return jQuery('<span class="wdi_gridlet" />').css({
883
+ display : "block",
884
+ width : width,
885
+ height : height,
886
+ top : top,
887
+ left : left,
888
+ backgroundImage : 'url("' + src + '")',
889
+ backgroundColor: jQuery(".wdi_spider_popup_wrap").css("background-color"),
890
+ /*backgroundColor: 'rgba(0, 0, 0, 0)',*/
891
+ backgroundRepeat: 'no-repeat',
892
+ backgroundPosition : img_left + 'px ' + img_top + 'px',
893
+ backgroundSize : imgWidth + 'px ' + imgHeight + 'px',
894
+ transition : 'all ' + wdi_transition_duration + 'ms ease-in-out ' + delay + 'ms',
895
+ transform : 'none'
896
+ });
897
+ }
898
+ /* Get the current slide's image.*/
899
+ var cur_img = jQuery(current_image_class).find('img');
900
+ /* Create a grid to hold the gridlets.*/
901
+ var grid = jQuery('<span style="display: block;" />').addClass('wdi_grid');
902
+ /* Prepend the grid to the next slide (i.e. so it's above the slide image).*/
903
+ jQuery(current_image_class).prepend(grid);
904
+ /* Vars to calculate positioning/size of gridlets.*/
905
+ var cont = jQuery(".wdi_slide_bg");
906
+ var imgWidth = cur_img.width();
907
+ var imgHeight = cur_img.height();
908
+ var contWidth = cont.width(),
909
+ contHeight = cont.height(),
910
+ colWidth = Math.floor(contWidth / cols),
911
+ rowHeight = Math.floor(contHeight / rows),
912
+ colRemainder = contWidth - (cols * colWidth),
913
+ colAdd = Math.ceil(colRemainder / cols),
914
+ rowRemainder = contHeight - (rows * rowHeight),
915
+ rowAdd = Math.ceil(rowRemainder / rows),
916
+ leftDist = 0,
917
+ img_leftDist = Math.ceil((jQuery(".wdi_slide_bg").width() - cur_img.width()) / 2);
918
+ var imgSrc = typeof cur_img.attr('src')=='undefined' ? '' :cur_img.attr('src');
919
+ /* tx/ty args can be passed as 'auto'/'min-auto' (meaning use slide width/height or negative slide width/height).*/
920
+ tx = tx === 'auto' ? contWidth : tx;
921
+ tx = tx === 'min-auto' ? - contWidth : tx;
922
+ ty = ty === 'auto' ? contHeight : ty;
923
+ ty = ty === 'min-auto' ? - contHeight : ty;
924
+ /* Loop through cols.*/
925
+ for (var i = 0; i < cols; i++) {
926
+ var topDist = 0,
927
+ img_topDst = Math.floor((jQuery(".wdi_slide_bg").height() - cur_img.height()) / 2),
928
+ newColWidth = colWidth;
929
+ /* If imgWidth (px) does not divide cleanly into the specified number of cols, adjust individual col widths to create correct total.*/
930
+ if (colRemainder > 0) {
931
+ var add = colRemainder >= colAdd ? colAdd : colRemainder;
932
+ newColWidth += add;
933
+ colRemainder -= add;
934
+ }
935
+ /* Nested loop to create row gridlets for each col.*/
936
+ for (var j = 0; j < rows; j++) {
937
+ var newRowHeight = rowHeight,
938
+ newRowRemainder = rowRemainder;
939
+ /* If contHeight (px) does not divide cleanly into the specified number of rows, adjust individual row heights to create correct total.*/
940
+ if (newRowRemainder > 0) {
941
+ add = newRowRemainder >= rowAdd ? rowAdd : rowRemainder;
942
+ newRowHeight += add;
943
+ newRowRemainder -= add;
944
+ }
945
+ /* Create & append gridlet to grid.*/
946
+ grid.append(wdi_gridlet(newColWidth, newRowHeight, topDist, img_topDst, leftDist, img_leftDist, imgSrc, imgWidth, imgHeight, i, j));
947
+ topDist += newRowHeight;
948
+ img_topDst -= newRowHeight;
949
+ }
950
+ img_leftDist -= newColWidth;
951
+ leftDist += newColWidth;
952
+ }
953
+ /* Set event listener on last gridlet to finish transitioning.*/
954
+ var last_gridlet = grid.children().last();
955
+ /* Show grid & hide the image it replaces.*/
956
+ grid.show();
957
+ cur_img.css('opacity', 0);
958
+ /* Add identifying classes to corner gridlets (useful if applying border radius).*/
959
+ grid.children().first().addClass('rs-top-left');
960
+ grid.children().last().addClass('rs-bottom-right');
961
+ grid.children().eq(rows - 1).addClass('rs-bottom-left');
962
+ grid.children().eq(- rows).addClass('rs-top-right');
963
+ /* Execution steps.*/
964
+ setTimeout(function () {
965
+ grid.children().css({
966
+ opacity: op,
967
+ transform: 'rotate('+ ro +'deg) translateX('+ tx +'px) translateY('+ ty +'px) scale('+ sc +')'
968
+ });
969
+ }, 1);
970
+ jQuery(next_image_class).css('opacity', 1);
971
+ /* After transition.*/
972
+ jQuery(last_gridlet).one('webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend', jQuery.proxy(wdi_after_trans));
973
+ function wdi_after_trans() {
974
+ jQuery(current_image_class).css({'opacity' : 0, 'z-index': 1});
975
+ jQuery(next_image_class).css({'opacity' : 1, 'z-index' : 2});
976
+ cur_img.css('opacity', 1);
977
+ grid.remove();
978
+ wdi_trans_in_progress = false;
979
+ jQuery(current_image_class).html('');
980
+ if (typeof event_stack !== 'undefined') {
981
+ if (event_stack.length > 0) {
982
+ key = event_stack[0].split("-");
983
+ event_stack.shift();
984
+ wdi_change_image(key[0], key[1], wdi_data, true);
985
+ }
986
+ }
987
+ wdi_change_watermark_container();
988
+ }
989
+ }
990
+ function wdi_sliceH(current_image_class, next_image_class, direction) {
991
+ if (direction == 'right') {
992
+ var translateX = 'min-auto';
993
+ }
994
+ else if (direction == 'left') {
995
+ var translateX = 'auto';
996
+ }
997
+ wdi_grid(1, 8, 0, translateX, 0, 1, 0, current_image_class, next_image_class, direction);
998
+ }
999
+ function wdi_sliceV(current_image_class, next_image_class, direction) {
1000
+ if (direction == 'right') {
1001
+ var translateY = 'min-auto';
1002
+ }
1003
+ else if (direction == 'left') {
1004
+ var translateY = 'auto';
1005
+ }
1006
+ wdi_grid(10, 1, 0, 0, translateY, 1, 0, current_image_class, next_image_class, direction);
1007
+ }
1008
+ function wdi_slideV(current_image_class, next_image_class, direction) {
1009
+ if (direction == 'right') {
1010
+ var translateY = 'auto';
1011
+ }
1012
+ else if (direction == 'left') {
1013
+ var translateY = 'min-auto';
1014
+ }
1015
+ wdi_grid(1, 1, 0, 0, translateY, 1, 1, current_image_class, next_image_class, direction);
1016
+ }
1017
+ function wdi_slideH(current_image_class, next_image_class, direction) {
1018
+ if (direction == 'right') {
1019
+ var translateX = 'min-auto';
1020
+ }
1021
+ else if (direction == 'left') {
1022
+ var translateX = 'auto';
1023
+ }
1024
+ wdi_grid(1, 1, 0, translateX, 0, 1, 1, current_image_class, next_image_class, direction);
1025
+ }
1026
+ function wdi_scaleOut(current_image_class, next_image_class, direction) {
1027
+ wdi_grid(1, 1, 0, 0, 0, 1.5, 0, current_image_class, next_image_class, direction);
1028
+ }
1029
+ function wdi_scaleIn(current_image_class, next_image_class, direction) {
1030
+ wdi_grid(1, 1, 0, 0, 0, 0.5, 0, current_image_class, next_image_class, direction);
1031
+ }
1032
+ function wdi_blockScale(current_image_class, next_image_class, direction) {
1033
+ wdi_grid(8, 6, 0, 0, 0, .6, 0, current_image_class, next_image_class, direction);
1034
+ }
1035
+ function wdi_kaleidoscope(current_image_class, next_image_class, direction) {
1036
+ wdi_grid(10, 8, 0, 0, 0, 1, 0, current_image_class, next_image_class, direction);
1037
+ }
1038
+ function wdi_fan(current_image_class, next_image_class, direction) {
1039
+ if (direction == 'right') {
1040
+ var rotate = 45;
1041
+ var translateX = 100;
1042
+ }
1043
+ else if (direction == 'left') {
1044
+ var rotate = -45;
1045
+ var translateX = -100;
1046
+ }
1047
+ wdi_grid(1, 10, rotate, translateX, 0, 1, 0, current_image_class, next_image_class, direction);
1048
+ }
1049
+ function wdi_blindV(current_image_class, next_image_class, direction) {
1050
+ wdi_grid(1, 8, 0, 0, 0, .7, 0, current_image_class, next_image_class);
1051
+ }
1052
+ function wdi_blindH(current_image_class, next_image_class, direction) {
1053
+ wdi_grid(10, 1, 0, 0, 0, .7, 0, current_image_class, next_image_class);
1054
+ }
1055
+ function wdi_random(current_image_class, next_image_class, direction) {
1056
+ var anims = ['sliceH', 'sliceV', 'slideH', 'slideV', 'scaleOut', 'scaleIn', 'blockScale', 'kaleidoscope', 'fan', 'blindH', 'blindV'];
1057
+ /* Pick a random transition from the anims array.*/
1058
+ this["wdi_" + anims[Math.floor(Math.random() * anims.length)]](current_image_class, next_image_class, direction);
1059
+ }
1060
  function wdi_pause_stream(parent){
1061
  jQuery(parent).find('video').each(function(){
1062
  jQuery(this).get(0).pause();
js/gallerybox/wdi_gallery_box.min.js CHANGED
@@ -1 +1 @@
1
- var isPopUpOpened=!1,wdi_data=[];function wdi_spider_createpopup(e,t,i,a,r,n,o,d,s){if(e=e.replace(/&#038;/g,"&"),!isPopUpOpened&&(isPopUpOpened=!0,!wdi_spider_hasalreadyreceivedpopup(n)&&!wdi_spider_isunsupporteduseragent())){jQuery("html").attr("style","overflow:hidden !important;"),jQuery("#wdi_spider_popup_loading_"+t).css({display:"block"}),jQuery("#wdi_spider_popup_overlay_"+t).css({display:"block"});for(var _,m=0,c=0;c<d.parsedData.length;c++)if(d.parsedData[c].id===s){m=c,_=[d.parsedData[c]];break}jQuery.ajax({type:"POST",url:e,dataType:"text",data:{action:"WDIGalleryBox",image_rows:JSON.stringify(_),feed_id:d.feed_row.id,feed_counter:d.feed_row.wdi_feed_counter,current_image_index:m,image_rows_count:d.parsedData.length,carousel_media_row:JSON.stringify(_[0].carousel_media)},success:function(e){var _=jQuery('<div id="wdi_spider_popup_wrap" class="wdi_spider_popup_wrap wdi_lightbox_theme_'+d.feed_row.theme_id+'" style="width:'+i+"px;height:"+a+"px;margin-top:-"+a/2+"px;margin-left: -"+i/2+'px; ">'+e+"</div>");new wdi_construct_popup(_,d,d.parsedData,s).construct(),_.hide().appendTo("body"),wdi_spider_showpopup(n,o,_,r),jQuery("#wdi_spider_popup_loading_"+t).css({display:"none !important;"})}})}}var wdi_construct_popup=function(e,t,i,a){this.theme_row={},this.construct=function(){this.theme_row=window["wdi_theme_"+t.feed_row.theme_id],this.set_wdi_data()},this.set_wdi_data=function(){wdi_data=[];for(var e=0;e<i.length;e++)wdi_data[e]=[],wdi_data[e].number=e+1,wdi_data[e].id=i[e].id,wdi_data[e].alt=i[e].alt,wdi_data[e].description=wdi_front.escape_tags(i[e].description),wdi_data[e].username=i[e].username,wdi_data[e].profile_picture=i[e].profile_picture,wdi_data[e].image_url=i[e].image_url,wdi_data[e].thumb_url=i[e].thumb_url,wdi_data[e].src=i[e].images.standard_resolution.url,wdi_data[e].date=i[e].date,wdi_data[e].comment_count=i[e].comment_count,wdi_data[e].filetype=i[e].filetype,wdi_data[e].filename=i[e].filename,wdi_data[e].avg_rating=i[e].avg_rating,wdi_data[e].rate=i[e].rate,wdi_data[e].rate_count=i[e].rate_count,wdi_data[e].hit_count=i[e].hit_count,wdi_data[e].comments_data=void 0!==i[e].comments_data?i[e].comments_data:"null",wdi_data[e].carousel_media=void 0!==i[e].carousel_media?i[e].carousel_media:null}};function wdi_spider_showpopup(e,t,i,a){isPopUpOpened=!0,i.show(),wdi_spider_receivedpopup(e,t)}function wdi_spider_hasalreadyreceivedpopup(e){return document.cookie.indexOf(e)>-1&&delete document.cookie[document.cookie.indexOf(e)],!1}function wdi_spider_receivedpopup(e,t){var i=new Date;i.setDate(i.getDate()+t),document.cookie=e+"=true;expires="+i.toUTCString()+";path=/",jQuery(".wdi_image_info").mCustomScrollbar({autoHideScrollbar:!1,scrollInertia:150,advanced:{updateOnContentResize:!0}})}function wdi_spider_isunsupporteduseragent(){return!window.XMLHttpRequest}function wdi_spider_destroypopup(e){null!=document.getElementById("wdi_spider_popup_wrap")&&(wdi_comments_manager.popup_destroyed(),void 0!==jQuery().fullscreen&&jQuery.isFunction(jQuery().fullscreen)&&jQuery.fullscreen.isFullScreen()&&jQuery.fullscreen.exit(),setTimeout(function(){jQuery(".wdi_spider_popup_wrap").remove(),jQuery(".wdi_spider_popup_loading").css({display:"none"}),jQuery(".wdi_spider_popup_overlay").css({display:"none"}),jQuery(document).off("keydown"),jQuery("html").attr("style","")},20)),isPopUpOpened=!1;var t=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()),i=document.querySelector('meta[name="viewport"]');t&&i&&(i.content="width=device-width, initial-scale=1");var a=jQuery(document).scrollTop();window.location.hash="",jQuery(document).scrollTop(a),"undefined"!=typeof wdi_playInterval&&clearInterval(wdi_playInterval)}function wdi_spider_ajax_save(e,t){return wdi_comments_manager.init(t),!1}function wdi_spider_set_input_value(e,t){document.getElementById(e)&&(document.getElementById(e).value=t)}function wdi_spider_form_submit(e,t){document.getElementById(t)&&document.getElementById(t).submit(),e.preventDefault?e.preventDefault():e.returnValue=!1}function wdi_spider_check_required(e,t){return""==jQuery("#"+e).val()&&(wdi_front.show_alert(t+"* "+wdi_objectL10n.wdi_field_required),jQuery("#"+e).attr("style","border-color: #FF0000;"),jQuery("#"+e).focus(),!0)}function wdi_spider_check_email(e){if(""!=jQuery("#"+e).val())return-1==jQuery("#"+e).val().replace(/^\s+|\s+$/g,"").search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)&&(wdi_front.show_alert(wdi_objectL10n.wdi_mail_validation),!0)}function wdi_captcha_refresh(e){document.getElementById(e+"_img")&&document.getElementById(e+"_input")&&(srcArr=document.getElementById(e+"_img").src.split("&r="),document.getElementById(e+"_img").src=srcArr[0]+"&r="+Math.floor(100*Math.random()),document.getElementById(e+"_img").style.display="inline-block",document.getElementById(e+"_input").value="")}function wdi_play_pause(e){var t=navigator.userAgent.indexOf("Chrome")>-1,i=navigator.userAgent.indexOf("Safari")>-1;if(t&&i&&(i=!1),!i){var a=e.get(0),r=!1;navigator.userAgent.match(/firefox/i)&&(r=!0),r||(a.paused?a.play():a.pause())}}function wdi_spider_display_embed(e,t,i,a,r){var n="";switch(e){case"EMBED_OEMBED_INSTAGRAM_VIDEO":var o="<div ";for(attr in a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(o+=" "+attr+'="'+a[attr]+'"');o+=" >",""!=t&&(o+='<video onclick="wdi_play_pause(jQuery(this));" style="width:auto !important; height:auto !important; max-width:100% !important; max-height:100% !important; margin:0 !important;" controls><source src="'+i+'" type="video/mp4"> Your browser does not support the video tag. </video>'),n+=o+="</div>";break;case"EMBED_OEMBED_INSTAGRAM_IMAGE":o="<div ";for(attr in a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(o+=" "+attr+'="'+a[attr]+'"');if(o+=" >",null!=r&&r.length)for(var d=0;d<r.length;d++)"image"==r[d].type?o+='<img src="'+r[d].images.standard_resolution.url+'" style="max-width:100% !important; max-height:100% !important; width:auto !important; height:auto !important;" data-id="'+d+'" class="carousel_media '+(0==d?"active":"")+'">':"video"==r[d].type&&(o+='<video onclick="wdi_play_pause(jQuery(this));" style="width:auto !important; height:auto !important; max-width:100% !important; max-height:100% !important; margin:0 !important;" controls data-id="'+d+'" class="carousel_media '+(0==d?"active":"")+'"><source src="'+i+'" type="video/mp4"> Your browser does not support the video tag. </video>');else""!=t&&(o+='<img src="'+i+'" style=" max-width:100% !important; max-height:100% !important; width:auto; height:auto;">');n+=o+="</div>"}return n}function wdi_testBrowser_cssTransitions(){return wdi_testDom("Transition")}function wdi_testBrowser_cssTransforms3d(){return wdi_testDom("Perspective")}function wdi_testDom(e){for(var t=["","Webkit","Moz","ms","O","Khtml"],i=t.length;i--;)if(void 0!==document.body.style[t[i]+e])return!0;return!1}function wdi_fallback(e,t,i){wdi_fade(e,t,i)}function wdi_fallback3d(e,t,i){wdi_sliceV(e,t,i)}function wdi_none(e,t,i){jQuery(e).css({opacity:0,"z-index":1}),jQuery(t).css({opacity:1,"z-index":2}),jQuery(".wdi_filmstrip_thumbnail").removeClass("wdi_thumb_active").addClass("wdi_thumb_deactive"),jQuery("#wdi_filmstrip_thumbnail_"+wdi_current_key).removeClass("wdi_thumb_deactive").addClass("wdi_thumb_active"),wdi_trans_in_progress=!1,jQuery(e).html(""),wdi_change_watermark_container()}function wdi_fade(e,t,i){jQuery(".wdi_filmstrip_thumbnail").removeClass("wdi_thumb_active").addClass("wdi_thumb_deactive"),jQuery("#wdi_filmstrip_thumbnail_"+wdi_current_key).removeClass("wdi_thumb_deactive").addClass("wdi_thumb_active"),wdi_testBrowser_cssTransitions()?(jQuery(t).css("transition","opacity "+wdi_transition_duration+"ms linear"),jQuery(e).css({opacity:0,"z-index":1}),jQuery(t).css({opacity:1,"z-index":2}),wdi_change_watermark_container()):(jQuery(e).animate({opacity:0,"z-index":1},wdi_transition_duration),jQuery(t).animate({opacity:1,"z-index":2},{duration:wdi_transition_duration,complete:function(){wdi_trans_in_progress=!1,jQuery(e).html(""),wdi_change_watermark_container()}}),jQuery(e).fadeTo(wdi_transition_duration,0),jQuery(t).fadeTo(wdi_transition_duration,1))}function wdi_pause_stream(e){jQuery(e).find("video").each(function(){jQuery(this).get(0).pause()})}function wdi_reset_zoom(){var e=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()),t=document.querySelector('meta[name="viewport"]');e&&t&&(t.content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=0")}Object.size=function(e){var t,i=0;for(t in e)e.hasOwnProperty(t)&&i++;return i},wdi_comments_manager={media_id:"",mediaComments:[],load_more_count:10,commentCounter:0,currentKey:-1,init:function(e){this.instagram=new WDIInstagram,this.instagram.addToken(wdi_front.access_token),this.currentKey!=e&&(this.currentKey=e,this.reset_comments())},reset_comments:function(){jQuery("#wdi_load_more_comments").remove(),jQuery("#wdi_added_comments").html(""),this.commentCounter=0,this.media_id=wdi_data[this.currentKey].id,this.getAjaxComments(this.currentKey)},popup_destroyed:function(){this.media_id="",this.mediaComments=[],this.commentCounter=0,this.currentKey=-1},showComments:function(e,t){(Object.size(e)-this.commentCounter-t<0||void 0===t)&&(t=Object.size(e)-this.commentCounter);var a=this.commentCounter;for(i=Object.size(e)-a-1;i>=Object.size(e)-a-t;i--){this.commentCounter++;var r=e[i].text;r=wdi_front.escape_tags(r),r=this.filterCommentText(r);var n=e[i].from.username,o=(e[i].from.profile_picture,jQuery('<div class="wdi_single_comment"></div>'));o.append(jQuery('<p class="wdi_comment_header_p"><span class="wdi_comment_header"><a target="_blank" href="//instagram.com/'+n+'">'+n+'</a></span><span class="wdi_comment_date">'+wdi_front.convertUnixDate(e[i].created_time)+"</span></p>")),o.append(jQuery('<div class="wdi_comment_body_p"><span class="wdi_comment_body"><p>'+r+"</p></span></div>")),jQuery("#wdi_added_comments").prepend(o)}this.updateScrollbar()},updateScrollbar:function(){var e=jQuery("#wdi_comments"),t=jQuery("#wdi_added_comments");jQuery(".wdi_comments").attr("class","wdi_comments"),jQuery(".wdi_comments").html(""),jQuery(".wdi_comments").append(e),jQuery(".wdi_comments").append(t),void 0!==jQuery().mCustomScrollbar&&jQuery.isFunction(jQuery().mCustomScrollbar)&&jQuery(".wdi_comments").mCustomScrollbar({scrollInertia:250}),jQuery(".wdi_comments_close_btn").on("click",wdi_comment)},getAjaxComments:function(){this.instagram.getRecentMediaComments(this.media_id,{success:function(e){if(""==e||null==e||null==e)return errorMessage="Network Error, please try again later :(",void console.log("%c"+errorMessage,"color:#cc0000;");if(200!=e.meta.code)return errorMessage=e.meta.error_message,void console.log("%c"+errorMessage,"color:#cc0000;");wdi_comments_manager.mediaComments=e.data;var t=wdi_data[wdi_comments_manager.currentKey];t.comments_data=e.data,wdi_comments_manager.showComments(t.comments_data,wdi_comments_manager.load_more_count),wdi_comments_manager.ajax_comments_ready(e.data)}})},ajax_comments_ready:function(e){this.createLoadMoreAndBindEvent()},createLoadMoreAndBindEvent:function(){jQuery("#wdi_added_comments").prepend(jQuery('<p id="wdi_load_more_comments" class="wdi_load_more_comments">load more comments</p>')),jQuery(".wdi_comment_container #wdi_load_more_comments").on("click",function(){jQuery(this).remove(),wdi_comments_manager.showComments(wdi_comments_manager.mediaComments,wdi_comments_manager.load_more_count),wdi_comments_manager.createLoadMoreAndBindEvent()})},filterCommentText:function(e){for(var t=e.split(" "),i="",a=0;a<t.length;a++)switch(t[a][0]){case"@":i+='<a target="blank" class="wdi_comm_text_link" href="//instagram.com/'+t[a].substring(1,t[a].length)+'">'+t[a]+"</a> ";break;case"#":i+='<a target="blank" class="wdi_comm_text_link" href="//instagram.com/explore/tags/'+t[a].substring(1,t[a].length)+'">'+t[a]+"</a> ";break;default:i+=t[a]+" "}return i=i.substring(0,i.length-1)}};
1
+ var isPopUpOpened=!1,wdi_data=[];function wdi_spider_createpopup(e,i,a,r,n,d,o,s,_){if(e=e.replace(/&#038;/g,"&"),!isPopUpOpened&&(isPopUpOpened=!0,!wdi_spider_hasalreadyreceivedpopup(d)&&!wdi_spider_isunsupporteduseragent())){jQuery("html").attr("style","overflow:hidden !important;"),jQuery("#wdi_spider_popup_loading_"+i).css({display:"block"}),jQuery("#wdi_spider_popup_overlay_"+i).css({display:"block"});for(var t,c=0,u=0;u<s.parsedData.length;u++)if(s.parsedData[u].id===_){c=u,t=[s.parsedData[u]];break}jQuery.ajax({type:"POST",url:e,dataType:"text",data:{action:"WDIGalleryBox",image_rows:JSON.stringify(t),feed_id:s.feed_row.id,feed_counter:s.feed_row.wdi_feed_counter,current_image_index:c,image_rows_count:s.parsedData.length,carousel_media_row:JSON.stringify(t[0].carousel_media)},success:function(e){var t=jQuery('<div id="wdi_spider_popup_wrap" class="wdi_spider_popup_wrap wdi_lightbox_theme_'+s.feed_row.theme_id+'" style="width:'+a+"px;height:"+r+"px;margin-top:-"+r/2+"px;margin-left: -"+a/2+'px; ">'+e+"</div>");new wdi_construct_popup(t,s,s.parsedData,_).construct(),t.hide().appendTo("body"),wdi_spider_showpopup(d,o,t,n),jQuery("#wdi_spider_popup_loading_"+i).css({display:"none !important;"})}})}}var wdi_construct_popup=function(h,f,y,g){this.theme_row={},this.construct=function(){this.theme_row=window["wdi_theme_"+f.feed_row.theme_id],f.feed_row.popup_enable_filmstrip&&"1"===f.feed_row.popup_enable_filmstrip&&this.add_filmstrip(),this.set_wdi_data()},this.add_filmstrip=function(){var e="horizontal";"right"!==this.theme_row.lightbox_filmstrip_pos&&"left"!==this.theme_row.lightbox_filmstrip_pos||(e="vertical");for(var t="horizontal"===e?"tenweb-i-angle-left":"tenweb-i-angle-up",i="horizontal"===e?"tenweb-i-angle-right":"tenweb-i-angle-down",a="",r=n="horizontal"===e?void 0!==f.feed_row.popup_filmstrip_height?f.feed_row.popup_filmstrip_height:"20":void 0!==f.feed_row.popup_filmstrip_height?f.feed_row.popup_filmstrip_height:"50",n=r=parseInt(r),d=0;d<y.length;d++){var o,s,_,c,u,m=y[d];u=m.resolution&&""!==m.resolution?(m.resolution.split(" "),_=intval($resolution_arr[0]),c=intval($resolution_arr[2]),0!==_&&0!==c?(o=_*(s=Math.max(r/_,n/c)),c*s):(o=r,n)):(o=r,n);var l=(r-(o*=s=Math.max(r/o,n/u)))/2,p=(n-(u*=s))/2;a+='<div id="wdi_filmstrip_thumbnail_'+d+'" class="'+("wdi_filmstrip_thumbnail "+(parseInt(m.id)===parseInt(g)?"wdi_thumb_active":"wdi_thumb_deactive"))+'">'+('<img style="'+("width:"+o+"px;height:"+u+"px;margin-left:"+l+"px;margin-top:"+p+"px;")+'" class="wdi_filmstrip_thumbnail_img" src="'+("EMBED_OEMBED_INSTAGRAM_VIDEO"==m.filetype?void 0!==m.filename?m.filename:m.thumb_url:void 0!==m.images[f.feedImageResolution]&&void 0!==m.images[f.feedImageResolution].url?m.images[f.feedImageResolution].url:m.thumb_url)+'" onclick="'+("wdi_change_image(parseInt(jQuery('#wdi_current_image_key').val()), '"+d+"', wdi_data)")+'" ontouchend="'+("wdi_change_image(parseInt(jQuery('#wdi_current_image_key').val()), '"+d+"', wdi_data)")+'" image_id="'+m.id+'" image_key="'+d+'" alt="'+m.alt+'" />')+"</div>"}var w='<div class="wdi_filmstrip_left"><i class="tenweb-i '+t+'"></i></div><div class="wdi_filmstrip"><div class="wdi_filmstrip_thumbnails">'+a+'</div></div><div class="wdi_filmstrip_right"><i class="tenweb-i '+i+'"></i></div>';h.find(".wdi_filmstrip_container").append(w)},this.set_wdi_data=function(){wdi_data=[];for(var e=0;e<y.length;e++)wdi_data[e]=[],wdi_data[e].number=e+1,wdi_data[e].id=y[e].id,wdi_data[e].alt=y[e].alt,wdi_data[e].description=wdi_front.escape_tags(y[e].description),wdi_data[e].username=y[e].username,wdi_data[e].profile_picture=y[e].profile_picture,wdi_data[e].image_url=y[e].image_url,wdi_data[e].thumb_url=y[e].thumb_url,wdi_data[e].src=y[e].images.standard_resolution.url,wdi_data[e].date=y[e].date,wdi_data[e].comment_count=y[e].comment_count,wdi_data[e].filetype=y[e].filetype,wdi_data[e].filename=y[e].filename,wdi_data[e].avg_rating=y[e].avg_rating,wdi_data[e].rate=y[e].rate,wdi_data[e].rate_count=y[e].rate_count,wdi_data[e].hit_count=y[e].hit_count,wdi_data[e].comments_data=void 0!==y[e].comments_data?y[e].comments_data:"null",wdi_data[e].carousel_media=void 0!==y[e].carousel_media?y[e].carousel_media:null}};function wdi_spider_showpopup(e,t,i,a){isPopUpOpened=!0,i.show(),wdi_spider_receivedpopup(e,t)}function wdi_spider_hasalreadyreceivedpopup(e){return-1<document.cookie.indexOf(e)&&delete document.cookie[document.cookie.indexOf(e)],!1}function wdi_spider_receivedpopup(e,t){var i=new Date;i.setDate(i.getDate()+t),document.cookie=e+"=true;expires="+i.toUTCString()+";path=/",jQuery(".wdi_image_info").mCustomScrollbar({autoHideScrollbar:!1,scrollInertia:150,advanced:{updateOnContentResize:!0}})}function wdi_spider_isunsupporteduseragent(){return!window.XMLHttpRequest}function wdi_spider_destroypopup(e){null!=document.getElementById("wdi_spider_popup_wrap")&&(wdi_comments_manager.popup_destroyed(),void 0!==jQuery().fullscreen&&jQuery.isFunction(jQuery().fullscreen)&&jQuery.fullscreen.isFullScreen()&&jQuery.fullscreen.exit(),setTimeout(function(){jQuery(".wdi_spider_popup_wrap").remove(),jQuery(".wdi_spider_popup_loading").css({display:"none"}),jQuery(".wdi_spider_popup_overlay").css({display:"none"}),jQuery(document).off("keydown"),jQuery("html").attr("style","")},20)),isPopUpOpened=!1;var t=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()),i=document.querySelector('meta[name="viewport"]');t&&i&&(i.content="width=device-width, initial-scale=1");var a=jQuery(document).scrollTop();window.location.hash="",jQuery(document).scrollTop(a),"undefined"!=typeof wdi_playInterval&&clearInterval(wdi_playInterval)}function wdi_spider_ajax_save(e,t){return wdi_comments_manager.init(t),!1}function wdi_spider_set_input_value(e,t){document.getElementById(e)&&(document.getElementById(e).value=t)}function wdi_spider_form_submit(e,t){document.getElementById(t)&&document.getElementById(t).submit(),e.preventDefault?e.preventDefault():e.returnValue=!1}function wdi_spider_check_required(e,t){return""==jQuery("#"+e).val()&&(wdi_front.show_alert(t+"* "+wdi_objectL10n.wdi_field_required),jQuery("#"+e).attr("style","border-color: #FF0000;"),jQuery("#"+e).focus(),!0)}function wdi_spider_check_email(e){if(""!=jQuery("#"+e).val())return-1==jQuery("#"+e).val().replace(/^\s+|\s+$/g,"").search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)&&(wdi_front.show_alert(wdi_objectL10n.wdi_mail_validation),!0)}function wdi_captcha_refresh(e){document.getElementById(e+"_img")&&document.getElementById(e+"_input")&&(srcArr=document.getElementById(e+"_img").src.split("&r="),document.getElementById(e+"_img").src=srcArr[0]+"&r="+Math.floor(100*Math.random()),document.getElementById(e+"_img").style.display="inline-block",document.getElementById(e+"_input").value="")}function wdi_play_pause(e){var t,i,a=-1<navigator.userAgent.indexOf("Chrome"),r=-1<navigator.userAgent.indexOf("Safari");a&&r&&(r=!1),r||(t=e.get(0),i=!/firefox/i,navigator.userAgent.match(/firefox/i)&&(i=!0),i||(t.paused?t.play():t.pause()))}function wdi_spider_display_embed(e,t,i,a,r){var n="";switch(e){case"EMBED_OEMBED_INSTAGRAM_VIDEO":var d="<div ";for(attr in a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(d+=" "+attr+'="'+a[attr]+'"');d+=" >",""!=t&&(d+='<video onclick="wdi_play_pause(jQuery(this));" style="width:auto !important; height:auto !important; max-width:100% !important; max-height:100% !important; margin:0 !important;" controls><source src="'+i+'" type="video/mp4"> Your browser does not support the video tag. </video>'),n+=d+="</div>";break;case"EMBED_OEMBED_INSTAGRAM_IMAGE":d="<div ";for(attr in a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(d+=" "+attr+'="'+a[attr]+'"');if(d+=" >",null!=r&&r.length)for(var o=0;o<r.length;o++)"image"==r[o].type?d+='<img src="'+r[o].images.standard_resolution.url+'" style="max-width:100% !important; max-height:100% !important; width:auto !important; height:auto !important;" data-id="'+o+'" class="carousel_media '+(0==o?"active":"")+'">':"video"==r[o].type&&(void 0!==r[o].videos&&void 0!==r[o].videos.standard_resolution&&void 0!==r[o].videos.standard_resolution.url&&(i=r[o].videos.standard_resolution.url),d+='<video onclick="wdi_play_pause(jQuery(this));" style="width:auto !important; height:auto !important; max-width:100% !important; max-height:100% !important; margin:0 !important;" controls data-id="'+o+'" class="carousel_media '+(0==o?"active":"")+'"><source src="'+i+'" type="video/mp4"> Your browser does not support the video tag. </video>');else""!=t&&(d+='<img src="'+i+'" style=" max-width:100% !important; max-height:100% !important; width:auto; height:auto;">');n+=d+="</div>"}return n}function wdi_testBrowser_cssTransitions(){return wdi_testDom("Transition")}function wdi_testBrowser_cssTransforms3d(){return wdi_testDom("Perspective")}function wdi_testDom(e){for(var t=["","Webkit","Moz","ms","O","Khtml"],i=t.length;i--;)if(void 0!==document.body.style[t[i]+e])return!0;return!1}function wdi_cube(e,t,i,a,r,n,d,o,s,_){if(!wdi_testBrowser_cssTransitions())return wdi_fallback(o,s,_);if(!wdi_testBrowser_cssTransforms3d())return wdi_fallback3d(o,s,_);wdi_trans_in_progress=!0,jQuery(".wdi_filmstrip_thumbnail").removeClass("wdi_thumb_active").addClass("wdi_thumb_deactive"),jQuery("#wdi_filmstrip_thumbnail_"+wdi_current_key).removeClass("wdi_thumb_deactive").addClass("wdi_thumb_active"),jQuery(".wdi_slide_bg").css("perspective",1e3),jQuery(o).css({transform:"translateZ("+e+"px)",backfaceVisibility:"hidden"}),jQuery(s).css({opacity:1,filter:"Alpha(opacity=100)",backfaceVisibility:"hidden",transform:"translateY("+i+"px) translateX("+t+"px) rotateY("+r+"deg) rotateX("+a+"deg)"}),jQuery(".wdi_slider").css({transform:"translateZ(-"+e+"px)",transformStyle:"preserve-3d"}),setTimeout(function(){jQuery(".wdi_slider").css({transition:"all "+wdi_transition_duration+"ms ease-in-out",transform:"translateZ(-"+e+"px) rotateX("+n+"deg) rotateY("+d+"deg)"})},20),jQuery(".wdi_slider").one("webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend",jQuery.proxy(function(){jQuery(o).removeAttr("style"),jQuery(s).removeAttr("style"),jQuery(".wdi_slider").removeAttr("style"),jQuery(o).css({opacity:0,filter:"Alpha(opacity=0)","z-index":1}),jQuery(s).css({opacity:1,filter:"Alpha(opacity=100)","z-index":2}),wdi_trans_in_progress=!1,jQuery(o).html(""),"undefined"==typeof event_stack||0<event_stack.length&&(key=event_stack[0].split("-"),event_stack.shift(),wdi_change_image(key[0],key[1],wdi_data,!0));wdi_change_watermark_container()}))}function wdi_cubeH(e,t,i){var a=jQuery(e).width()/2;"right"==i?wdi_cube(a,a,0,0,90,0,-90,e,t,i):"left"==i&&wdi_cube(a,-a,0,0,-90,0,90,e,t,i)}function wdi_cubeV(e,t,i){var a=jQuery(e).height()/2;"right"==i?wdi_cube(a,0,-a,90,0,-90,0,e,t,i):"left"==i&&wdi_cube(a,0,a,-90,0,90,0,e,t,i)}function wdi_fallback(e,t,i){wdi_fade(e,t,i)}function wdi_fallback3d(e,t,i){wdi_sliceV(e,t,i)}function wdi_none(e,t,i){jQuery(e).css({opacity:0,"z-index":1}),jQuery(t).css({opacity:1,"z-index":2}),jQuery(".wdi_filmstrip_thumbnail").removeClass("wdi_thumb_active").addClass("wdi_thumb_deactive"),jQuery("#wdi_filmstrip_thumbnail_"+wdi_current_key).removeClass("wdi_thumb_deactive").addClass("wdi_thumb_active"),wdi_trans_in_progress=!1,jQuery(e).html(""),wdi_change_watermark_container()}function wdi_fade(e,t,i){jQuery(".wdi_filmstrip_thumbnail").removeClass("wdi_thumb_active").addClass("wdi_thumb_deactive"),jQuery("#wdi_filmstrip_thumbnail_"+wdi_current_key).removeClass("wdi_thumb_deactive").addClass("wdi_thumb_active"),wdi_testBrowser_cssTransitions()?(jQuery(t).css("transition","opacity "+wdi_transition_duration+"ms linear"),jQuery(e).css({opacity:0,"z-index":1}),jQuery(t).css({opacity:1,"z-index":2}),wdi_change_watermark_container()):(jQuery(e).animate({opacity:0,"z-index":1},wdi_transition_duration),jQuery(t).animate({opacity:1,"z-index":2},{duration:wdi_transition_duration,complete:function(){wdi_trans_in_progress=!1,jQuery(e).html(""),wdi_change_watermark_container()}}),jQuery(e).fadeTo(wdi_transition_duration,0),jQuery(t).fadeTo(wdi_transition_duration,1))}function wdi_grid(e,t,i,a,r,n,d,o,s,_){if(!wdi_testBrowser_cssTransitions())return wdi_fallback(o,s,_);wdi_trans_in_progress=!0,jQuery(".wdi_filmstrip_thumbnail").removeClass("wdi_thumb_active").addClass("wdi_thumb_deactive"),jQuery("#wdi_filmstrip_thumbnail_"+wdi_current_key).removeClass("wdi_thumb_deactive").addClass("wdi_thumb_active");var c=wdi_transition_duration/(e+t);var u=jQuery(o).find("img"),m=jQuery('<span style="display: block;" />').addClass("wdi_grid");jQuery(o).prepend(m);var l=jQuery(".wdi_slide_bg"),p=u.width(),w=u.height(),h=l.width(),f=l.height(),y=Math.floor(h/e),g=Math.floor(f/t),v=h-e*y,b=Math.ceil(v/e),j=f-t*g,Q=Math.ceil(j/t),k=0,x=Math.ceil((jQuery(".wdi_slide_bg").width()-u.width())/2),C=void 0===u.attr("src")?"":u.attr("src");a="min-auto"===(a="auto"===a?h:a)?-h:a,r="min-auto"===(r="auto"===r?f:r)?-f:r;for(var I,E,M,A,T,B,O,z,D,S,V=0;V<e;V++){var R,H=0,P=Math.floor((jQuery(".wdi_slide_bg").height()-u.height())/2),K=y;0<v&&(K+=R=b<=v?b:v,v-=R);for(var L=0;L<t;L++){var q=g,U=j;0<U&&(q+=R=Q<=U?Q:j,U-=R),m.append((I=K,E=q,M=H,A=P,T=k,B=x,O=C,z=p,D=w,S=(V+L)*c,jQuery('<span class="wdi_gridlet" />').css({display:"block",width:I,height:E,top:M,left:T,backgroundImage:'url("'+O+'")',backgroundColor:jQuery(".wdi_spider_popup_wrap").css("background-color"),backgroundRepeat:"no-repeat",backgroundPosition:B+"px "+A+"px",backgroundSize:z+"px "+D+"px",transition:"all "+wdi_transition_duration+"ms ease-in-out "+S+"ms",transform:"none"}))),H+=q,P-=q}x-=K,k+=K}var N=m.children().last();m.show(),u.css("opacity",0),m.children().first().addClass("rs-top-left"),m.children().last().addClass("rs-bottom-right"),m.children().eq(t-1).addClass("rs-bottom-left"),m.children().eq(-t).addClass("rs-top-right"),setTimeout(function(){m.children().css({opacity:d,transform:"rotate("+i+"deg) translateX("+a+"px) translateY("+r+"px) scale("+n+")"})},1),jQuery(s).css("opacity",1),jQuery(N).one("webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend",jQuery.proxy(function(){jQuery(o).css({opacity:0,"z-index":1}),jQuery(s).css({opacity:1,"z-index":2}),u.css("opacity",1),m.remove(),wdi_trans_in_progress=!1,jQuery(o).html(""),"undefined"==typeof event_stack||0<event_stack.length&&(key=event_stack[0].split("-"),event_stack.shift(),wdi_change_image(key[0],key[1],wdi_data,!0));wdi_change_watermark_container()}))}function wdi_sliceH(e,t,i){var a;"right"==i?a="min-auto":"left"==i&&(a="auto"),wdi_grid(1,8,0,a,0,1,0,e,t,i)}function wdi_sliceV(e,t,i){var a;"right"==i?a="min-auto":"left"==i&&(a="auto"),wdi_grid(10,1,0,0,a,1,0,e,t,i)}function wdi_slideV(e,t,i){var a;"right"==i?a="auto":"left"==i&&(a="min-auto"),wdi_grid(1,1,0,0,a,1,1,e,t,i)}function wdi_slideH(e,t,i){var a;"right"==i?a="min-auto":"left"==i&&(a="auto"),wdi_grid(1,1,0,a,0,1,1,e,t,i)}function wdi_scaleOut(e,t,i){wdi_grid(1,1,0,0,0,1.5,0,e,t,i)}function wdi_scaleIn(e,t,i){wdi_grid(1,1,0,0,0,.5,0,e,t,i)}function wdi_blockScale(e,t,i){wdi_grid(8,6,0,0,0,.6,0,e,t,i)}function wdi_kaleidoscope(e,t,i){wdi_grid(10,8,0,0,0,1,0,e,t,i)}function wdi_fan(e,t,i){var a,r;"right"==i?(a=45,r=100):"left"==i&&(a=-45,r=-100),wdi_grid(1,10,a,r,0,1,0,e,t,i)}function wdi_blindV(e,t,i){wdi_grid(1,8,0,0,0,.7,0,e,t)}function wdi_blindH(e,t,i){wdi_grid(10,1,0,0,0,.7,0,e,t)}function wdi_random(e,t,i){var a=["sliceH","sliceV","slideH","slideV","scaleOut","scaleIn","blockScale","kaleidoscope","fan","blindH","blindV"];this["wdi_"+a[Math.floor(Math.random()*a.length)]](e,t,i)}function wdi_pause_stream(e){jQuery(e).find("video").each(function(){jQuery(this).get(0).pause()})}function wdi_reset_zoom(){var e=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()),t=document.querySelector('meta[name="viewport"]');e&&t&&(t.content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=0")}Object.size=function(e){var t,i=0;for(t in e)e.hasOwnProperty(t)&&i++;return i},wdi_comments_manager={media_id:"",mediaComments:[],load_more_count:10,commentCounter:0,currentKey:-1,init:function(e){this.instagram=new WDIInstagram,this.instagram.addToken(wdi_front.access_token),this.currentKey!=e&&(this.currentKey=e,this.reset_comments())},reset_comments:function(){jQuery("#wdi_load_more_comments").remove(),jQuery("#wdi_added_comments").html(""),this.commentCounter=0,this.media_id=wdi_data[this.currentKey].id,this.getAjaxComments(this.currentKey)},popup_destroyed:function(){this.media_id="",this.mediaComments=[],this.commentCounter=0,this.currentKey=-1},showComments:function(e,t){(Object.size(e)-this.commentCounter-t<0||void 0===t)&&(t=Object.size(e)-this.commentCounter);var a=this.commentCounter;for(i=Object.size(e)-a-1;i>=Object.size(e)-a-t;i--){this.commentCounter++;var r=e[i].text,r=wdi_front.escape_tags(r);r=this.filterCommentText(r);var n=e[i].from.username,d=(e[i].from.profile_picture,jQuery('<div class="wdi_single_comment"></div>'));d.append(jQuery('<p class="wdi_comment_header_p"><span class="wdi_comment_header"><a target="_blank" href="//instagram.com/'+n+'">'+n+'</a></span><span class="wdi_comment_date">'+wdi_front.convertUnixDate(e[i].created_time)+"</span></p>")),d.append(jQuery('<div class="wdi_comment_body_p"><span class="wdi_comment_body"><p>'+r+"</p></span></div>")),jQuery("#wdi_added_comments").prepend(d)}this.updateScrollbar()},updateScrollbar:function(){var e=jQuery("#wdi_comments"),t=jQuery("#wdi_added_comments");jQuery(".wdi_comments").attr("class","wdi_comments"),jQuery(".wdi_comments").html(""),jQuery(".wdi_comments").append(e),jQuery(".wdi_comments").append(t),void 0!==jQuery().mCustomScrollbar&&jQuery.isFunction(jQuery().mCustomScrollbar)&&jQuery(".wdi_comments").mCustomScrollbar({scrollInertia:250}),jQuery(".wdi_comments_close_btn").on("click",wdi_comment)},getAjaxComments:function(){this.instagram.getRecentMediaComments(this.media_id,{success:function(e){if(""==e||null==e||null==e)return errorMessage="Network Error, please try again later :(",void console.log("%c"+errorMessage,"color:#cc0000;");if(200!=e.meta.code)return errorMessage=e.meta.error_message,void console.log("%c"+errorMessage,"color:#cc0000;");wdi_comments_manager.mediaComments=e.data;var t=wdi_data[wdi_comments_manager.currentKey];t.comments_data=e.data,wdi_comments_manager.showComments(t.comments_data,wdi_comments_manager.load_more_count),wdi_comments_manager.ajax_comments_ready(e.data)}})},ajax_comments_ready:function(e){this.createLoadMoreAndBindEvent()},createLoadMoreAndBindEvent:function(){jQuery("#wdi_added_comments").prepend(jQuery('<p id="wdi_load_more_comments" class="wdi_load_more_comments">load more comments</p>')),jQuery(".wdi_comment_container #wdi_load_more_comments").on("click",function(){jQuery(this).remove(),wdi_comments_manager.showComments(wdi_comments_manager.mediaComments,wdi_comments_manager.load_more_count),wdi_comments_manager.createLoadMoreAndBindEvent()})},filterCommentText:function(e){for(var t=e.split(" "),i="",a=0;a<t.length;a++)switch(t[a][0]){case"@":i+='<a target="blank" class="wdi_comm_text_link" href="//instagram.com/'+t[a].substring(1,t[a].length)+'">'+t[a]+"</a> ";break;case"#":i+='<a target="blank" class="wdi_comm_text_link" href="//instagram.com/explore/tags/'+t[a].substring(1,t[a].length)+'">'+t[a]+"</a> ";break;default:i+=t[a]+" "}return i=i.substring(0,i.length-1)}};
js/wd_bp_install.min.js ADDED
@@ -0,0 +1 @@
 
1
+ function wd_bp_notice_install(){jQuery.post(wd_bp_url)}jQuery(document).ready(function(){jQuery(".wd_bp_notice_dissmiss").on("click",function(){jQuery("#wd_bp_notice_cont").hide(),jQuery.post(wd_bp_url)})});
js/wdi_admin.js CHANGED
@@ -126,6 +126,20 @@ jQuery(document).ready(function() {
126
  jQuery(this).find('i').toggleClass('dashicons-arrow-up-alt2 dashicons-arrow-down-alt2');
127
  jQuery(this).parents('.wdi-advanced-options').find('.wdi-advanced-body' ).slideToggle(500);
128
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  });
130
 
131
  function wdi_multiple_accounts_option_controller() {
@@ -459,7 +473,6 @@ wdi_controller.save_feed = function ( task ) {
459
  }
460
  }
461
  feed_users.push(default_user);
462
- this.updateFeaturedImageSelect(username, 'add', 'selected');
463
  jQuery('#WDI_feed_users').val(this.stringifyUserData(feed_users));
464
  jQuery('#wdi_feed_thumb').val('');
465
  if ( type == 'business' ) {
@@ -663,54 +676,9 @@ wdi_controller.removeFeedUser = function ( $this ) {
663
  }
664
  $this.parent().remove();
665
  jQuery('#WDI_feed_users').val(this.stringifyUserData(this.feed_users));
666
- // wdi_controller.updateHiddenField();
667
- if ( username !== jQuery('#wdi_default_user').val() ) {
668
- wdi_controller.updateFeaturedImageSelect(username, 'remove');
669
- }
670
  wdi_controller.changed_users();
671
  }
672
 
673
- /**
674
- * Adds or removes users from featured image select
675
- *
676
- * @param {String} username [username of user we want to add/remove]
677
- * @param {String} action [valid options are 'add' and 'remove']
678
- * @param {String} selected [if is set 'selected' then user will be marked as selected in select element]
679
- */
680
- wdi_controller.updateFeaturedImageSelect = function(username, action, selected) {
681
- var select = jQuery('#WDI_thumb_user');
682
- if (selected != 'selected') {
683
- selected = '';
684
- }
685
- switch (action) {
686
- case 'add':
687
- {
688
- //check if there is no duplicate then add
689
- var flag = select.find('option[value="' + username + '"]').length;
690
- if (!flag) {
691
-
692
- var option = jQuery('<option ' + selected + ' value="' + username + '">' + username + '</option>');
693
- select.append(option);
694
- }
695
-
696
- break;
697
- }
698
- case 'remove':
699
- {
700
- select.find('option[value="' + username + '"]').remove();
701
- if(this.feed_users.length > 0) {
702
- select.val(this.feed_users[0].username);
703
- }
704
-
705
- break;
706
- }
707
- }
708
-
709
- }
710
-
711
- ////////////////////////////////////////////////////////////////////////////////
712
- ///////////////////////////////Themes Page//////////////////////////////////////
713
- ////////////////////////////////////////////////////////////////////////////////
714
  wdi_controller.bindSaveThemeEvent = function() {
715
  jQuery('#wdi_save_theme_submit').on('click', function() {
716
  jQuery('#task').attr('value', 'save_feed');
@@ -902,11 +870,6 @@ wdi_controller.addHashtag = function(tagname, response) {
902
  tag_id: response.tag_id
903
  };
904
  this.feed_users.push(tag_obj);
905
- var user_input = '#' + tagname;
906
- selected = this.thumbUser(user_input) ? 'selected' : '';
907
-
908
- wdi_controller.updateFeaturedImageSelect(user_input, 'add', selected);
909
-
910
  } else {
911
  alert(wdi_messages.invalid_hashtag);
912
  }
@@ -958,12 +921,7 @@ wdi_controller.addUser = function(user) {
958
  } else {
959
  alert(user.username + ' ' + wdi_messages.already_added);
960
  }
961
-
962
- selected = this.thumbUser(user.username) ? 'selected' : '';
963
- this.updateFeaturedImageSelect(user.username, 'add', selected);
964
-
965
  this.updateConditionalFiltersUi();
966
-
967
  wdi_controller.saveFeedAfterAjaxWait(true);
968
  }
969
 
126
  jQuery(this).find('i').toggleClass('dashicons-arrow-up-alt2 dashicons-arrow-down-alt2');
127
  jQuery(this).parents('.wdi-advanced-options').find('.wdi-advanced-body' ).slideToggle(500);
128
  });
129
+
130
+ jQuery(document).on('click', '#wdi_verify', function () {
131
+ jQuery('#wdi_submit').prop('disabled', true);
132
+ if ( jQuery(this).is(":checked") ) {
133
+ jQuery('#wdi_submit').prop('disabled', false);
134
+ }
135
+ });
136
+
137
+ jQuery(document).on('click', '#wdi_submit', function () {
138
+ if ( confirm(wdi_messages.uninstall_plugin) ) {
139
+ jQuery('#wdi_uninstall_form').submit();
140
+ }
141
+ return false;
142
+ });
143
  });
144
 
145
  function wdi_multiple_accounts_option_controller() {
473
  }
474
  }
475
  feed_users.push(default_user);
 
476
  jQuery('#WDI_feed_users').val(this.stringifyUserData(feed_users));
477
  jQuery('#wdi_feed_thumb').val('');
478
  if ( type == 'business' ) {
676
  }
677
  $this.parent().remove();
678
  jQuery('#WDI_feed_users').val(this.stringifyUserData(this.feed_users));
 
 
 
 
679
  wdi_controller.changed_users();
680
  }
681
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
682
  wdi_controller.bindSaveThemeEvent = function() {
683
  jQuery('#wdi_save_theme_submit').on('click', function() {
684
  jQuery('#task').attr('value', 'save_feed');
870
  tag_id: response.tag_id
871
  };
872
  this.feed_users.push(tag_obj);
 
 
 
 
 
873
  } else {
874
  alert(wdi_messages.invalid_hashtag);
875
  }
921
  } else {
922
  alert(user.username + ' ' + wdi_messages.already_added);
923
  }
 
 
 
 
924
  this.updateConditionalFiltersUi();
 
925
  wdi_controller.saveFeedAfterAjaxWait(true);
926
  }
927
 
js/wdi_admin.min.js CHANGED
@@ -1 +1 @@
1
- function wdi_multiple_accounts_option_controller(){var e=jQuery(jQuery("#wdi_user_id").closest("form").find(".form-table").get(1));e.addClass("wdi_multiple_accounts_section");var t="";if(wdi_options.wdi_authenticated_users_list){var i=JSON.parse(wdi_options.wdi_authenticated_users_list),r=0;for(var a in i)t+="<tr data-multiple-account='"+r+"'>",t+="<th>Access Token</th>",t+='<td><input type="text" name="wdi_instagram_options[wdi_authenticated_users_list][access_token][]" size="53" required="" value="'+i[a].access_token+'"></td>',t+="</tr>",t+="<tr data-multiple-account='"+r+"' class='wdi_username_tr'>",t+="<th>Username</th>",t+='<td><div class="wdi_input_wrapper"><input type="text" name="wdi_instagram_options[wdi_authenticated_users_list][user_name][]" size="53" required="" value="'+i[a].user_name+'"></div><div class="wdi_remove_auth_user">Delete</div></td>',t+='<input type="hidden" name="wdi_instagram_options[wdi_authenticated_users_list][user_id][]" size="53" required="" value="'+i[a].user_id+'">',t+="</tr>",r++;e.append(t)}jQuery(".wdi_remove_auth_user").on("click",function(e){e.preventDefault();var t=jQuery(this).closest(".wdi_username_tr").data("multiple-account");return jQuery(this).closest(".wdi_multiple_accounts_section").find('tr[data-multiple-account="'+t+'"]').remove(),!1})}function wdi_advanced_option_controller(){var e=jQuery(jQuery("#wdi_user_id").closest("form").find(".form-table").get(1));e.addClass("wdi_advanced_option wdi_advanced_option_close");$tr=jQuery("<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>"),e.prepend($tr),$tr.on("click",function(){e.hasClass("wdi_advanced_option_open")?(e.removeClass("wdi_advanced_option_open"),e.addClass("wdi_advanced_option_close")):(e.removeClass("wdi_advanced_option_close"),e.addClass("wdi_advanced_option_open"))})}function wdi_controller(){}function wdi_spider_select_value(e){e.focus(),e.select()}function wdi_spider_set_input_value(e,t){"add"===t&&""==jQuery("#wdi_access_token").attr("value")&&alert("Please get your access token"),document.getElementById(e)&&(document.getElementById(e).value=t)}function wdi_spider_form_submit(e,t){document.getElementById(t)&&document.getElementById(t).submit(),e.preventDefault?e.preventDefault():e.returnValue=!1}function wdi_bulk_actions(e){var t=jQuery(e).val();return""!=t&&(!("delete_all"==t&&!confirm(wdi_messages.do_you_want_to_delete_selected_items))&&(wdi_spider_set_input_value("task",t),jQuery("#wdi_feed_form").submit(),!0))}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").prop("checked"))jQuery("#check_all_items").prop("checked",!1),jQuery("#draganddrop").hide();else{var e=parseInt(jQuery(".displaying-num").html())?parseInt(jQuery(".displaying-num").html()):0,t=(jQuery('input[id^="check_pr_"]').length?parseInt(jQuery('input[id^="check_pr_"]').length):0)+e;jQuery("#check_all_items").prop("checked",!0),t&&(jQuery("#draganddrop").html("<strong><p>Selected "+t+" item"+(t>1?"s":"")+".</p></strong>"),jQuery("#draganddrop").show())}}function wdi_spider_check_all(e){jQuery(e).prop("checked")||(jQuery("#check_all_items").prop("checked",!1),jQuery("#draganddrop").hide())}function wdi_spider_set_input_value(e,t){"add"===t&&""==jQuery("#wdi_access_token").attr("value")&&alert("Please get your access token"),document.getElementById(e)&&(document.getElementById(e).value=t)}function wdi_account_refresh(e){jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{page:"wdi_settings",action:"wdi_account_refresh",nonce:wdi_ajax.wdi_nonce,user_name:e},success:function(e){e.success}})}function wdi_account_remove(e){jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{page:"wdi_settings",action:"wdi_account_disconnect",nonce:wdi_ajax.wdi_nonce,user_name:e},success:function(t){t.success&&jQuery(".wdi-account-list-"+e).remove()}})}function wdi_popup_open(){jQuery(".wdi-popup").show()}function wdi_popup_close(){jQuery(".wdi-popup").hide()}jQuery(document).ready(function(){function e(e){if(!1===e){var r=JSON.parse(localStorage.getItem("wdi_sections"));for(i in null!==r&&!1!==r||(r={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"},localStorage.setItem("wdi_sections",JSON.stringify(r))),r){var a=jQuery("#wdi_save_feed").find("[data-section_name='"+i+"']");t(r[i],a)}}else{var s=jQuery(e).data("section_name"),d=null;if(e.hasClass("wdi_section_open")?(t("show",e),d="show"):e.hasClass("wdi_section_close")&&(t("hide",e),d="hide"),null!=d){var n=JSON.parse(localStorage.getItem("wdi_sections"))||{};n[s]=d,localStorage.setItem("wdi_sections",JSON.stringify(n))}}}function t(e,t){if("show"===e){var i=t.closest(".wdi_section").find(".wdi_elements");"table"===i.data("display")?i.css({display:"table"}):i.css({display:"block"}),t.css({"border-bottom":"1px solid #f1f1f1",margin:"0 auto 15px"}),t.removeClass("wdi_section_open"),t.addClass("wdi_section_close")}else t.closest(".wdi_section").find(".wdi_elements").css({display:"none"}),t.css({"border-bottom":"0px",margin:"0 auto 0px"}),t.removeClass("wdi_section_close"),t.addClass("wdi_section_open")}jQuery("#wdi_reset_cache").click(function(e){jQuery(".wdi_reset_cache_success").remove(),e.preventDefault(),jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_nonce:wdi_ajax.wdi_nonce,task:"reset",action:"wdi_cache"},success:function(e){!1===e.success?jQuery("#wdi_reset_cache").after("<span class='wdi_reset_cache_success' style='color: #fc0000; margin-left: 15px; line-height: 2;'>Failed</span>"):jQuery("#wdi_reset_cache").after("<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("body").hasClass("instagram-feed_page_wdi_settings")&&wdi_advanced_option_controller(),jQuery(".wdi_section_name").click(function(){e(jQuery(this))}),e(!1),jQuery(document).on("click",".wdi-account-show-token",function(){jQuery(this).find("i").toggleClass("dashicons-arrow-up-alt2 dashicons-arrow-down-alt2"),jQuery(this).parents("li").find(".wdi-account-accesstoken").slideToggle(300)}),jQuery(document).on("click",".wdi-advanced-options .wdi-advanced-headline",function(){jQuery(this).find("i").toggleClass("dashicons-arrow-up-alt2 dashicons-arrow-down-alt2"),jQuery(this).parents(".wdi-advanced-options").find(".wdi-advanced-body").slideToggle(500)})}),wdi_controller.getParameterByName=function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(location.search);return null===t?"":decodeURIComponent(t[1].replace(/\+/g," "))},wdi_controller.apiRedirected=function(){var e=this.getParameterByName("access_token").split("."),t=/^[^\\\/&?><"']*$/;for(i=0;i<e.length;i++)if(null===e[i].match(t))return;var r=e.join(".");jQuery(document).ready(function(){""===wdi_options.wdi_access_token?jQuery("#wdi_access_token").attr("value",r):(jQuery(".wdi_more_token_template .wdi_more_access_token").prop("disabled",!1),jQuery(".wdi_more_token_template .wdi_more_access_token").attr("value",r))}),wdi_controller.instagram.addToken(r),wdi_controller.getUserInfo(r)},wdi_controller.getUserInfo=function(e){this.instagram.getSelfInfo({success:function(e){""===wdi_options.wdi_access_token?(jQuery("#wdi_user_name").attr("value",e.data.username),jQuery("#wdi_user_id").attr("value",e.data.id)):(jQuery(".wdi_more_token_template .wdi_more_user_name").prop("disabled",!1),jQuery(".wdi_more_token_template .wdi_more_user_id").prop("disabled",!1),jQuery(".wdi_more_token_template .wdi_more_user_name").attr("value",e.data.username),jQuery(".wdi_more_token_template .wdi_more_user_id").attr("value",e.data.id)),jQuery(document).trigger("wdi_settings_filled")}})},wdi_controller.oldDisplayType={},wdi_controller.displayTypeMemory={},wdi_controller.switchFeedTabs=function(e,t){jQuery("#wdi_refresh_tab").attr("value",e),jQuery(".wdi_tab").hide(),jQuery("#"+e+"_tab").show(),jQuery(".display_type").css("display","none"),jQuery('.display_type[tab="'+e+'"]').css("display","block"),jQuery('.display_type[tab="'+e+'"]').length?jQuery(".display_type_content").show():jQuery(".display_type_content").hide(),jQuery(".wdi_feed_tabs").filter(".wdi_feed_tab_active").each(function(){jQuery(this).removeClass("wdi_feed_tab_active")}),jQuery("#wdi_"+e).addClass("wdi_feed_tab_active");var i=jQuery(),r=!1;null!=t&&""!=t&&(i=jQuery(".display_type #"+t).prop("checked",!0),jQuery("#wdi_feed_type").attr("value",t)),r||0!=(i=jQuery('.display_type[tab="'+e+'"] input[name="feed_type"]:checked')).length&&(r=!0),r||0!=(i=jQuery('.display_type[tab="'+e+'"] #thumbnails')).length&&(r=!0,i.prop("checked",!0),jQuery("#wdi_feed_type").attr("value","thumbnails")),r&&wdi_controller.displaySettingsSection(i),"conditional_filters"==e&&wdi_controller.updateConditionalFiltersUi()},wdi_controller.displaySettingsSection=function(e){var t=e.attr("id").toLowerCase().trim(),i=e.parent().parent().attr("tab"),r=jQuery("#wdi_refresh_section");wdi_controller.oldDisplayType={section:t,tab:i},wdi_controller.displayTypeMemory[i]=wdi_controller.oldDisplayType,null!=r&&r.attr("value",t);var a=jQuery(".wdi_border_wrapper .form-table");jQuery("#wdi_feed_type").attr("value",t);var s=0,d=!1;a.find(".wdi_element").each(function(){0;var e=jQuery(this).find(".wdwt_param").children().children().children().attr("section");if(void 0!==e){d=!1;var i=e.toLowerCase().trim().split(",");for(s=0;s<i.length;s++)i[s]===t&&(jQuery(this).css("display","block"),d=!0);!1===d&&jQuery(this).css("display","none")}})},wdi_controller.switchThemeTabs=function(e,t){jQuery(".wdi_feed_tabs").filter(".wdi_feed_tab_active").each(function(){jQuery(this).removeClass("wdi_feed_tab_active")}),jQuery("#wdi_"+e).addClass("wdi_feed_tab_active"),jQuery("[tab]").each(function(){jQuery(this).attr("tab")!=e?jQuery(this).parent().parent().parent().parent().parent().filter("tr").css("display","none"):jQuery(this).parent().parent().parent().parent().parent().filter("tr").css("display","block")}),jQuery(".display_type").css("display","none"),jQuery('.display_type[tab="'+e+'"]').css("display","block"),jQuery("#wdi_refresh_tab").attr("value",e),null!=t&&""!=t&&jQuery("#wdi_refresh_section").attr("value",t),null==t&&""!=t?null!=wdi_controller.displayTypeMemory[e]?jQuery(".display_type #"+wdi_controller.displayTypeMemory[e].section).trigger("click"):jQuery('.display_type[tab="'+e+'"]').first().find("input").trigger("click"):jQuery(".display_type #"+t).trigger("click")},wdi_controller.bindSaveFeedEvent=function(){var e=this;jQuery("#wdi_save_feed_submit").on("click",function(){e.save_feed("save_feed")}),jQuery("#wdi_save_feed_apply").on("click",function(){e.save_feed("apply_changes")}),jQuery("#wdi_cancel_changes").on("click",function(){e.save_feed("cancel")})},wdi_controller.save_feed=function(e){var t,i,r,a,s=this.feed_users,d={};"cancel"==e&&(window.location=window.location.href),i=jQuery("#WDI_user_name option:selected").data("type"),r=jQuery("#WDI_user_name option:selected").val();var n=wdi_controller.getUserObj(r);if(!n)return alert(wdi_messages.user_field_required),!1;if(a={id:n.user_id,username:n.user_name},wdi_controller.checkIfUserNotSaved(e),0==wdi_controller.waitingAjaxRequestEnd.button){if(d=jQuery("#WDI_feed_users").val(),this.isJsonString(d))for(var l in d=JSON.parse(d))"#"===d[l].username.charAt(0)&&s.push(d[l]);s.push(a),this.updateFeaturedImageSelect(r,"add","selected"),jQuery("#WDI_feed_users").val(this.stringifyUserData(s)),jQuery("#wdi_feed_thumb").val(""),"business"==i&&jQuery("#wdi_feed_thumb").val(n.profile_picture_url),"apply_changes"!=e&&"save_feed"!=e||(t=jQuery("#wdi_add_or_edit").val(),jQuery("#wdi_current_id").val(t)),jQuery("#task").attr("value",e),jQuery("#wdi_save_feed").submit()}},wdi_controller.makeInstagramUserRequest=function(e,t){var i,r,a=this,s=this.getInputType(e),d="hashtag"===s;if(""==e)return alert(wdi_messages.please_write_hashtag),!1;if(""!=e&&!d)return alert(wdi_messages.invalid_hashtag),!1;if(a.checkForDuplicateUser(e))return alert(e+" "+wdi_messages.already_added),!1;switch(i=jQuery("#WDI_user_name option:selected").val(),(r=wdi_controller.getUserObj(i))&&(this.instagram.user=r),s){case"user":break;case"hashtag":var n=e.substr(1,e.length);n=n.replace(" ","");var l=jQuery("input[name='wdi_feed_settings[hashtag_top_recent]']:checked").val();this.instagram.getTagRecentMedia(n,{success:function(e){jQuery("#wdi_add_user_ajax").removeAttr("disabled");var i=a.isValidResponse(e);i.valid&&a.hasData(e)?a.addHashtag(n,e):a.hasData(e)||"success"!=i.msg?alert(i.msg):1!=t?confirm(wdi_messages.hashtag_no_data)?a.addHashtag(n,e):jQuery("#wdi_add_user_ajax_input").val(""):a.addHashtag(n,e)}},null,l)}},wdi_controller.checkForDuplicateUser=function(e){for(var t=0;t<this.feed_users.length;t++)if(e==this.feed_users[t].username)return!0;return!1},wdi_controller.getInputType=function(e){switch(e[0]){case"#":return"hashtag";case"%":return"location";default:return"user"}},wdi_controller.stringifyUserData=function(e){for(var t=[],i=0;i<e.length;i++)t.push({id:e[i].id,username:e[i].username,tag_id:void 0!==e[i].tag_id?e[i].tag_id:""});return JSON.stringify(t)},wdi_controller.bindAddNewUserOrHashtagEvent=function(){jQuery("#wdi_add_user_ajax").on("click",function(){if(void 0===jQuery(this).attr("disabled")){jQuery(this).attr("disabled","disabled");var e=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase();!1===wdi_controller.makeInstagramUserRequest(e)&&jQuery(this).removeAttr("disabled","disabled")}}),jQuery("#wdi_add_user_ajax_input").on("keypress",function(e){if(13==e.keyCode){if(void 0!==jQuery("#wdi_add_user_ajax").attr("disabled"))return;jQuery("#wdi_add_user_ajax").attr("disabled","disabled");var t=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase();return!1===wdi_controller.makeInstagramUserRequest(t)&&jQuery("#wdi_add_user_ajax").removeAttr("disabled","disabled"),!1}})},wdi_controller.removeFeedUser=function(e){var t=e.parent().find("a span").text();if(e.parent().find("a span").hasClass("wdi_hashtag")&&(t="#"+t),0==this.feed_users.length){var i=jQuery("#WDI_feed_users").val();void 0!==i&&this.isJsonString(i)&&(this.feed_users=JSON.parse(i))}for(var r=0;r<this.feed_users.length;r++){if(this.feed_users[r].username==t){this.feed_users.splice(r,1);break}}for(r=0;r<this.feed_users.length;r++){"#"!==this.feed_users[r].username.charAt(0)&&this.feed_users.splice(r,1)}e.parent().remove(),jQuery("#WDI_feed_users").val(this.stringifyUserData(this.feed_users)),t!==jQuery("#wdi_default_user").val()&&wdi_controller.updateFeaturedImageSelect(t,"remove"),wdi_controller.changed_users()},wdi_controller.updateFeaturedImageSelect=function(e,t,i){var r=jQuery("#WDI_thumb_user");switch("selected"!=i&&(i=""),t){case"add":if(!r.find('option[value="'+e+'"]').length){var a=jQuery("<option "+i+' value="'+e+'">'+e+"</option>");r.append(a)}break;case"remove":r.find('option[value="'+e+'"]').remove(),this.feed_users.length>0&&r.val(this.feed_users[0].username)}},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 e=jQuery("#wdi_add_or_edit").attr("value");jQuery("#wdi_current_id").attr("value",e),jQuery("#wdi_save_feed").submit()}),jQuery("#wdi_save_theme_reset").on("click",function(){jQuery("#task").attr("value","reset_changes");var e=jQuery("#wdi_add_or_edit").attr("value");jQuery("#wdi_current_id").attr("value",e),jQuery("#wdi_save_feed").submit()})},wdi_controller.checkIfUserNotSaved=function(e){switch(e){case"save_feed":e="submit";break;case"apply_changes":e="apply";break;case"reset_changes":e="reset"}if(""!=jQuery("#wdi_add_user_ajax_input").val().trim()){var t=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase();return wdi_controller.waitingAjaxRequestEnd={button:e},wdi_controller.makeInstagramUserRequest(t),1}return wdi_controller.waitingAjaxRequestEnd={button:0},0},wdi_controller.saveFeedAfterAjaxWait=function(e){if(null!=wdi_controller.waitingAjaxRequestEnd){var t=wdi_controller.waitingAjaxRequestEnd.button;e&&0!=t&&jQuery("#wdi_save_feed_"+t).trigger("click"),wdi_controller.waitingAjaxRequestEnd=void 0}},wdi_controller.getCookie=function(e){var t=("; "+document.cookie).split("; "+e+"=");if(2==t.length)return t.pop().split(";").shift()},wdi_controller.isValidResponse=function(e){var t={};return void 0===e||void 0===e.meta.code||200!=e.meta.code?(t.valid=!1,void 0===e?t.msg=wdi_messages.instagram_server_error:200!==e.meta.code?t.msg=e.meta.error_message:t.msg=""):(t.valid=!0,t.msg="success"),t},wdi_controller.hasData=function(e){return void 0!==e&&void 0!==e.data&&0!=e.data.length},wdi_controller.thumbUser=function(e){return this.feed_users.length>0&&this.feed_users[0].username===e},wdi_controller.findUser=function(e,t){var i=[];void 0!==t&&void 0!==t.data&&(i=t.data);for(var r=0;r<i.length;r++)if(i[r].username==e)return i[r];return!1},wdi_controller.addHashtag=function(e,t){if(null==e.match(/[~!@$%&*#^()<>?]/)){var i=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_ajax").append(i),jQuery("#wdi_add_user_ajax_input").val("");var r={id:"#"+e,username:"#"+e,profile_picture:void 0!==t&&0!=t.data.length&&void 0!==t.data[0].images.thumbnail?t.data[0].images.thumbnail.url:"",tag_id:t.tag_id};this.feed_users.push(r);var a="#"+e;selected=this.thumbUser(a)?"selected":"",wdi_controller.updateFeaturedImageSelect(a,"add",selected)}else alert(wdi_messages.invalid_hashtag);this.updateConditionalFiltersUi(),wdi_controller.saveFeedAfterAjaxWait(!0),wdi_controller.changed_users()},wdi_controller.changed_users=function(){for(var e=!1,t=0;t<this.feed_users.length;t++)if("#"===this.feed_users[t].username[0]){e=!0;break}e?(jQuery(".wdi_element_name_hashtag_top_recent").show(),jQuery(".wdi_element_name_show_username_on_thumb").hide()):(jQuery(".wdi_element_name_hashtag_top_recent").hide(),jQuery(".wdi_element_name_show_username_on_thumb").show())},wdi_controller.addUser=function(e){e.username=e.user_name,0==this.checkForDuplicateUser(e.username)?(newUser=jQuery('<div class="wdi_user"><a target="_blank" href="http://www.instagram.com/'+e.username+'"><span class="wdi_username">'+e.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_ajax").append(newUser),jQuery("#wdi_add_user_ajax_input").val(""),this.feed_users.push({id:e.id,username:e.username,profile_picture:""})):alert(e.username+" "+wdi_messages.already_added),selected=this.thumbUser(e.username)?"selected":"",this.updateFeaturedImageSelect(e.username,"add",selected),this.updateConditionalFiltersUi(),wdi_controller.saveFeedAfterAjaxWait(!0)},wdi_controller.getUserProfilePic=function(e){for(var t=0;t<this.feed_users.length;t++)if(e==this.feed_users[t].username)return this.feed_users[t].profile_picture;return"false"},wdi_controller.conditionalFiltersTabInit=function(){this.setInitialFilters(),this.updateFiltersUi();var e=this;function t(){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")}}jQuery("#wdi_add_filter").on("click",function(){e.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(t){if(13==t.keyCode)return e.addConditionalFilter()&&jQuery(this).val(""),!1}),t(),jQuery("#WDI_wrap_conditional_filter_enable input").on("change",function(){t()}),jQuery("#WDI_conditional_filter_type").on("change",function(){switch("none"==jQuery(this).val()||jQuery("#WDI_conditional_filters").css("display","block"),jQuery(this).parent().find("label").css({display:"inline-block"}),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)}wdi_controller.updateFiltersUi()}),jQuery("#WDI_conditional_filter_type").trigger("change")},wdi_controller.addConditionalFilter=function(){var e=jQuery("#wdi_filter_input").val(),t=jQuery("#wdi_filter_type").val();if(filter={},""==e)return!1;switch(e=e.trim(),null==t&&("@"==e[0]?t="mention":"#"==e[0]?t="hashtag":"http"!=e.split("://")[0]&&"https"!=e.split("://")[0]||(t="url")),t){case"username":case"mention":"@"==e[0]&&(e=e.substr(1,e.length));break;case"hashtag":"#"==e[0]&&(e=e.substr(1,e.length));break;case"url":if(!/^(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.test(e))return alert(wdi_messages.invalid_url),!1}return filter={filter_type:t,filter_by:e,id:this.randomId()},null!=t?this.filterExists(filter)?(alert(e+" "+wdi_messages.already_added),!1):(this.conditionalFilters.push(filter),this.updateFiltersUi(),!0):(alert(wdi_messages.selectConditionType),!1)},wdi_controller.filterExists=function(e){for(var t=0;t<this.conditionalFilters.length;t++)if(this.conditionalFilters[t].filter_type==e.filter_type&&this.conditionalFilters[t].filter_by==e.filter_by)return!0;return!1},wdi_controller.updateFiltersUi=function(){for(var e=jQuery("#wdi_filters_ui").html(""),t=0;t<this.conditionalFilters.length;t++){if(0==t)if(1!=this.conditionalFilters.length)switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":break;case"OR":e.append(jQuery('<span class="wdi_logic">'+wdi_messages.either+"</span>"));break;case"NOR":e.append(jQuery('<span class="wdi_logic">'+wdi_messages.neither+"</span>"))}else switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":case"OR":break;case"NOR":e.append(jQuery('<span class="wdi_logic">'+wdi_messages.not+"</span>"))}var i;switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":i=wdi_messages.and;break;case"OR":i=wdi_messages.or;break;case"NOR":i=wdi_messages.nor}t>=1&&e.append(jQuery('<span class="wdi_logic">'+i+"</span>")),e.append(this.createUiElement(this.conditionalFilters[t]))}this.updateFilterTextarea()},wdi_controller.createUiElement=function(e){var t;switch(e.filter_type){case"mention":t="@";break;case"hashtag":t="#";break;case"location":t="%";break;default:t=""}return jQuery('<span data-id="'+e.id+'" class="wdi_filter_item wdi_filter_by_'+e.filter_type+'"></span>').html(t+e.filter_by+'<span onclick="wdi_controller.removeConditionalFilter(jQuery(this));" class="wdi_remove_filter">X</span>')},wdi_controller.randomId=function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=0;i<5;i++)e+=t.charAt(Math.floor(Math.random()*t.length));return e},wdi_controller.removeConditionalFilter=function(e){for(var t=e.parent().attr("data-id"),i=0;i<this.conditionalFilters.length;i++)this.conditionalFilters[i].id==t&&this.conditionalFilters.splice(i,1);this.updateFiltersUi()},wdi_controller.updateFilterTextarea=function(){var e,t=this.conditionalFilters;e=JSON.stringify(t),jQuery("#wdi_conditional_filters_textarea").val(e)},wdi_controller.setInitialFilters=function(){var e=[],t=jQuery("#wdi_conditional_filters_textarea").val();this.isJsonString(t)&&(e=JSON.parse(t)),this.conditionalFilters=e},wdi_controller.updateConditionalFiltersUi=function(){wdi_controller.updateFilterSource()},wdi_controller.updateFilterSource=function(){if("liked"!=jQuery('input[name="wdi_feed_settings[liked_feed]"]:checked').val()){var e,t,i=[];jQuery(".wdi_user").each(function(){e=0!=jQuery(this).find(".wdi_username").length?jQuery(this).find(".wdi_username").text():jQuery(this).find(".wdi_hashtag").text(),t=jQuery(this).find("img").attr("src"),i.push({username:e,image:t})});a=jQuery("#wdi_filter_source").html("");for(var r=0;r<i.length;r++){s="<div class='wdi_source_user'><span class='wdi_source_img'><img src='"+i[r].image+"'></span><span class='wdi_source_username'>"+i[r].username+"</span></div>";a.html(a.html()+s)}}else{var a,s="<div class='wdi_source_user'><span class='wdi_source_username'>Media I liked</span></div>";(a=jQuery("#wdi_filter_source").html("")).html(a.html()+s)}},wdi_controller.isJsonString=function(e){try{JSON.parse(e)}catch(e){return!1}return!0},wdi_controller.getUserObj=function(e){var t=JSON.parse(wdi_options.wdi_authenticated_users_list);if("object"==typeof t){if("object"==typeof t[e]&&""!=t[e])return t[e];console.log("Error: User not exist on Users object")}else console.log("Error: Wrong response when parsed on users (JSON.parse)");return!1};
1
+ function wdi_multiple_accounts_option_controller(){var e=jQuery(jQuery("#wdi_user_id").closest("form").find(".form-table").get(1));e.addClass("wdi_multiple_accounts_section");var t="";if(wdi_options.wdi_authenticated_users_list){var i=JSON.parse(wdi_options.wdi_authenticated_users_list),r=0;for(var a in i)t+="<tr data-multiple-account='"+r+"'>",t+="<th>Access Token</th>",t+='<td><input type="text" name="wdi_instagram_options[wdi_authenticated_users_list][access_token][]" size="53" required="" value="'+i[a].access_token+'"></td>',t+="</tr>",t+="<tr data-multiple-account='"+r+"' class='wdi_username_tr'>",t+="<th>Username</th>",t+='<td><div class="wdi_input_wrapper"><input type="text" name="wdi_instagram_options[wdi_authenticated_users_list][user_name][]" size="53" required="" value="'+i[a].user_name+'"></div><div class="wdi_remove_auth_user">Delete</div></td>',t+='<input type="hidden" name="wdi_instagram_options[wdi_authenticated_users_list][user_id][]" size="53" required="" value="'+i[a].user_id+'">',t+="</tr>",r++;e.append(t)}jQuery(".wdi_remove_auth_user").on("click",function(e){e.preventDefault();var t=jQuery(this).closest(".wdi_username_tr").data("multiple-account");return jQuery(this).closest(".wdi_multiple_accounts_section").find('tr[data-multiple-account="'+t+'"]').remove(),!1})}function wdi_advanced_option_controller(){var e=jQuery(jQuery("#wdi_user_id").closest("form").find(".form-table").get(1));e.addClass("wdi_advanced_option wdi_advanced_option_close");$tr=jQuery("<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>"),e.prepend($tr),$tr.on("click",function(){e.hasClass("wdi_advanced_option_open")?(e.removeClass("wdi_advanced_option_open"),e.addClass("wdi_advanced_option_close")):(e.removeClass("wdi_advanced_option_close"),e.addClass("wdi_advanced_option_open"))})}function wdi_controller(){}function wdi_spider_select_value(e){e.focus(),e.select()}function wdi_spider_set_input_value(e,t){"add"===t&&""==jQuery("#wdi_access_token").attr("value")&&alert("Please get your access token"),document.getElementById(e)&&(document.getElementById(e).value=t)}function wdi_spider_form_submit(e,t){document.getElementById(t)&&document.getElementById(t).submit(),e.preventDefault?e.preventDefault():e.returnValue=!1}function wdi_bulk_actions(e){var t=jQuery(e).val();return""!=t&&(!("delete_all"==t&&!confirm(wdi_messages.do_you_want_to_delete_selected_items))&&(wdi_spider_set_input_value("task",t),jQuery("#wdi_feed_form").submit(),!0))}function wdi_spider_check_all_items(){wdi_spider_check_all_items_checkbox(),jQuery("#check_all").trigger("click")}function wdi_spider_check_all_items_checkbox(){var e,t;jQuery("#check_all_items").prop("checked")?(jQuery("#check_all_items").prop("checked",!1),jQuery("#draganddrop").hide()):(e=parseInt(jQuery(".displaying-num").html())?parseInt(jQuery(".displaying-num").html()):0,t=(jQuery('input[id^="check_pr_"]').length?parseInt(jQuery('input[id^="check_pr_"]').length):0)+e,jQuery("#check_all_items").prop("checked",!0),t&&(jQuery("#draganddrop").html("<strong><p>Selected "+t+" item"+(1<t?"s":"")+".</p></strong>"),jQuery("#draganddrop").show()))}function wdi_spider_check_all(e){jQuery(e).prop("checked")||(jQuery("#check_all_items").prop("checked",!1),jQuery("#draganddrop").hide())}function wdi_spider_set_input_value(e,t){"add"===t&&""==jQuery("#wdi_access_token").attr("value")&&alert("Please get your access token"),document.getElementById(e)&&(document.getElementById(e).value=t)}function wdi_account_refresh(e){jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{page:"wdi_settings",action:"wdi_account_refresh",nonce:wdi_ajax.wdi_nonce,user_name:e},success:function(e){e.success}})}function wdi_account_remove(t){jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{page:"wdi_settings",action:"wdi_account_disconnect",nonce:wdi_ajax.wdi_nonce,user_name:t},success:function(e){e.success&&jQuery(".wdi-account-list-"+t).remove()}})}function wdi_popup_open(){jQuery(".wdi-popup").show()}function wdi_popup_close(){jQuery(".wdi-popup").hide()}jQuery(document).ready(function(){function e(e){if(!1===e){var t=JSON.parse(localStorage.getItem("wdi_sections"));for(i in null!==t&&!1!==t||(t={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"},localStorage.setItem("wdi_sections",JSON.stringify(t))),t){var r=jQuery("#wdi_save_feed").find("[data-section_name='"+i+"']");d(t[i],r)}}else{var a,s=jQuery(e).data("section_name"),n=null;e.hasClass("wdi_section_open")?(d("show",e),n="show"):e.hasClass("wdi_section_close")&&(d("hide",e),n="hide"),null!=n&&((a=JSON.parse(localStorage.getItem("wdi_sections"))||{})[s]=n,localStorage.setItem("wdi_sections",JSON.stringify(a)))}}function d(e,t){var i;"show"===e?("table"===(i=t.closest(".wdi_section").find(".wdi_elements")).data("display")?i.css({display:"table"}):i.css({display:"block"}),t.css({"border-bottom":"1px solid #f1f1f1",margin:"0 auto 15px"}),t.removeClass("wdi_section_open"),t.addClass("wdi_section_close")):(t.closest(".wdi_section").find(".wdi_elements").css({display:"none"}),t.css({"border-bottom":"0px",margin:"0 auto 0px"}),t.removeClass("wdi_section_close"),t.addClass("wdi_section_open"))}jQuery("#wdi_reset_cache").click(function(e){jQuery(".wdi_reset_cache_success").remove(),e.preventDefault(),jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_nonce:wdi_ajax.wdi_nonce,task:"reset",action:"wdi_cache"},success:function(e){!1===e.success?jQuery("#wdi_reset_cache").after("<span class='wdi_reset_cache_success' style='color: #fc0000; margin-left: 15px; line-height: 2;'>Failed</span>"):jQuery("#wdi_reset_cache").after("<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("body").hasClass("instagram-feed_page_wdi_settings")&&wdi_advanced_option_controller(),jQuery(".wdi_section_name").click(function(){e(jQuery(this))}),e(!1),jQuery(document).on("click",".wdi-account-show-token",function(){jQuery(this).find("i").toggleClass("dashicons-arrow-up-alt2 dashicons-arrow-down-alt2"),jQuery(this).parents("li").find(".wdi-account-accesstoken").slideToggle(300)}),jQuery(document).on("click",".wdi-advanced-options .wdi-advanced-headline",function(){jQuery(this).find("i").toggleClass("dashicons-arrow-up-alt2 dashicons-arrow-down-alt2"),jQuery(this).parents(".wdi-advanced-options").find(".wdi-advanced-body").slideToggle(500)}),jQuery(document).on("click","#wdi_verify",function(){jQuery("#wdi_submit").prop("disabled",!0),jQuery(this).is(":checked")&&jQuery("#wdi_submit").prop("disabled",!1)}),jQuery(document).on("click","#wdi_submit",function(){return confirm(wdi_messages.uninstall_plugin)&&jQuery("#wdi_uninstall_form").submit(),!1})}),wdi_controller.getParameterByName=function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(location.search);return null===t?"":decodeURIComponent(t[1].replace(/\+/g," "))},wdi_controller.apiRedirected=function(){var e=this.getParameterByName("access_token").split("."),t=/^[^\\\/&?><"']*$/;for(i=0;i<e.length;i++)if(null===e[i].match(t))return;var r=e.join(".");jQuery(document).ready(function(){""===wdi_options.wdi_access_token?jQuery("#wdi_access_token").attr("value",r):(jQuery(".wdi_more_token_template .wdi_more_access_token").prop("disabled",!1),jQuery(".wdi_more_token_template .wdi_more_access_token").attr("value",r))}),wdi_controller.instagram.addToken(r),wdi_controller.getUserInfo(r)},wdi_controller.getUserInfo=function(e){this.instagram.getSelfInfo({success:function(e){""===wdi_options.wdi_access_token?(jQuery("#wdi_user_name").attr("value",e.data.username),jQuery("#wdi_user_id").attr("value",e.data.id)):(jQuery(".wdi_more_token_template .wdi_more_user_name").prop("disabled",!1),jQuery(".wdi_more_token_template .wdi_more_user_id").prop("disabled",!1),jQuery(".wdi_more_token_template .wdi_more_user_name").attr("value",e.data.username),jQuery(".wdi_more_token_template .wdi_more_user_id").attr("value",e.data.id)),jQuery(document).trigger("wdi_settings_filled")}})},wdi_controller.oldDisplayType={},wdi_controller.displayTypeMemory={},wdi_controller.switchFeedTabs=function(e,t){jQuery("#wdi_refresh_tab").attr("value",e),jQuery(".wdi_tab").hide(),jQuery("#"+e+"_tab").show(),jQuery(".display_type").css("display","none"),jQuery('.display_type[tab="'+e+'"]').css("display","block"),jQuery('.display_type[tab="'+e+'"]').length?jQuery(".display_type_content").show():jQuery(".display_type_content").hide(),jQuery(".wdi_feed_tabs").filter(".wdi_feed_tab_active").each(function(){jQuery(this).removeClass("wdi_feed_tab_active")}),jQuery("#wdi_"+e).addClass("wdi_feed_tab_active");var i=jQuery(),r=!1;null!=t&&""!=t&&(i=jQuery(".display_type #"+t).prop("checked",!0),jQuery("#wdi_feed_type").attr("value",t)),r||0!=(i=jQuery('.display_type[tab="'+e+'"] input[name="feed_type"]:checked')).length&&(r=!0),r||0!=(i=jQuery('.display_type[tab="'+e+'"] #thumbnails')).length&&(r=!0,i.prop("checked",!0),jQuery("#wdi_feed_type").attr("value","thumbnails")),r&&wdi_controller.displaySettingsSection(i),"conditional_filters"==e&&wdi_controller.updateConditionalFiltersUi()},wdi_controller.displaySettingsSection=function(e){var i=e.attr("id").toLowerCase().trim(),t=e.parent().parent().attr("tab"),r=jQuery("#wdi_refresh_section");wdi_controller.oldDisplayType={section:i,tab:t},wdi_controller.displayTypeMemory[t]=wdi_controller.oldDisplayType,null!=r&&r.attr("value",i);var a=jQuery(".wdi_border_wrapper .form-table");jQuery("#wdi_feed_type").attr("value",i);var s=0,n=!1;a.find(".wdi_element").each(function(){0;var e=jQuery(this).find(".wdwt_param").children().children().children().attr("section");if(void 0!==e){n=!1;var t=e.toLowerCase().trim().split(",");for(s=0;s<t.length;s++)t[s]===i&&(jQuery(this).css("display","block"),n=!0);!1===n&&jQuery(this).css("display","none")}})},wdi_controller.switchThemeTabs=function(e,t){jQuery(".wdi_feed_tabs").filter(".wdi_feed_tab_active").each(function(){jQuery(this).removeClass("wdi_feed_tab_active")}),jQuery("#wdi_"+e).addClass("wdi_feed_tab_active"),jQuery("[tab]").each(function(){jQuery(this).attr("tab")!=e?jQuery(this).parent().parent().parent().parent().parent().filter("tr").css("display","none"):jQuery(this).parent().parent().parent().parent().parent().filter("tr").css("display","block")}),jQuery(".display_type").css("display","none"),jQuery('.display_type[tab="'+e+'"]').css("display","block"),jQuery("#wdi_refresh_tab").attr("value",e),null!=t&&""!=t&&jQuery("#wdi_refresh_section").attr("value",t),null==t&&""!=t?null!=wdi_controller.displayTypeMemory[e]?jQuery(".display_type #"+wdi_controller.displayTypeMemory[e].section).trigger("click"):jQuery('.display_type[tab="'+e+'"]').first().find("input").trigger("click"):jQuery(".display_type #"+t).trigger("click")},wdi_controller.bindSaveFeedEvent=function(){var e=this;jQuery("#wdi_save_feed_submit").on("click",function(){e.save_feed("save_feed")}),jQuery("#wdi_save_feed_apply").on("click",function(){e.save_feed("apply_changes")}),jQuery("#wdi_cancel_changes").on("click",function(){e.save_feed("cancel")})},wdi_controller.save_feed=function(e){var t,i,r,a,s=this.feed_users,n={};"cancel"==e&&(window.location=window.location.href),i=jQuery("#WDI_user_name option:selected").data("type"),r=jQuery("#WDI_user_name option:selected").val();var d=wdi_controller.getUserObj(r);if(!d)return alert(wdi_messages.user_field_required),!1;if(a={id:d.user_id,username:d.user_name},wdi_controller.checkIfUserNotSaved(e),0==wdi_controller.waitingAjaxRequestEnd.button){if(n=jQuery("#WDI_feed_users").val(),this.isJsonString(n))for(var l in n=JSON.parse(n))"#"===n[l].username.charAt(0)&&s.push(n[l]);s.push(a),jQuery("#WDI_feed_users").val(this.stringifyUserData(s)),jQuery("#wdi_feed_thumb").val(""),"business"==i&&jQuery("#wdi_feed_thumb").val(d.profile_picture_url),"apply_changes"!=e&&"save_feed"!=e||(t=jQuery("#wdi_add_or_edit").val(),jQuery("#wdi_current_id").val(t)),jQuery("#task").attr("value",e),jQuery("#wdi_save_feed").submit()}},wdi_controller.makeInstagramUserRequest=function(e,i){var t,r,a=this,s=this.getInputType(e),n="hashtag"===s;if(""==e)return alert(wdi_messages.please_write_hashtag),!1;if(""!=e&&!n)return alert(wdi_messages.invalid_hashtag),!1;if(a.checkForDuplicateUser(e))return alert(e+" "+wdi_messages.already_added),!1;switch(t=jQuery("#WDI_user_name option:selected").val(),(r=wdi_controller.getUserObj(t))&&(this.instagram.user=r),s){case"user":break;case"hashtag":var d=(d=e.substr(1,e.length)).replace(" ",""),l=jQuery("input[name='wdi_feed_settings[hashtag_top_recent]']:checked").val();this.instagram.getTagRecentMedia(d,{success:function(e){jQuery("#wdi_add_user_ajax").removeAttr("disabled");var t=a.isValidResponse(e);t.valid&&a.hasData(e)?a.addHashtag(d,e):a.hasData(e)||"success"!=t.msg?alert(t.msg):1==i||confirm(wdi_messages.hashtag_no_data)?a.addHashtag(d,e):jQuery("#wdi_add_user_ajax_input").val("")}},null,l)}},wdi_controller.checkForDuplicateUser=function(e){for(var t=0;t<this.feed_users.length;t++)if(e==this.feed_users[t].username)return!0;return!1},wdi_controller.getInputType=function(e){switch(e[0]){case"#":return"hashtag";case"%":return"location";default:return"user"}},wdi_controller.stringifyUserData=function(e){for(var t=[],i=0;i<e.length;i++)t.push({id:e[i].id,username:e[i].username,tag_id:void 0!==e[i].tag_id?e[i].tag_id:""});return JSON.stringify(t)},wdi_controller.bindAddNewUserOrHashtagEvent=function(){jQuery("#wdi_add_user_ajax").on("click",function(){var e;void 0===jQuery(this).attr("disabled")&&(jQuery(this).attr("disabled","disabled"),e=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase(),!1===wdi_controller.makeInstagramUserRequest(e)&&jQuery(this).removeAttr("disabled","disabled"))}),jQuery("#wdi_add_user_ajax_input").on("keypress",function(e){if(13==e.keyCode){if(void 0!==jQuery("#wdi_add_user_ajax").attr("disabled"))return;jQuery("#wdi_add_user_ajax").attr("disabled","disabled");var t=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase();return!1===wdi_controller.makeInstagramUserRequest(t)&&jQuery("#wdi_add_user_ajax").removeAttr("disabled","disabled"),!1}})},wdi_controller.removeFeedUser=function(e){var t,i=e.parent().find("a span").text();e.parent().find("a span").hasClass("wdi_hashtag")&&(i="#"+i),0!=this.feed_users.length||void 0!==(t=jQuery("#WDI_feed_users").val())&&this.isJsonString(t)&&(this.feed_users=JSON.parse(t));for(var r=0;r<this.feed_users.length;r++){if(this.feed_users[r].username==i){this.feed_users.splice(r,1);break}}for(r=0;r<this.feed_users.length;r++){"#"!==this.feed_users[r].username.charAt(0)&&this.feed_users.splice(r,1)}e.parent().remove(),jQuery("#WDI_feed_users").val(this.stringifyUserData(this.feed_users)),wdi_controller.changed_users()},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 e=jQuery("#wdi_add_or_edit").attr("value");jQuery("#wdi_current_id").attr("value",e),jQuery("#wdi_save_feed").submit()}),jQuery("#wdi_save_theme_reset").on("click",function(){jQuery("#task").attr("value","reset_changes");var e=jQuery("#wdi_add_or_edit").attr("value");jQuery("#wdi_current_id").attr("value",e),jQuery("#wdi_save_feed").submit()})},wdi_controller.checkIfUserNotSaved=function(e){switch(e){case"save_feed":e="submit";break;case"apply_changes":e="apply";break;case"reset_changes":e="reset"}if(""==jQuery("#wdi_add_user_ajax_input").val().trim())return wdi_controller.waitingAjaxRequestEnd={button:0},0;var t=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase();return wdi_controller.waitingAjaxRequestEnd={button:e},wdi_controller.makeInstagramUserRequest(t),1},wdi_controller.saveFeedAfterAjaxWait=function(e){var t;null!=wdi_controller.waitingAjaxRequestEnd&&(t=wdi_controller.waitingAjaxRequestEnd.button,e&&0!=t&&jQuery("#wdi_save_feed_"+t).trigger("click"),wdi_controller.waitingAjaxRequestEnd=void 0)},wdi_controller.getCookie=function(e){var t=("; "+document.cookie).split("; "+e+"=");if(2==t.length)return t.pop().split(";").shift()},wdi_controller.isValidResponse=function(e){var t={};return void 0===e||void 0===e.meta.code||200!=e.meta.code?(t.valid=!1,void 0===e?t.msg=wdi_messages.instagram_server_error:200!==e.meta.code?t.msg=e.meta.error_message:t.msg=""):(t.valid=!0,t.msg="success"),t},wdi_controller.hasData=function(e){return void 0!==e&&void 0!==e.data&&0!=e.data.length},wdi_controller.thumbUser=function(e){return 0<this.feed_users.length&&this.feed_users[0].username===e},wdi_controller.findUser=function(e,t){var i=[];void 0!==t&&void 0!==t.data&&(i=t.data);for(var r=0;r<i.length;r++)if(i[r].username==e)return i[r];return!1},wdi_controller.addHashtag=function(e,t){var i,r;null==e.match(/[~!@$%&*#^()<>?]/)?(i=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_ajax").append(i),jQuery("#wdi_add_user_ajax_input").val(""),r={id:"#"+e,username:"#"+e,profile_picture:void 0!==t&&0!=t.data.length&&void 0!==t.data[0].images.thumbnail?t.data[0].images.thumbnail.url:"",tag_id:t.tag_id},this.feed_users.push(r)):alert(wdi_messages.invalid_hashtag),this.updateConditionalFiltersUi(),wdi_controller.saveFeedAfterAjaxWait(!0),wdi_controller.changed_users()},wdi_controller.changed_users=function(){for(var e=!1,t=0;t<this.feed_users.length;t++)if("#"===this.feed_users[t].username[0]){e=!0;break}e?(jQuery(".wdi_element_name_hashtag_top_recent").show(),jQuery(".wdi_element_name_show_username_on_thumb").hide()):(jQuery(".wdi_element_name_hashtag_top_recent").hide(),jQuery(".wdi_element_name_show_username_on_thumb").show())},wdi_controller.addUser=function(e){e.username=e.user_name,0==this.checkForDuplicateUser(e.username)?(newUser=jQuery('<div class="wdi_user"><a target="_blank" href="http://www.instagram.com/'+e.username+'"><span class="wdi_username">'+e.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_ajax").append(newUser),jQuery("#wdi_add_user_ajax_input").val(""),this.feed_users.push({id:e.id,username:e.username,profile_picture:""})):alert(e.username+" "+wdi_messages.already_added),this.updateConditionalFiltersUi(),wdi_controller.saveFeedAfterAjaxWait(!0)},wdi_controller.getUserProfilePic=function(e){for(var t=0;t<this.feed_users.length;t++)if(e==this.feed_users[t].username)return this.feed_users[t].profile_picture;return"false"},wdi_controller.conditionalFiltersTabInit=function(){this.setInitialFilters(),this.updateFiltersUi();var t=this;function e(){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")}}jQuery("#wdi_add_filter").on("click",function(){t.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(e){if(13==e.keyCode)return t.addConditionalFilter()&&jQuery(this).val(""),!1}),e(),jQuery("#WDI_wrap_conditional_filter_enable input").on("change",function(){e()}),jQuery("#WDI_conditional_filter_type").on("change",function(){switch("none"==jQuery(this).val()||jQuery("#WDI_conditional_filters").css("display","block"),jQuery(this).parent().find("label").css({display:"inline-block"}),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)}wdi_controller.updateFiltersUi()}),jQuery("#WDI_conditional_filter_type").trigger("change")},wdi_controller.addConditionalFilter=function(){var e=jQuery("#wdi_filter_input").val(),t=jQuery("#wdi_filter_type").val();if(filter={},""==e)return!1;switch(e=e.trim(),null==t&&("@"==e[0]?t="mention":"#"==e[0]?t="hashtag":"http"!=e.split("://")[0]&&"https"!=e.split("://")[0]||(t="url")),t){case"username":case"mention":"@"==e[0]&&(e=e.substr(1,e.length));break;case"hashtag":"#"==e[0]&&(e=e.substr(1,e.length));break;case"url":if(!/^(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.test(e))return alert(wdi_messages.invalid_url),!1}return filter={filter_type:t,filter_by:e,id:this.randomId()},null!=t?this.filterExists(filter)?(alert(e+" "+wdi_messages.already_added),!1):(this.conditionalFilters.push(filter),this.updateFiltersUi(),!0):(alert(wdi_messages.selectConditionType),!1)},wdi_controller.filterExists=function(e){for(var t=0;t<this.conditionalFilters.length;t++)if(this.conditionalFilters[t].filter_type==e.filter_type&&this.conditionalFilters[t].filter_by==e.filter_by)return!0;return!1},wdi_controller.updateFiltersUi=function(){for(var e,t=jQuery("#wdi_filters_ui").html(""),i=0;i<this.conditionalFilters.length;i++){if(0==i)if(1!=this.conditionalFilters.length)switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":break;case"OR":t.append(jQuery('<span class="wdi_logic">'+wdi_messages.either+"</span>"));break;case"NOR":t.append(jQuery('<span class="wdi_logic">'+wdi_messages.neither+"</span>"))}else switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":case"OR":break;case"NOR":t.append(jQuery('<span class="wdi_logic">'+wdi_messages.not+"</span>"))}switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":e=wdi_messages.and;break;case"OR":e=wdi_messages.or;break;case"NOR":e=wdi_messages.nor}1<=i&&t.append(jQuery('<span class="wdi_logic">'+e+"</span>")),t.append(this.createUiElement(this.conditionalFilters[i]))}this.updateFilterTextarea()},wdi_controller.createUiElement=function(e){var t;switch(e.filter_type){case"mention":t="@";break;case"hashtag":t="#";break;case"location":t="%";break;default:t=""}return jQuery('<span data-id="'+e.id+'" class="wdi_filter_item wdi_filter_by_'+e.filter_type+'"></span>').html(t+e.filter_by+'<span onclick="wdi_controller.removeConditionalFilter(jQuery(this));" class="wdi_remove_filter">X</span>')},wdi_controller.randomId=function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=0;i<5;i++)e+=t.charAt(Math.floor(Math.random()*t.length));return e},wdi_controller.removeConditionalFilter=function(e){for(var t=e.parent().attr("data-id"),i=0;i<this.conditionalFilters.length;i++)this.conditionalFilters[i].id==t&&this.conditionalFilters.splice(i,1);this.updateFiltersUi()},wdi_controller.updateFilterTextarea=function(){var e=this.conditionalFilters,t=JSON.stringify(e);jQuery("#wdi_conditional_filters_textarea").val(t)},wdi_controller.setInitialFilters=function(){var e=[],t=jQuery("#wdi_conditional_filters_textarea").val();this.isJsonString(t)&&(e=JSON.parse(t)),this.conditionalFilters=e},wdi_controller.updateConditionalFiltersUi=function(){wdi_controller.updateFilterSource()},wdi_controller.updateFilterSource=function(){if("liked"!=jQuery('input[name="wdi_feed_settings[liked_feed]"]:checked').val()){var e,t,i=[];jQuery(".wdi_user").each(function(){e=0!=jQuery(this).find(".wdi_username").length?jQuery(this).find(".wdi_username").text():jQuery(this).find(".wdi_hashtag").text(),t=jQuery(this).find("img").attr("src"),i.push({username:e,image:t})});for(var r=jQuery("#wdi_filter_source").html(""),a=0;a<i.length;a++){s="<div class='wdi_source_user'><span class='wdi_source_img'><img src='"+i[a].image+"'></span><span class='wdi_source_username'>"+i[a].username+"</span></div>";r.html(r.html()+s)}}else{var r,s="<div class='wdi_source_user'><span class='wdi_source_username'>Media I liked</span></div>";(r=jQuery("#wdi_filter_source").html("")).html(r.html()+s)}},wdi_controller.isJsonString=function(e){try{JSON.parse(e)}catch(e){return!1}return!0},wdi_controller.getUserObj=function(e){var t=JSON.parse(wdi_options.wdi_authenticated_users_list);if("object"==typeof t){if("object"==typeof t[e]&&""!=t[e])return t[e];console.log("Error: User not exist on Users object")}else console.log("Error: Wrong response when parsed on users (JSON.parse)");return!1};
js/wdi_frontend.js CHANGED
@@ -108,7 +108,7 @@ wdi_front.globalInit = function () {
108
 
109
  for (var i = init_feed_counter; i <= num; i++) {
110
 
111
- if(jQuery('#wdi_feed_' + i).length === 0){ //conflict with Yoast SEO, Page Builder by SiteOrigin
112
  continue;
113
  }
114
 
@@ -124,7 +124,43 @@ wdi_front.globalInit = function () {
124
  feed: currentFeed
125
  };
126
 
127
- currentFeed.instagram.filters = [];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
 
129
  currentFeed.instagram.addToken(currentFeed['feed_row']['access_token']);
130
 
@@ -219,13 +255,11 @@ wdi_front.globalInit = function () {
219
  } //endfor
220
  }
221
 
222
- wdi_front.init = function (currentFeed)
223
- {
224
  jQuery('.wdi_js_error').hide();
225
  //some varables used in code
226
  currentFeed.photoCounter = currentFeed.feed_row["number_of_photos"];
227
 
228
-
229
  if (currentFeed.feed_row.liked_feed == 'liked') {
230
  currentFeed.feed_users = ['self'];
231
  // do nothing,
@@ -248,23 +282,30 @@ wdi_front.init = function (currentFeed)
248
  }
249
 
250
  var all_tags = [];
 
 
251
  if (typeof window["wdi_all_tags"] !== "undefined") {
252
  all_tags = window["wdi_all_tags"];
253
  }
254
-
255
  for (var k =0; k < currentFeed.feed_users.length; k++) {
256
  if (currentFeed.feed_users[k].username[0] === "#" && typeof currentFeed.feed_users[k].tag_id !== "undefined") {
257
  all_tags[currentFeed.feed_users[k].tag_id] = currentFeed.feed_users[k];
 
 
 
 
258
  }
259
  }
260
  window["wdi_all_tags"] = all_tags;
 
261
 
262
- currentFeed.dataCount = currentFeed.feed_users.length; //1 in case of self feed
263
  var feedResolution = wdi_front.getFeedItemResolution(currentFeed);
264
  currentFeed.feedImageResolution = feedResolution.image;
265
  currentFeed.feedVideoResolution = feedResolution.video;
266
- for (var i = 0; i < currentFeed.dataCount; i++) {
267
- wdi_front.instagramRequest(i, currentFeed);
 
 
268
  }
269
  if (currentFeed.feed_row["number_of_photos"] > 0) {
270
  wdi_front.ajaxLoader(currentFeed);
@@ -273,6 +314,9 @@ wdi_front.init = function (currentFeed)
273
  if (currentFeed['feed_row']['display_header'] === '1') {
274
  wdi_front.show('header', currentFeed);
275
  }
 
 
 
276
  }
277
 
278
  wdi_front.getFeedItemResolution = function (currentFeed) {
@@ -347,21 +391,17 @@ wdi_front.isJsonString = function (str)
347
  * @param {Number} id [index of user in current_feed.feed_users array]
348
  * @param {Object} currentFeed
349
  */
350
- wdi_front.instagramRequest = function (id, currentFeed)
351
- {
352
  var _this = this,
353
  feed_users = currentFeed.feed_users;
354
 
355
  if (typeof feed_users[id] === 'string' && feed_users[id] === 'self') { // self liked media
356
  currentFeed.instagram.getRecentLikedMedia({
357
- success: function (response)
358
- {
359
-
360
  if(typeof response.meta!= "undefined" && typeof response.meta.error_type != "undefined"){
361
  wdi_front.show_alert(false, response, currentFeed);
362
  }
363
  currentFeed.mediaRequestsDone = true;
364
-
365
  response = _this.checkMediaResponse(response, currentFeed);
366
  if (response != false) {
367
  _this.saveSelfUserData(response, currentFeed);
@@ -370,38 +410,34 @@ wdi_front.instagramRequest = function (id, currentFeed)
370
  });
371
  }
372
  else {
373
- if (this.getInputType(feed_users[id]['username']) == 'hashtag') {
374
  currentFeed.instagram.getTagRecentMedia(this.stripHashtag(feed_users[id]['username']), {
375
- success: function (response)
376
- {
377
  if(typeof response.meta!= "undefined" && typeof response.meta.error_type != "undefined"){
378
  wdi_front.show_alert(false, response, currentFeed);
379
  }
380
  currentFeed.mediaRequestsDone = true;
381
 
382
  response = _this.checkMediaResponse(response, currentFeed);
383
- if (response != false) {
384
- _this.saveUserData(response, currentFeed.feed_users[id], currentFeed);
385
  }
386
  }
387
  }, null, currentFeed.feed_row.hashtag_top_recent);
388
  }
389
  else {
390
- if (this.getInputType(feed_users[id]['username']) == 'user') {
391
-
392
  currentFeed.instagram.getUserMedia({
393
  user_id: feed_users[id].id,
394
- success: function (response)
395
- {
396
  if(typeof response.meta != "undefined" && typeof response.meta.error_type != "undefined"){
397
  response.wdi_current_feed_name = feed_users[id].username;
398
  wdi_front.show_alert(false, response, currentFeed);
399
  }
400
  currentFeed.mediaRequestsDone = true;
401
-
402
  response = _this.checkMediaResponse(response, currentFeed);
403
- if (response != false) {
404
- _this.saveUserData(response, currentFeed.feed_users[id], currentFeed);
405
  }
406
  }
407
  });
@@ -425,14 +461,13 @@ wdi_front.isHashtag = function (str)
425
  * Saves each user data on seperate index in currentFeed.usersData array
426
  * And also checks if all data form all users is already avialable if yes it displays feed
427
  */
428
- wdi_front.saveUserData = function (data, user, currentFeed)
429
- {
430
 
431
- data['username'] = user.username;
432
  data['user_id'] = user.id;
 
433
 
434
- //checking if user type is hashtag then manually add hashtag to each object, for later use
435
- //hashtag based filters
436
  if (data['user_id'][0] === '#') {
437
  data['data'] = wdi_front.appendRequestHashtag(data['data'], data['user_id']);
438
  }
@@ -440,7 +475,6 @@ wdi_front.saveUserData = function (data, user, currentFeed)
440
  currentFeed.usersData.push(data);
441
  currentFeed.currentResponseLength = wdi_front.getArrayContentLength(currentFeed.usersData, 'data');
442
  currentFeed.allResponseLength += currentFeed.currentResponseLength;
443
-
444
  if (currentFeed.dataCount == currentFeed.usersData.length) {
445
 
446
  //if getted objects is not enough then recuest new ones
@@ -448,17 +482,13 @@ wdi_front.saveUserData = function (data, user, currentFeed)
448
  /*here we are calling loadMore function out of recursion cycle, after this initial-keep call
449
  loadMore will be called with 'initial' recursively until the desired number of photos is reached
450
  if possible*/
451
-
452
  wdi_front.loadMore('initial-keep', currentFeed);
453
  }
454
  else {
455
-
456
  //display feed
457
  wdi_front.displayFeed(currentFeed);
458
  //when all data us properly displayed check for any active filters and then apply them
459
  wdi_front.applyFilters(currentFeed);
460
-
461
-
462
  /*removing load more button of feed has finished*/
463
  if (!wdi_front.activeUsersCount(currentFeed)) {
464
  if (currentFeed.feed_row.feed_display_view == 'load_more_btn') {
@@ -484,30 +514,23 @@ wdi_front.saveSelfUserData = function (data, currentFeed)
484
  data['username'] = '';
485
 
486
  currentFeed.usersData.push(data);
487
-
488
  currentFeed.currentResponseLength = wdi_front.getArrayContentLength(currentFeed.usersData, 'data');
489
  currentFeed.allResponseLength += currentFeed.currentResponseLength;
490
-
491
-
492
  if (currentFeed.dataCount == currentFeed.usersData.length) {
493
-
494
  //if retrieved objects are not enough then request new ones
495
-
496
  if (currentFeed.currentResponseLength < currentFeed.feed_row.number_of_photos && !wdi_front.userHasNoPhoto(currentFeed)) {
497
  /*here we are calling loadMore function out of recursion cycle, after this initial-keep call
498
  loadMore will be called with 'initial' recursively until the desired number of photos is reached
499
  if possible*/
500
 
501
  wdi_front.loadMore('initial-keep', currentFeed);
502
- } else {
503
-
504
-
505
  //display feed
506
  wdi_front.displayFeed(currentFeed);
507
  //when all data us properly displayed check for any active filters and then apply them
508
  wdi_front.applyFilters(currentFeed);
509
 
510
-
511
  /*removing load more button of feed has finished*/
512
  if (!wdi_front.activeUsersCount(currentFeed)) {
513
  if (currentFeed.feed_row.feed_display_view == 'load_more_btn') {
@@ -571,9 +594,7 @@ wdi_front.appendRequestHashtag = function (data, hashtag)
571
  * also checks if one request is not enough for displaying all images user wanted
572
  * it recursively calls wdi_front.loadMore() until the desired number of photos is reached
573
  */
574
- wdi_front.displayFeed = function (currentFeed, load_more_number)
575
- {
576
-
577
 
578
  if (currentFeed.customFilterChanged == false) {
579
  //sorting data...
@@ -944,7 +965,7 @@ wdi_front.displayFeedItems = function (data, currentFeed) {
944
  */
945
  if (currentFeed.feed_row.feed_display_view == 'pagination') {
946
  var local_load_more_number = currentFeed.feed_row.load_more_number;
947
- if(currentFeed.feed_row.feed_type == "image_browser"){
948
  local_load_more_number = 1;
949
  }
950
  if (jQuery('#wdi_feed_' + currentFeed.feed_row.wdi_feed_counter + ' [wdi_page="' + (currentFeed.currentPage - 1) + '"]').length < local_load_more_number || data.length == 0) {
@@ -1342,13 +1363,19 @@ wdi_front.createObject = function (obj, currentFeed)
1342
  if ( obj['type'] == 'video' && obj['videos'][currentFeed.feedVideoResolution] && obj['videos'][currentFeed.feedVideoResolution]['url'] != null ) {
1343
  videoUrl = obj.hasOwnProperty('videos') ? obj['videos'][currentFeed.feedVideoResolution]['url'] : '';
1344
  }
1345
-
1346
- if(typeof obj.images[currentFeed.feedImageResolution] == "undefined"){
1347
  var image_url = wdi_url.plugin_url + "images/missing.png";
1348
- }else {
1349
- if( obj.type == "carousel" && typeof obj.images[currentFeed.feedImageResolution].url === 'undefined') {
1350
- var image_url = obj.carousel_media[0].images[currentFeed.feedImageResolution].url;
1351
- } else {
 
 
 
 
 
 
 
1352
  var image_url = obj.images[currentFeed.feedImageResolution].url;
1353
  }
1354
  }
@@ -1435,6 +1462,10 @@ wdi_front.getPhotoTemplate = function (currentFeed)
1435
  }
1436
 
1437
 
 
 
 
 
1438
  //checking if caption is opend by default then add wdi_full_caption class
1439
  //only in masonry
1440
  if (currentFeed.feed_row.show_full_description == 1 && currentFeed.feed_row.feed_type == 'masonry') {
@@ -1496,7 +1527,22 @@ wdi_front.getPhotoTemplate = function (currentFeed)
1496
  '</div>' +
1497
  '</div>' +
1498
  '</div>';
1499
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1500
 
1501
  source += '</div>';
1502
  var template = _.template(source);
@@ -1531,7 +1577,9 @@ wdi_front.getSliderTemplate = function (currentFeed)
1531
  }
1532
 
1533
 
1534
-
 
 
1535
 
1536
  //checking if caption is opend by default then add wdi_full_caption class
1537
  //only in masonry
@@ -1596,7 +1644,22 @@ wdi_front.getSliderTemplate = function (currentFeed)
1596
  '</div>' +
1597
  '</div>' +
1598
  '</div>';
1599
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1600
 
1601
  source += '</div>';
1602
  var template = _.template(source);
@@ -1639,6 +1702,9 @@ wdi_front.getVideoTemplate = function (currentFeed)
1639
  customClass = 'wdi_hidden';
1640
  }
1641
 
 
 
 
1642
 
1643
  //checking if caption is opend by default then add wdi_full_caption class
1644
  //only in masonry
@@ -1694,7 +1760,7 @@ wdi_front.getVideoTemplate = function (currentFeed)
1694
  '<div class="wdi_photo_wrap">' +
1695
  '<div class="wdi_photo_wrap_inner">' +
1696
  '<div class="wdi_photo_img ' +wdi_shape_class + '">' +
1697
- '<img class="wdi_img" ' + sourceAttr + '="<%=image_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);">' +
1698
  '<div class="wdi_photo_overlay ' + overlayCustomClass + '" ' + onclick + '>' + showUsernameOnThumb +
1699
  '<div class="wdi_thumb_icon" style="display:table;width:100%;height:100%;">' +
1700
  '<div style="display:table-cell;vertical-align:middle;text-align:center;color:white;">' +
@@ -1705,7 +1771,22 @@ wdi_front.getVideoTemplate = function (currentFeed)
1705
  '</div>' +
1706
  '</div>' +
1707
  '</div>';
1708
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1709
  source += '</div>';
1710
  var template = _.template(source);
1711
  return template;
@@ -1749,8 +1830,31 @@ wdi_front.bindEvents = function (currentFeed)
1749
  //setting pagiantion flags
1750
  currentFeed.paginatorNextFlag = false;
1751
  }
 
 
 
 
 
 
 
 
 
1752
  }
1753
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1754
 
1755
  wdi_front.paginationFirstPage = function (btn, currentFeed)
1756
  {
@@ -2093,7 +2197,6 @@ wdi_front.checkForLoadMoreDone = function (currentFeed, button)
2093
  if (!wdi_front.activeUsersCount(currentFeed)) {
2094
  return;
2095
  }
2096
-
2097
  wdi_front.displayFeed(currentFeed, load_more_number);
2098
  //when all data us properly displayed check for any active filters and then apply them
2099
  wdi_front.applyFilters(currentFeed);
@@ -2151,6 +2254,7 @@ wdi_front.mergeData = function (array1, array2)
2151
  //broken image handling
2152
  wdi_front.brokenImageHandler = function (source)
2153
  {
 
2154
  var url_params = source.src.split("/p/");
2155
  if(typeof url_params[0] !== "undefined" && typeof url_params[1] !== "undefined" && url_params[0] !== "https://www.instagram.com"){
2156
  var main_url = wdi_baseName(url_params[0]);
@@ -2160,6 +2264,7 @@ wdi_front.brokenImageHandler = function (source)
2160
  source.src = wdi_url.plugin_url + "images/missing.png";
2161
  }
2162
  source.onerror = "";
 
2163
  return true;
2164
  }
2165
  function wdi_baseName(str)
@@ -2169,8 +2274,7 @@ function wdi_baseName(str)
2169
  }
2170
 
2171
  //ajax loading
2172
- wdi_front.ajaxLoader = function (currentFeed)
2173
- {
2174
  var wdi_feed_counter = currentFeed.feed_row['wdi_feed_counter'];
2175
 
2176
  var feed_container = jQuery('#wdi_feed_' + wdi_feed_counter);
@@ -2179,6 +2283,16 @@ wdi_front.ajaxLoader = function (currentFeed)
2179
  feed_container.find('.wdi_spinner').removeClass('wdi_hidden');
2180
  }
2181
  /////////////////////////////////////////////////////
 
 
 
 
 
 
 
 
 
 
2182
  }
2183
 
2184
  //if all images loaded then clicking load more causes it's removal
@@ -2201,6 +2315,10 @@ wdi_front.allImagesLoaded = function (currentFeed) {
2201
  feed_container.find('.wdi_load_more').removeClass('wdi_hidden');
2202
  feed_container.find('.wdi_spinner').addClass('wdi_hidden');
2203
  }
 
 
 
 
2204
  //custom event fired for user based custom js
2205
  feed_container.trigger('wdi_feed_loaded');
2206
  }
@@ -2409,8 +2527,7 @@ wdi_front.show = function (name, currentFeed) {
2409
  }
2410
  }
2411
 
2412
- wdi_front.getUserTemplate = function (currentFeed, username)
2413
- {
2414
  var usersCount = currentFeed.dataCount,
2415
  instagramLink, instagramLinkOnClick, js;
2416
 
@@ -2616,13 +2733,17 @@ wdi_front.parseLighboxData = function (currentFeed, filterFlag) {
2616
  }
2617
  data.sort(sortOperator);
2618
  }
2619
-
2620
  for (i = 0; i < data.length; i++) {
2621
  var thumb_url = (typeof data[i]['media_url'] !== 'undefined') ? data[i]['media_url'] : wdi_url.plugin_url + 'images/video_missing.png';
2622
- if( typeof data[i]['media_url'] === 'undefined' ) {
2623
- if( data[i]['type'] === 'carousel' ) {
2624
  var carousel_media = data[i]['carousel_media'][0];
2625
- thumb_url = carousel_media['images']['standard_resolution']['url'];
 
 
 
 
 
2626
  }
2627
  }
2628
  obj = {
@@ -2886,8 +3007,7 @@ wdi_front.replaceNewLines = function (string)
2886
  }
2887
 
2888
 
2889
- wdi_front.isEmptyObject = function (obj)
2890
- {
2891
  for (var prop in obj) {
2892
  if (obj.hasOwnProperty(prop))
2893
  return false;
@@ -2895,6 +3015,10 @@ wdi_front.isEmptyObject = function (obj)
2895
  return true
2896
  }
2897
 
 
 
 
 
2898
 
2899
  var WDIFeed = function (obj)
2900
  {
@@ -2923,6 +3047,62 @@ var WDIFeed = function (obj)
2923
  */
2924
  WDIFeed.prototype.conditionalFilter = function (response, args)
2925
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2926
  return response;
2927
  }
2928
 
108
 
109
  for (var i = init_feed_counter; i <= num; i++) {
110
 
111
+ if(jQuery('#wdi_feed_' + i).length === 0) { //conflict with Yoast SEO, Page Builder by SiteOrigin
112
  continue;
113
  }
114
 
124
  feed: currentFeed
125
  };
126
 
127
+ currentFeed.instagram.filters = [
128
+ {
129
+ 'where': 'getUserRecentMedia',
130
+ 'what': function (response, args, cArgs)
131
+ {
132
+ return args.feed.conditionalFilter(response, cArgs);
133
+ }
134
+ },
135
+ {
136
+ 'where': 'getUserMedia',
137
+ 'what': function (response, args, cArgs)
138
+ {
139
+ return args.feed.conditionalFilter(response, cArgs);
140
+ }
141
+ },
142
+ {
143
+ 'where': 'getTagRecentMedia',
144
+ 'what': function (response, args, cArgs)
145
+ {
146
+ return args.feed.conditionalFilter(response, cArgs);
147
+ }
148
+ },
149
+ {
150
+ 'where': 'getRecentLikedMedia',
151
+ 'what': function (response, args, cArgs)
152
+ {
153
+ return args.feed.conditionalFilter(response, cArgs);
154
+ }
155
+ },
156
+ {
157
+ 'where': 'requestByUrl',
158
+ 'what': function (response, args, cArgs)
159
+ {
160
+ return args.feed.conditionalFilter(response, cArgs);
161
+ }
162
+ }
163
+ ];
164
 
165
  currentFeed.instagram.addToken(currentFeed['feed_row']['access_token']);
166
 
255
  } //endfor
256
  }
257
 
258
+ wdi_front.init = function (currentFeed) {
 
259
  jQuery('.wdi_js_error').hide();
260
  //some varables used in code
261
  currentFeed.photoCounter = currentFeed.feed_row["number_of_photos"];
262
 
 
263
  if (currentFeed.feed_row.liked_feed == 'liked') {
264
  currentFeed.feed_users = ['self'];
265
  // do nothing,
282
  }
283
 
284
  var all_tags = [];
285
+ var feed_user = [];
286
+ var feed_user_tags = [];
287
  if (typeof window["wdi_all_tags"] !== "undefined") {
288
  all_tags = window["wdi_all_tags"];
289
  }
 
290
  for (var k =0; k < currentFeed.feed_users.length; k++) {
291
  if (currentFeed.feed_users[k].username[0] === "#" && typeof currentFeed.feed_users[k].tag_id !== "undefined") {
292
  all_tags[currentFeed.feed_users[k].tag_id] = currentFeed.feed_users[k];
293
+ feed_user_tags[k] = currentFeed.feed_users[k];
294
+ }
295
+ else {
296
+ feed_user[0] = currentFeed.feed_users[k];
297
  }
298
  }
299
  window["wdi_all_tags"] = all_tags;
300
+ currentFeed.feed_users = ( typeof feed_user_tags !== 'undefined' && !wdi_front.isEmpty(feed_user_tags) ) ? feed_user_tags : feed_user;
301
 
 
302
  var feedResolution = wdi_front.getFeedItemResolution(currentFeed);
303
  currentFeed.feedImageResolution = feedResolution.image;
304
  currentFeed.feedVideoResolution = feedResolution.video;
305
+ currentFeed.dataCount = currentFeed.feed_users.length; // 1 in case of self feed
306
+
307
+ for ( var i = 0; i < currentFeed.dataCount; i++ ) {
308
+ wdi_front.instagramRequest(i, currentFeed);
309
  }
310
  if (currentFeed.feed_row["number_of_photos"] > 0) {
311
  wdi_front.ajaxLoader(currentFeed);
314
  if (currentFeed['feed_row']['display_header'] === '1') {
315
  wdi_front.show('header', currentFeed);
316
  }
317
+ if (currentFeed['feed_row']['show_usernames'] === '1') {
318
+ wdi_front.show('users', currentFeed);
319
+ }
320
  }
321
 
322
  wdi_front.getFeedItemResolution = function (currentFeed) {
391
  * @param {Number} id [index of user in current_feed.feed_users array]
392
  * @param {Object} currentFeed
393
  */
394
+ wdi_front.instagramRequest = function (id, currentFeed) {
 
395
  var _this = this,
396
  feed_users = currentFeed.feed_users;
397
 
398
  if (typeof feed_users[id] === 'string' && feed_users[id] === 'self') { // self liked media
399
  currentFeed.instagram.getRecentLikedMedia({
400
+ success: function (response) {
 
 
401
  if(typeof response.meta!= "undefined" && typeof response.meta.error_type != "undefined"){
402
  wdi_front.show_alert(false, response, currentFeed);
403
  }
404
  currentFeed.mediaRequestsDone = true;
 
405
  response = _this.checkMediaResponse(response, currentFeed);
406
  if (response != false) {
407
  _this.saveSelfUserData(response, currentFeed);
410
  });
411
  }
412
  else {
413
+ if ( this.getInputType(feed_users[id]['username']) == 'hashtag' ) {
414
  currentFeed.instagram.getTagRecentMedia(this.stripHashtag(feed_users[id]['username']), {
415
+ success: function (response) {
 
416
  if(typeof response.meta!= "undefined" && typeof response.meta.error_type != "undefined"){
417
  wdi_front.show_alert(false, response, currentFeed);
418
  }
419
  currentFeed.mediaRequestsDone = true;
420
 
421
  response = _this.checkMediaResponse(response, currentFeed);
422
+ if ( response != false ) {
423
+ _this.saveUserData(response, currentFeed.feed_users[id], currentFeed);
424
  }
425
  }
426
  }, null, currentFeed.feed_row.hashtag_top_recent);
427
  }
428
  else {
429
+ if ( this.getInputType( feed_users[id]['username']) == 'user' ) {
 
430
  currentFeed.instagram.getUserMedia({
431
  user_id: feed_users[id].id,
432
+ success: function (response) {
 
433
  if(typeof response.meta != "undefined" && typeof response.meta.error_type != "undefined"){
434
  response.wdi_current_feed_name = feed_users[id].username;
435
  wdi_front.show_alert(false, response, currentFeed);
436
  }
437
  currentFeed.mediaRequestsDone = true;
 
438
  response = _this.checkMediaResponse(response, currentFeed);
439
+ if ( response != false ) {
440
+ _this.saveUserData(response, currentFeed.feed_users[id], currentFeed);
441
  }
442
  }
443
  });
461
  * Saves each user data on seperate index in currentFeed.usersData array
462
  * And also checks if all data form all users is already avialable if yes it displays feed
463
  */
464
+ wdi_front.saveUserData = function (data, user, currentFeed) {
 
465
 
 
466
  data['user_id'] = user.id;
467
+ data['username'] = user.username;
468
 
469
+ // checking if user type is hashtag then manually add hashtag to each object, for later use
470
+ // hashtag based filters
471
  if (data['user_id'][0] === '#') {
472
  data['data'] = wdi_front.appendRequestHashtag(data['data'], data['user_id']);
473
  }
475
  currentFeed.usersData.push(data);
476
  currentFeed.currentResponseLength = wdi_front.getArrayContentLength(currentFeed.usersData, 'data');
477
  currentFeed.allResponseLength += currentFeed.currentResponseLength;
 
478
  if (currentFeed.dataCount == currentFeed.usersData.length) {
479
 
480
  //if getted objects is not enough then recuest new ones
482
  /*here we are calling loadMore function out of recursion cycle, after this initial-keep call
483
  loadMore will be called with 'initial' recursively until the desired number of photos is reached
484
  if possible*/
 
485
  wdi_front.loadMore('initial-keep', currentFeed);
486
  }
487
  else {
 
488
  //display feed
489
  wdi_front.displayFeed(currentFeed);
490
  //when all data us properly displayed check for any active filters and then apply them
491
  wdi_front.applyFilters(currentFeed);
 
 
492
  /*removing load more button of feed has finished*/
493
  if (!wdi_front.activeUsersCount(currentFeed)) {
494
  if (currentFeed.feed_row.feed_display_view == 'load_more_btn') {
514
  data['username'] = '';
515
 
516
  currentFeed.usersData.push(data);
 
517
  currentFeed.currentResponseLength = wdi_front.getArrayContentLength(currentFeed.usersData, 'data');
518
  currentFeed.allResponseLength += currentFeed.currentResponseLength;
 
 
519
  if (currentFeed.dataCount == currentFeed.usersData.length) {
 
520
  //if retrieved objects are not enough then request new ones
 
521
  if (currentFeed.currentResponseLength < currentFeed.feed_row.number_of_photos && !wdi_front.userHasNoPhoto(currentFeed)) {
522
  /*here we are calling loadMore function out of recursion cycle, after this initial-keep call
523
  loadMore will be called with 'initial' recursively until the desired number of photos is reached
524
  if possible*/
525
 
526
  wdi_front.loadMore('initial-keep', currentFeed);
527
+ }
528
+ else {
 
529
  //display feed
530
  wdi_front.displayFeed(currentFeed);
531
  //when all data us properly displayed check for any active filters and then apply them
532
  wdi_front.applyFilters(currentFeed);
533
 
 
534
  /*removing load more button of feed has finished*/
535
  if (!wdi_front.activeUsersCount(currentFeed)) {
536
  if (currentFeed.feed_row.feed_display_view == 'load_more_btn') {
594
  * also checks if one request is not enough for displaying all images user wanted
595
  * it recursively calls wdi_front.loadMore() until the desired number of photos is reached
596
  */
597
+ wdi_front.displayFeed = function (currentFeed, load_more_number) {
 
 
598
 
599
  if (currentFeed.customFilterChanged == false) {
600
  //sorting data...
965
  */
966
  if (currentFeed.feed_row.feed_display_view == 'pagination') {
967
  var local_load_more_number = currentFeed.feed_row.load_more_number;
968
+ if(currentFeed.feed_row.feed_type == 'image_browser') {
969
  local_load_more_number = 1;
970
  }
971
  if (jQuery('#wdi_feed_' + currentFeed.feed_row.wdi_feed_counter + ' [wdi_page="' + (currentFeed.currentPage - 1) + '"]').length < local_load_more_number || data.length == 0) {
1363
  if ( obj['type'] == 'video' && obj['videos'][currentFeed.feedVideoResolution] && obj['videos'][currentFeed.feedVideoResolution]['url'] != null ) {
1364
  videoUrl = obj.hasOwnProperty('videos') ? obj['videos'][currentFeed.feedVideoResolution]['url'] : '';
1365
  }
1366
+ if ( typeof obj.images[currentFeed.feedImageResolution] == "undefined" ) {
 
1367
  var image_url = wdi_url.plugin_url + "images/missing.png";
1368
+ }
1369
+ else {
1370
+ if ( obj.type == "carousel" && typeof obj.images[currentFeed.feedImageResolution].url === 'undefined' ) {
1371
+ if ( typeof obj.carousel_media[0].images !== 'undefined' ) {
1372
+ var image_url = obj.carousel_media[0].images[currentFeed.feedImageResolution].url;
1373
+ }
1374
+ else if ( typeof obj.carousel_media[0].videos !== 'undefined' ) {
1375
+ var image_url = obj.carousel_media[0].videos['standard_resolution'].url;
1376
+ }
1377
+ }
1378
+ else {
1379
  var image_url = obj.images[currentFeed.feedImageResolution].url;
1380
  }
1381
  }
1462
  }
1463
 
1464
 
1465
+ if (currentFeed.feed_row.show_username_on_thumb == '1' && currentFeed.data.length && currentFeed.data[0].user.username !== "") {
1466
+ showUsernameOnThumb = '<span class="wdi_media_user">@<%= wdi_username%></span>';
1467
+ }
1468
+
1469
  //checking if caption is opend by default then add wdi_full_caption class
1470
  //only in masonry
1471
  if (currentFeed.feed_row.show_full_description == 1 && currentFeed.feed_row.feed_type == 'masonry') {
1527
  '</div>' +
1528
  '</div>' +
1529
  '</div>';
1530
+ if (currentFeed['feed_row']['show_likes'] === '1' || currentFeed['feed_row']['show_comments'] === '1' || currentFeed['feed_row']['show_description'] === '1') {
1531
+ source += '<div class="wdi_photo_meta">';
1532
+ if (currentFeed['feed_row']["thumb_user"][0] ==="#" && currentFeed['feed_row']['show_likes'] === '1') {
1533
+ source += '<div class="wdi_thumb_likes"><i class="tenweb-i tenweb-i-heart-o">&nbsp;<%= likes%></i></div>';
1534
+ }
1535
+ if (currentFeed['feed_row']["thumb_user"][0] ==="#" && currentFeed['feed_row']['show_comments'] === '1') {
1536
+ source += '<div class="wdi_thumb_comments"><i class="tenweb-i tenweb-i-comment-square">&nbsp;<%= comments%></i></div>';
1537
+ }
1538
+ source += '<div class="wdi_clear"></div>';
1539
+ if (currentFeed['feed_row']['show_description'] === '1') {
1540
+ source += '<div class="wdi_photo_title" onclick=' + onclickevent + ' >' +
1541
+ '<%=caption%>' +
1542
+ '</div>';
1543
+ }
1544
+ source += '</div>';
1545
+ }
1546
 
1547
  source += '</div>';
1548
  var template = _.template(source);
1577
  }
1578
 
1579
 
1580
+ if (currentFeed.feed_row.show_username_on_thumb == '1' && currentFeed.data.length && currentFeed.data[0].user.username !== "") {
1581
+ showUsernameOnThumb = '<span class="wdi_media_user">@<%= wdi_username%></span>';
1582
+ }
1583
 
1584
  //checking if caption is opend by default then add wdi_full_caption class
1585
  //only in masonry
1644
  '</div>' +
1645
  '</div>' +
1646
  '</div>';
1647
+ if (currentFeed['feed_row']['show_likes'] === '1' || currentFeed['feed_row']['show_comments'] === '1' || currentFeed['feed_row']['show_description'] === '1') {
1648
+ source += '<div class="wdi_photo_meta">';
1649
+ if (currentFeed['feed_row']["thumb_user"][0] ==="#" && currentFeed['feed_row']['show_likes'] === '1') {
1650
+ source += '<div class="wdi_thumb_likes"><i class="tenweb-i tenweb-i-heart-o">&nbsp;<%= likes%></i></div>';
1651
+ }
1652
+ if (currentFeed['feed_row']["thumb_user"][0] ==="#" && currentFeed['feed_row']['show_comments'] === '1') {
1653
+ source += '<div class="wdi_thumb_comments"><i class="tenweb-i tenweb-i-comment-square">&nbsp;<%= comments%></i></div>';
1654
+ }
1655
+ source += '<div class="wdi_clear"></div>';
1656
+ if (currentFeed['feed_row']['show_description'] === '1') {
1657
+ source += '<div class="wdi_photo_title" onclick=' + onclickevent + ' >' +
1658
+ '<%=caption%>' +
1659
+ '</div>';
1660
+ }
1661
+ source += '</div>';
1662
+ }
1663
 
1664
  source += '</div>';
1665
  var template = _.template(source);
1702
  customClass = 'wdi_hidden';
1703
  }
1704
 
1705
+ if (currentFeed.feed_row.show_username_on_thumb == '1' && currentFeed.data.length && currentFeed.data[0].user.username !== "") {
1706
+ showUsernameOnThumb = '<span class="wdi_media_user">@<%= wdi_username%></span>';
1707
+ }
1708
 
1709
  //checking if caption is opend by default then add wdi_full_caption class
1710
  //only in masonry
1760
  '<div class="wdi_photo_wrap">' +
1761
  '<div class="wdi_photo_wrap_inner">' +
1762
  '<div class="wdi_photo_img ' +wdi_shape_class + '">' +
1763
+ '<img class="wdi_img" ' + sourceAttr + '="<%=video_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);">' +
1764
  '<div class="wdi_photo_overlay ' + overlayCustomClass + '" ' + onclick + '>' + showUsernameOnThumb +
1765
  '<div class="wdi_thumb_icon" style="display:table;width:100%;height:100%;">' +
1766
  '<div style="display:table-cell;vertical-align:middle;text-align:center;color:white;">' +
1771
  '</div>' +
1772
  '</div>' +
1773
  '</div>';
1774
+ if (currentFeed['feed_row']['show_likes'] === '1' || currentFeed['feed_row']['show_comments'] === '1' || currentFeed['feed_row']['show_description'] === '1') {
1775
+ source += '<div class="wdi_photo_meta">';
1776
+ if (currentFeed['feed_row']["thumb_user"][0] ==="#" && currentFeed['feed_row']['show_likes'] === '1') {
1777
+ source += '<div class="wdi_thumb_likes"><i class="tenweb-i tenweb-i-heart-o">&nbsp;<%= likes%></i></div>';
1778
+ }
1779
+ if (currentFeed['feed_row']["thumb_user"][0] ==="#" && currentFeed['feed_row']['show_comments'] === '1') {
1780
+ source += '<div class="wdi_thumb_comments"><i class="tenweb-i tenweb-i-comment-square">&nbsp;<%= comments%></i></div>';
1781
+ }
1782
+ source += '<div class="wdi_clear"></div>';
1783
+ if (currentFeed['feed_row']['show_description'] === '1') {
1784
+ source += '<div class="wdi_photo_title" onclick=' + onclickevent + ' >' +
1785
+ '<%=caption%>' +
1786
+ '</div>';
1787
+ }
1788
+ source += '</div>';
1789
+ }
1790
  source += '</div>';
1791
  var template = _.template(source);
1792
  return template;
1830
  //setting pagiantion flags
1831
  currentFeed.paginatorNextFlag = false;
1832
  }
1833
+ if (currentFeed.feed_row.feed_display_view == 'infinite_scroll') {
1834
+ //binding infinite scroll Events
1835
+ jQuery(window).on('scroll', function ()
1836
+ {
1837
+ wdi_front.infiniteScroll(currentFeed);
1838
+ });
1839
+ //infinite scroll flags
1840
+ currentFeed.infiniteScrollFlag = false;
1841
+ }
1842
  }
1843
 
1844
+ wdi_front.infiniteScroll = function (currentFeed)
1845
+ {
1846
+
1847
+ if ((jQuery(window).scrollTop() + jQuery(window).height() - 100) >= jQuery('#wdi_feed_' + currentFeed.feed_row['wdi_feed_counter'] + ' #wdi_infinite_scroll').offset().top) {
1848
+ if (currentFeed.infiniteScrollFlag === false && currentFeed.stopInfiniteScrollFlag == false) {
1849
+ currentFeed.infiniteScrollFlag = true;
1850
+ wdi_front.loadMore(jQuery('#wdi_feed_' + currentFeed.feed_row['wdi_feed_counter'] + ' #wdi_infinite_scroll'), currentFeed);
1851
+ } else
1852
+ if (currentFeed.stopInfiniteScrollFlag) {
1853
+ wdi_front.allImagesLoaded(currentFeed);
1854
+ }
1855
+
1856
+ }
1857
+ }
1858
 
1859
  wdi_front.paginationFirstPage = function (btn, currentFeed)
1860
  {
2197
  if (!wdi_front.activeUsersCount(currentFeed)) {
2198
  return;
2199
  }
 
2200
  wdi_front.displayFeed(currentFeed, load_more_number);
2201
  //when all data us properly displayed check for any active filters and then apply them
2202
  wdi_front.applyFilters(currentFeed);
2254
  //broken image handling
2255
  wdi_front.brokenImageHandler = function (source)
2256
  {
2257
+ /* @ToDo. remove this function
2258
  var url_params = source.src.split("/p/");
2259
  if(typeof url_params[0] !== "undefined" && typeof url_params[1] !== "undefined" && url_params[0] !== "https://www.instagram.com"){
2260
  var main_url = wdi_baseName(url_params[0]);
2264
  source.src = wdi_url.plugin_url + "images/missing.png";
2265
  }
2266
  source.onerror = "";
2267
+ */
2268
  return true;
2269
  }
2270
  function wdi_baseName(str)
2274
  }
2275
 
2276
  //ajax loading
2277
+ wdi_front.ajaxLoader = function (currentFeed) {
 
2278
  var wdi_feed_counter = currentFeed.feed_row['wdi_feed_counter'];
2279
 
2280
  var feed_container = jQuery('#wdi_feed_' + wdi_feed_counter);
2283
  feed_container.find('.wdi_spinner').removeClass('wdi_hidden');
2284
  }
2285
  /////////////////////////////////////////////////////
2286
+ if (currentFeed.feed_row.feed_display_view == 'infinite_scroll') {
2287
+ var loadingDiv;
2288
+ if (feed_container.find('.wdi_ajax_loading').length == 0) {
2289
+ loadingDiv = 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>');
2290
+ feed_container.append(loadingDiv);
2291
+ } else {
2292
+ loadingDiv = feed_container.find('.wdi_ajax_loading');
2293
+ }
2294
+ loadingDiv.removeClass('wdi_hidden');
2295
+ }
2296
  }
2297
 
2298
  //if all images loaded then clicking load more causes it's removal
2315
  feed_container.find('.wdi_load_more').removeClass('wdi_hidden');
2316
  feed_container.find('.wdi_spinner').addClass('wdi_hidden');
2317
  }
2318
+
2319
+ if (currentFeed.feed_row.feed_display_view == 'infinite_scroll') {
2320
+ jQuery('#wdi_feed_' + currentFeed.feed_row['wdi_feed_counter'] + ' .wdi_ajax_loading').addClass('wdi_hidden');
2321
+ }
2322
  //custom event fired for user based custom js
2323
  feed_container.trigger('wdi_feed_loaded');
2324
  }
2527
  }
2528
  }
2529
 
2530
+ wdi_front.getUserTemplate = function (currentFeed, username) {
 
2531
  var usersCount = currentFeed.dataCount,
2532
  instagramLink, instagramLinkOnClick, js;
2533
 
2733
  }
2734
  data.sort(sortOperator);
2735
  }
 
2736
  for (i = 0; i < data.length; i++) {
2737
  var thumb_url = (typeof data[i]['media_url'] !== 'undefined') ? data[i]['media_url'] : wdi_url.plugin_url + 'images/video_missing.png';
2738
+ if ( typeof data[i]['media_url'] === 'undefined' ) {
2739
+ if ( data[i]['type'] === 'carousel' ) {
2740
  var carousel_media = data[i]['carousel_media'][0];
2741
+ if ( typeof carousel_media['images'] !== 'undefined' ) {
2742
+ thumb_url = carousel_media['images']['standard_resolution']['url'];
2743
+ }
2744
+ else if ( typeof carousel_media['videos'] !== 'undefined' ) {
2745
+ thumb_url = carousel_media['videos']['standard_resolution']['url'];
2746
+ }
2747
  }
2748
  }
2749
  obj = {
3007
  }
3008
 
3009
 
3010
+ wdi_front.isEmptyObject = function (obj) {
 
3011
  for (var prop in obj) {
3012
  if (obj.hasOwnProperty(prop))
3013
  return false;
3015
  return true
3016
  }
3017
 
3018
+ wdi_front.isEmpty = function (str) {
3019
+ return (!str || 0 === str.length);
3020
+ }
3021
+
3022
 
3023
  var WDIFeed = function (obj)
3024
  {
3047
  */
3048
  WDIFeed.prototype.conditionalFilter = function (response, args)
3049
  {
3050
+ var currentFeed = this,
3051
+ conditional_filter_type = currentFeed.feed_row.conditional_filter_type,
3052
+ filters = currentFeed.feed_row.conditional_filters;
3053
+
3054
+
3055
+ if (args.ignoreFiltering == true) {
3056
+
3057
+ } else {
3058
+
3059
+ /**
3060
+ * Get rid of duplicate media
3061
+ */
3062
+ response = this.avoidDuplicateMedia(response);
3063
+ }
3064
+
3065
+ //if filters json is invalid then return response without filtering
3066
+ if (!wdi_front.isJsonString(filters)) {
3067
+ return response;
3068
+ } else {
3069
+ filters = JSON.parse(filters);
3070
+ if (typeof filters !=="undefined" && filters.length == 0) {
3071
+ return response;
3072
+ }
3073
+ }
3074
+
3075
+
3076
+ if (currentFeed.feed_row.conditional_filter_enable == '0') {
3077
+ return response;
3078
+ }
3079
+ //increase counter for determing request count if this counter is more then
3080
+ //currentFeed.maxConditionalFiltersRequestCount then program will terminate recursion loop
3081
+ currentFeed.instagramRequestCounter++;
3082
+
3083
+ switch (conditional_filter_type) {
3084
+ case 'AND':
3085
+ {
3086
+ response = this.applyANDLogic(response, filters, currentFeed);
3087
+ break;
3088
+ }
3089
+ case 'OR':
3090
+ {
3091
+ response = this.applyORLogic(response, filters, currentFeed)
3092
+ break;
3093
+ }
3094
+ case 'NOR':
3095
+ {
3096
+ response = this.applyNORLogic(response, filters, currentFeed)
3097
+ break;
3098
+ }
3099
+ default:
3100
+ {
3101
+ break;
3102
+ }
3103
+ }
3104
+
3105
+
3106
  return response;
3107
  }
3108
 
js/wdi_frontend.min.js CHANGED
@@ -1 +1 @@
1
- "undefined"==typeof wdi_front&&(wdi_front={type:"not_declared"}),wdi_front.detectEvent=function(){return/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())?"touchend":"click"};var wdi_error_show=!1,wdi_error_init=!1;function wdi_baseName(e){var t=e.substr(e.lastIndexOf("/"));return e.replace(t,"")}wdi_front.escape_tags=function(e){return void 0===e&&(e=""),e=e.toString().replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&#34;")},wdi_front.show_alert=function(e,t,r){if(r=jQuery("#wdi_feed_"+r.feed_row.wdi_feed_counter),400===t.meta.code&&"APINotAllowedError"===t.meta.error_type){if(void 0!==t.wdi_current_feed_name){var i=t.wdi_current_feed_name,a=r.find(".wdi_private_feed_names");void 0===a.attr("wdi_first_private_user")?a.attr("wdi_first_private_user",1):i=", "+i,a.append(i),r.find(".wdi_private_feed_error").removeClass("wdi_hidden")}r.find(".wdi_spinner").remove()}if(void 0!==r&&"APINotAllowedError"!=t.meta.error_type){r.find(".wdi_spinner").remove(),wdi_error_show=!0;var d=r.find(".wdi_js_error"),o=r.find(".wdi_token_error");0!=t&&null!=typeof t.meta&&"OAuthAccessTokenException"===t.meta.error_type?(o.removeClass("wdi_hidden"),"1"!=wdi_front_messages.wdi_token_error_flag&&jQuery.ajax({type:"POST",url:wdi_url.ajax_url,dataType:"json",data:{action:"wdi_token_flag",wdi_token_flag_nonce:wdi_front_messages.wdi_token_flag_nonce},success:function(e){}})):(d.removeClass("wdi_js_error"),d.addClass("wdi_js_error_no_animate"),jQuery(".wdi_js_error_no_animate").show()),wdi_front_messages.show_alerts||console.log("%c"+e,"color:#cc0000;")}wdi_error_show=!0},wdi_front.globalInit=function(){var e=wdi_front.feed_counter,t=0;if(void 0!==wdi_ajax.ajax_response)t=wdi_feed_counter_init.wdi_feed_counter_init;for(var r=t;r<=e;r++)if(0!==jQuery("#wdi_feed_"+r).length){var i=new WDIFeed(window["wdi_feed_"+r]);i.instagram=new WDIInstagram,i.instagram.filterArguments={feed:i},i.instagram.filters=[],i.instagram.addToken(i.feed_row.access_token),wdi_front.access_token=i.feed_row.access_token,i.dataStorageRaw=[],i.dataStorage=[],i.dataStorageList=[],i.allResponseLength=0,i.currentResponseLength=0,i.temproraryUsersData=[],i.removedUsers=0,i.nowLoadingImages=!0,i.imageIndex=0,i.resIndex=0,i.currentPage=1,i.userSortFlags=[],i.customFilterChanged=!1,i.maxConditionalFiltersRequestCount=10,i.instagramRequestCounter=0,i.mediaRequestsDone=!1,i.conditionalFilterBuffer=[],i.stopInfiniteScrollFlag=!1,"masonry"==i.feed_row.feed_type&&(i.displayedData=[]),"pagination"==i.feed_row.feed_display_view?(i.feed_row.resort_after_load_more=0,"image_browser"!=i.feed_row.feed_type?(i.feed_row.load_more_number=parseInt(i.feed_row.pagination_per_page_number),i.feed_row.number_of_photos=(1+parseInt(i.feed_row.pagination_preload_number))*i.feed_row.load_more_number):(i.feed_row.number_of_photos=1+parseInt(i.feed_row.image_browser_preload_number),i.feed_row.load_more_number=parseInt(i.feed_row.image_browser_load_number)),i.freeSpaces=(Math.floor(i.feed_row.pagination_per_page_number/i.feed_row.number_of_columns)+1)*i.feed_row.number_of_columns-i.feed_row.pagination_per_page_number):i.freeSpaces=0,i.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(i),"masonry"==i.feed_row.feed_type&&jQuery(window).trigger("resize"),wdi_front.bindEvents(i),window["wdi_feed_"+r]=i,wdi_front.init(i)}},wdi_front.init=function(e){if(jQuery(".wdi_js_error").hide(),e.photoCounter=e.feed_row.number_of_photos,"liked"==e.feed_row.liked_feed)e.feed_users=["self"];else{if(!wdi_front.isJsonString(e.feed_row.feed_users))return void wdi_front.show_alert(wdi_front_messages.invalid_users_format,!1,e);e.feed_users=JSON.parse(e.feed_row.feed_users)}var t=[];void 0!==window.wdi_all_tags&&(t=window.wdi_all_tags);for(var r=0;r<e.feed_users.length;r++)"#"===e.feed_users[r].username[0]&&void 0!==e.feed_users[r].tag_id&&(t[e.feed_users[r].tag_id]=e.feed_users[r]);window.wdi_all_tags=t,e.dataCount=e.feed_users.length;var i=wdi_front.getFeedItemResolution(e);e.feedImageResolution=i.image,e.feedVideoResolution=i.video;for(var a=0;a<e.dataCount;a++)wdi_front.instagramRequest(a,e);e.feed_row.number_of_photos>0&&wdi_front.ajaxLoader(e),"1"===e.feed_row.display_header&&wdi_front.show("header",e)},wdi_front.getFeedItemResolution=function(e){var t={image:"standard_resolution",video:"standard_resolution"};if("thumbnail"===e.feed_row.feed_resolution)return{image:"thumbnail",video:"low_bandwidth"};if("low"===e.feed_row.feed_resolution)return{image:"low_resolution",video:"low_resolution"};if("standard"===e.feed_row.feed_resolution)return{image:"standard_resolution",video:"standard_resolution"};var r=jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter).find(".wdi_feed_wrapper");r.append('<div class="wdi_feed_item" id="wdi_feed_item_example"></div>'),wdi_responsive.columnControl(e,1);var i=r.attr("wdi-res").split("wdi_col_");if(r.find("#wdi_feed_item_example").remove(),2!==i.length)return t;var a=parseInt(i[1]);if(a<=0)return t;var d=r.width()/a-10,o=t;return d<=150?(o.image="thumbnail",o.video="low_bandwidth"):d>150&&d<=320?(o.image="low_resolution",o.video="low_resolution"):(o.image="standard_resolution",o.video="standard_resolution"),o},wdi_front.isJsonString=function(e){try{JSON.parse(e)}catch(e){return!1}return!0},wdi_front.instagramRequest=function(e,t){var r=this,i=t.feed_users;"string"==typeof i[e]&&"self"===i[e]?t.instagram.getRecentLikedMedia({success:function(e){void 0!==e.meta&&void 0!==e.meta.error_type&&wdi_front.show_alert(!1,e,t),t.mediaRequestsDone=!0,0!=(e=r.checkMediaResponse(e,t))&&r.saveSelfUserData(e,t)}}):"hashtag"==this.getInputType(i[e].username)?t.instagram.getTagRecentMedia(this.stripHashtag(i[e].username),{success:function(i){void 0!==i.meta&&void 0!==i.meta.error_type&&wdi_front.show_alert(!1,i,t),t.mediaRequestsDone=!0,0!=(i=r.checkMediaResponse(i,t))&&r.saveUserData(i,t.feed_users[e],t)}},null,t.feed_row.hashtag_top_recent):"user"==this.getInputType(i[e].username)&&t.instagram.getUserMedia({user_id:i[e].id,success:function(a){void 0!==a.meta&&void 0!==a.meta.error_type&&(a.wdi_current_feed_name=i[e].username,wdi_front.show_alert(!1,a,t)),t.mediaRequestsDone=!0,0!=(a=r.checkMediaResponse(a,t))&&r.saveUserData(a,t.feed_users[e],t)}})},wdi_front.isHashtag=function(e){return"#"===e[0]},wdi_front.saveUserData=function(e,t,r){if(e.username=t.username,e.user_id=t.id,"#"===e.user_id[0]&&(e.data=wdi_front.appendRequestHashtag(e.data,e.user_id)),r.usersData.push(e),r.currentResponseLength=wdi_front.getArrayContentLength(r.usersData,"data"),r.allResponseLength+=r.currentResponseLength,r.dataCount==r.usersData.length)if(r.currentResponseLength<r.feed_row.number_of_photos&&!wdi_front.userHasNoPhoto(r))wdi_front.loadMore("initial-keep",r);else if(wdi_front.displayFeed(r),wdi_front.applyFilters(r),!wdi_front.activeUsersCount(r)&&"load_more_btn"==r.feed_row.feed_display_view){var i=jQuery("#wdi_feed_"+r.feed_row.wdi_feed_counter);i.find(".wdi_load_more").addClass("wdi_hidden"),i.find(".wdi_spinner").addClass("wdi_hidden")}},wdi_front.saveSelfUserData=function(e,t){if(e.user_id="",e.username="",t.usersData.push(e),t.currentResponseLength=wdi_front.getArrayContentLength(t.usersData,"data"),t.allResponseLength+=t.currentResponseLength,t.dataCount==t.usersData.length)if(t.currentResponseLength<t.feed_row.number_of_photos&&!wdi_front.userHasNoPhoto(t))wdi_front.loadMore("initial-keep",t);else if(wdi_front.displayFeed(t),wdi_front.applyFilters(t),!wdi_front.activeUsersCount(t)&&"load_more_btn"==t.feed_row.feed_display_view){var r=jQuery("#wdi_feed_"+t.feed_row.wdi_feed_counter);r.find(".wdi_load_more").addClass("wdi_hidden"),r.find(".wdi_spinner").addClass("wdi_hidden")}},wdi_front.userHasNoPhoto=function(e,t){var r=0,i=e.usersData;void 0!==t&&(i=t);for(var a=0;a<i.length;a++)void 0===i[a].pagination&&(i[a].pagination=[]),"liked"===e.feed_row.liked_feed?void 0===i[a].pagination.next_max_like_id&&r++:void 0===i[a].pagination.next_max_id&&r++;return r==i.length?1:0},wdi_front.appendRequestHashtag=function(e,t){for(var r=0;r<e.length;r++)e[r].wdi_hashtag=t;return e},wdi_front.displayFeed=function(e,t){if(0==e.customFilterChanged)var r=wdi_front.feedSort(e,t);var i=e.customFilterChanged;if(1==e.customFilterChanged){r=e.customFilteredData;e.parsedData=wdi_front.parseLighboxData(e,!0)}"1"!=e.feed_row.resort_after_load_more?0==e.customFilterChanged&&(e.dataStorageList=e.dataStorageList.concat(r)):0==e.customFilterChanged&&(e.dataStorageList=r),"masonry"==e.feed_row.feed_type&&wdi_front.masonryDisplayFeedItems(r,e),"thumbnails"!=e.feed_row.feed_type&&"blog_style"!=e.feed_row.feed_type&&"image_browser"!=e.feed_row.feed_type||wdi_front.displayFeedItems(r,e),wdi_front.getDataLength(e)<e.photoCounter&&!i&&e.instagramRequestCounter<=e.maxConditionalFiltersRequestCount&&!wdi_front.allDataHasFinished(e)?wdi_front.loadMore("",e):wdi_front.allImagesLoaded(e),e.instagramRequestCounter>e.maxConditionalFiltersRequestCount&&(wdi_front.allImagesLoaded(e),0==r.length&&(e.stopInfiniteScrollFlag=!0)),"pagination"==e.feed_row.feed_display_view&&e.currentPage<e.paginator&&jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter).find("#wdi_last_page").removeClass("wdi_disabled"),e.instagramRequestCounter=0,e.conditionalFilterBuffer=[],wdi_front.updateUsersImages(e)},wdi_front.updateUsersImages=function(e){jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter).find(".wdi_single_user .wdi_user_img_wrap img").each(function(){if(jQuery(this).attr("src")==wdi_url.plugin_url+"images/missing.png"||""==jQuery(this).attr("src")){if("liked"==e.feed_row.liked_feed)return;for(var t=0;t<e.usersData.length;t++)e.usersData[t].username==jQuery(this).parent().parent().find("h3").text()&&0!=e.usersData[t].data.length&&jQuery(this).attr("src",e.usersData[t].data[0].images.thumbnail.url)}})},wdi_front.masonryDisplayFeedItems=function(e,t){var r=[],i=[];if(0!=jQuery("#wdi_feed_"+t.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").length){jQuery("#wdi_feed_"+t.feed_row.wdi_feed_counter+" .wdi_masonry_column").each(function(){1==t.feed_row.resort_after_load_more&&(jQuery(this).html(""),t.imageIndex=0),1==t.customFilterChanged&&(jQuery(this).html(""),t.imageIndex=0),"pagination"==t.feed_row.feed_display_view?r.push(0):r.push(jQuery(this).height()),i.push(jQuery(this))}),1==t.customFilterChanged&&(t.customFilterChanged=!1);for(var a=0;a<e.length;a++)if("object"!=typeof e[a].videos||null!=e[a].videos.standard_resolution){if(t.displayedData.push(e[a]),"image"==e[a].type)var d=wdi_front.getPhotoTemplate(t);else if(e[a].hasOwnProperty("videos")||"video"==e[a].type)d=wdi_front.getVideoTemplate(t);else d=wdi_front.getSliderTemplate(t);var o=e[a],n=d(wdi_front.createObject(o,t)),s=wdi_front.array_min(r),_=wdi_front.getImageResolution(e[a]);i[s.index].html(i[s.index].html()+n),r[s.index]+=i[s.index].width()*_,t.imageIndex++,"pagination"==t.feed_row.feed_display_view&&((a+1)%t.feed_row.pagination_per_page_number==0?t.resIndex+=t.freeSpaces+1:t.resIndex++)}t.wdi_loadedImages=0;var f=!1;t.wdi_load_count=a;var l=t.feed_row.wdi_feed_counter;jQuery("#wdi_feed_"+l+" img.wdi_img").on("load",function(){t.wdi_loadedImages++,w(),!1===f&&(wdi_responsive.columnControl(t,1),f=!0)});w(),1==t.paginatorNextFlag&&wdi_front.updatePagination(t,"next"),t.infiniteScrollFlag=!1}function w(){t.wdi_load_count===t.wdi_loadedImages&&0!=t.wdi_loadedImages&&(t.loadedImages=0,t.wdi_load_count=0,wdi_front.allImagesLoaded(t))}},wdi_front.getImageResolution=function(e){var t=e.images.standard_resolution.width;return e.images.standard_resolution.height/t},wdi_front.getDataLength=function(e,t){var r=0;if(void 0===t)for(var i=0;i<e.dataStorage.length;i++)r+=e.dataStorage[i].length;else for(i=0;i<t.length;i++)r+=t[i].length;return r},wdi_front.getArrayContentLength=function(e,t){for(var r=0,i=0;i<e.length;i++)"finished"!=e[i].finished&&(r+=e[i][t].length);return r},wdi_front.displayFeedItems=function(e,t){if(0!=jQuery("#wdi_feed_"+t.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").length){var r=t.feed_row.wdi_feed_counter,i=jQuery("#wdi_feed_"+r+" .wdi_feed_wrapper");"1"===t.feed_row.resort_after_load_more&&(i.html(""),t.imageIndex=0),1==t.customFilterChanged&&(i.html(""),t.imageIndex=0,t.customFilterChanged=!1);wdi_front.getImgCount(t),e.length;if("pagination"==t.feed_row.feed_display_view){var a=t.feed_row.load_more_number;"image_browser"==t.feed_row.feed_type&&(a=1),(jQuery("#wdi_feed_"+t.feed_row.wdi_feed_counter+' [wdi_page="'+(t.currentPage-1)+'"]').length<a||0==e.length)&&(t.currentPage=--t.currentPage<=1?1:t.currentPage)}for(var d=0;d<e.length;d++)if("object"!=typeof e[d].videos||null!=e[d].videos.standard_resolution){if("image"==e[d].type)var o=wdi_front.getPhotoTemplate(t);else if(e[d].hasOwnProperty("videos"))o=wdi_front.getVideoTemplate(t);else o=wdi_front.getSliderTemplate(t);var n=e[d],s=o(wdi_front.createObject(n,t));i.html(i.html()+s),t.imageIndex++,"pagination"==t.feed_row.feed_display_view&&((d+1)%t.feed_row.pagination_per_page_number==0?t.resIndex+=t.freeSpaces+1:t.resIndex++)}t.wdi_loadedImages=0;var _=!1;t.wdi_load_count=d;r=t.feed_row.wdi_feed_counter,i=jQuery("#wdi_feed_"+r+" img.wdi_img").on("load",function(){t.wdi_loadedImages++,t.wdi_load_count===t.wdi_loadedImages&&0!=t.wdi_loadedImages&&(t.loadedImages=0,t.wdi_load_count=0,wdi_front.allImagesLoaded(t)),!1===_&&(wdi_responsive.columnControl(t,1),_=!0)});1==t.paginatorNextFlag&&wdi_front.updatePagination(t,"next"),t.infiniteScrollFlag=!1}},wdi_front.checkFeedFinished=function(e){for(var t=0;t<e.usersData.length;t++)if(void 0===e.usersData[t].finished)return!1;return!0},wdi_front.sortingOperator=function(e,t){var r;switch(e){case"date":switch(t){case"asc":r=function(e,t){return e.created_time>t.created_time?1:-1};break;case"desc":r=function(e,t){return e.created_time>t.created_time?-1:1}}break;case"likes":switch(t){case"asc":r=function(e,t){return e.likes.count<t.likes.count?-1:1};break;case"desc":r=function(e,t){return e.likes.count<t.likes.count?1:-1}}break;case"comments":switch(t){case"asc":r=function(e,t){return e.comments.count<t.comments.count?-1:1};break;case"desc":r=function(e,t){return e.comments.count<t.comments.count?1:-1}}break;case"random":r=function(e,t){return Math.random()>.5?1:-1}}return r},wdi_front.feedSort=function(e,t){var r=e.feed_row.sort_images_by,i=e.feed_row.display_order;"1"===e.feed_row.resort_after_load_more?e.data=e.data.concat(wdi_front.smartPicker(e,t)):e.data=wdi_front.smartPicker(e,t);var a=wdi_front.sortingOperator(r,i);return e.data.sort(a),e.data},wdi_front.smartPicker=function(e,t){var r=[],i=0,a=[],d=Math.ceil(e.feed_row.number_of_photos/e.usersData.length),o=parseInt(e.feed_row.number_of_photos),n=0;""!=t&&void 0!==t&&null!=t&&(o=parseInt(t),d=Math.ceil(o/wdi_front.activeUsersCount(e)));e.storeRawData(e.usersData,"dataStorageRaw");for(var s=e.dataStorageRaw.sort(function(e,t){return e.length()>t.length()?1:-1}),_=e.usersData.sort(function(e,t){return e.data.length>t.data.length?1:-1}),f=0;f<_.length;f++)if(n+=d,s[f].length()<=n)n-=s[f].length(),r.push(s[f].getData(s[f].length())),i+=r[r.length-1].length;else{i+n>o&&(n=o-i);var l=[];!1===e.auto_trigger?l=l.concat(s[f].getData(n)):l.length+wdi_front.getDataLength(e)+wdi_front.getDataLength(e,r)<e.feed_row.number_of_photos&&(l=l.concat(s[f].getData(n))),n=0,i+=l.length,r.push(l)}for(f=0;f<r.length;f++)void 0===e.dataStorage[f]?e.dataStorage.push(r[f]):e.dataStorage[f]=e.dataStorage[f].concat(r[f]);for(e.parsedData=wdi_front.parseLighboxData(e),f=0;f<r.length;f++)a=a.concat(r[f]);return a},wdi_front.createObject=function(e,t){var r=null!=e.caption?e.caption.text:"&nbsp",i=wdi_url.plugin_url+"images/video_missing.png";if("video"==e.type&&e.videos[t.feedVideoResolution]&&null!=e.videos[t.feedVideoResolution].url&&(i=e.hasOwnProperty("videos")?e.videos[t.feedVideoResolution].url:""),void 0===e.images[t.feedImageResolution])var a=wdi_url.plugin_url+"images/missing.png";else if("carousel"==e.type&&void 0===e.images[t.feedImageResolution].url)a=e.carousel_media[0].images[t.feedImageResolution].url;else a=e.images[t.feedImageResolution].url;var d=t.imageIndex,o="square",n=e.images.standard_resolution.height,s=e.images.standard_resolution.width;n>s?o="portrait":n<s&&(o="landscape");var _=e.user.username;return""===_&&(_="no_user"),{id:e.id,caption:wdi_front.escape_tags(r),image_url:a,likes:e.likes.count,comments:e.comments.count,wdi_index:d,wdi_res_index:t.resIndex,wdi_media_user:_,link:e.link,video_url:i,wdi_username:_,wdi_shape:o}},wdi_front.setPage=function(e){var t=e.feed_row.feed_display_view,r=e.feed_row.feed_type;if("pagination"!=t)return"";var i=e.imageIndex;if("image_browser"==r)var a=1;else a=Math.abs(e.feed_row.pagination_per_page_number);return e.paginator=Math.ceil((i+1)/a),e.paginator},wdi_front.getPhotoTemplate=function(e){var t=wdi_front.setPage(e),r="",i="",a="",d="",o="tenweb-i-arrows-out";"blog_style"!=e.feed_row.feed_type&&"image_browser"!=e.feed_row.feed_type||(o=""),""!=t?(i='wdi_page="'+t+'"',sourceAttr="src"):sourceAttr="src",""!=t&&1!=t&&(r="wdi_hidden"),1==e.feed_row.show_full_description&&"masonry"==e.feed_row.feed_type&&(r+=" wdi_full_caption");switch("blog_style"!==e.feed_row.feed_type&&("masonry"==e.feed_row.feed_type?"wdi_responsive.showMasonryCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");":"wdi_responsive.showCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");"),e.feed_row.feed_item_onclick){case"lightbox":a="onclick=wdi_feed_"+e.feed_row.wdi_feed_counter+".galleryBox('<%=id%>')";break;case"instagram":a="onclick=\"window.open ('<%= link%>','_blank')\"",d="wdi_hover_off",o="";break;case"custom_redirect":a="onclick=\"window.open ('"+e.feed_row.redirect_url+"','_self')\"",d="wdi_hover_off",o="";break;case"none":a="",d="wdi_cursor_off wdi_hover_off",o=""}var n='<div class="wdi_feed_item '+r+'" wdi_index=<%= wdi_index%> wdi_res_index=<%= wdi_res_index%> wdi_media_user=<%= wdi_media_user%> '+i+' wdi_type="image" id="wdi_'+e.feed_row.wdi_feed_counter+"_<%=id%>\"><div class=\"wdi_photo_wrap\"><div class=\"wdi_photo_wrap_inner\"><div class=\"wdi_photo_img <%= wdi_shape == 'square' ? 'wdi_shape_square' : (wdi_shape == 'portrait' ? 'wdi_shape_portrait' : (wdi_shape == 'landscape' ? 'wdi_shape_landscape' : 'wdi_shape_square') ) %>\"><img class=\"wdi_img\" "+sourceAttr+'="<%=image_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);"><div class="wdi_photo_overlay '+d+'" ><div class="wdi_thumb_icon" '+a+' style="display:table;width:100%;height:100%;"><div style="display:table-cell;vertical-align:middle;text-align:center;color:white;"><i class="tenweb-i '+o+'"></i></div></div></div></div></div></div>';return n+="</div>",_.template(n)},wdi_front.getSliderTemplate=function(e){var t=wdi_front.setPage(e),r="",i="",a="",d="",o="tenweb-i-clone";"blog_style"!=e.feed_row.feed_type&&"image_browser"!=e.feed_row.feed_type||(o=""),""!=t?(i='wdi_page="'+t+'"',sourceAttr="src"):sourceAttr="src",""!=t&&1!=t&&(r="wdi_hidden"),1==e.feed_row.show_full_description&&"masonry"==e.feed_row.feed_type&&(r+=" wdi_full_caption");switch("blog_style"!==e.feed_row.feed_type&&("masonry"==e.feed_row.feed_type?"wdi_responsive.showMasonryCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");":"wdi_responsive.showCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");"),e.feed_row.feed_item_onclick){case"lightbox":a="onclick=wdi_feed_"+e.feed_row.wdi_feed_counter+".galleryBox('<%=id%>')";break;case"instagram":a="onclick=\"window.open ('<%= link%>','_blank')\"",d="wdi_hover_off",o="tenweb-i-clone";break;case"custom_redirect":a="onclick=\"window.open ('"+e.feed_row.redirect_url+"','_self')\"",d="wdi_hover_off",o="";break;case"none":a="",d="wdi_cursor_off wdi_hover_off",o=""}var n='<div class="wdi_feed_item '+r+'" wdi_index=<%= wdi_index%> wdi_res_index=<%= wdi_res_index%> wdi_media_user=<%= wdi_media_user%> '+i+' wdi_type="slideshow" id="wdi_'+e.feed_row.wdi_feed_counter+"_<%=id%>\"><div class=\"wdi_photo_wrap\"><div class=\"wdi_photo_wrap_inner\"><div class=\"wdi_photo_img <%= wdi_shape == 'square' ? 'wdi_shape_square' : (wdi_shape == 'portrait' ? 'wdi_shape_portrait' : (wdi_shape == 'landscape' ? 'wdi_shape_landscape' : 'wdi_shape_square') ) %>\"><img class=\"wdi_img\" "+sourceAttr+'="<%=image_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);"><div class="wdi_photo_overlay '+d+'" ><div class="wdi_thumb_icon" '+a+' style="display:table;width:100%;height:100%;"><div style="display:table-cell;vertical-align:middle;text-align:center;color:white;"><i class="tenweb-i '+o+'"></i></div></div></div></div></div></div>';return n+="</div>",_.template(n)},wdi_front.replaceToVideo=function(e,t,r){overlayHtml="<video style='width:auto !important; height:auto !important; max-width:100% !important; max-height:100% !important; margin:0 !important;' controls=''><source src='"+e+"' type='video/mp4'>Your browser does not support the video tag. </video>",jQuery("#wdi_feed_"+r+' [wdi_index="'+t+'"] .wdi_photo_wrap_inner').html(overlayHtml),jQuery("#wdi_feed_"+r+' [wdi_index="'+t+'"] .wdi_photo_wrap_inner video').get(0).play()},wdi_front.getVideoTemplate=function(e){var t,r=wdi_front.setPage(e),i="",a="",d="tenweb-i-play",o="",n="";""!=r?(a='wdi_page="'+r+'"',t="src"):t="src",""!=r&&1!=r&&(i="wdi_hidden"),1==e.feed_row.show_full_description&&"masonry"==e.feed_row.feed_type&&(i+=" wdi_full_caption");switch("blog_style"!==e.feed_row.feed_type&&("masonry"==e.feed_row.feed_type?"wdi_responsive.showMasonryCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");":"wdi_responsive.showCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");"),e.feed_row.feed_item_onclick){case"lightbox":o="onclick=wdi_feed_"+e.feed_row.wdi_feed_counter+".galleryBox('<%=id%>')";break;case"instagram":o="onclick=\"window.open ('<%= link%>','_blank')\"",n="wdi_hover_off",d="tenweb-i-play";break;case"custom_redirect":o="onclick=\"window.open ('"+e.feed_row.redirect_url+"','_self')\"",n="wdi_hover_off",d="";break;case"none":n="wdi_cursor_off wdi_hover_off",d="","blog_style"!=e.feed_row.feed_type&&"image_browser"!=e.feed_row.feed_type||(o="onclick=wdi_front.replaceToVideo('<%= video_url%>','<%= wdi_index%>',"+e.feed_row.wdi_feed_counter+")",n="",d="tenweb-i-play")}var s='<div class="wdi_feed_item '+i+'" wdi_index=<%= wdi_index%> wdi_res_index=<%= wdi_res_index%> wdi_media_user=<%= wdi_media_user%> '+a+' wdi_type="image" id="wdi_'+e.feed_row.wdi_feed_counter+"_<%=id%>\"><div class=\"wdi_photo_wrap\"><div class=\"wdi_photo_wrap_inner\"><div class=\"wdi_photo_img <%= wdi_shape == 'square' ? 'wdi_shape_square' : (wdi_shape == 'portrait' ? 'wdi_shape_portrait' : (wdi_shape == 'landscape' ? 'wdi_shape_landscape' : 'wdi_shape_square') ) %>\"><img class=\"wdi_img\" "+t+'="<%=image_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);"><div class="wdi_photo_overlay '+n+'" '+o+'><div class="wdi_thumb_icon" style="display:table;width:100%;height:100%;"><div style="display:table-cell;vertical-align:middle;text-align:center;color:white;"><i class="tenweb-i '+d+'"></i></div></div></div></div></div></div>';return s+="</div>",_.template(s)},wdi_front.bindEvents=function(e){0!=jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").length&&("load_more_btn"==e.feed_row.feed_display_view&&jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" .wdi_load_more_container").on(wdi_front.clickOrTouch,function(){wdi_front.loadMore(jQuery(this).find(".wdi_load_more_wrap"))}),"pagination"==e.feed_row.feed_display_view&&(jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_next").on(wdi_front.clickOrTouch,function(){wdi_front.paginatorNext(jQuery(this),e)}),jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_prev").on(wdi_front.clickOrTouch,function(){wdi_front.paginatorPrev(jQuery(this),e)}),jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_last_page").on(wdi_front.clickOrTouch,function(){wdi_front.paginationLastPage(jQuery(this),e)}),jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_first_page").on(wdi_front.clickOrTouch,function(){wdi_front.paginationFirstPage(jQuery(this),e)}),e.paginatorNextFlag=!1))},wdi_front.paginationFirstPage=function(e,t){if(1!=t.paginator&&1!=t.currentPage){var r=t.currentPage;t.currentPage=1,wdi_front.updatePagination(t,"custom",r),e.parent().find("#wdi_last_page").removeClass("wdi_disabled"),e.addClass("wdi_disabled")}else e.addClass("wdi_disabled")},wdi_front.paginationLastPage=function(e,t){if(1!=t.paginator&&t.currentPage!=t.paginator){var r=t.currentPage;t.currentPage=t.paginator,wdi_front.updatePagination(t,"custom",r),e.addClass("wdi_disabled"),e.parent().find("#wdi_first_page").removeClass("wdi_disabled")}},wdi_front.paginatorNext=function(e,t){var r=e.parent().find("#wdi_last_page"),i=e.parent().find("#wdi_first_page");if(t.paginatorNextFlag=!0,t.paginator!=t.currentPage||wdi_front.checkFeedFinished(t))t.paginator>t.currentPage&&(t.currentPage++,wdi_front.updatePagination(t,"next"),t.paginator>t.currentPage?r.removeClass("wdi_disabled"):r.addClass("wdi_disabled"));else{t.currentPage++;var a=t.feed_row.number_of_photos;wdi_front.loadMore(e,t,a),r.addClass("wdi_disabled")}i.removeClass("wdi_disabled")},wdi_front.paginatorPrev=function(e,t){var r=e.parent().find("#wdi_last_page"),i=e.parent().find("#wdi_first_page");1!=t.currentPage?(t.currentPage--,wdi_front.updatePagination(t,"prev"),r.removeClass("wdi_disabled"),1==t.currentPage&&i.addClass("wdi_disabled")):i.addClass("wdi_disabled")},wdi_front.updatePagination=function(e,t,r){var i="#wdi_feed_"+e.feed_row.wdi_feed_counter;switch(jQuery(i+' [wdi_page="'+e.currentPage+'"]').each(function(){jQuery(this).removeClass("wdi_hidden")}),t){case"next":r=e.currentPage-1;jQuery(i+" .wdi_feed_wrapper").height(jQuery(".wdi_feed_wrapper").height()),jQuery(i+' [wdi_page="'+r+'"]').each(function(){jQuery(this).addClass("wdi_hidden")});break;case"prev":r=e.currentPage+1;jQuery(i+" .wdi_feed_wrapper").height(jQuery(".wdi_feed_wrapper").height()),jQuery(i+' [wdi_page="'+r+'"]').each(function(){jQuery(this).addClass("wdi_hidden")});break;case"custom":(r=r)!=e.currentPage&&(jQuery(i+" .wdi_feed_wrapper").height(jQuery(".wdi_feed_wrapper").height()),jQuery(i+' [wdi_page="'+r+'"]').each(function(){jQuery(this).addClass("wdi_hidden")}))}e.paginatorNextFlag=!1,jQuery(i+" .wdi_feed_wrapper").css("height","auto"),jQuery(i+" #wdi_current_page").text(e.currentPage)},wdi_front.loadMore=function(e,t){var r=0;if(""!=e&&void 0!==e&&"initial"!=e&&"initial-keep"!=e)var i=window[e.parent().parent().parent().parent().attr("id")];if(void 0!==t)i=t;for(var a=0,d=0,o=0;o<i.userSortFlags.length;o++)if(!0===i.userSortFlags[o].flag){a++;for(var n=0;n<i.usersData.length;n++)i.userSortFlags[o].id===i.usersData[n].user_id&&"finished"===i.usersData[n].finished&&d++}if(a!==d||0==a){i.auto_trigger=""===e,wdi_front.ajaxLoader(i),"masonry"===i.feed_row.feed_type&&"pagination"==i.feed_row.feed_display_view&&jQuery("#wdi_feed_"+wdi_front.feed_counter+" .wdi_full_caption").each(function(){jQuery(this).find(".wdi_photo_title").trigger(wdi_front.clickOrTouch)});for(o=0;o<i.usersData.length;o++)"finished"===i.usersData[o].finished&&r++;r===i.usersData.length&&(wdi_front.allImagesLoaded(i),jQuery("#wdi_feed_"+i.feed_row.wdi_feed_counter+" .wdi_load_more").remove());var s=i.usersData;i.loadMoreDataCount=i.feed_users.length;for(o=0;o<s.length;o++){var _=s[o].pagination,f={user_id:s[o].user_id,username:s[o].username};if(""!=_.next_url&&null!=_.next_url&&void 0!==_.next_url){var l=_.next_url;wdi_front.loadMoreRequest(f,l,i,e)}else"initial-keep"==e&&(i.temproraryUsersData[o]=i.usersData[o]),i.loadMoreDataCount--,wdi_front.checkForLoadMoreDone(i,e)}}},wdi_front.loadMoreRequest=function(e,t,r,i){if(r.mediaRequestsDone){r.usersData;var a="",d=function(t){if(""===t||void 0===t||null==t)return a=wdi_front_messages.network_error,r.loadMoreDataCount--,void wdi_front.show_alert(a,t,r);if(void 0!==t.meta&&void 0!==t.meta.error_type&&wdi_front.show_alert(!1,t,r),void 0!==t.meta&&void 0!==t.meta.code&&200!=t.meta.code)return a=t.meta.error_message,r.loadMoreDataCount--,void wdi_front.show_alert(a,t,r);t.user_id=e.user_id,t.username=e.username;for(var d=0;d<r.usersData.length;d++)t.user_id===r.usersData[d].user_id&&("#"===t.user_id[0]&&(t.data=wdi_front.appendRequestHashtag(t.data,t.user_id)),"initial-keep"==i&&(r.temproraryUsersData[d]=r.usersData[d]),r.usersData[d]=t,r.loadMoreDataCount--);wdi_front.checkForLoadMoreDone(r,i)};"#"!==e.username[0]?r.instagram.requestByUrl(t,{success:d}):r.instagram.getTagRecentMedia(e.username,{success:d},t,r.feed_row.hashtag_top_recent)}},wdi_front.checkForLoadMoreDone=function(e,t){var r=e.feed_row.load_more_number,i=e.feed_row.number_of_photos;if(0==e.loadMoreDataCount){e.temproraryUsersData=wdi_front.mergeData(e.temproraryUsersData,e.usersData);var a=wdi_front.getArrayContentLength(e.temproraryUsersData,"data");if("initial-keep"==t&&(t="initial"),"initial"==t)a<i&&!wdi_front.userHasNoPhoto(e,e.temproraryUsersData)&&e.instagramRequestCounter<=e.maxConditionalFiltersRequestCount?wdi_front.loadMore("initial",e):(e.usersData=e.temproraryUsersData,wdi_front.displayFeed(e),wdi_front.applyFilters(e),e.temproraryUsersData=[]);else if(a<r&&!wdi_front.userHasNoPhoto(e,e.temproraryUsersData)&&e.instagramRequestCounter<=e.maxConditionalFiltersRequestCount)wdi_front.loadMore(void 0,e);else{if(e.usersData=e.temproraryUsersData,!wdi_front.activeUsersCount(e))return;wdi_front.displayFeed(e,r),wdi_front.applyFilters(e),e.temproraryUsersData=[]}}},wdi_front.allDataHasFinished=function(e){for(var t=0,r=0;r<e.dataStorageRaw.length;r++)0==e.dataStorageRaw[r].length()&&1==e.dataStorageRaw[r].locked&&t++;return t==e.dataStorageRaw.length},wdi_front.mergeData=function(e,t){for(var r=0;r<t.length;r++)if(void 0!==e[r]){if("finished"==t[r].finished)continue;if(void 0===e[r].pagination.next_max_id&&void 0===e[r].pagination.next_max_like_id)continue;e[r].data=e[r].data.concat(t[r].data),e[r].pagination=t[r].pagination,e[r].user_id=t[r].user_id,e[r].username=t[r].username,e[r].meta=t[r].meta}else e.push(t[r]);return e},wdi_front.brokenImageHandler=function(e){var t=e.src.split("/p/");if(void 0!==t[0]&&void 0!==t[1]&&"https://www.instagram.com"!==t[0]){var r=wdi_baseName(t[0])+"/p/"+t[1];e.src=r}else e.src=wdi_url.plugin_url+"images/missing.png";return e.onerror="",!0},wdi_front.ajaxLoader=function(e){var t=e.feed_row.wdi_feed_counter,r=jQuery("#wdi_feed_"+t);"load_more_btn"==e.feed_row.feed_display_view&&(r.find(".wdi_load_more").addClass("wdi_hidden"),r.find(".wdi_spinner").removeClass("wdi_hidden"))},wdi_front.allImagesLoaded=function(e){var t=wdi_front.getDataLength(e);e.mediaRequestsDone||jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").remove("wdi_nomedia"),0!=t||!e.mediaRequestsDone||0!=e.feed_row.conditional_filters.length&&0!=e.feed_row.conditional_filter_enable||jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").append("<p class='wdi_nomedia'>"+wdi_front_messages.feed_nomedia+"</p>");var r=e.feed_row.wdi_feed_counter,i=jQuery("#wdi_feed_"+r);"load_more_btn"==e.feed_row.feed_display_view&&(i.find(".wdi_load_more").removeClass("wdi_hidden"),i.find(".wdi_spinner").addClass("wdi_hidden")),i.trigger("wdi_feed_loaded")},wdi_front.show=function(e,t){var r,i,a,d=t.feed_row.wdi_feed_counter,o=jQuery("#wdi_feed_"+d+" .wdi_feed_container");switch(e){case"header":r={feed_thumb:t.feed_row.feed_thumb,feed_name:t.feed_row.feed_name},i=wdi_front.getHeaderTemplate()(r),a=o.find(".wdi_feed_header").html(),o.find(".wdi_feed_header").html(a+i)}},wdi_front.getUserTemplate=function(e,t){var r,i,a=e.dataCount;switch(t[0]){case"#":r="//instagram.com/explore/tags/"+t.substr(1,t.length);break;default:r="//instagram.com/"+t}i="onclick='"+('window.open("'+r+'","_blank")')+"'";var d='<div class="wdi_single_user" user_index="<%=user_index%>"><div class="wdi_header_user_text <%=hashtagClass%>"><div class="wdi_user_img_wrap"><img onerror="wdi_front.brokenImageHandler(this);" src="<%= user_img_url%>">';return a>1&&(d+='<div title="'+wdi_front_messages.filter_title+'" class="wdi_filter_overlay"><div class="wdi_filter_icon"><span onclick="wdi_front.addFilter(<%=user_index%>,<%=feed_counter%>);" class="tenweb-i tenweb-i-filter"></span></div></div>'),d+="</div>",d+="<h3 "+i+"><%= user_name%></h3>","#"!==t[0]?("1"==e.feed_row.follow_on_instagram_btn&&(d+='<div class="wdi_user_controls"><div class="wdi_follow_btn" onclick="window.open(\'//instagram.com/<%= user_name%>\',\'_blank\')"><span> '+wdi_front_messages.follow+"</span></div></div>"),d+='<div class="wdi_media_info"><p class="wdi_posts"><span class="tenweb-i tenweb-i-camera-retro"></span><%= counts.media%></p><p class="wdi_followers"><span class="tenweb-i tenweb-i-user"></span><%= counts.followed_by%></p></div>'):d+='<div class="wdi_user_controls"></div><div class="wdi_media_info"><p class="wdi_posts"><span class="tenweb-i tenweb-i-camera-retro"></span><%= counts.media%></p><p class="wdi_followers"><span></span></p></div>',d+='<div class="wdi_clear"></div>',1==a&&"#"!==t[0]&&"1"==e.feed_row.display_user_info&&(d+='<div class="wdi_bio"><%= bio%></div>',d+='<div class="wdi_website"><a target="_blank" href="<%= website_url%>" ><%= website%></a></div>'),d+="</div></div>",_.template(d)},wdi_front.getHeaderTemplate=function(){return _.template('<div class="wdi_header_wrapper"><div class="wdi_header_img_wrap"><img src="<%=feed_thumb%>"></div><div class="wdi_header_text"><%=feed_name%></div><div class="wdi_clear"></div>')},wdi_front.addFilter=function(e,t){var r=window["wdi_feed_"+t];if(!(r.dataCount<2)&&0==r.nowLoadingImages){var i=jQuery("#wdi_feed_"+r.feed_row.wdi_feed_counter+'_users [user_index="'+e+'"]');i.find(".wdi_filter_overlay").toggleClass("wdi_filter_active_bg"),i.find(".wdi_header_user_text h3").toggleClass("wdi_filter_active_col"),i.find(".wdi_media_info").toggleClass("wdi_filter_active_col"),i.find(".wdi_follow_btn").toggleClass("wdi_filter_active_col"),r.customFilterChanged=!0,0==r.userSortFlags[e].flag?r.userSortFlags[e].flag=!0:r.userSortFlags[e].flag=!1;for(var a=0,d=0;d<r.userSortFlags.length;d++)1==r.userSortFlags[d].flag&&a++;"pagination"==r.feed_row.feed_display_view&&(r.resIndex=0),0!=a?(wdi_front.filterData(r),wdi_front.displayFeed(r)):(r.customFilteredData=r.dataStorageList,wdi_front.displayFeed(r)),"pagination"==r.feed_row.feed_display_view&&(r.paginator=Math.ceil(r.imageIndex/parseInt(r.feed_row.pagination_per_page_number)),r.currentPage=r.paginator,wdi_front.updatePagination(r,"custom",1),jQuery("#wdi_first_page").removeClass("wdi_disabled"),jQuery("#wdi_last_page").addClass("wdi_disabled"))}},wdi_front.filterData=function(e){var t=e.userSortFlags;e.customFilteredData=[];for(var r=0;r<e.dataStorageList.length;r++)for(var i=0;i<t.length;i++)(void 0!==e.dataStorageList[r].user.id&&e.dataStorageList[r].user.id==t[i].id||e.dataStorageList[r].wdi_hashtag==t[i].name)&&1==t[i].flag&&e.customFilteredData.push(e.dataStorageList[r])},wdi_front.applyFilters=function(e){for(var t=0;t<e.userSortFlags.length;t++)if(1==e.userSortFlags[t].flag){jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+'[user_index="'+t+'"]');wdi_front.addFilter(t,e.feed_row.wdi_feed_counter),wdi_front.addFilter(t,e.feed_row.wdi_feed_counter)}},wdi_front.getImgCount=function(e){for(var t=e.dataStorage,r=0,i=0;i<t.length;i++)r+=t[i].length;return r},wdi_front.parseLighboxData=function(e,t){var r=e.dataStorage,i=e.feed_row.sort_images_by,a=e.feed_row.display_order,d=wdi_front.sortingOperator(i,a),o=[],n=[],s={};if(1==t)o=e.customFilteredData;else{for(var _=0;_<r.length;_++)for(var f=0;f<r[_].length;f++)o.push(r[_][f]);o.sort(d)}for(_=0;_<o.length;_++){var l=void 0!==o[_].media_url?o[_].media_url:wdi_url.plugin_url+"images/video_missing.png";if(void 0===o[_].media_url)if("carousel"===o[_].type)l=o[_].carousel_media[0].images.standard_resolution.url;s={alt:"",avg_rating:"",comment_count:o[_].comments.count,date:wdi_front.convertUnixDate(o[_].created_time),description:wdi_front.getDescription(null!==o[_].caption?wdi_front.escape_tags(o[_].caption.text):""),filename:wdi_front.getFileName(o[_]),filetype:wdi_front.getFileType(o[_]),hit_count:"0",id:o[_].id,image_url:o[_].link,number:0,rate:"",rate_count:"0",username:o[_].user.username,profile_picture:o[_].user.profile_picture,thumb_url:l,comments_data:o[_].comments.data,images:o[_].images,carousel_media:void 0!==o[_].carousel_media?o[_].carousel_media:null},n.push(s)}return n},wdi_front.convertUnixDate=function(e){var t=parseInt(e),r=new Date(0);r.setUTCSeconds(t);var i=r.getFullYear()+"-"+r.getMonth()+"-"+r.getDate();return i+=" "+r.getHours()+":"+r.getMinutes()},wdi_front.getDescription=function(e){return e=e.replace(/\r?\n|\r/g," ")},wdi_front.getFileName=function(e){var t=e.link;if("video"===e.type&&e.hasOwnProperty("videos")&&null!=e.videos.standard_resolution)return e.videos.standard_resolution.url;var r=t.split("/");return r[r.length-2]},wdi_front.getFileType=function(e){return"video"==e.type&&e.hasOwnProperty("videos")?"EMBED_OEMBED_INSTAGRAM_VIDEO":"EMBED_OEMBED_INSTAGRAM_IMAGE"},wdi_front.array_max=function(e){for(var t=e[0],r=0,i=1;i<e.length;i++)t<e[i]&&(t=e[i],r=i);return{value:t,index:r}},wdi_front.array_min=function(e){for(var t=e[0],r=0,i=1;i<e.length;i++)t>e[i]&&(t=e[i],r=i);return{value:t,index:r}},wdi_front.activeUsersCount=function(e){for(var t=0,r=0;r<e.usersData.length;r++)"finished"!=e.usersData[r].finished&&t++;return t},wdi_front.checkMediaResponse=function(e,t){return""==e||void 0===e||null==e?(errorMessage=wdi_front_messages.connection_error,wdi_front.show_alert(errorMessage,e,t),!1):""!=e&&void 0!==e&&null!=e&&200!=e.meta.code?(errorMessage=e.meta.error_message,wdi_front.show_alert(errorMessage,e,t),!1):e},wdi_front.stripHashtag=function(e){switch(e[0]){case"#":return e.substr(1,e.length);default:return e}},wdi_front.getInputType=function(e){switch(e[0]){case"#":return"hashtag";case"%":return"location";default:return"user"}},wdi_front.regexpTestCaption=function(e,t){var r=!1,i=!1,a=t.replace(/[-[\]{}()*+?.,\\^$|]/g,"\\$&"),d=new RegExp("(?:^|\\s)"+a+"(?:^|\\s)"),o=new RegExp("(?:^|\\s)"+a,"g");for(null!=d.exec(e)&&(r=!0);null!=(match=o.exec(e));)i=!0;return 1==r||1==i},wdi_front.replaceNewLines=function(e){var t,r=[];for(e=e.replace(/\r?\n|\r/g,"vUkCJvN2ps3t"),t=new RegExp("vUkCJvN2ps3t","g");null!=(match=t.exec(e));)r.push(match.index);for(var i=e.split("vUkCJvN2ps3t"),a=0,d=0;d<i.length;d++)""==i[d]?a++:a=0,a>0&&(i.splice(d,1),a--,d--);return e=i.join(" ")},wdi_front.isEmptyObject=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0};var WDIFeed=function(e){this.data=e.data,this.dataCount=e.dataCount,this.feed_row=e.feed_row,this.usersData=e.usersData,_this=this,this.set_images_loading_flag=function(e){window.addEventListener("load",function(){e.nowLoadingImages=!1})},this.set_images_loading_flag(_this)};function wdi_extractHostname(e){return void 0===e||""===e?"":e.replace(/(^\w+:|^)\/\//,"")}WDIFeed.prototype.conditionalFilter=function(e,t){return e},WDIFeed.prototype.applyANDLogic=function(e,t){for(var r=0;r<t.length;r++)e=this.filterResponse(e,t[r]);return e},WDIFeed.prototype.applyORLogic=function(e,t){for(var r,i,a=[],d=[],o=0;o<t.length;o++)r=this.filterResponse(e,t[o]),a=a.concat(r.data),r={};for(o=0;o<a.length;o++)i=a[o],this.mediaExists(i,d)||this.mediaExists(i,this.dataStorageList)||d.push(i);return{data:d,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.applyNORLogic=function(e,t){for(var r=e,i=this.applyORLogic(e,t,this),a=[],d=0;d<r.data.length;d++)this.mediaExists(r.data[d],i.data)||a.push(r.data[d]);return{data:a,meta:r.meta,pagination:r.pagination}},WDIFeed.prototype.mediaExists=function(e,t){for(var r=0;r<t.length;r++)if(e.id==t[r].id)return!0;return!1},WDIFeed.prototype.filterResponse=function(e,t){switch(t.filter_type){case"hashtag":return this.filterByHashtag(e,t);case"username":return this.filterByUsername(e,t);case"mention":return this.filterByMention(e,t);case"description":return this.filterByDescription(e,t);case"location":return this.filterByLocation(e,t);case"url":return this.filterByUrl(e,t)}},WDIFeed.prototype.filterByHashtag=function(e,t){for(var r,i=[],a=0;a<e.data.length;a++)if(void 0!==(r=e.data[a]).tags)for(var d=0;d<r.tags.length;d++){tag=r.tags[d];var o=tag.toLowerCase(),n=t.filter_by.toLowerCase();o.trim()==n.trim()&&i.push(r)}return{data:i,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByUsername=function(e,t){for(var r,i=[],a=0;a<e.data.length;a++)(r=e.data[a]).user.username.toLowerCase()==t.filter_by.toLowerCase()&&i.push(r);return{data:i,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByMention=function(e,t){for(var r,i=[],a=0;a<e.data.length;a++)null!==(r=e.data[a]).caption&&-1!=r.caption.text.toLowerCase().indexOf("@"+t.filter_by.toLowerCase())&&i.push(r);return{data:i,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByDescription=function(e,t){for(var r,i,a=[],d=0;d<e.data.length;d++)if(null!==(r=e.data[d]).caption){i=r.caption.text.toLowerCase(),i=wdi_front.replaceNewLines(i);var o=t.filter_by.toLowerCase();wdi_front.regexpTestCaption(i,o)&&a.push(r)}return{data:a,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByLocation=function(e,t){for(var r,i=[],a=0;a<e.data.length;a++)null!==(r=e.data[a]).location&&r.location.id==t.filter_by&&i.push(r);return{data:i,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByUrl=function(e,t){var r,i=[];t.filter_by=this.getIdFromUrl(t.filter_by);for(var a=0;a<e.data.length;a++)null!==(r=e.data[a]).link&&this.getIdFromUrl(r.link)==t.filter_by&&i.push(r);return{data:i,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.getIdFromUrl=function(e){for(var t=e.split("/"),r=!1,i=0;i<t.length;i++)if("p"==t[i]&&void 0!==t[i+1]){r=t[i+1];break}return r},WDIFeed.prototype.avoidDuplicateMedia=function(e){var t=e.data,r=[];void 0===t&&(t=[]);for(var i=0;i<t.length;i++)this.mediaExists(t[i],this.dataStorageList)||this.mediaExists(t[i],r)||this.mediaExists(t[i],this.conditionalFilterBuffer)||r.push(t[i]);return this.conditionalFilterBuffer=this.conditionalFilterBuffer.concat(r),{data:r,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.storeRawData=function(e,t){var r=this;if("object"==typeof this[t]&&"number"==typeof this[t].length)for(var i=0;i<e.length;i++){var a="";wdi_front.isHashtag(e[i].user_id)?void 0!==e[i].pagination.cursors&&(a=e[i].pagination.cursors.after):"liked"==r.feed_row.liked_feed?void 0===(a=e[i].pagination.next_max_like_id)&&(a=""):(null==e[i].pagination&&(e[i].pagination=[]),void 0===(a=e[i].pagination.next_max_id)&&(a="")),void 0===this[t][i]?this[t].push({data:e[i].data,index:0,locked:!1,hash_id:a,usersDataFinished:!1,userId:e[i].user_id,length:function(){return this.data.length-this.index},getData:function(e){var t=this.data.slice(this.index,this.index+e);if(this.index+=Math.min(e,this.length()),this.index==this.data.length&&1==this.locked&&0==this.usersDataFinished)for(var i=0;i<r.usersData.length;i++)if(r.usersData[i].user_id==this.userId){r.usersData[i].finished="finished",this.usersDataFinished=!0;break}return t}}):0==this[t][i].locked&&(a!=this[t][i].hash_id?(this[t][i].data=this[t][i].data.concat(e[i].data),this[t][i].hash_id=a):this[t][i].locked=!0)}},wdi_front.updateUsersIfNecessary=function(e){for(var t=e.feed_users,r=!1,i=0;i<t.length;i++)"#"!=t[i].username.substr(0,1)?""!=t[i].id&&"username"!=t[i].id||(r=!0,e.instagram.searchForUsersByName(t[i].username,{success:function(r){if(void 0!==r.meta&&void 0!==r.meta.error_type&&wdi_front.show_alert(!1,r,e),200==r.meta.code&&r.data.length>0){for(var i=!1,a=0;a<r.data.length;a++)if(r.data[a].username==r.args.username){i=!0;break}if(i)for(var d=0;d<t.length;d++)r.data[a].username==t[d].username&&(t[d].id=r.data[a].id)}for(var o=!1,n=0;n<t.length;n++)if(""==t[n].id||"username"==t[n].id){o=!0;break}o||(e.feed_row.feed_users=JSON.stringify(t),wdi_front.init(e))},username:t[i].username})):t[i].id=t[i].username;return r},void 0!==wdi_ajax.ajax_response?jQuery(document).one("ajaxStop",function(){"not_declared"!=wdi_front.type&&(wdi_front.clickOrTouch=wdi_front.detectEvent(),wdi_front.globalInit())}):jQuery(document).ready(function(){"not_declared"!=wdi_front.type&&(wdi_front.clickOrTouch=wdi_front.detectEvent(),wdi_front.globalInit())}),jQuery(document).ready(function(){setTimeout(function(){"1"===wdi_front_messages.show_alerts&&"I"!==jQuery(".wdi_check_fontawesome .tenweb-i-instagram").prop("tagName")&&console.log("Font Awesome is not loaded properly. Please ask for support https://wordpress.org/support/plugin/wd-instagram-feed/")},2e3)});
1
+ "undefined"==typeof wdi_front&&(wdi_front={type:"not_declared"});var wdi_error_show=!(wdi_front.detectEvent=function(){return/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())?"touchend":"click"}),wdi_error_init=!1;function wdi_baseName(e){var i=e.substr(e.lastIndexOf("/"));return e.replace(i,"")}wdi_front.escape_tags=function(e){return void 0===e&&(e=""),e=e.toString().replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&#34;")},wdi_front.show_alert=function(e,i,t){var r,a,d,o;t=jQuery("#wdi_feed_"+t.feed_row.wdi_feed_counter),400===i.meta.code&&"APINotAllowedError"===i.meta.error_type&&(void 0!==i.wdi_current_feed_name&&(r=i.wdi_current_feed_name,void 0===(a=t.find(".wdi_private_feed_names")).attr("wdi_first_private_user")?a.attr("wdi_first_private_user",1):r=", "+r,a.append(r),t.find(".wdi_private_feed_error").removeClass("wdi_hidden")),t.find(".wdi_spinner").remove()),void 0!==t&&"APINotAllowedError"!=i.meta.error_type&&(t.find(".wdi_spinner").remove(),wdi_error_show=!0,d=t.find(".wdi_js_error"),o=t.find(".wdi_token_error"),0!=i&&null!=typeof i.meta&&"OAuthAccessTokenException"===i.meta.error_type?(o.removeClass("wdi_hidden"),"1"!=wdi_front_messages.wdi_token_error_flag&&jQuery.ajax({type:"POST",url:wdi_url.ajax_url,dataType:"json",data:{action:"wdi_token_flag",wdi_token_flag_nonce:wdi_front_messages.wdi_token_flag_nonce},success:function(e){}})):(d.removeClass("wdi_js_error"),d.addClass("wdi_js_error_no_animate"),jQuery(".wdi_js_error_no_animate").show()),wdi_front_messages.show_alerts||console.log("%c"+e,"color:#cc0000;")),wdi_error_show=!0},wdi_front.globalInit=function(){var e=wdi_front.feed_counter,i=0;void 0!==wdi_ajax.ajax_response&&(i=wdi_feed_counter_init.wdi_feed_counter_init);for(var t,r=i;r<=e;r++){0!==jQuery("#wdi_feed_"+r).length&&((t=new WDIFeed(window["wdi_feed_"+r])).instagram=new WDIInstagram,t.instagram.filterArguments={feed:t},t.instagram.filters=[{where:"getUserRecentMedia",what:function(e,i,t){return i.feed.conditionalFilter(e,t)}},{where:"getUserMedia",what:function(e,i,t){return i.feed.conditionalFilter(e,t)}},{where:"getTagRecentMedia",what:function(e,i,t){return i.feed.conditionalFilter(e,t)}},{where:"getRecentLikedMedia",what:function(e,i,t){return i.feed.conditionalFilter(e,t)}},{where:"requestByUrl",what:function(e,i,t){return i.feed.conditionalFilter(e,t)}}],t.instagram.addToken(t.feed_row.access_token),wdi_front.access_token=t.feed_row.access_token,t.dataStorageRaw=[],t.dataStorage=[],t.dataStorageList=[],t.allResponseLength=0,t.currentResponseLength=0,t.temproraryUsersData=[],t.removedUsers=0,t.nowLoadingImages=!0,t.imageIndex=0,t.resIndex=0,t.currentPage=1,t.userSortFlags=[],t.customFilterChanged=!1,t.maxConditionalFiltersRequestCount=10,t.instagramRequestCounter=0,t.mediaRequestsDone=!1,t.conditionalFilterBuffer=[],t.stopInfiniteScrollFlag=!1,"masonry"==t.feed_row.feed_type&&(t.displayedData=[]),"pagination"==t.feed_row.feed_display_view?(t.feed_row.resort_after_load_more=0,"image_browser"!=t.feed_row.feed_type?(t.feed_row.load_more_number=parseInt(t.feed_row.pagination_per_page_number),t.feed_row.number_of_photos=(1+parseInt(t.feed_row.pagination_preload_number))*t.feed_row.load_more_number):(t.feed_row.number_of_photos=1+parseInt(t.feed_row.image_browser_preload_number),t.feed_row.load_more_number=parseInt(t.feed_row.image_browser_load_number)),t.freeSpaces=(Math.floor(t.feed_row.pagination_per_page_number/t.feed_row.number_of_columns)+1)*t.feed_row.number_of_columns-t.feed_row.pagination_per_page_number):t.freeSpaces=0,t.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(t),"masonry"==t.feed_row.feed_type&&jQuery(window).trigger("resize"),wdi_front.bindEvents(t),window["wdi_feed_"+r]=t,wdi_front.init(t))}},wdi_front.init=function(e){if(jQuery(".wdi_js_error").hide(),e.photoCounter=e.feed_row.number_of_photos,"liked"==e.feed_row.liked_feed)e.feed_users=["self"];else{if(!wdi_front.isJsonString(e.feed_row.feed_users))return void wdi_front.show_alert(wdi_front_messages.invalid_users_format,!1,e);e.feed_users=JSON.parse(e.feed_row.feed_users)}var i=[],t=[],r=[];void 0!==window.wdi_all_tags&&(i=window.wdi_all_tags);for(var a=0;a<e.feed_users.length;a++)"#"===e.feed_users[a].username[0]&&void 0!==e.feed_users[a].tag_id?(i[e.feed_users[a].tag_id]=e.feed_users[a],r[a]=e.feed_users[a]):t[0]=e.feed_users[a];window.wdi_all_tags=i,e.feed_users=void 0===r||wdi_front.isEmpty(r)?t:r;var d=wdi_front.getFeedItemResolution(e);e.feedImageResolution=d.image,e.feedVideoResolution=d.video,e.dataCount=e.feed_users.length;for(var o=0;o<e.dataCount;o++)wdi_front.instagramRequest(o,e);0<e.feed_row.number_of_photos&&wdi_front.ajaxLoader(e),"1"===e.feed_row.display_header&&wdi_front.show("header",e),"1"===e.feed_row.show_usernames&&wdi_front.show("users",e)},wdi_front.getFeedItemResolution=function(e){var i={image:"standard_resolution",video:"standard_resolution"};if("thumbnail"===e.feed_row.feed_resolution)return{image:"thumbnail",video:"low_bandwidth"};if("low"===e.feed_row.feed_resolution)return{image:"low_resolution",video:"low_resolution"};if("standard"===e.feed_row.feed_resolution)return{image:"standard_resolution",video:"standard_resolution"};var t=jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter).find(".wdi_feed_wrapper");t.append('<div class="wdi_feed_item" id="wdi_feed_item_example"></div>'),wdi_responsive.columnControl(e,1);var r=t.attr("wdi-res").split("wdi_col_");if(t.find("#wdi_feed_item_example").remove(),2!==r.length)return i;var a=parseInt(r[1]);if(a<=0)return i;var d=t.width()/a-10,o=i;return d<=150?(o.image="thumbnail",o.video="low_bandwidth"):150<d&&d<=320?(o.image="low_resolution",o.video="low_resolution"):(o.image="standard_resolution",o.video="standard_resolution"),o},wdi_front.isJsonString=function(e){try{JSON.parse(e)}catch(e){return!1}return!0},wdi_front.instagramRequest=function(i,t){var r=this,a=t.feed_users;"string"==typeof a[i]&&"self"===a[i]?t.instagram.getRecentLikedMedia({success:function(e){void 0!==e.meta&&void 0!==e.meta.error_type&&wdi_front.show_alert(!1,e,t),t.mediaRequestsDone=!0,0!=(e=r.checkMediaResponse(e,t))&&r.saveSelfUserData(e,t)}}):"hashtag"==this.getInputType(a[i].username)?t.instagram.getTagRecentMedia(this.stripHashtag(a[i].username),{success:function(e){void 0!==e.meta&&void 0!==e.meta.error_type&&wdi_front.show_alert(!1,e,t),t.mediaRequestsDone=!0,0!=(e=r.checkMediaResponse(e,t))&&r.saveUserData(e,t.feed_users[i],t)}},null,t.feed_row.hashtag_top_recent):"user"==this.getInputType(a[i].username)&&t.instagram.getUserMedia({user_id:a[i].id,success:function(e){void 0!==e.meta&&void 0!==e.meta.error_type&&(e.wdi_current_feed_name=a[i].username,wdi_front.show_alert(!1,e,t)),t.mediaRequestsDone=!0,0!=(e=r.checkMediaResponse(e,t))&&r.saveUserData(e,t.feed_users[i],t)}})},wdi_front.isHashtag=function(e){return"#"===e[0]},wdi_front.saveUserData=function(e,i,t){var r;e.user_id=i.id,e.username=i.username,"#"===e.user_id[0]&&(e.data=wdi_front.appendRequestHashtag(e.data,e.user_id)),t.usersData.push(e),t.currentResponseLength=wdi_front.getArrayContentLength(t.usersData,"data"),t.allResponseLength+=t.currentResponseLength,t.dataCount==t.usersData.length&&(t.currentResponseLength<t.feed_row.number_of_photos&&!wdi_front.userHasNoPhoto(t)?wdi_front.loadMore("initial-keep",t):(wdi_front.displayFeed(t),wdi_front.applyFilters(t),wdi_front.activeUsersCount(t)||"load_more_btn"==t.feed_row.feed_display_view&&((r=jQuery("#wdi_feed_"+t.feed_row.wdi_feed_counter)).find(".wdi_load_more").addClass("wdi_hidden"),r.find(".wdi_spinner").addClass("wdi_hidden"))))},wdi_front.saveSelfUserData=function(e,i){var t;e.user_id="",e.username="",i.usersData.push(e),i.currentResponseLength=wdi_front.getArrayContentLength(i.usersData,"data"),i.allResponseLength+=i.currentResponseLength,i.dataCount==i.usersData.length&&(i.currentResponseLength<i.feed_row.number_of_photos&&!wdi_front.userHasNoPhoto(i)?wdi_front.loadMore("initial-keep",i):(wdi_front.displayFeed(i),wdi_front.applyFilters(i),wdi_front.activeUsersCount(i)||"load_more_btn"==i.feed_row.feed_display_view&&((t=jQuery("#wdi_feed_"+i.feed_row.wdi_feed_counter)).find(".wdi_load_more").addClass("wdi_hidden"),t.find(".wdi_spinner").addClass("wdi_hidden"))))},wdi_front.userHasNoPhoto=function(e,i){var t=0,r=e.usersData;void 0!==i&&(r=i);for(var a=0;a<r.length;a++)void 0===r[a].pagination&&(r[a].pagination=[]),"liked"===e.feed_row.liked_feed?void 0===r[a].pagination.next_max_like_id&&t++:void 0===r[a].pagination.next_max_id&&t++;return t==r.length?1:0},wdi_front.appendRequestHashtag=function(e,i){for(var t=0;t<e.length;t++)e[t].wdi_hashtag=i;return e},wdi_front.displayFeed=function(e,i){0==e.customFilterChanged&&(t=wdi_front.feedSort(e,i));var t,r=e.customFilterChanged;1==e.customFilterChanged&&(t=e.customFilteredData,e.parsedData=wdi_front.parseLighboxData(e,!0)),"1"!=e.feed_row.resort_after_load_more?0==e.customFilterChanged&&(e.dataStorageList=e.dataStorageList.concat(t)):0==e.customFilterChanged&&(e.dataStorageList=t),"masonry"==e.feed_row.feed_type&&wdi_front.masonryDisplayFeedItems(t,e),"thumbnails"!=e.feed_row.feed_type&&"blog_style"!=e.feed_row.feed_type&&"image_browser"!=e.feed_row.feed_type||wdi_front.displayFeedItems(t,e),wdi_front.getDataLength(e)<e.photoCounter&&!r&&e.instagramRequestCounter<=e.maxConditionalFiltersRequestCount&&!wdi_front.allDataHasFinished(e)?wdi_front.loadMore("",e):wdi_front.allImagesLoaded(e),e.instagramRequestCounter>e.maxConditionalFiltersRequestCount&&(wdi_front.allImagesLoaded(e),0==t.length&&(e.stopInfiniteScrollFlag=!0)),"pagination"==e.feed_row.feed_display_view&&e.currentPage<e.paginator&&jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter).find("#wdi_last_page").removeClass("wdi_disabled"),e.instagramRequestCounter=0,e.conditionalFilterBuffer=[],wdi_front.updateUsersImages(e)},wdi_front.updateUsersImages=function(i){jQuery("#wdi_feed_"+i.feed_row.wdi_feed_counter).find(".wdi_single_user .wdi_user_img_wrap img").each(function(){if(jQuery(this).attr("src")==wdi_url.plugin_url+"images/missing.png"||""==jQuery(this).attr("src")){if("liked"==i.feed_row.liked_feed)return;for(var e=0;e<i.usersData.length;e++)i.usersData[e].username==jQuery(this).parent().parent().find("h3").text()&&0!=i.usersData[e].data.length&&jQuery(this).attr("src",i.usersData[e].data[0].images.thumbnail.url)}})},wdi_front.masonryDisplayFeedItems=function(e,i){var t=[],r=[];if(0!=jQuery("#wdi_feed_"+i.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").length){jQuery("#wdi_feed_"+i.feed_row.wdi_feed_counter+" .wdi_masonry_column").each(function(){1==i.feed_row.resort_after_load_more&&(jQuery(this).html(""),i.imageIndex=0),1==i.customFilterChanged&&(jQuery(this).html(""),i.imageIndex=0),"pagination"==i.feed_row.feed_display_view?t.push(0):t.push(jQuery(this).height()),r.push(jQuery(this))}),1==i.customFilterChanged&&(i.customFilterChanged=!1);for(var a,d,o,n,s,_=0;_<e.length;_++){"object"==typeof e[_].videos&&null==e[_].videos.standard_resolution||(i.displayedData.push(e[_]),a="image"==e[_].type?wdi_front.getPhotoTemplate(i):e[_].hasOwnProperty("videos")||"video"==e[_].type?wdi_front.getVideoTemplate(i):wdi_front.getSliderTemplate(i),d=e[_],o=a(wdi_front.createObject(d,i)),n=wdi_front.array_min(t),s=wdi_front.getImageResolution(e[_]),r[n.index].html(r[n.index].html()+o),t[n.index]+=r[n.index].width()*s,i.imageIndex++,"pagination"==i.feed_row.feed_display_view&&((_+1)%i.feed_row.pagination_per_page_number==0?i.resIndex+=i.freeSpaces+1:i.resIndex++))}i.wdi_loadedImages=0;var l=!1;i.wdi_load_count=_;var f=i.feed_row.wdi_feed_counter;jQuery("#wdi_feed_"+f+" img.wdi_img").on("load",function(){i.wdi_loadedImages++,w(),!1===l&&(wdi_responsive.columnControl(i,1),l=!0)});w(),1==i.paginatorNextFlag&&wdi_front.updatePagination(i,"next"),i.infiniteScrollFlag=!1}function w(){i.wdi_load_count===i.wdi_loadedImages&&0!=i.wdi_loadedImages&&(i.loadedImages=0,i.wdi_load_count=0,wdi_front.allImagesLoaded(i))}},wdi_front.getImageResolution=function(e){var i=e.images.standard_resolution.width;return e.images.standard_resolution.height/i},wdi_front.getDataLength=function(e,i){var t=0;if(void 0===i)for(var r=0;r<e.dataStorage.length;r++)t+=e.dataStorage[r].length;else for(r=0;r<i.length;r++)t+=i[r].length;return t},wdi_front.getArrayContentLength=function(e,i){for(var t=0,r=0;r<e.length;r++)"finished"!=e[r].finished&&(t+=e[r][i].length);return t},wdi_front.displayFeedItems=function(e,i){if(0!=jQuery("#wdi_feed_"+i.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").length){var t=i.feed_row.wdi_feed_counter,r=jQuery("#wdi_feed_"+t+" .wdi_feed_wrapper");"1"===i.feed_row.resort_after_load_more&&(r.html(""),i.imageIndex=0),1==i.customFilterChanged&&(r.html(""),i.imageIndex=0,i.customFilterChanged=!1);var a;wdi_front.getImgCount(i),e.length;"pagination"==i.feed_row.feed_display_view&&(a=i.feed_row.load_more_number,"image_browser"==i.feed_row.feed_type&&(a=1),(jQuery("#wdi_feed_"+i.feed_row.wdi_feed_counter+' [wdi_page="'+(i.currentPage-1)+'"]').length<a||0==e.length)&&(i.currentPage=--i.currentPage<=1?1:i.currentPage));for(var d,o,n,s=0;s<e.length;s++){"object"==typeof e[s].videos&&null==e[s].videos.standard_resolution||(d="image"==e[s].type?wdi_front.getPhotoTemplate(i):e[s].hasOwnProperty("videos")?wdi_front.getVideoTemplate(i):wdi_front.getSliderTemplate(i),o=e[s],n=d(wdi_front.createObject(o,i)),r.html(r.html()+n),i.imageIndex++,"pagination"==i.feed_row.feed_display_view&&((s+1)%i.feed_row.pagination_per_page_number==0?i.resIndex+=i.freeSpaces+1:i.resIndex++))}i.wdi_loadedImages=0;var _=!1;i.wdi_load_count=s;t=i.feed_row.wdi_feed_counter,r=jQuery("#wdi_feed_"+t+" img.wdi_img").on("load",function(){i.wdi_loadedImages++,i.wdi_load_count===i.wdi_loadedImages&&0!=i.wdi_loadedImages&&(i.loadedImages=0,i.wdi_load_count=0,wdi_front.allImagesLoaded(i)),!1===_&&(wdi_responsive.columnControl(i,1),_=!0)});1==i.paginatorNextFlag&&wdi_front.updatePagination(i,"next"),i.infiniteScrollFlag=!1}},wdi_front.checkFeedFinished=function(e){for(var i=0;i<e.usersData.length;i++)if(void 0===e.usersData[i].finished)return!1;return!0},wdi_front.sortingOperator=function(e,i){var t;switch(e){case"date":switch(i){case"asc":t=function(e,i){return e.created_time>i.created_time?1:-1};break;case"desc":t=function(e,i){return e.created_time>i.created_time?-1:1}}break;case"likes":switch(i){case"asc":t=function(e,i){return e.likes.count<i.likes.count?-1:1};break;case"desc":t=function(e,i){return e.likes.count<i.likes.count?1:-1}}break;case"comments":switch(i){case"asc":t=function(e,i){return e.comments.count<i.comments.count?-1:1};break;case"desc":t=function(e,i){return e.comments.count<i.comments.count?1:-1}}break;case"random":t=function(e,i){return.5<Math.random()?1:-1}}return t},wdi_front.feedSort=function(e,i){var t=e.feed_row.sort_images_by,r=e.feed_row.display_order;"1"===e.feed_row.resort_after_load_more?e.data=e.data.concat(wdi_front.smartPicker(e,i)):e.data=wdi_front.smartPicker(e,i);var a=wdi_front.sortingOperator(t,r);return e.data.sort(a),e.data},wdi_front.smartPicker=function(e,i){var t=[],r=0,a=[],d=Math.ceil(e.feed_row.number_of_photos/e.usersData.length),o=parseInt(e.feed_row.number_of_photos),n=0;""!=i&&void 0!==i&&null!=i&&(o=parseInt(i),d=Math.ceil(o/wdi_front.activeUsersCount(e)));e.storeRawData(e.usersData,"dataStorageRaw");for(var s,_=e.dataStorageRaw.sort(function(e,i){return e.length()>i.length()?1:-1}),l=e.usersData.sort(function(e,i){return e.data.length>i.data.length?1:-1}),f=0;f<l.length;f++){n+=d,_[f].length()<=n?(n-=_[f].length(),t.push(_[f].getData(_[f].length())),r+=t[t.length-1].length):(o<r+n&&(n=o-r),(!(s=[])===e.auto_trigger||s.length+wdi_front.getDataLength(e)+wdi_front.getDataLength(e,t)<e.feed_row.number_of_photos)&&(s=s.concat(_[f].getData(n))),n=0,r+=s.length,t.push(s))}for(f=0;f<t.length;f++)void 0===e.dataStorage[f]?e.dataStorage.push(t[f]):e.dataStorage[f]=e.dataStorage[f].concat(t[f]);for(e.parsedData=wdi_front.parseLighboxData(e),f=0;f<t.length;f++)a=a.concat(t[f]);return a},wdi_front.createObject=function(e,i){var t,r=null!=e.caption?e.caption.text:"&nbsp",a=wdi_url.plugin_url+"images/video_missing.png";"video"==e.type&&e.videos[i.feedVideoResolution]&&null!=e.videos[i.feedVideoResolution].url&&(a=e.hasOwnProperty("videos")?e.videos[i.feedVideoResolution].url:""),void 0===e.images[i.feedImageResolution]?t=wdi_url.plugin_url+"images/missing.png":"carousel"==e.type&&void 0===e.images[i.feedImageResolution].url?void 0!==e.carousel_media[0].images?t=e.carousel_media[0].images[i.feedImageResolution].url:void 0!==e.carousel_media[0].videos&&(t=e.carousel_media[0].videos.standard_resolution.url):t=e.images[i.feedImageResolution].url;var d=i.imageIndex,o="square",n=e.images.standard_resolution.height,s=e.images.standard_resolution.width;s<n?o="portrait":n<s&&(o="landscape");var _=e.user.username;return""===_&&(_="no_user"),{id:e.id,caption:wdi_front.escape_tags(r),image_url:t,likes:e.likes.count,comments:e.comments.count,wdi_index:d,wdi_res_index:i.resIndex,wdi_media_user:_,link:e.link,video_url:a,wdi_username:_,wdi_shape:o}},wdi_front.setPage=function(e){var i=e.feed_row.feed_display_view,t=e.feed_row.feed_type;if("pagination"!=i)return"";var r,a=e.imageIndex;return r="image_browser"==t?1:Math.abs(e.feed_row.pagination_per_page_number),e.paginator=Math.ceil((a+1)/r),e.paginator},wdi_front.getPhotoTemplate=function(e){var i=wdi_front.setPage(e),t="",r="",a="",d="",o="tenweb-i-arrows-out",n="";"blog_style"!=e.feed_row.feed_type&&"image_browser"!=e.feed_row.feed_type||(o=""),sourceAttr=(""!=i&&(r='wdi_page="'+i+'"'),"src"),""!=i&&1!=i&&(t="wdi_hidden"),"1"==e.feed_row.show_username_on_thumb&&e.data.length&&""!==e.data[0].user.username&&(n='<span class="wdi_media_user">@<%= wdi_username%></span>'),1==e.feed_row.show_full_description&&"masonry"==e.feed_row.feed_type&&(t+=" wdi_full_caption");var s="";switch("blog_style"!==e.feed_row.feed_type&&(s="masonry"==e.feed_row.feed_type?"wdi_responsive.showMasonryCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");":"wdi_responsive.showCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");"),e.feed_row.feed_item_onclick){case"lightbox":a="onclick=wdi_feed_"+e.feed_row.wdi_feed_counter+".galleryBox('<%=id%>')";break;case"instagram":a="onclick=\"window.open ('<%= link%>','_blank')\"",d="wdi_hover_off",o="";break;case"custom_redirect":a="onclick=\"window.open ('"+e.feed_row.redirect_url+"','_self')\"",d="wdi_hover_off",o="";break;case"none":d="wdi_cursor_off wdi_hover_off",o=a=""}var l='<div class="wdi_feed_item '+t+'" wdi_index=<%= wdi_index%> wdi_res_index=<%= wdi_res_index%> wdi_media_user=<%= wdi_media_user%> '+r+' wdi_type="image" id="wdi_'+e.feed_row.wdi_feed_counter+"_<%=id%>\"><div class=\"wdi_photo_wrap\"><div class=\"wdi_photo_wrap_inner\"><div class=\"wdi_photo_img <%= wdi_shape == 'square' ? 'wdi_shape_square' : (wdi_shape == 'portrait' ? 'wdi_shape_portrait' : (wdi_shape == 'landscape' ? 'wdi_shape_landscape' : 'wdi_shape_square') ) %>\"><img class=\"wdi_img\" "+sourceAttr+'="<%=image_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);"><div class="wdi_photo_overlay '+d+'" >'+n+'<div class="wdi_thumb_icon" '+a+' style="display:table;width:100%;height:100%;"><div style="display:table-cell;vertical-align:middle;text-align:center;color:white;"><i class="tenweb-i '+o+'"></i></div></div></div></div></div></div>';return"1"!==e.feed_row.show_likes&&"1"!==e.feed_row.show_comments&&"1"!==e.feed_row.show_description||(l+='<div class="wdi_photo_meta">',"#"===e.feed_row.thumb_user[0]&&"1"===e.feed_row.show_likes&&(l+='<div class="wdi_thumb_likes"><i class="tenweb-i tenweb-i-heart-o">&nbsp;<%= likes%></i></div>'),"#"===e.feed_row.thumb_user[0]&&"1"===e.feed_row.show_comments&&(l+='<div class="wdi_thumb_comments"><i class="tenweb-i tenweb-i-comment-square">&nbsp;<%= comments%></i></div>'),l+='<div class="wdi_clear"></div>',"1"===e.feed_row.show_description&&(l+='<div class="wdi_photo_title" onclick='+s+" ><%=caption%></div>"),l+="</div>"),l+="</div>",_.template(l)},wdi_front.getSliderTemplate=function(e){var i=wdi_front.setPage(e),t="",r="",a="",d="",o="tenweb-i-clone",n="";"blog_style"!=e.feed_row.feed_type&&"image_browser"!=e.feed_row.feed_type||(o=""),sourceAttr=(""!=i&&(r='wdi_page="'+i+'"'),"src"),""!=i&&1!=i&&(t="wdi_hidden"),"1"==e.feed_row.show_username_on_thumb&&e.data.length&&""!==e.data[0].user.username&&(n='<span class="wdi_media_user">@<%= wdi_username%></span>'),1==e.feed_row.show_full_description&&"masonry"==e.feed_row.feed_type&&(t+=" wdi_full_caption");var s="";switch("blog_style"!==e.feed_row.feed_type&&(s="masonry"==e.feed_row.feed_type?"wdi_responsive.showMasonryCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");":"wdi_responsive.showCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");"),e.feed_row.feed_item_onclick){case"lightbox":a="onclick=wdi_feed_"+e.feed_row.wdi_feed_counter+".galleryBox('<%=id%>')";break;case"instagram":a="onclick=\"window.open ('<%= link%>','_blank')\"",d="wdi_hover_off",o="tenweb-i-clone";break;case"custom_redirect":a="onclick=\"window.open ('"+e.feed_row.redirect_url+"','_self')\"",d="wdi_hover_off",o="";break;case"none":d="wdi_cursor_off wdi_hover_off",o=a=""}var l='<div class="wdi_feed_item '+t+'" wdi_index=<%= wdi_index%> wdi_res_index=<%= wdi_res_index%> wdi_media_user=<%= wdi_media_user%> '+r+' wdi_type="slideshow" id="wdi_'+e.feed_row.wdi_feed_counter+"_<%=id%>\"><div class=\"wdi_photo_wrap\"><div class=\"wdi_photo_wrap_inner\"><div class=\"wdi_photo_img <%= wdi_shape == 'square' ? 'wdi_shape_square' : (wdi_shape == 'portrait' ? 'wdi_shape_portrait' : (wdi_shape == 'landscape' ? 'wdi_shape_landscape' : 'wdi_shape_square') ) %>\"><img class=\"wdi_img\" "+sourceAttr+'="<%=image_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);"><div class="wdi_photo_overlay '+d+'" >'+n+'<div class="wdi_thumb_icon" '+a+' style="display:table;width:100%;height:100%;"><div style="display:table-cell;vertical-align:middle;text-align:center;color:white;"><i class="tenweb-i '+o+'"></i></div></div></div></div></div></div>';return"1"!==e.feed_row.show_likes&&"1"!==e.feed_row.show_comments&&"1"!==e.feed_row.show_description||(l+='<div class="wdi_photo_meta">',"#"===e.feed_row.thumb_user[0]&&"1"===e.feed_row.show_likes&&(l+='<div class="wdi_thumb_likes"><i class="tenweb-i tenweb-i-heart-o">&nbsp;<%= likes%></i></div>'),"#"===e.feed_row.thumb_user[0]&&"1"===e.feed_row.show_comments&&(l+='<div class="wdi_thumb_comments"><i class="tenweb-i tenweb-i-comment-square">&nbsp;<%= comments%></i></div>'),l+='<div class="wdi_clear"></div>',"1"===e.feed_row.show_description&&(l+='<div class="wdi_photo_title" onclick='+s+" ><%=caption%></div>"),l+="</div>"),l+="</div>",_.template(l)},wdi_front.replaceToVideo=function(e,i,t){overlayHtml="<video style='width:auto !important; height:auto !important; max-width:100% !important; max-height:100% !important; margin:0 !important;' controls=''><source src='"+e+"' type='video/mp4'>Your browser does not support the video tag. </video>",jQuery("#wdi_feed_"+t+' [wdi_index="'+i+'"] .wdi_photo_wrap_inner').html(overlayHtml),jQuery("#wdi_feed_"+t+' [wdi_index="'+i+'"] .wdi_photo_wrap_inner video').get(0).play()},wdi_front.getVideoTemplate=function(e){var i=wdi_front.setPage(e),t="",r="",a="tenweb-i-play",d="",o="",n="",s=(""!=i&&(r='wdi_page="'+i+'"'),"src");""!=i&&1!=i&&(t="wdi_hidden"),"1"==e.feed_row.show_username_on_thumb&&e.data.length&&""!==e.data[0].user.username&&(n='<span class="wdi_media_user">@<%= wdi_username%></span>'),1==e.feed_row.show_full_description&&"masonry"==e.feed_row.feed_type&&(t+=" wdi_full_caption");var l="";switch("blog_style"!==e.feed_row.feed_type&&(l="masonry"==e.feed_row.feed_type?"wdi_responsive.showMasonryCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");":"wdi_responsive.showCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");"),e.feed_row.feed_item_onclick){case"lightbox":d="onclick=wdi_feed_"+e.feed_row.wdi_feed_counter+".galleryBox('<%=id%>')";break;case"instagram":d="onclick=\"window.open ('<%= link%>','_blank')\"",o="wdi_hover_off",a="tenweb-i-play";break;case"custom_redirect":d="onclick=\"window.open ('"+e.feed_row.redirect_url+"','_self')\"",o="wdi_hover_off",a="";break;case"none":o="wdi_cursor_off wdi_hover_off",a="","blog_style"!=e.feed_row.feed_type&&"image_browser"!=e.feed_row.feed_type||(d="onclick=wdi_front.replaceToVideo('<%= video_url%>','<%= wdi_index%>',"+e.feed_row.wdi_feed_counter+")",o="",a="tenweb-i-play")}var f='<div class="wdi_feed_item '+t+'" wdi_index=<%= wdi_index%> wdi_res_index=<%= wdi_res_index%> wdi_media_user=<%= wdi_media_user%> '+r+' wdi_type="image" id="wdi_'+e.feed_row.wdi_feed_counter+"_<%=id%>\"><div class=\"wdi_photo_wrap\"><div class=\"wdi_photo_wrap_inner\"><div class=\"wdi_photo_img <%= wdi_shape == 'square' ? 'wdi_shape_square' : (wdi_shape == 'portrait' ? 'wdi_shape_portrait' : (wdi_shape == 'landscape' ? 'wdi_shape_landscape' : 'wdi_shape_square') ) %>\"><img class=\"wdi_img\" "+s+'="<%=video_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);"><div class="wdi_photo_overlay '+o+'" '+d+">"+n+'<div class="wdi_thumb_icon" style="display:table;width:100%;height:100%;"><div style="display:table-cell;vertical-align:middle;text-align:center;color:white;"><i class="tenweb-i '+a+'"></i></div></div></div></div></div></div>';return"1"!==e.feed_row.show_likes&&"1"!==e.feed_row.show_comments&&"1"!==e.feed_row.show_description||(f+='<div class="wdi_photo_meta">',"#"===e.feed_row.thumb_user[0]&&"1"===e.feed_row.show_likes&&(f+='<div class="wdi_thumb_likes"><i class="tenweb-i tenweb-i-heart-o">&nbsp;<%= likes%></i></div>'),"#"===e.feed_row.thumb_user[0]&&"1"===e.feed_row.show_comments&&(f+='<div class="wdi_thumb_comments"><i class="tenweb-i tenweb-i-comment-square">&nbsp;<%= comments%></i></div>'),f+='<div class="wdi_clear"></div>',"1"===e.feed_row.show_description&&(f+='<div class="wdi_photo_title" onclick='+l+" ><%=caption%></div>"),f+="</div>"),f+="</div>",_.template(f)},wdi_front.bindEvents=function(e){0!=jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").length&&("load_more_btn"==e.feed_row.feed_display_view&&jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" .wdi_load_more_container").on(wdi_front.clickOrTouch,function(){wdi_front.loadMore(jQuery(this).find(".wdi_load_more_wrap"))}),"pagination"==e.feed_row.feed_display_view&&(jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_next").on(wdi_front.clickOrTouch,function(){wdi_front.paginatorNext(jQuery(this),e)}),jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_prev").on(wdi_front.clickOrTouch,function(){wdi_front.paginatorPrev(jQuery(this),e)}),jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_last_page").on(wdi_front.clickOrTouch,function(){wdi_front.paginationLastPage(jQuery(this),e)}),jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_first_page").on(wdi_front.clickOrTouch,function(){wdi_front.paginationFirstPage(jQuery(this),e)}),e.paginatorNextFlag=!1),"infinite_scroll"==e.feed_row.feed_display_view&&(jQuery(window).on("scroll",function(){wdi_front.infiniteScroll(e)}),e.infiniteScrollFlag=!1))},wdi_front.infiniteScroll=function(e){jQuery(window).scrollTop()+jQuery(window).height()-100>=jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_infinite_scroll").offset().top&&(!1===e.infiniteScrollFlag&&0==e.stopInfiniteScrollFlag?(e.infiniteScrollFlag=!0,wdi_front.loadMore(jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_infinite_scroll"),e)):e.stopInfiniteScrollFlag&&wdi_front.allImagesLoaded(e))},wdi_front.paginationFirstPage=function(e,i){var t;1!=i.paginator&&1!=i.currentPage&&(t=i.currentPage,i.currentPage=1,wdi_front.updatePagination(i,"custom",t),e.parent().find("#wdi_last_page").removeClass("wdi_disabled")),e.addClass("wdi_disabled")},wdi_front.paginationLastPage=function(e,i){var t;1!=i.paginator&&i.currentPage!=i.paginator&&(t=i.currentPage,i.currentPage=i.paginator,wdi_front.updatePagination(i,"custom",t),e.addClass("wdi_disabled"),e.parent().find("#wdi_first_page").removeClass("wdi_disabled"))},wdi_front.paginatorNext=function(e,i){var t,r=e.parent().find("#wdi_last_page"),a=e.parent().find("#wdi_first_page");i.paginatorNextFlag=!0,i.paginator!=i.currentPage||wdi_front.checkFeedFinished(i)?i.paginator>i.currentPage&&(i.currentPage++,wdi_front.updatePagination(i,"next"),i.paginator>i.currentPage?r.removeClass("wdi_disabled"):r.addClass("wdi_disabled")):(i.currentPage++,t=i.feed_row.number_of_photos,wdi_front.loadMore(e,i,t),r.addClass("wdi_disabled")),a.removeClass("wdi_disabled")},wdi_front.paginatorPrev=function(e,i){var t=e.parent().find("#wdi_last_page"),r=e.parent().find("#wdi_first_page");1!=i.currentPage?(i.currentPage--,wdi_front.updatePagination(i,"prev"),t.removeClass("wdi_disabled"),1==i.currentPage&&r.addClass("wdi_disabled")):r.addClass("wdi_disabled")},wdi_front.updatePagination=function(e,i,t){var r="#wdi_feed_"+e.feed_row.wdi_feed_counter;switch(jQuery(r+' [wdi_page="'+e.currentPage+'"]').each(function(){jQuery(this).removeClass("wdi_hidden")}),i){case"next":var t=e.currentPage-1;jQuery(r+" .wdi_feed_wrapper").height(jQuery(".wdi_feed_wrapper").height()),jQuery(r+' [wdi_page="'+t+'"]').each(function(){jQuery(this).addClass("wdi_hidden")});break;case"prev":t=e.currentPage+1;jQuery(r+" .wdi_feed_wrapper").height(jQuery(".wdi_feed_wrapper").height()),jQuery(r+' [wdi_page="'+t+'"]').each(function(){jQuery(this).addClass("wdi_hidden")});break;case"custom":(t=t)!=e.currentPage&&(jQuery(r+" .wdi_feed_wrapper").height(jQuery(".wdi_feed_wrapper").height()),jQuery(r+' [wdi_page="'+t+'"]').each(function(){jQuery(this).addClass("wdi_hidden")}))}e.paginatorNextFlag=!1,jQuery(r+" .wdi_feed_wrapper").css("height","auto"),jQuery(r+" #wdi_current_page").text(e.currentPage)},wdi_front.loadMore=function(e,i){var t,r=0;""!=e&&void 0!==e&&"initial"!=e&&"initial-keep"!=e&&(t=window[e.parent().parent().parent().parent().attr("id")]),void 0!==i&&(t=i);for(var a=0,d=0,o=0;o<t.userSortFlags.length;o++)if(!0===t.userSortFlags[o].flag){a++;for(var n=0;n<t.usersData.length;n++)t.userSortFlags[o].id===t.usersData[n].user_id&&"finished"===t.usersData[n].finished&&d++}if(a!==d||0==a){t.auto_trigger=""===e,wdi_front.ajaxLoader(t),"masonry"===t.feed_row.feed_type&&"pagination"==t.feed_row.feed_display_view&&jQuery("#wdi_feed_"+wdi_front.feed_counter+" .wdi_full_caption").each(function(){jQuery(this).find(".wdi_photo_title").trigger(wdi_front.clickOrTouch)});for(o=0;o<t.usersData.length;o++)"finished"===t.usersData[o].finished&&r++;r===t.usersData.length&&(wdi_front.allImagesLoaded(t),jQuery("#wdi_feed_"+t.feed_row.wdi_feed_counter+" .wdi_load_more").remove());var s=t.usersData;t.loadMoreDataCount=t.feed_users.length;for(o=0;o<s.length;o++){var _,l=s[o].pagination,f={user_id:s[o].user_id,username:s[o].username};""!=l.next_url&&null!=l.next_url&&void 0!==l.next_url?(_=l.next_url,wdi_front.loadMoreRequest(f,_,t,e)):("initial-keep"==e&&(t.temproraryUsersData[o]=t.usersData[o]),t.loadMoreDataCount--,wdi_front.checkForLoadMoreDone(t,e))}}},wdi_front.loadMoreRequest=function(t,e,r,a){var d,i;r.mediaRequestsDone&&(r.usersData,d="",i=function(e){if(""===e||void 0===e||null==e)return d=wdi_front_messages.network_error,r.loadMoreDataCount--,void wdi_front.show_alert(d,e,r);if(void 0!==e.meta&&void 0!==e.meta.error_type&&wdi_front.show_alert(!1,e,r),void 0!==e.meta&&void 0!==e.meta.code&&200!=e.meta.code)return d=e.meta.error_message,r.loadMoreDataCount--,void wdi_front.show_alert(d,e,r);e.user_id=t.user_id,e.username=t.username;for(var i=0;i<r.usersData.length;i++)e.user_id===r.usersData[i].user_id&&("#"===e.user_id[0]&&(e.data=wdi_front.appendRequestHashtag(e.data,e.user_id)),"initial-keep"==a&&(r.temproraryUsersData[i]=r.usersData[i]),r.usersData[i]=e,r.loadMoreDataCount--);wdi_front.checkForLoadMoreDone(r,a)},"#"!==t.username[0]?r.instagram.requestByUrl(e,{success:i}):r.instagram.getTagRecentMedia(t.username,{success:i},e,r.feed_row.hashtag_top_recent))},wdi_front.checkForLoadMoreDone=function(e,i){var t=e.feed_row.load_more_number,r=e.feed_row.number_of_photos;if(0==e.loadMoreDataCount){e.temproraryUsersData=wdi_front.mergeData(e.temproraryUsersData,e.usersData);var a=wdi_front.getArrayContentLength(e.temproraryUsersData,"data");if("initial-keep"==i&&(i="initial"),"initial"==i)a<r&&!wdi_front.userHasNoPhoto(e,e.temproraryUsersData)&&e.instagramRequestCounter<=e.maxConditionalFiltersRequestCount?wdi_front.loadMore("initial",e):(e.usersData=e.temproraryUsersData,wdi_front.displayFeed(e),wdi_front.applyFilters(e),e.temproraryUsersData=[]);else if(a<t&&!wdi_front.userHasNoPhoto(e,e.temproraryUsersData)&&e.instagramRequestCounter<=e.maxConditionalFiltersRequestCount)wdi_front.loadMore(void 0,e);else{if(e.usersData=e.temproraryUsersData,!wdi_front.activeUsersCount(e))return;wdi_front.displayFeed(e,t),wdi_front.applyFilters(e),e.temproraryUsersData=[]}}},wdi_front.allDataHasFinished=function(e){for(var i=0,t=0;t<e.dataStorageRaw.length;t++)0==e.dataStorageRaw[t].length()&&1==e.dataStorageRaw[t].locked&&i++;return i==e.dataStorageRaw.length},wdi_front.mergeData=function(e,i){for(var t=0;t<i.length;t++)if(void 0!==e[t]){if("finished"==i[t].finished)continue;if(void 0===e[t].pagination.next_max_id&&void 0===e[t].pagination.next_max_like_id)continue;e[t].data=e[t].data.concat(i[t].data),e[t].pagination=i[t].pagination,e[t].user_id=i[t].user_id,e[t].username=i[t].username,e[t].meta=i[t].meta}else e.push(i[t]);return e},wdi_front.brokenImageHandler=function(e){return!0},wdi_front.ajaxLoader=function(e){var i,t=e.feed_row.wdi_feed_counter,r=jQuery("#wdi_feed_"+t);"load_more_btn"==e.feed_row.feed_display_view&&(r.find(".wdi_load_more").addClass("wdi_hidden"),r.find(".wdi_spinner").removeClass("wdi_hidden")),"infinite_scroll"==e.feed_row.feed_display_view&&(0==r.find(".wdi_ajax_loading").length?(i=jQuery('<div class="wdi_ajax_loading"><div><div><img class="wdi_load_more_spinner" src="'+wdi_url.plugin_url+'images/ajax_loader.png"></div></div></div>'),r.append(i)):i=r.find(".wdi_ajax_loading"),i.removeClass("wdi_hidden"))},wdi_front.allImagesLoaded=function(e){var i=wdi_front.getDataLength(e);e.mediaRequestsDone||jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").remove("wdi_nomedia"),0!=i||!e.mediaRequestsDone||0!=e.feed_row.conditional_filters.length&&0!=e.feed_row.conditional_filter_enable||jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").append("<p class='wdi_nomedia'>"+wdi_front_messages.feed_nomedia+"</p>");var t=e.feed_row.wdi_feed_counter,r=jQuery("#wdi_feed_"+t);"load_more_btn"==e.feed_row.feed_display_view&&(r.find(".wdi_load_more").removeClass("wdi_hidden"),r.find(".wdi_spinner").addClass("wdi_hidden")),"infinite_scroll"==e.feed_row.feed_display_view&&jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" .wdi_ajax_loading").addClass("wdi_hidden"),r.trigger("wdi_feed_loaded")},wdi_front.show=function(e,i){var t,r,a,d=i.feed_row.wdi_feed_counter,o=jQuery("#wdi_feed_"+d+" .wdi_feed_container");switch(e){case"header":t={feed_thumb:i.feed_row.feed_thumb,feed_name:i.feed_row.feed_name},r=wdi_front.getHeaderTemplate()(t),a=o.find(".wdi_feed_header").html(),o.find(".wdi_feed_header").html(a+r)}},wdi_front.getUserTemplate=function(e,i){var t,r,a=e.dataCount;switch(i[0]){case"#":t="//instagram.com/explore/tags/"+i.substr(1,i.length);break;default:t="//instagram.com/"+i}r="onclick='"+('window.open("'+t+'","_blank")')+"'";var d='<div class="wdi_single_user" user_index="<%=user_index%>"><div class="wdi_header_user_text <%=hashtagClass%>"><div class="wdi_user_img_wrap"><img onerror="wdi_front.brokenImageHandler(this);" src="<%= user_img_url%>">';return 1<a&&(d+='<div title="'+wdi_front_messages.filter_title+'" class="wdi_filter_overlay"><div class="wdi_filter_icon"><span onclick="wdi_front.addFilter(<%=user_index%>,<%=feed_counter%>);" class="tenweb-i tenweb-i-filter"></span></div></div>'),d+="</div>",d+="<h3 "+r+"><%= user_name%></h3>","#"!==i[0]?("1"==e.feed_row.follow_on_instagram_btn&&(d+='<div class="wdi_user_controls"><div class="wdi_follow_btn" onclick="window.open(\'//instagram.com/<%= user_name%>\',\'_blank\')"><span> '+wdi_front_messages.follow+"</span></div></div>"),d+='<div class="wdi_media_info"><p class="wdi_posts"><span class="tenweb-i tenweb-i-camera-retro"></span><%= counts.media%></p><p class="wdi_followers"><span class="tenweb-i tenweb-i-user"></span><%= counts.followed_by%></p></div>'):d+='<div class="wdi_user_controls"></div><div class="wdi_media_info"><p class="wdi_posts"><span class="tenweb-i tenweb-i-camera-retro"></span><%= counts.media%></p><p class="wdi_followers"><span></span></p></div>',d+='<div class="wdi_clear"></div>',1==a&&"#"!==i[0]&&"1"==e.feed_row.display_user_info&&(d+='<div class="wdi_bio"><%= bio%></div>',d+='<div class="wdi_website"><a target="_blank" href="<%= website_url%>" ><%= website%></a></div>'),d+="</div></div>",_.template(d)},wdi_front.getHeaderTemplate=function(){return _.template('<div class="wdi_header_wrapper"><div class="wdi_header_img_wrap"><img src="<%=feed_thumb%>"></div><div class="wdi_header_text"><%=feed_name%></div><div class="wdi_clear"></div>')},wdi_front.addFilter=function(e,i){var t=window["wdi_feed_"+i];if(!(t.dataCount<2)&&0==t.nowLoadingImages){var r=jQuery("#wdi_feed_"+t.feed_row.wdi_feed_counter+'_users [user_index="'+e+'"]');r.find(".wdi_filter_overlay").toggleClass("wdi_filter_active_bg"),r.find(".wdi_header_user_text h3").toggleClass("wdi_filter_active_col"),r.find(".wdi_media_info").toggleClass("wdi_filter_active_col"),r.find(".wdi_follow_btn").toggleClass("wdi_filter_active_col"),t.customFilterChanged=!0,0==t.userSortFlags[e].flag?t.userSortFlags[e].flag=!0:t.userSortFlags[e].flag=!1;for(var a=0,d=0;d<t.userSortFlags.length;d++)1==t.userSortFlags[d].flag&&a++;"pagination"==t.feed_row.feed_display_view&&(t.resIndex=0),0!=a?wdi_front.filterData(t):t.customFilteredData=t.dataStorageList,wdi_front.displayFeed(t),"pagination"==t.feed_row.feed_display_view&&(t.paginator=Math.ceil(t.imageIndex/parseInt(t.feed_row.pagination_per_page_number)),t.currentPage=t.paginator,wdi_front.updatePagination(t,"custom",1),jQuery("#wdi_first_page").removeClass("wdi_disabled"),jQuery("#wdi_last_page").addClass("wdi_disabled"))}},wdi_front.filterData=function(e){var i=e.userSortFlags;e.customFilteredData=[];for(var t=0;t<e.dataStorageList.length;t++)for(var r=0;r<i.length;r++)(void 0!==e.dataStorageList[t].user.id&&e.dataStorageList[t].user.id==i[r].id||e.dataStorageList[t].wdi_hashtag==i[r].name)&&1==i[r].flag&&e.customFilteredData.push(e.dataStorageList[t])},wdi_front.applyFilters=function(e){for(var i=0;i<e.userSortFlags.length;i++){1==e.userSortFlags[i].flag&&(jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+'[user_index="'+i+'"]'),wdi_front.addFilter(i,e.feed_row.wdi_feed_counter),wdi_front.addFilter(i,e.feed_row.wdi_feed_counter))}},wdi_front.getImgCount=function(e){for(var i=e.dataStorage,t=0,r=0;r<i.length;r++)t+=i[r].length;return t},wdi_front.parseLighboxData=function(e,i){var t=e.dataStorage,r=e.feed_row.sort_images_by,a=e.feed_row.display_order,d=wdi_front.sortingOperator(r,a),o=[],n=[],s={};if(1==i)o=e.customFilteredData;else{for(var _=0;_<t.length;_++)for(var l=0;l<t[_].length;l++)o.push(t[_][l]);o.sort(d)}for(_=0;_<o.length;_++){var f,w=void 0!==o[_].media_url?o[_].media_url:wdi_url.plugin_url+"images/video_missing.png";void 0===o[_].media_url&&"carousel"===o[_].type&&(void 0!==(f=o[_].carousel_media[0]).images?w=f.images.standard_resolution.url:void 0!==f.videos&&(w=f.videos.standard_resolution.url)),s={alt:"",avg_rating:"",comment_count:o[_].comments.count,date:wdi_front.convertUnixDate(o[_].created_time),description:wdi_front.getDescription(null!==o[_].caption?wdi_front.escape_tags(o[_].caption.text):""),filename:wdi_front.getFileName(o[_]),filetype:wdi_front.getFileType(o[_]),hit_count:"0",id:o[_].id,image_url:o[_].link,number:0,rate:"",rate_count:"0",username:o[_].user.username,profile_picture:o[_].user.profile_picture,thumb_url:w,comments_data:o[_].comments.data,images:o[_].images,carousel_media:void 0!==o[_].carousel_media?o[_].carousel_media:null},n.push(s)}return n},wdi_front.convertUnixDate=function(e){var i=parseInt(e),t=new Date(0);t.setUTCSeconds(i);var r=t.getFullYear()+"-"+t.getMonth()+"-"+t.getDate();return r+=" "+t.getHours()+":"+t.getMinutes()},wdi_front.getDescription=function(e){return e=e.replace(/\r?\n|\r/g," ")},wdi_front.getFileName=function(e){var i=e.link;if("video"===e.type&&e.hasOwnProperty("videos")&&null!=e.videos.standard_resolution)return e.videos.standard_resolution.url;var t=i.split("/");return t[t.length-2]},wdi_front.getFileType=function(e){return"video"==e.type&&e.hasOwnProperty("videos")?"EMBED_OEMBED_INSTAGRAM_VIDEO":"EMBED_OEMBED_INSTAGRAM_IMAGE"},wdi_front.array_max=function(e){for(var i=e[0],t=0,r=1;r<e.length;r++)i<e[r]&&(i=e[r],t=r);return{value:i,index:t}},wdi_front.array_min=function(e){for(var i=e[0],t=0,r=1;r<e.length;r++)i>e[r]&&(i=e[r],t=r);return{value:i,index:t}},wdi_front.activeUsersCount=function(e){for(var i=0,t=0;t<e.usersData.length;t++)"finished"!=e.usersData[t].finished&&i++;return i},wdi_front.checkMediaResponse=function(e,i){return""==e||void 0===e||null==e?(errorMessage=wdi_front_messages.connection_error,wdi_front.show_alert(errorMessage,e,i),!1):""!=e&&void 0!==e&&null!=e&&200!=e.meta.code?(errorMessage=e.meta.error_message,wdi_front.show_alert(errorMessage,e,i),!1):e},wdi_front.stripHashtag=function(e){switch(e[0]){case"#":return e.substr(1,e.length);default:return e}},wdi_front.getInputType=function(e){switch(e[0]){case"#":return"hashtag";case"%":return"location";default:return"user"}},wdi_front.regexpTestCaption=function(e,i){var t=!1,r=!1,a=i.replace(/[-[\]{}()*+?.,\\^$|]/g,"\\$&"),d=new RegExp("(?:^|\\s)"+a+"(?:^|\\s)"),o=new RegExp("(?:^|\\s)"+a,"g");for(null!=d.exec(e)&&(t=!0);null!=(match=o.exec(e));)r=!0;return 1==t||1==r},wdi_front.replaceNewLines=function(e){var i,t="vUkCJvN2ps3t",r=[];for(e=e.replace(/\r?\n|\r/g,t),i=new RegExp(t,"g");null!=(match=i.exec(e));)r.push(match.index);for(var a=e.split(t),d=0,o=0;o<a.length;o++)""==a[o]?d++:d=0,0<d&&(a.splice(o,1),d--,o--);return e=a.join(" ")},wdi_front.isEmptyObject=function(e){for(var i in e)if(e.hasOwnProperty(i))return!1;return!0},wdi_front.isEmpty=function(e){return!e||0===e.length};var WDIFeed=function(e){this.data=e.data,this.dataCount=e.dataCount,this.feed_row=e.feed_row,this.usersData=e.usersData,(_this=this).set_images_loading_flag=function(e){window.addEventListener("load",function(){e.nowLoadingImages=!1})},this.set_images_loading_flag(_this)};function wdi_extractHostname(e){return void 0===e||""===e?"":e.replace(/(^\w+:|^)\/\//,"")}WDIFeed.prototype.conditionalFilter=function(e,i){var t=this,r=t.feed_row.conditional_filter_type,a=t.feed_row.conditional_filters;if(1==i.ignoreFiltering||(e=this.avoidDuplicateMedia(e)),!wdi_front.isJsonString(a))return e;if(void 0!==(a=JSON.parse(a))&&0==a.length)return e;if("0"==t.feed_row.conditional_filter_enable)return e;switch(t.instagramRequestCounter++,r){case"AND":e=this.applyANDLogic(e,a,t);break;case"OR":e=this.applyORLogic(e,a,t);break;case"NOR":e=this.applyNORLogic(e,a,t)}return e},WDIFeed.prototype.applyANDLogic=function(e,i){for(var t=0;t<i.length;t++)e=this.filterResponse(e,i[t]);return e},WDIFeed.prototype.applyORLogic=function(e,i){for(var t,r,a=[],d=[],o=0;o<i.length;o++)t=this.filterResponse(e,i[o]),a=a.concat(t.data),t={};for(o=0;o<a.length;o++)r=a[o],this.mediaExists(r,d)||this.mediaExists(r,this.dataStorageList)||d.push(r);return{data:d,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.applyNORLogic=function(e,i){for(var t=e,r=this.applyORLogic(e,i,this),a=[],d=0;d<t.data.length;d++)this.mediaExists(t.data[d],r.data)||a.push(t.data[d]);return{data:a,meta:t.meta,pagination:t.pagination}},WDIFeed.prototype.mediaExists=function(e,i){for(var t=0;t<i.length;t++)if(e.id==i[t].id)return!0;return!1},WDIFeed.prototype.filterResponse=function(e,i){switch(i.filter_type){case"hashtag":return this.filterByHashtag(e,i);case"username":return this.filterByUsername(e,i);case"mention":return this.filterByMention(e,i);case"description":return this.filterByDescription(e,i);case"location":return this.filterByLocation(e,i);case"url":return this.filterByUrl(e,i)}},WDIFeed.prototype.filterByHashtag=function(e,i){for(var t,r=[],a=0;a<e.data.length;a++)if(void 0!==(t=e.data[a]).tags)for(var d=0;d<t.tags.length;d++){tag=t.tags[d];var o=tag.toLowerCase(),n=i.filter_by.toLowerCase();o.trim()==n.trim()&&r.push(t)}return{data:r,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByUsername=function(e,i){for(var t,r=[],a=0;a<e.data.length;a++)(t=e.data[a]).user.username.toLowerCase()==i.filter_by.toLowerCase()&&r.push(t);return{data:r,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByMention=function(e,i){for(var t,r=[],a=0;a<e.data.length;a++)null!==(t=e.data[a]).caption&&-1!=t.caption.text.toLowerCase().indexOf("@"+i.filter_by.toLowerCase())&&r.push(t);return{data:r,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByDescription=function(e,i){for(var t,r,a,d=[],o=0;o<e.data.length;o++){null!==(a=e.data[o]).caption&&(t=a.caption.text.toLowerCase(),t=wdi_front.replaceNewLines(t),r=i.filter_by.toLowerCase(),wdi_front.regexpTestCaption(t,r)&&d.push(a))}return{data:d,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByLocation=function(e,i){for(var t,r=[],a=0;a<e.data.length;a++)null!==(t=e.data[a]).location&&t.location.id==i.filter_by&&r.push(t);return{data:r,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByUrl=function(e,i){var t,r=[];i.filter_by=this.getIdFromUrl(i.filter_by);for(var a=0;a<e.data.length;a++)null!==(t=e.data[a]).link&&this.getIdFromUrl(t.link)==i.filter_by&&r.push(t);return{data:r,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.getIdFromUrl=function(e){for(var i=e.split("/"),t=!1,r=0;r<i.length;r++)if("p"==i[r]&&void 0!==i[r+1]){t=i[r+1];break}return t},WDIFeed.prototype.avoidDuplicateMedia=function(e){var i=e.data,t=[];void 0===i&&(i=[]);for(var r=0;r<i.length;r++)this.mediaExists(i[r],this.dataStorageList)||this.mediaExists(i[r],t)||this.mediaExists(i[r],this.conditionalFilterBuffer)||t.push(i[r]);return this.conditionalFilterBuffer=this.conditionalFilterBuffer.concat(t),{data:t,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.storeRawData=function(e,i){var r=this;if("object"==typeof this[i]&&"number"==typeof this[i].length)for(var t=0;t<e.length;t++){var a="";wdi_front.isHashtag(e[t].user_id)?void 0!==e[t].pagination.cursors&&(a=e[t].pagination.cursors.after):"liked"==r.feed_row.liked_feed?void 0===(a=e[t].pagination.next_max_like_id)&&(a=""):(null==e[t].pagination&&(e[t].pagination=[]),void 0===(a=e[t].pagination.next_max_id)&&(a="")),void 0===this[i][t]?this[i].push({data:e[t].data,index:0,locked:!1,hash_id:a,usersDataFinished:!1,userId:e[t].user_id,length:function(){return this.data.length-this.index},getData:function(e){var i=this.data.slice(this.index,this.index+e);if(this.index+=Math.min(e,this.length()),this.index==this.data.length&&1==this.locked&&0==this.usersDataFinished)for(var t=0;t<r.usersData.length;t++)if(r.usersData[t].user_id==this.userId){r.usersData[t].finished="finished",this.usersDataFinished=!0;break}return i}}):0==this[i][t].locked&&(a!=this[i][t].hash_id?(this[i][t].data=this[i][t].data.concat(e[t].data),this[i][t].hash_id=a):this[i][t].locked=!0)}},wdi_front.updateUsersIfNecessary=function(o){for(var n=o.feed_users,e=!1,i=0;i<n.length;i++)"#"!=n[i].username.substr(0,1)?""!=n[i].id&&"username"!=n[i].id||(e=!0,o.instagram.searchForUsersByName(n[i].username,{success:function(e){if(void 0!==e.meta&&void 0!==e.meta.error_type&&wdi_front.show_alert(!1,e,o),200==e.meta.code&&0<e.data.length){for(var i=!1,t=0;t<e.data.length;t++)if(e.data[t].username==e.args.username){i=!0;break}if(i)for(var r=0;r<n.length;r++)e.data[t].username==n[r].username&&(n[r].id=e.data[t].id)}for(var a=!1,d=0;d<n.length;d++)if(""==n[d].id||"username"==n[d].id){a=!0;break}a||(o.feed_row.feed_users=JSON.stringify(n),wdi_front.init(o))},username:n[i].username})):n[i].id=n[i].username;return e},void 0!==wdi_ajax.ajax_response?jQuery(document).one("ajaxStop",function(){"not_declared"!=wdi_front.type&&(wdi_front.clickOrTouch=wdi_front.detectEvent(),wdi_front.globalInit())}):jQuery(document).ready(function(){"not_declared"!=wdi_front.type&&(wdi_front.clickOrTouch=wdi_front.detectEvent(),wdi_front.globalInit())}),jQuery(document).ready(function(){setTimeout(function(){"1"===wdi_front_messages.show_alerts&&"I"!==jQuery(".wdi_check_fontawesome .tenweb-i-instagram").prop("tagName")&&console.log("Font Awesome is not loaded properly. Please ask for support https://wordpress.org/support/plugin/wd-instagram-feed/")},2e3)});
js/wdi_instagram.js CHANGED
@@ -272,19 +272,11 @@ function WDIInstagram(args) {
272
  }
273
 
274
  response = response.response;
275
-
276
-
277
-
278
-
279
  response = _this.convertHashtagData(response);
280
  response.meta = {"code": 200};
281
  response.tag_id = wdiTagId;
282
  response = _this.addTags(response);
283
  success(response)
284
-
285
-
286
-
287
-
288
  },
289
  error: function (response) {
290
  if (errorFlag) {
@@ -303,9 +295,10 @@ function WDIInstagram(args) {
303
  },
304
  statusCode: statusCode
305
  });
 
306
  function success(response) {
307
- if (typeof response["data"] === "undefined") response["data"] = [];
308
- if (successFlag) {
309
  if (typeof args.success == 'object' && args.success.length == 2) {
310
  if (typeof window[args.success[0]] != 'undefined') {
311
  if (typeof window[args.success[0]][args.success[1]] == 'function') {
@@ -315,15 +308,15 @@ function WDIInstagram(args) {
315
  window[args.success[0]][args.success[1]](response);
316
  }
317
  }
318
-
319
- } else if (typeof args.success == 'string') {
320
- if (typeof window[args.success] == 'function') {
321
  if (filter) {
322
  response = filter(response, instagram.filterArguments, args.args);
323
  }
324
  window[args.success](response);
325
  }
326
- } else if (typeof args.success == 'function') {
 
327
  if (filter) {
328
  response = filter(response, instagram.filterArguments, args.args);
329
  }
@@ -372,185 +365,180 @@ function WDIInstagram(args) {
372
  return false;
373
  };
374
 
375
- this.convertHashtagData = function (data) {
376
  var converted_data = {
377
  data: [],
378
  pagination: {}
379
  };
380
-
381
- if(typeof data.paging !== "undefined"){
382
- converted_data.pagination = {
383
- cursors: {after: data.paging.cursors.after},
384
- next_url: data.paging.next
 
385
  }
386
  }
387
-
388
- for (var i in data.data) {
389
- var media = data.data[i];
390
-
391
- var media_type;
392
- if (media.media_type === "IMAGE") {
393
- media_type = "image";
394
- } else if (media.media_type === "VIDEO") {
395
- media_type = "video";
396
- } else {
397
- media_type = "carousel";
398
- }
399
-
400
- var converted = {
401
- "id": media.id,
402
- "user": {
403
- "id": "",
404
- "full_name": "",
405
- "profile_picture": "",
406
- "username": ""
407
- },
408
- "images": {
409
- "thumbnail": {
410
- "width": 150,
411
- "height": 150,
412
- "url": media.media_url
413
- },
414
- "low_resolution": {
415
- "width": 320,
416
- "height": 320,
417
- "url": media.media_url
418
- },
419
- "standard_resolution": {
420
- "width": 1080,
421
- "height": 1080,
422
- "url": media.media_url
423
- }
424
- },
425
- "created_time": media.timestamp,
426
- "caption": {
427
- "id": "",
428
- "text": media.caption,
429
- "created_time": "",
430
- "from": {
431
  "id": "",
432
  "full_name": "",
433
  "profile_picture": "",
434
  "username": ""
435
- }
436
- },
437
- "user_has_liked": (media.like_count > 0),
438
- "likes": {
439
- "count": media.like_count
440
- },
441
- "tags": [],
442
- "filter": "Normal",
443
- "comments": {
444
- "count": media.comments_count
445
- },
446
- "type": media_type,
447
- "link": media.permalink,
448
- "location": null,
449
- "attribution": null,
450
- "users_in_photo": []
451
- };
452
-
453
- if (media.media_type === "IMAGE" || media.media_type === "CAROUSEL_ALBUM") {
454
- converted.images = {
455
- "thumbnail": {
456
- "width": 150,
457
- "height": 150,
458
- "url": media.media_url
459
  },
460
- "low_resolution": {
461
- "width": 320,
462
- "height": 320,
463
- "url": media.media_url
 
 
 
 
 
 
 
 
 
 
 
 
464
  },
465
- "standard_resolution": {
466
- "width": 1080,
467
- "height": 1080,
468
- "url": media.media_url
469
- }
470
- };
471
- } else if (media.media_type === "VIDEO") {
472
- converted.videos = {
473
- "standard_resolution": {
474
- "width": 640,
475
- "height": 800,
476
- "url": media.thumb_url,
477
  },
478
- "low_bandwidth": {
479
- "width": 480,
480
- "height": 600,
481
- "url": media.thumb_url,
482
  },
483
- "low_resolution": {
484
- "width": 480,
485
- "height": 600,
486
- "url": media.thumb_url,
487
- }
 
 
 
 
 
488
  };
489
- }
490
-
491
- if (media.media_type === "CAROUSEL_ALBUM") {
492
- converted.carousel_media = [];
493
-
494
- for (var j in media.children.data) {
495
- if (media.children.data[j].media_type === "IMAGE") {
496
- var child = {
497
- "images": {
498
- "thumbnail": {
499
- "width": 150,
500
- "height": 150,
501
- "url": media.children.data[j].media_url
502
- },
503
- "low_resolution": {
504
- "width": 320,
505
- "height": 320,
506
- "url": media.children.data[j].media_url
507
- },
508
- "standard_resolution": {
509
- "width": 640,
510
- "height": 640,
511
- "url": media.children.data[j].media_url
512
- }
513
- },
514
- "users_in_photo": [],
515
- "type": "image"
516
- };
517
- }
518
- else {
519
- var child = {
520
- "videos": {
521
- "standard_resolution": {
522
- "width": 640,
523
- "height": 800,
524
- "url": media.children.data[j].media_url,
525
- "id": media.children.data[j].id
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
526
  },
527
- "low_bandwidth": {
528
- "width": 480,
529
- "height": 600,
530
- "url": media.children.data[j].media_url,
531
- "id": media.children.data[j].id
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
532
  },
533
- "low_resolution": {
534
- "width": 480,
535
- "height": 600,
536
- "url": media.children.data[j].media_url,
537
- "id": media.children.data[j].id
538
- }
539
- },
540
- "users_in_photo": [],
541
- "type": "video"
542
- };
543
  }
544
-
545
- converted.carousel_media.push(child);
546
-
547
  }
548
-
549
  }
550
-
551
- converted_data.data.push(converted);
552
  }
553
-
554
  return converted_data;
555
  };
556
 
@@ -1078,7 +1066,6 @@ function WDIInstagram(args) {
1078
  argFlag = false,
1079
  filter = this.getFilter('getUserMedia');
1080
 
1081
-
1082
  if (typeof args == 'undefined' || args.length === 0) {
1083
  noArgument = true;
1084
  } else {
@@ -1109,7 +1096,6 @@ function WDIInstagram(args) {
1109
  }
1110
  }
1111
 
1112
-
1113
  jQuery.ajax({
1114
  type: "POST",
1115
  url: wdi_ajax.ajax_url,
@@ -1877,5 +1863,4 @@ function WDIInstagram(args) {
1877
  }
1878
  });
1879
  }
1880
-
1881
  }
272
  }
273
 
274
  response = response.response;
 
 
 
 
275
  response = _this.convertHashtagData(response);
276
  response.meta = {"code": 200};
277
  response.tag_id = wdiTagId;
278
  response = _this.addTags(response);
279
  success(response)
 
 
 
 
280
  },
281
  error: function (response) {
282
  if (errorFlag) {
295
  },
296
  statusCode: statusCode
297
  });
298
+
299
  function success(response) {
300
+ if ( typeof response["data"] === 'undefined' ) response["data"] = [];
301
+ if ( successFlag ) {
302
  if (typeof args.success == 'object' && args.success.length == 2) {
303
  if (typeof window[args.success[0]] != 'undefined') {
304
  if (typeof window[args.success[0]][args.success[1]] == 'function') {
308
  window[args.success[0]][args.success[1]](response);
309
  }
310
  }
311
+ } else if ( typeof args.success == 'string' ) {
312
+ if ( typeof window[args.success] == 'function' ) {
 
313
  if (filter) {
314
  response = filter(response, instagram.filterArguments, args.args);
315
  }
316
  window[args.success](response);
317
  }
318
+ }
319
+ else if ( typeof args.success == 'function' ) {
320
  if (filter) {
321
  response = filter(response, instagram.filterArguments, args.args);
322
  }
365
  return false;
366
  };
367
 
368
+ this.convertHashtagData = function ( data ) {
369
  var converted_data = {
370
  data: [],
371
  pagination: {}
372
  };
373
+ if ( typeof data !== 'undefined' ) {
374
+ if ( typeof data.paging !== "undefined" ) {
375
+ converted_data.pagination = {
376
+ cursors: { after: data.paging.cursors.after },
377
+ next_url: data.paging.next
378
+ }
379
  }
380
  }
381
+ if ( typeof data.data != 'undefined' ) {
382
+ for ( var i in data.data ) {
383
+ var media = data.data[i];
384
+ var media_type;
385
+ if ( media.media_type === "IMAGE" ) {
386
+ media_type = "image";
387
+ }
388
+ else if ( media.media_type === "VIDEO" ) {
389
+ media_type = "video";
390
+ }
391
+ else {
392
+ media_type = "carousel";
393
+ }
394
+ var converted = {
395
+ "id": media.id,
396
+ "user": {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
397
  "id": "",
398
  "full_name": "",
399
  "profile_picture": "",
400
  "username": ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
401
  },
402
+ "images": {
403
+ "thumbnail": {
404
+ "width": 150,
405
+ "height": 150,
406
+ "url": media.media_url
407
+ },
408
+ "low_resolution": {
409
+ "width": 320,
410
+ "height": 320,
411
+ "url": media.media_url
412
+ },
413
+ "standard_resolution": {
414
+ "width": 1080,
415
+ "height": 1080,
416
+ "url": media.media_url
417
+ }
418
  },
419
+ "created_time": media.timestamp,
420
+ "caption": {
421
+ "id": "",
422
+ "text": media.caption,
423
+ "created_time": "",
424
+ "from": {
425
+ "id": "",
426
+ "full_name": "",
427
+ "profile_picture": "",
428
+ "username": ""
429
+ }
 
430
  },
431
+ "user_has_liked": (media.like_count > 0),
432
+ "likes": {
433
+ "count": media.like_count
 
434
  },
435
+ "tags": [],
436
+ "filter": "Normal",
437
+ "comments": {
438
+ "count": media.comments_count
439
+ },
440
+ "type": media_type,
441
+ "link": media.permalink,
442
+ "location": null,
443
+ "attribution": null,
444
+ "users_in_photo": []
445
  };
446
+ if ( media.media_type === "IMAGE" || media.media_type === "CAROUSEL_ALBUM" ) {
447
+ converted.images = {
448
+ "thumbnail": {
449
+ "width": 150,
450
+ "height": 150,
451
+ "url": media.media_url
452
+ },
453
+ "low_resolution": {
454
+ "width": 320,
455
+ "height": 320,
456
+ "url": media.media_url
457
+ },
458
+ "standard_resolution": {
459
+ "width": 1080,
460
+ "height": 1080,
461
+ "url": media.media_url
462
+ }
463
+ };
464
+ }
465
+ else if ( media.media_type === "VIDEO" ) {
466
+ converted.videos = {
467
+ "standard_resolution": {
468
+ "width": 640,
469
+ "height": 800,
470
+ "url": media.thumb_url,
471
+ },
472
+ "low_bandwidth": {
473
+ "width": 480,
474
+ "height": 600,
475
+ "url": media.thumb_url,
476
+ },
477
+ "low_resolution": {
478
+ "width": 480,
479
+ "height": 600,
480
+ "url": media.thumb_url,
481
+ }
482
+ };
483
+ }
484
+ if ( media.media_type === "CAROUSEL_ALBUM" ) {
485
+ converted.carousel_media = [];
486
+ for ( var j in media.children.data ) {
487
+ if ( media.children.data[j].media_type === "IMAGE" ) {
488
+ var child = {
489
+ "images": {
490
+ "thumbnail": {
491
+ "width": 150,
492
+ "height": 150,
493
+ "url": media.children.data[j].media_url
494
+ },
495
+ "low_resolution": {
496
+ "width": 320,
497
+ "height": 320,
498
+ "url": media.children.data[j].media_url
499
+ },
500
+ "standard_resolution": {
501
+ "width": 640,
502
+ "height": 640,
503
+ "url": media.children.data[j].media_url
504
+ }
505
  },
506
+ "users_in_photo": [],
507
+ "type": "image"
508
+ };
509
+ }
510
+ else {
511
+ var child = {
512
+ "videos": {
513
+ "standard_resolution": {
514
+ "width": 640,
515
+ "height": 800,
516
+ "url": media.children.data[j].media_url,
517
+ "id": media.children.data[j].id
518
+ },
519
+ "low_bandwidth": {
520
+ "width": 480,
521
+ "height": 600,
522
+ "url": media.children.data[j].media_url,
523
+ "id": media.children.data[j].id
524
+ },
525
+ "low_resolution": {
526
+ "width": 480,
527
+ "height": 600,
528
+ "url": media.children.data[j].media_url,
529
+ "id": media.children.data[j].id
530
+ }
531
  },
532
+ "users_in_photo": [],
533
+ "type": "video"
534
+ };
535
+ }
536
+ converted.carousel_media.push(child);
 
 
 
 
 
537
  }
 
 
 
538
  }
539
+ converted_data.data.push(converted);
540
  }
 
 
541
  }
 
542
  return converted_data;
543
  };
544
 
1066
  argFlag = false,
1067
  filter = this.getFilter('getUserMedia');
1068
 
 
1069
  if (typeof args == 'undefined' || args.length === 0) {
1070
  noArgument = true;
1071
  } else {
1096
  }
1097
  }
1098
 
 
1099
  jQuery.ajax({
1100
  type: "POST",
1101
  url: wdi_ajax.ajax_url,
1863
  }
1864
  });
1865
  }
 
1866
  }
js/wdi_instagram.min.js CHANGED
@@ -1 +1 @@
1
- function WDIInstagram(e){this.user={},this.access_tokens=[],this.filters=[],void 0!==e&&(void 0!==e.access_tokens&&(this.access_tokens=e.access_tokens),void 0!==e.filters&&(this.filters=e.filters));var s=this;function t(){return void 0!==s.user&&void 0!==s.user.user_name?s.user.user_name:"undefined"!=typeof wdi_object&&void 0!==wdi_object.user?wdi_object.user.user_name:""}function r(){return void 0!==s.user&&void 0!==s.user.access_token?s.user.access_token:"undefined"!=typeof wdi_object&&void 0!==wdi_object.user&&void 0!==wdi_object.user.access_token?wdi_object.user.access_token:""}this.statusCode={429:function(){console.log(" 429: Too many requests. Try after one hour")}},this.getFilter=function(e){var t=s.filters;if(void 0===t)return!1;for(var r=0;r<t.length;r++)if(t[r].where==e)if("object"==typeof t[r].what&&2==t[r].what.length){if(void 0!==window[t[r].what[0]]&&"function"==typeof window[t[r].what[0]][t[r].what[1]])return window[t[r].what[0]][t[r].what[1]]}else{if("string"!=typeof t[r].what)return"function"==typeof t[r].what&&t[r].what;if("function"==typeof window[t[r].what])return window[t[r].what]}return!1},this.addToken=function(e){"string"==typeof e&&s.access_tokens.push(e)},this.resetTokens=function(){s.access_tokens=[]},this.getTagRecentMedia=function(e,r,o,i){var n=this,c=!1,u=this.statusCode,a=!1,d=this.getFilter("getTagRecentMedia");i=0===parseInt(i)?"top_media":"recent_media",void 0===r||0===r.length||("success"in r&&(c=!0),"statusCode"in r&&(u=r.statusCode),"error"in r&&(a=!0),"args"in r?!0:r.args={},"count"in r?(r.count=parseInt(r.count),(!Number.isInteger(r.count)||r.count<=0)&&(r.count=33)):r.count=33);var f=this.getTagId(e);jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{tagname:e,endpoint:i,wdi_nonce:wdi_ajax.wdi_nonce,wdiTagId:f,next_url:o,user_name:t(),action:"wdi_getTagRecentMedia"},success:function(e){if(!1===f&&(f=""),void 0!==e.tag_data){var t=e.tag_data;void 0!==t.tag_id&&(f=t.tag_id);var o=[];void 0!==window.wdi_all_tags&&(o=window.wdi_all_tags),o[t.tag_id]=t,window.wdi_all_tags=o}e=e.response,(e=s.convertHashtagData(e)).meta={code:200},e.tag_id=f,function(e){void 0===e.data&&(e.data=[]);c&&("object"==typeof r.success&&2==r.success.length?void 0!==window[r.success[0]]&&"function"==typeof window[r.success[0]][r.success[1]]&&(d&&(e=d(e,n.filterArguments,r.args)),window[r.success[0]][r.success[1]](e)):"string"==typeof r.success?"function"==typeof window[r.success]&&(d&&(e=d(e,n.filterArguments,r.args)),window[r.success](e)):"function"==typeof r.success&&(d&&(e=d(e,n.filterArguments,r.args)),r.success(e)))}(e=s.addTags(e))},error:function(e){a&&("object"==typeof r.error&&2==r.error.length?"function"==typeof window[r.error[0]][r.error[1]]&&window[r.error[0]][r.error[1]](e):"string"==typeof r.error?"function"==typeof window[r.error]&&window[r.error](e):"function"==typeof r.error&&r.error(e))},statusCode:u})},this.addTags=function(e){for(i in e.data){var s=e.data[i].caption.text;if(void 0!==s&&""!==s&&-1!=s.indexOf("#")){var t=s.split("#");e.data[i].tags=t}}return e},this.getTagId=function(e){var s=[];if("undefined"!=typeof wdi_controller){if(0===(s=wdi_controller.feed_users).length){var t=jQuery("#WDI_feed_users").val();void 0!==t&&""!==t&&(s=JSON.parse(t))}}else void 0!==window.wdi_all_tags&&(s=window.wdi_all_tags);for(var r in s)if(e===s[r].username||"#"+e===s[r].username)return void 0!==s[r].tag_id&&s[r].tag_id;return!1},this.convertHashtagData=function(e){var s={data:[],pagination:{}};for(var t in void 0!==e.paging&&(s.pagination={cursors:{after:e.paging.cursors.after},next_url:e.paging.next}),e.data){var r,o=e.data[t];r="IMAGE"===o.media_type?"image":"VIDEO"===o.media_type?"video":"carousel";var i={id:o.id,user:{id:"",full_name:"",profile_picture:"",username:""},images:{thumbnail:{width:150,height:150,url:o.media_url},low_resolution:{width:320,height:320,url:o.media_url},standard_resolution:{width:1080,height:1080,url:o.media_url}},created_time:o.timestamp,caption:{id:"",text:o.caption,created_time:"",from:{id:"",full_name:"",profile_picture:"",username:""}},user_has_liked:o.like_count>0,likes:{count:o.like_count},tags:[],filter:"Normal",comments:{count:o.comments_count},type:r,link:o.permalink,location:null,attribution:null,users_in_photo:[]};if("IMAGE"===o.media_type||"CAROUSEL_ALBUM"===o.media_type?i.images={thumbnail:{width:150,height:150,url:o.media_url},low_resolution:{width:320,height:320,url:o.media_url},standard_resolution:{width:1080,height:1080,url:o.media_url}}:"VIDEO"===o.media_type&&(i.videos={standard_resolution:{width:640,height:800,url:o.thumb_url},low_bandwidth:{width:480,height:600,url:o.thumb_url},low_resolution:{width:480,height:600,url:o.thumb_url}}),"CAROUSEL_ALBUM"===o.media_type)for(var n in i.carousel_media=[],o.children.data){if("IMAGE"===o.children.data[n].media_type)var c={images:{thumbnail:{width:150,height:150,url:o.children.data[n].media_url},low_resolution:{width:320,height:320,url:o.children.data[n].media_url},standard_resolution:{width:640,height:640,url:o.children.data[n].media_url}},users_in_photo:[],type:"image"};else c={videos:{standard_resolution:{width:640,height:800,url:o.children.data[n].media_url,id:o.children.data[n].id},low_bandwidth:{width:480,height:600,url:o.children.data[n].media_url,id:o.children.data[n].id},low_resolution:{width:480,height:600,url:o.children.data[n].media_url,id:o.children.data[n].id}},users_in_photo:[],type:"video"};i.carousel_media.push(c)}s.data.push(i)}return s},this.searchForTagsByName=function(e,t){var o=this,i=!1,n=this.statusCode,c=!1;filter=this.getFilter("searchForTagsByName"),void 0===t||0===t.length||("success"in t&&(i=!0),"error"in t&&(c=!0),"statusCode"in t&&(n=t.statusCode));var u="https://api.instagram.com/v1/tags/search?q="+e+"&access_token="+r();s.getDataFromCache(function(e){function r(e){i&&("object"==typeof t.success&&2==t.success.length?void 0!==window[t.success[0]]&&"function"==typeof window[t.success[0]][t.success[1]]&&(filter&&(e=filter(e,o.filterArguments)),window[t.success[0]][t.success[1]](e)):"string"==typeof t.success?"function"==typeof window[t.success]&&(filter&&(e=filter(e,o.filterArguments)),window[t.success](e)):"function"==typeof t.success&&(filter&&(e=filter(e,o.filterArguments)),t.success(e)))}!1===e?jQuery.ajax({type:"POST",url:u,dataType:"jsonp",success:function(e){s.setDataToCache(u,e),r(e)},error:function(e){c&&("object"==typeof t.error&&2==t.error.length?"function"==typeof window[t.error[0]][t.error[1]]&&window[t.error[0]][t.error[1]](e):"string"==typeof t.error?"function"==typeof window[t.error]&&window[t.error](e):"function"==typeof t.error&&t.error(e))},statusCode:n}):r(e)},u)},this.searchForUsersByName=function(e,s){var t=this,o=!1,i=(this.statusCode,!1),n=this.getFilter("searchForUsersByName");void 0===s||0===s.length||("success"in s&&(o=!0),"error"in s&&(i=!0),"statusCode"in s&&s.statusCode),jQuery.ajax({type:"POST",dataType:"jsonp",url:"https://api.instagram.com/v1/users/search?q="+e+"&access_token="+r(),success:function(e){o&&("object"==typeof s.success&&2==s.success.length?void 0!==window[s.success[0]]&&"function"==typeof window[s.success[0]][s.success[1]]&&(n&&(e=n(e,t.filterArguments)),e.args=s,window[s.success[0]][s.success[1]](e)):"string"==typeof s.success?"function"==typeof window[s.success]&&(n&&(e=n(e,t.filterArguments)),e.args=s,window[s.success](e)):"function"==typeof s.success&&(n&&(e=n(e,t.filterArguments)),e.args=s,s.success(e)))},error:function(e){i&&("object"==typeof s.error&&2==s.error.length?"function"==typeof window[s.error[0]][s.error[1]]&&window[s.error[0]][s.error[1]](e):"string"==typeof s.error?"function"==typeof window[s.error]&&window[s.error](e):"function"==typeof s.error&&s.error(e))},statusCode:this.statusCode})},this.getRecentLikedMedia=function(e){var s=this,t=!1,o=this.statusCode,i=!1,n=this.getFilter("getRecentLikedMedia"),c="https://api.instagram.com/v1/users/self/media/liked?access_token="+r();void 0===e||0===e.length||("success"in e&&(t=!0),"error"in e&&(i=!0),"statusCode"in e&&(o=e.statusCode),"args"in e?argFlag=!0:e.args={},"count"in e?(e.count=parseInt(e.count),(!Number.isInteger(e.count)||e.count<=0)&&(e.count=20)):e.count=20,c+="&count="+e.count,"next_max_like_id"in e&&(c+="&next_max_like_id="+e.next_max_like_id)),jQuery.ajax({type:"POST",dataType:"jsonp",url:c,success:function(r){t&&("object"==typeof e.success&&2==e.success.length?void 0!==window[e.success[0]]&&"function"==typeof window[e.success[0]][e.success[1]]&&(n&&(r=n(r,s.filterArguments,e.args)),window[e.success[0]][e.success[1]](r)):"string"==typeof e.success?"function"==typeof window[e.success]&&(n&&(r=n(r,s.filterArguments,e.args)),window[e.success](r)):"function"==typeof e.success&&(n&&(r=n(r,s.filterArguments,e.args)),e.success(r)))},error:function(s){i&&("object"==typeof e.error&&2==e.error.length?"function"==typeof window[e.error[0]][e.error[1]]&&window[e.error[0]][e.error[1]](s):"string"==typeof e.error?"function"==typeof window[e.error]&&window[e.error](s):"function"==typeof e.error&&e.error(s))},statusCode:o})},this.getUserRecentMedia=function(e,s){var t=this,o=!1,i=this.statusCode,n=!1,c=this.getFilter("getUserRecentMedia"),u="https://api.instagram.com/v1/users/"+e+"/media/recent/?access_token="+r();void 0===s||0===s.length||("success"in s&&(o=!0),"statusCode"in s&&(i=s.statusCode),"args"in s?!0:s.args={},"error"in s&&(n=!0),"count"in s?(s.count=parseInt(s.count),(!Number.isInteger(s.count)||s.count<=0)&&(s.count=33)):s.count=33,u+="&count="+s.count,"min_id"in s&&(u+="&min_id="+s.min_id),"max_id"in s&&(u+="&max_id="+s.max_id)),jQuery.ajax({type:"POST",dataType:"jsonp",url:u,success:function(e){void 0===e.data&&(e.data=[]),o&&("object"==typeof s.success&&2==s.success.length?void 0!==window[s.success[0]]&&"function"==typeof window[s.success[0]][s.success[1]]&&(c&&(e=c(e,t.filterArguments,s.args)),window[s.success[0]][s.success[1]](e)):"string"==typeof s.success?"function"==typeof window[s.success]&&(c&&(e=c(e,t.filterArguments,s.args)),window[s.success](e)):"function"==typeof s.success&&(c&&(e=c(e,t.filterArguments,s.args)),s.success(e)))},error:function(e){n&&("object"==typeof s.error&&2==s.error.length?"function"==typeof window[s.error[0]][s.error[1]]&&window[s.error[0]][s.error[1]](e):"string"==typeof s.error?"function"==typeof window[s.error]&&window[s.error](e):"function"==typeof s.error&&s.error(e))},statusCode:i})},this.getUserMedia=function(e){var r=this,o=!1,i=this.statusCode,n=!1,c=this.getFilter("getUserMedia");void 0===e||0===e.length||("success"in e&&(o=!0),"error"in e&&(n=!0),"statusCode"in e&&(i=e.statusCode),"args"in e?!0:e.args={},"count"in e?(e.count=parseInt(e.count),(!Number.isInteger(e.count)||e.count<=0)&&(e.count=20)):e.count=20),jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_nonce:wdi_ajax.wdi_nonce,action:"wdi_getUserMedia",user_name:t()},success:function(t){t.meta={code:200},o&&("object"==typeof e.success&&2==e.success.length?void 0!==window[e.success[0]]&&"function"==typeof window[e.success[0]][e.success[1]]&&(c&&(t=s.addTags(t),t=c(t,r.filterArguments,e)),window[e.success[0]][e.success[1]](t)):"string"==typeof e.success?"function"==typeof window[e.success]&&(c&&(t=s.addTags(t),t=c(t,r.filterArguments,e)),window[e.success](t)):"function"==typeof e.success&&(c&&(t=s.addTags(t),t=c(t,r.filterArguments,e)),e.success(t)))},error:function(s){n&&("object"==typeof e.error&&2==e.error.length?"function"==typeof window[e.error[0]][e.error[1]]&&window[e.error[0]][e.error[1]](s):"string"==typeof e.error?"function"==typeof window[e.error]&&window[e.error](s):"function"==typeof e.error&&e.error(s))},statusCode:i})},this.getUserInfo=function(e,s){var t=this,o=!1,i=this.statusCode,n=!1,c=this.getFilter("getUserInfo");void 0===s||0===s.length||("success"in s&&(o=!0),"error"in s&&(n=!0),"statusCode"in s&&(i=s.statusCode)),jQuery.ajax({type:"POST",dataType:"jsonp",url:"https://api.instagram.com/v1/users/"+e+"/?access_token="+r(),success:function(e){o&&("object"==typeof s.success&&2==s.success.length?void 0!==window[s.success[0]]&&"function"==typeof window[s.success[0]][s.success[1]]&&(c&&(e=c(e,t.filterArguments)),window[s.success[0]][s.success[1]](e)):"string"==typeof s.success?"function"==typeof window[s.success]&&(c&&(e=c(e,t.filterArguments)),window[s.success](e)):"function"==typeof s.success&&(c&&(e=c(e,t.filterArguments)),s.success(e)))},error:function(e){n&&("object"==typeof s.error&&2==s.error.length?"function"==typeof window[s.error[0]][s.error[1]]&&window[s.error[0]][s.error[1]](e):"string"==typeof s.error?"function"==typeof window[s.error]&&window[s.error](e):"function"==typeof s.error&&s.error(e))},statusCode:i})},this.getSelfInfo=function(e){var t=this,o=!1,i=this.statusCode,n=!1,c=this.getFilter("getSelfInfo");void 0===e||0===e.length||("success"in e&&(o=!0),"error"in e&&(n=!0),"statusCode"in e&&(i=e.statusCode));var u="https://graph.facebook.com/v3.2/"+(void 0!==s.user&&void 0!==s.user.user_id?s.user.user_id:"undefined"!=typeof wdi_object&&void 0!==wdi_object.user?wdi_object.user.user_id:"")+"?fields=id,ig_id,username,name,biography,profile_picture_url,followers_count,follows_count,media_count,website&access_token="+r();s.getDataFromCache(function(r){var a;!1===r?jQuery.ajax({type:"POST",dataType:"jsonp",url:u,statusCode:i,success:function(r){s.setDataToCache(u,r),o&&("object"==typeof e.success&&2==e.success.length?void 0!==window[e.success[0]]&&"function"==typeof window[e.success[0]][e.success[1]]&&(c&&(r.meta={code:200},r=c(r,t.filterArguments)),window[e.success[0]][e.success[1]](r)):"string"==typeof e.success?"function"==typeof window[e.success]&&(c&&(r.meta={code:200},r=c(r,t.filterArguments)),window[e.success](r)):"function"==typeof e.success&&(c&&(r.meta={code:200},r=c(r,t.filterArguments)),e.success(r)))},error:function(s){n&&("object"==typeof e.error&&2==e.error.length?"function"==typeof window[e.error[0]][e.error[1]]&&window[e.error[0]][e.error[1]](s):"string"==typeof e.error?"function"==typeof window[e.error]&&window[e.error](s):"function"==typeof e.error&&e.error(s))}}):(a=r,o&&("object"==typeof e.success&&2==e.success.length?void 0!==window[e.success[0]]&&"function"==typeof window[e.success[0]][e.success[1]]&&(c&&(a=c(a,t.filterArguments)),window[e.success[0]][e.success[1]](a)):"string"==typeof e.success?"function"==typeof window[e.success]&&(c&&(a=c(a,t.filterArguments)),window[e.success](a)):"function"==typeof e.success&&(c&&(a=c(a,t.filterArguments)),e.success(a))))},u)},this.getRecentMediaComments=function(e,t){var o=this,i=!1,n=this.statusCode,c=!1,u=this.getFilter("getRecentMediaComments");void 0===t||0===t.length||("success"in t&&(i=!0),"error"in t&&(c=!0),"statusCode"in t&&(n=t.statusCode));var a="https://api.instagram.com/v1/media/"+e+"/comments?access_token="+r();s.getDataFromCache(function(e){function r(e){i&&("object"==typeof t.success&&2==t.success.length?void 0!==window[t.success[0]]&&"function"==typeof window[t.success[0]][t.success[1]]&&(u&&(e=u(e,o.filterArguments)),window[t.success[0]][t.success[1]](e)):"string"==typeof t.success?"function"==typeof window[t.success]&&(u&&(e=u(e,o.filterArguments)),window[t.success](e)):"function"==typeof t.success&&(u&&(e=u(e,o.filterArguments)),t.success(e)))}!1===e?jQuery.ajax({type:"POST",dataType:"jsonp",url:a,success:function(e){s.setDataToCache(a,e),r(e)},error:function(e){c&&("object"==typeof t.error&&2==t.error.length?"function"==typeof window[t.error[0]][t.error[1]]&&window[t.error[0]][t.error[1]](e):"string"==typeof t.error?"function"==typeof window[t.error]&&window[t.error](e):"function"==typeof t.error&&t.error(e))},statusCode:n}):r(e)},a)},this.getRecentMediaLikes=function(e,s){var t=this,o=!1,i=this.statusCode,n=!1,c=this.getFilter("getRecentMediaLikes");void 0===s||0===s.length||("success"in s&&(o=!0),"error"in s&&(n=!0),"statusCode"in s&&(i=s.statusCode)),jQuery.ajax({type:"POST",dataType:"jsonp",url:"https://api.instagram.com/v1/media/"+e+"/likes?access_token="+r(),success:function(e){o&&("object"==typeof s.success&&2==s.success.length?void 0!==window[s.success[0]]&&"function"==typeof window[s.success[0]][s.success[1]]&&(c&&(e=c(e,t.filterArguments)),window[s.success[0]][s.success[1]](e)):"string"==typeof s.success?"function"==typeof window[s.success]&&(c&&(e=c(e,t.filterArguments)),window[s.success](e)):"function"==typeof s.success&&(c&&(e=c(e,t.filterArguments)),s.success(e)))},error:function(e){n&&("object"==typeof s.error&&2==s.error.length?"function"==typeof window[s.error[0]][s.error[1]]&&window[s.error[0]][s.error[1]](e):"string"==typeof s.error?"function"==typeof window[s.error]&&window[s.error](e):"function"==typeof s.error&&s.error(e))},statusCode:i})},this.requestByUrl=function(e,t){var o,i=this,n=!1,c=!1,u=this.statusCode,a=this.getFilter("requestByUrl");o=e.split("?")[1].split("&");for(var d=0;d<o.length;d++)o[d]=o[d].split("="),"access_token"==o[d][0]&&(o[d][1]=r()),o[d]=o[d].join("=");o=o.join("&"),e=e.split("?")[0]+"?"+o,void 0===t||0===t.length||("success"in t&&(n=!0),"args"in t?!0:t.args={},"error"in t&&(c=!0),"statusCode"in t&&(u=t.statusCode));s.getDataFromCache(function(r){var o;!1===r?jQuery.ajax({type:"POST",dataType:"jsonp",url:e,success:function(r){s.setDataToCache(e,r),n&&("object"==typeof t.success&&2==t.success.length?void 0!==window[t.success[0]]&&"function"==typeof window[t.success[0]][t.success[1]]&&(a&&(r=a(r,i.filterArguments,t.args)),window[t.success[0]][t.success[1]](r)):"string"==typeof t.success?"function"==typeof window[t.success]&&(a&&(r=a(r,i.filterArguments,t.args)),window[t.success](r)):"function"==typeof t.success&&(a&&(r=a(r,i.filterArguments,t.args)),t.success(r)))},error:function(e){c&&("object"==typeof t.error&&2==t.error.length?"function"==typeof window[t.error[0]][t.error[1]]&&window[t.error[0]][t.error[1]](e):"string"==typeof t.error?"function"==typeof window[t.error]&&window[t.error](e):"function"==typeof t.error&&t.error(e))},statusCode:u}):(o=r,n&&("object"==typeof t.success&&2==t.success.length?void 0!==window[t.success[0]]&&"function"==typeof window[t.success[0]][t.success[1]]&&(a&&(o=a(o,i.filterArguments,t.args)),window[t.success[0]][t.success[1]](o)):"string"==typeof t.success?"function"==typeof window[t.success]&&(a&&(o=a(o,i.filterArguments,t.args)),window[t.success](o)):"function"==typeof t.success&&(a&&(o=a(o,i.filterArguments,t.args)),t.success(o))))},e)},this.getDataFromCache=function(e,s,t){void 0===t&&(t=!0),jQuery.ajax({type:"POST",async:t,url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_cache_name:s,wdi_nonce:wdi_ajax.wdi_nonce,WDI_MINIFY:wdi_ajax.WDI_MINIFY,task:"get",action:"wdi_cache"},success:function(s){if(s.success)if(void 0!==s.cache_data&&null!==s.cache_data){var t=JSON.parse(s.cache_data);e(t)}else e(!1);else e(!1)}})},this.setDataToCache=function(e,s){jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_cache_name:e,wdi_cache_response:JSON.stringify(s),wdi_nonce:wdi_ajax.wdi_nonce,task:"set",action:"wdi_cache"},success:function(e){}})}}
1
+ function WDIInstagram(e){this.user={},this.access_tokens=[],this.filters=[],void 0!==e&&(void 0!==e.access_tokens&&(this.access_tokens=e.access_tokens),void 0!==e.filters&&(this.filters=e.filters));var d=this;function f(){return void 0!==d.user&&void 0!==d.user.user_name?d.user.user_name:"undefined"!=typeof wdi_object&&void 0!==wdi_object.user?wdi_object.user.user_name:""}function a(){return void 0!==d.user&&void 0!==d.user.access_token?d.user.access_token:"undefined"!=typeof wdi_object&&void 0!==wdi_object.user&&void 0!==wdi_object.user.access_token?wdi_object.user.access_token:""}this.statusCode={429:function(){console.log(" 429: Too many requests. Try after one hour")}},this.getFilter=function(e){var s=d.filters;if(void 0===s)return!1;for(var t=0;t<s.length;t++)if(s[t].where==e)if("object"==typeof s[t].what&&2==s[t].what.length){if(void 0!==window[s[t].what[0]]&&"function"==typeof window[s[t].what[0]][s[t].what[1]])return window[s[t].what[0]][s[t].what[1]]}else{if("string"!=typeof s[t].what)return"function"==typeof s[t].what&&s[t].what;if("function"==typeof window[s[t].what])return window[s[t].what]}return!1},this.addToken=function(e){"string"==typeof e&&d.access_tokens.push(e)},this.resetTokens=function(){d.access_tokens=[]},this.getTagRecentMedia=function(e,r,s,t){var o=this,i=!1,n=this.statusCode,c=!1,u=this.getFilter("getTagRecentMedia");t=0===parseInt(t)?"top_media":"recent_media",void 0===r||0===r.length||("success"in r&&(i=!0),"statusCode"in r&&(n=r.statusCode),"error"in r&&(c=!0),"args"in r||(r.args={}),"count"in r?(r.count=parseInt(r.count),(!Number.isInteger(r.count)||r.count<=0)&&(r.count=33)):r.count=33);var a=this.getTagId(e);jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{tagname:e,endpoint:t,wdi_nonce:wdi_ajax.wdi_nonce,wdiTagId:a,next_url:s,user_name:f(),action:"wdi_getTagRecentMedia"},success:function(e){var s,t;!1===a&&(a=""),void 0!==e.tag_data&&(void 0!==(s=e.tag_data).tag_id&&(a=s.tag_id),t=[],void 0!==window.wdi_all_tags&&(t=window.wdi_all_tags),t[s.tag_id]=s,window.wdi_all_tags=t),e=e.response,(e=d.convertHashtagData(e)).meta={code:200},e.tag_id=a,function(e){void 0===e.data&&(e.data=[]);i&&("object"==typeof r.success&&2==r.success.length?void 0!==window[r.success[0]]&&"function"==typeof window[r.success[0]][r.success[1]]&&(u&&(e=u(e,o.filterArguments,r.args)),window[r.success[0]][r.success[1]](e)):"string"==typeof r.success?"function"==typeof window[r.success]&&(u&&(e=u(e,o.filterArguments,r.args)),window[r.success](e)):"function"==typeof r.success&&(u&&(e=u(e,o.filterArguments,r.args)),r.success(e)))}(e=d.addTags(e))},error:function(e){c&&("object"==typeof r.error&&2==r.error.length?"function"==typeof window[r.error[0]][r.error[1]]&&window[r.error[0]][r.error[1]](e):"string"==typeof r.error?"function"==typeof window[r.error]&&window[r.error](e):"function"==typeof r.error&&r.error(e))},statusCode:n})},this.addTags=function(e){for(i in e.data){var s,t=e.data[i].caption.text;void 0!==t&&""!==t&&-1!=t.indexOf("#")&&(s=t.split("#"),e.data[i].tags=s)}return e},this.getTagId=function(e){var s,t=[];for(var r in"undefined"!=typeof wdi_controller?0!==(t=wdi_controller.feed_users).length||void 0!==(s=jQuery("#WDI_feed_users").val())&&""!==s&&(t=JSON.parse(s)):void 0!==window.wdi_all_tags&&(t=window.wdi_all_tags),t)if(e===t[r].username||"#"+e===t[r].username)return void 0!==t[r].tag_id&&t[r].tag_id;return!1},this.convertHashtagData=function(e){var s={data:[],pagination:{}};if(void 0!==e&&void 0!==e.paging&&(s.pagination={cursors:{after:e.paging.cursors.after},next_url:e.paging.next}),void 0!==e.data)for(var t in e.data){var r,o=e.data[t],i="IMAGE"===o.media_type?"image":"VIDEO"===o.media_type?"video":"carousel",n={id:o.id,user:{id:"",full_name:"",profile_picture:"",username:""},images:{thumbnail:{width:150,height:150,url:o.media_url},low_resolution:{width:320,height:320,url:o.media_url},standard_resolution:{width:1080,height:1080,url:o.media_url}},created_time:o.timestamp,caption:{id:"",text:o.caption,created_time:"",from:{id:"",full_name:"",profile_picture:"",username:""}},user_has_liked:0<o.like_count,likes:{count:o.like_count},tags:[],filter:"Normal",comments:{count:o.comments_count},type:i,link:o.permalink,location:null,attribution:null,users_in_photo:[]};if("IMAGE"===o.media_type||"CAROUSEL_ALBUM"===o.media_type?n.images={thumbnail:{width:150,height:150,url:o.media_url},low_resolution:{width:320,height:320,url:o.media_url},standard_resolution:{width:1080,height:1080,url:o.media_url}}:"VIDEO"===o.media_type&&(n.videos={standard_resolution:{width:640,height:800,url:o.thumb_url},low_bandwidth:{width:480,height:600,url:o.thumb_url},low_resolution:{width:480,height:600,url:o.thumb_url}}),"CAROUSEL_ALBUM"===o.media_type)for(var c in n.carousel_media=[],o.children.data){r="IMAGE"===o.children.data[c].media_type?{images:{thumbnail:{width:150,height:150,url:o.children.data[c].media_url},low_resolution:{width:320,height:320,url:o.children.data[c].media_url},standard_resolution:{width:640,height:640,url:o.children.data[c].media_url}},users_in_photo:[],type:"image"}:{videos:{standard_resolution:{width:640,height:800,url:o.children.data[c].media_url,id:o.children.data[c].id},low_bandwidth:{width:480,height:600,url:o.children.data[c].media_url,id:o.children.data[c].id},low_resolution:{width:480,height:600,url:o.children.data[c].media_url,id:o.children.data[c].id}},users_in_photo:[],type:"video"},n.carousel_media.push(r)}s.data.push(n)}return s},this.searchForTagsByName=function(e,t){var r=this,o=!1,i=this.statusCode,n=!1;filter=this.getFilter("searchForTagsByName"),void 0===t||0===t.length||("success"in t&&(o=!0),"error"in t&&(n=!0),"statusCode"in t&&(i=t.statusCode));var c="https://api.instagram.com/v1/tags/search?q="+e+"&access_token="+a();d.getDataFromCache(function(e){function s(e){o&&("object"==typeof t.success&&2==t.success.length?void 0!==window[t.success[0]]&&"function"==typeof window[t.success[0]][t.success[1]]&&(filter&&(e=filter(e,r.filterArguments)),window[t.success[0]][t.success[1]](e)):"string"==typeof t.success?"function"==typeof window[t.success]&&(filter&&(e=filter(e,r.filterArguments)),window[t.success](e)):"function"==typeof t.success&&(filter&&(e=filter(e,r.filterArguments)),t.success(e)))}!1===e?jQuery.ajax({type:"POST",url:c,dataType:"jsonp",success:function(e){d.setDataToCache(c,e),s(e)},error:function(e){n&&("object"==typeof t.error&&2==t.error.length?"function"==typeof window[t.error[0]][t.error[1]]&&window[t.error[0]][t.error[1]](e):"string"==typeof t.error?"function"==typeof window[t.error]&&window[t.error](e):"function"==typeof t.error&&t.error(e))},statusCode:i}):s(e)},c)},this.searchForUsersByName=function(e,s){var t=this,r=!1,o=(this.statusCode,!1),i=this.getFilter("searchForUsersByName");void 0===s||0===s.length||("success"in s&&(r=!0),"error"in s&&(o=!0),"statusCode"in s&&s.statusCode),jQuery.ajax({type:"POST",dataType:"jsonp",url:"https://api.instagram.com/v1/users/search?q="+e+"&access_token="+a(),success:function(e){r&&("object"==typeof s.success&&2==s.success.length?void 0!==window[s.success[0]]&&"function"==typeof window[s.success[0]][s.success[1]]&&(i&&(e=i(e,t.filterArguments)),e.args=s,window[s.success[0]][s.success[1]](e)):"string"==typeof s.success?"function"==typeof window[s.success]&&(i&&(e=i(e,t.filterArguments)),e.args=s,window[s.success](e)):"function"==typeof s.success&&(i&&(e=i(e,t.filterArguments)),(e.args=s).success(e)))},error:function(e){o&&("object"==typeof s.error&&2==s.error.length?"function"==typeof window[s.error[0]][s.error[1]]&&window[s.error[0]][s.error[1]](e):"string"==typeof s.error?"function"==typeof window[s.error]&&window[s.error](e):"function"==typeof s.error&&s.error(e))},statusCode:this.statusCode})},this.getRecentLikedMedia=function(s){var t=this,r=!1,e=this.statusCode,o=!1,i=this.getFilter("getRecentLikedMedia"),n="https://api.instagram.com/v1/users/self/media/liked?access_token="+a();void 0===s||0===s.length||("success"in s&&(r=!0),"error"in s&&(o=!0),"statusCode"in s&&(e=s.statusCode),"args"in s?argFlag=!0:s.args={},"count"in s?(s.count=parseInt(s.count),(!Number.isInteger(s.count)||s.count<=0)&&(s.count=20)):s.count=20,n+="&count="+s.count,"next_max_like_id"in s&&(n+="&next_max_like_id="+s.next_max_like_id)),jQuery.ajax({type:"POST",dataType:"jsonp",url:n,success:function(e){r&&("object"==typeof s.success&&2==s.success.length?void 0!==window[s.success[0]]&&"function"==typeof window[s.success[0]][s.success[1]]&&(i&&(e=i(e,t.filterArguments,s.args)),window[s.success[0]][s.success[1]](e)):"string"==typeof s.success?"function"==typeof window[s.success]&&(i&&(e=i(e,t.filterArguments,s.args)),window[s.success](e)):"function"==typeof s.success&&(i&&(e=i(e,t.filterArguments,s.args)),s.success(e)))},error:function(e){o&&("object"==typeof s.error&&2==s.error.length?"function"==typeof window[s.error[0]][s.error[1]]&&window[s.error[0]][s.error[1]](e):"string"==typeof s.error?"function"==typeof window[s.error]&&window[s.error](e):"function"==typeof s.error&&s.error(e))},statusCode:e})},this.getUserRecentMedia=function(e,s){var t=this,r=!1,o=this.statusCode,i=!1,n=this.getFilter("getUserRecentMedia"),c="https://api.instagram.com/v1/users/"+e+"/media/recent/?access_token="+a();void 0===s||0===s.length||("success"in s&&(r=!0),"statusCode"in s&&(o=s.statusCode),"args"in s||(s.args={}),"error"in s&&(i=!0),"count"in s?(s.count=parseInt(s.count),(!Number.isInteger(s.count)||s.count<=0)&&(s.count=33)):s.count=33,c+="&count="+s.count,"min_id"in s&&(c+="&min_id="+s.min_id),"max_id"in s&&(c+="&max_id="+s.max_id)),jQuery.ajax({type:"POST",dataType:"jsonp",url:c,success:function(e){void 0===e.data&&(e.data=[]),r&&("object"==typeof s.success&&2==s.success.length?void 0!==window[s.success[0]]&&"function"==typeof window[s.success[0]][s.success[1]]&&(n&&(e=n(e,t.filterArguments,s.args)),window[s.success[0]][s.success[1]](e)):"string"==typeof s.success?"function"==typeof window[s.success]&&(n&&(e=n(e,t.filterArguments,s.args)),window[s.success](e)):"function"==typeof s.success&&(n&&(e=n(e,t.filterArguments,s.args)),s.success(e)))},error:function(e){i&&("object"==typeof s.error&&2==s.error.length?"function"==typeof window[s.error[0]][s.error[1]]&&window[s.error[0]][s.error[1]](e):"string"==typeof s.error?"function"==typeof window[s.error]&&window[s.error](e):"function"==typeof s.error&&s.error(e))},statusCode:o})},this.getUserMedia=function(s){var t=this,r=!1,e=this.statusCode,o=!1,i=this.getFilter("getUserMedia");void 0===s||0===s.length||("success"in s&&(r=!0),"error"in s&&(o=!0),"statusCode"in s&&(e=s.statusCode),"args"in s||(s.args={}),"count"in s?(s.count=parseInt(s.count),(!Number.isInteger(s.count)||s.count<=0)&&(s.count=20)):s.count=20),jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_nonce:wdi_ajax.wdi_nonce,action:"wdi_getUserMedia",user_name:f()},success:function(e){e.meta={code:200},r&&("object"==typeof s.success&&2==s.success.length?void 0!==window[s.success[0]]&&"function"==typeof window[s.success[0]][s.success[1]]&&(i&&(e=d.addTags(e),e=i(e,t.filterArguments,s)),window[s.success[0]][s.success[1]](e)):"string"==typeof s.success?"function"==typeof window[s.success]&&(i&&(e=d.addTags(e),e=i(e,t.filterArguments,s)),window[s.success](e)):"function"==typeof s.success&&(i&&(e=d.addTags(e),e=i(e,t.filterArguments,s)),s.success(e)))},error:function(e){o&&("object"==typeof s.error&&2==s.error.length?"function"==typeof window[s.error[0]][s.error[1]]&&window[s.error[0]][s.error[1]](e):"string"==typeof s.error?"function"==typeof window[s.error]&&window[s.error](e):"function"==typeof s.error&&s.error(e))},statusCode:e})},this.getUserInfo=function(e,s){var t=this,r=!1,o=this.statusCode,i=!1,n=this.getFilter("getUserInfo");void 0===s||0===s.length||("success"in s&&(r=!0),"error"in s&&(i=!0),"statusCode"in s&&(o=s.statusCode)),jQuery.ajax({type:"POST",dataType:"jsonp",url:"https://api.instagram.com/v1/users/"+e+"/?access_token="+a(),success:function(e){r&&("object"==typeof s.success&&2==s.success.length?void 0!==window[s.success[0]]&&"function"==typeof window[s.success[0]][s.success[1]]&&(n&&(e=n(e,t.filterArguments)),window[s.success[0]][s.success[1]](e)):"string"==typeof s.success?"function"==typeof window[s.success]&&(n&&(e=n(e,t.filterArguments)),window[s.success](e)):"function"==typeof s.success&&(n&&(e=n(e,t.filterArguments)),s.success(e)))},error:function(e){i&&("object"==typeof s.error&&2==s.error.length?"function"==typeof window[s.error[0]][s.error[1]]&&window[s.error[0]][s.error[1]](e):"string"==typeof s.error?"function"==typeof window[s.error]&&window[s.error](e):"function"==typeof s.error&&s.error(e))},statusCode:o})},this.getSelfInfo=function(t){var r=this,o=!1,i=this.statusCode,n=!1,c=this.getFilter("getSelfInfo");void 0===t||0===t.length||("success"in t&&(o=!0),"error"in t&&(n=!0),"statusCode"in t&&(i=t.statusCode));var u="https://graph.facebook.com/v3.2/"+(void 0!==d.user&&void 0!==d.user.user_id?d.user.user_id:"undefined"!=typeof wdi_object&&void 0!==wdi_object.user?wdi_object.user.user_id:"")+"?fields=id,ig_id,username,name,biography,profile_picture_url,followers_count,follows_count,media_count,website&access_token="+a();d.getDataFromCache(function(e){var s;!1===e?jQuery.ajax({type:"POST",dataType:"jsonp",url:u,statusCode:i,success:function(e){d.setDataToCache(u,e),o&&("object"==typeof t.success&&2==t.success.length?void 0!==window[t.success[0]]&&"function"==typeof window[t.success[0]][t.success[1]]&&(c&&(e.meta={code:200},e=c(e,r.filterArguments)),window[t.success[0]][t.success[1]](e)):"string"==typeof t.success?"function"==typeof window[t.success]&&(c&&(e.meta={code:200},e=c(e,r.filterArguments)),window[t.success](e)):"function"==typeof t.success&&(c&&(e.meta={code:200},e=c(e,r.filterArguments)),t.success(e)))},error:function(e){n&&("object"==typeof t.error&&2==t.error.length?"function"==typeof window[t.error[0]][t.error[1]]&&window[t.error[0]][t.error[1]](e):"string"==typeof t.error?"function"==typeof window[t.error]&&window[t.error](e):"function"==typeof t.error&&t.error(e))}}):(s=e,o&&("object"==typeof t.success&&2==t.success.length?void 0!==window[t.success[0]]&&"function"==typeof window[t.success[0]][t.success[1]]&&(c&&(s=c(s,r.filterArguments)),window[t.success[0]][t.success[1]](s)):"string"==typeof t.success?"function"==typeof window[t.success]&&(c&&(s=c(s,r.filterArguments)),window[t.success](s)):"function"==typeof t.success&&(c&&(s=c(s,r.filterArguments)),t.success(s))))},u)},this.getRecentMediaComments=function(e,t){var r=this,o=!1,i=this.statusCode,n=!1,c=this.getFilter("getRecentMediaComments");void 0===t||0===t.length||("success"in t&&(o=!0),"error"in t&&(n=!0),"statusCode"in t&&(i=t.statusCode));var u="https://api.instagram.com/v1/media/"+e+"/comments?access_token="+a();d.getDataFromCache(function(e){function s(e){o&&("object"==typeof t.success&&2==t.success.length?void 0!==window[t.success[0]]&&"function"==typeof window[t.success[0]][t.success[1]]&&(c&&(e=c(e,r.filterArguments)),window[t.success[0]][t.success[1]](e)):"string"==typeof t.success?"function"==typeof window[t.success]&&(c&&(e=c(e,r.filterArguments)),window[t.success](e)):"function"==typeof t.success&&(c&&(e=c(e,r.filterArguments)),t.success(e)))}!1===e?jQuery.ajax({type:"POST",dataType:"jsonp",url:u,success:function(e){d.setDataToCache(u,e),s(e)},error:function(e){n&&("object"==typeof t.error&&2==t.error.length?"function"==typeof window[t.error[0]][t.error[1]]&&window[t.error[0]][t.error[1]](e):"string"==typeof t.error?"function"==typeof window[t.error]&&window[t.error](e):"function"==typeof t.error&&t.error(e))},statusCode:i}):s(e)},u)},this.getRecentMediaLikes=function(e,s){var t=this,r=!1,o=this.statusCode,i=!1,n=this.getFilter("getRecentMediaLikes");void 0===s||0===s.length||("success"in s&&(r=!0),"error"in s&&(i=!0),"statusCode"in s&&(o=s.statusCode)),jQuery.ajax({type:"POST",dataType:"jsonp",url:"https://api.instagram.com/v1/media/"+e+"/likes?access_token="+a(),success:function(e){r&&("object"==typeof s.success&&2==s.success.length?void 0!==window[s.success[0]]&&"function"==typeof window[s.success[0]][s.success[1]]&&(n&&(e=n(e,t.filterArguments)),window[s.success[0]][s.success[1]](e)):"string"==typeof s.success?"function"==typeof window[s.success]&&(n&&(e=n(e,t.filterArguments)),window[s.success](e)):"function"==typeof s.success&&(n&&(e=n(e,t.filterArguments)),s.success(e)))},error:function(e){i&&("object"==typeof s.error&&2==s.error.length?"function"==typeof window[s.error[0]][s.error[1]]&&window[s.error[0]][s.error[1]](e):"string"==typeof s.error?"function"==typeof window[s.error]&&window[s.error](e):"function"==typeof s.error&&s.error(e))},statusCode:o})},this.requestByUrl=function(t,r){for(var o=this,i=!1,n=!1,c=this.statusCode,u=this.getFilter("requestByUrl"),e=t.split("?")[1].split("&"),s=0;s<e.length;s++)e[s]=e[s].split("="),"access_token"==e[s][0]&&(e[s][1]=a()),e[s]=e[s].join("=");e=e.join("&"),t=t.split("?")[0]+"?"+e,void 0===r||0===r.length||("success"in r&&(i=!0),"args"in r||(r.args={}),"error"in r&&(n=!0),"statusCode"in r&&(c=r.statusCode));d.getDataFromCache(function(e){var s;!1===e?jQuery.ajax({type:"POST",dataType:"jsonp",url:t,success:function(e){d.setDataToCache(t,e),i&&("object"==typeof r.success&&2==r.success.length?void 0!==window[r.success[0]]&&"function"==typeof window[r.success[0]][r.success[1]]&&(u&&(e=u(e,o.filterArguments,r.args)),window[r.success[0]][r.success[1]](e)):"string"==typeof r.success?"function"==typeof window[r.success]&&(u&&(e=u(e,o.filterArguments,r.args)),window[r.success](e)):"function"==typeof r.success&&(u&&(e=u(e,o.filterArguments,r.args)),r.success(e)))},error:function(e){n&&("object"==typeof r.error&&2==r.error.length?"function"==typeof window[r.error[0]][r.error[1]]&&window[r.error[0]][r.error[1]](e):"string"==typeof r.error?"function"==typeof window[r.error]&&window[r.error](e):"function"==typeof r.error&&r.error(e))},statusCode:c}):(s=e,i&&("object"==typeof r.success&&2==r.success.length?void 0!==window[r.success[0]]&&"function"==typeof window[r.success[0]][r.success[1]]&&(u&&(s=u(s,o.filterArguments,r.args)),window[r.success[0]][r.success[1]](s)):"string"==typeof r.success?"function"==typeof window[r.success]&&(u&&(s=u(s,o.filterArguments,r.args)),window[r.success](s)):"function"==typeof r.success&&(u&&(s=u(s,o.filterArguments,r.args)),r.success(s))))},t)},this.getDataFromCache=function(t,e,s){void 0===s&&(s=!0),jQuery.ajax({type:"POST",async:s,url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_cache_name:e,wdi_nonce:wdi_ajax.wdi_nonce,WDI_MINIFY:wdi_ajax.WDI_MINIFY,task:"get",action:"wdi_cache"},success:function(e){var s;e.success&&void 0!==e.cache_data&&null!==e.cache_data?(s=JSON.parse(e.cache_data),t(s)):t(!1)}})},this.setDataToCache=function(e,s){jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_cache_name:e,wdi_cache_response:JSON.stringify(s),wdi_nonce:wdi_ajax.wdi_nonce,task:"set",action:"wdi_cache"},success:function(e){}})}}
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: custom instagram feed, feed, instagram, hashtag, Instagram feed, instagram
4
  Requires at least: 3.9
5
  Requires PHP: 5.2
6
  Tested up to: 5.5
7
- Stable tag: 1.4.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -505,6 +505,12 @@ Please make sure you don't have any important information before you proceed.
505
  10Web Social Photo Feed for Instagram plugin uses Instagram API on website front end. You have to authorize the plugin via sign in to get data from Instagram on your behalf. The plugin does not send any user’s data to Instagram. All the data received from Instagram via API is cached in WordPress database for some short customizable period to provide front end optimization. You can delete or update cached data. Instagram saves some cookies in browsers of website visitors via API data. These cookies are mostly used for security purposes. They are regulated under terms of Instagram’s privacy policy https://instagram.com/legal/privacy. The plugin asks for your consent to collect site administrator’s email address and site URL to offer customer support, deals and discounts on premium products and more.
506
 
507
  == Changelog ==
 
 
 
 
 
 
508
  = 1.4.7 =
509
  Fixed: Feed images view.
510
 
4
  Requires at least: 3.9
5
  Requires PHP: 5.2
6
  Tested up to: 5.5
7
+ Stable tag: 1.4.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
505
  10Web Social Photo Feed for Instagram plugin uses Instagram API on website front end. You have to authorize the plugin via sign in to get data from Instagram on your behalf. The plugin does not send any user’s data to Instagram. All the data received from Instagram via API is cached in WordPress database for some short customizable period to provide front end optimization. You can delete or update cached data. Instagram saves some cookies in browsers of website visitors via API data. These cookies are mostly used for security purposes. They are regulated under terms of Instagram’s privacy policy https://instagram.com/legal/privacy. The plugin asks for your consent to collect site administrator’s email address and site URL to offer customer support, deals and discounts on premium products and more.
506
 
507
  == Changelog ==
508
+ = 1.4.8 =
509
+ Fixed: JS error.
510
+ Fixed: Broken images.
511
+ Fixed: Uninstall functionality.
512
+ Fixed: Requests limitation in API.
513
+
514
  = 1.4.7 =
515
  Fixed: Feed images view.
516
 
wd-instagram-feed.php CHANGED
@@ -3,30 +3,27 @@
3
  Plugin Name: 10Web Social Photo Feed
4
  Plugin URI: https://10web.io/plugins/wordpress-instagram-feed/?utm_source=instagram_feed&utm_medium=free_plugin
5
  Description: 10Web Social Photo Feed is a user-friendly tool for displaying user or hashtag-based feeds on your website. You can create feeds with one of the available layouts. It allows displaying image metadata, open up images in lightbox, download them and even share in social networking websites.
6
- Version: 1.4.7
7
  Author: 10Web
8
  Author URI: https://10Web.io/plugins/?utm_source=instagram_feed&utm_medium=free_plugin
9
  License: GPLv2 or later
10
  */
11
 
12
  // define constants
 
 
 
13
  define('WDI_DIR', WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__)));
14
  define('WDI_URL', plugins_url(plugin_basename(dirname(__FILE__))));
15
- define('WDI_FRONT_URL', WDI_URL);
16
- define("WDI_VAR", 'wdi_instagram');
17
- define('WDI_PLUGIN_POSTFIX', 'wdi');
18
- define("WDI_OPT", WDI_VAR . '_options');
19
- define("WDI_FSN", 'wdi_feed_settings');
20
- define("WDI_TSN", 'wdi_theme_settings');
21
- define("WDI_META", '_' . WDI_VAR . '_meta');
22
  define('WDI_FEED_TABLE', 'wdi_feeds');
23
  define('WDI_THEME_TABLE', 'wdi_themes');
24
-
25
- define('WDI_VERSION', '1.4.7');
26
  $wdi_minify = (isset($_GET['wdi_no_minify']) && rest_sanitize_boolean($_GET['wdi_no_minify']) == 'true') ? FALSE : TRUE;
27
  define('WDI_MINIFY', $wdi_minify);
28
- define('IS_FREE', TRUE);
29
- define('WD_WDI_PREFIX', 'wdi' );
30
 
31
  add_action('wp_ajax_wdi_cache', 'wdi_cache');
32
  add_action('wp_ajax_nopriv_wdi_cache', 'wdi_cache');
@@ -84,8 +81,8 @@ function wdi_getUserMedia(){
84
  function wdi_getTagRecentMedia(){
85
  require_once(WDI_DIR . '/framework/WDILibrary.php');
86
  $wdi_nonce = WDILibrary::get('wdi_nonce');
87
- if ( wp_verify_nonce($wdi_nonce, 'wdi_cache')){
88
- if( WDILibrary::get('tagname') != '' && WDILibrary::get('endpoint') != '' ){
89
  $tagname = WDILibrary::get('tagname');
90
  $endpoint = WDILibrary::get('endpoint');
91
  $wdiTagId = FALSE;
@@ -107,12 +104,11 @@ function wdi_getTagRecentMedia(){
107
  require_once ("framework/WDIInstagram.php");
108
  $WDIInstagram = new WDIInstagram();
109
  $data = $WDIInstagram->getTagRecentMedia($tagname, $endpoint, $next_url, $wdiTagId, $user_name);
110
- echo $data;die;
111
  }
112
  }
113
  }
114
 
115
-
116
  function wdi_cache(){
117
  require_once(WDI_DIR . '/framework/WDILibrary.php');
118
  $wdi_nonce = WDILibrary::get('wdi_nonce');
@@ -182,7 +178,6 @@ function wdi_ajax_frontend(){
182
  }
183
  }
184
 
185
- ///////////////////////////////End GALLERY BOX////////////////////////////////////////
186
  //including admin functions
187
  require_once(WDI_DIR . '/admin-functions.php');
188
  //including shortcode file
@@ -190,6 +185,7 @@ require_once(WDI_DIR . '/frontend/shortcode.php');
190
 
191
  // Plugin activate.
192
  register_activation_hook( __FILE__, 'wdi_instagram_activate' );
 
193
  function wdi_instagram_activate( $networkwide ) {
194
  if ( function_exists('is_multisite') && is_multisite() ) {
195
  // Check if it is a network activation - if so, run the activation function for each blog id.
@@ -285,9 +281,6 @@ function wdi_run_cache_cron() {
285
  $WDIInstagram->wdi_preload_cache();
286
  }
287
 
288
-
289
-
290
-
291
  add_filter('cron_schedules', 'wdi_autoupdate_interval');
292
 
293
  function wdi_autoupdate_interval( $schedules ) {
@@ -308,9 +301,6 @@ function wdi_schedule_events() {
308
  add_filter('wdi_sanitize_options', 'wdi_create_sample_feed');
309
  function wdi_create_sample_feed($new_options){
310
  require_once(WDI_DIR . '/framework/WDILibrary.php');
311
- if ( empty($new_options['wdi_authenticated_users_list']) ) {
312
- // $new_options['wdi_authenticated_users_list'] = '[]';
313
- }
314
 
315
  //submit wdi options
316
  $option_page = WDILibrary::get('option_page');
@@ -395,7 +385,7 @@ function WDI_instagram_menu() {
395
  add_submenu_page($parent_slug, __('Themes', 'wd-instagram-feed'), __('Themes', 'wd-instagram-feed'), $min_feeds_capability, 'wdi_themes', 'WDI_instagram_themes_page');
396
  add_submenu_page($parent_slug, __('Settings', 'wd-instagram-feed'), __('Settings', 'wd-instagram-feed'), 'manage_options', 'wdi_settings', 'WDI_instagram_settings_page');
397
  add_submenu_page("", __('Uninstall', 'wd-instagram-feed'), __('Uninstall', 'wd-instagram-feed'), 'manage_options', 'wdi_uninstall', 'WDI_instagram_uninstall_page');
398
- if ( IS_FREE ) {
399
  /* Custom link to wordpress.org*/
400
  global $submenu;
401
  $url = 'https://wordpress.org/support/plugin/wd-instagram-feed/#new-post';
@@ -411,8 +401,6 @@ add_action('admin_head-toplevel_page_wdi_feeds', 'wdi_check_necessary_params');
411
 
412
  // Settings page callback
413
  function WDI_instagram_settings_page(){
414
- // check if user has already unistalled plugin from settings
415
- wdi_check_uninstalled();
416
  require_once(WDI_DIR . '/framework/WDILibrary.php');
417
  require_once(WDI_DIR . '/admin/controllers/settings.php');
418
  $controller = new Settings_controller_wdi();
@@ -421,8 +409,6 @@ function WDI_instagram_settings_page(){
421
 
422
  // Feeds page callback
423
  function WDI_instagram_feeds_page(){
424
- // check if user has already unistalled plugin from settings
425
- wdi_check_uninstalled();
426
  require_once(WDI_DIR . '/framework/WDILibrary.php');
427
  require_once(WDI_DIR . '/admin/controllers/feeds.php');
428
  $controller = new Feeds_controller_wdi();
@@ -430,7 +416,6 @@ function WDI_instagram_feeds_page(){
430
  }
431
 
432
  function WDI_instagram_themes_page(){
433
- wdi_check_uninstalled();
434
  require_once(WDI_DIR . '/framework/WDILibrary.php');
435
  $controller_class = 'WDIControllerThemes_wdi';
436
  require_once(WDI_DIR . '/admin/controllers/' . $controller_class . '.php');
@@ -438,16 +423,14 @@ function WDI_instagram_themes_page(){
438
  $controller->execute();
439
  }
440
 
441
- function WDI_instagram_uninstall_page(){
442
-
443
- require_once(WDI_DIR . '/framework/WDILibrary.php');
444
- $controller_class = 'WDIControllerUninstall_wdi';
445
- require_once(WDI_DIR . '/admin/controllers/' . $controller_class . '.php');
446
- $controller = new $controller_class();
447
  $controller->execute();
448
  }
449
 
450
- //loading admin scripts
451
  add_action('admin_enqueue_scripts', 'wdi_load_scripts');
452
 
453
  function wdi_load_scripts(){
@@ -455,7 +438,7 @@ function wdi_load_scripts(){
455
  global $wdi_options;
456
  $page = WDILibrary::get('page');
457
  if($page === 'wdi_themes' || $page === 'wdi_feeds' || $page === 'wdi_settings' || $page === 'wdi_uninstall') {
458
- wp_register_style(WDI_PLUGIN_POSTFIX . '-roboto', 'https://fonts.googleapis.com/css?family=Roboto:300,400,500,700');
459
  wp_enqueue_script('jquery-color');
460
  wp_enqueue_script('wp-color-picker');
461
  wp_enqueue_style('wp-color-picker');
@@ -479,6 +462,7 @@ function wdi_load_scripts(){
479
 
480
  wp_localize_script("wdi_admin", 'wdi_messages', array(
481
  'uninstall_confirm' => __("All the data will be removed from the database. Continue?", 'wd-instagram-feed'),
 
482
  'instagram_server_error' => __('Some error with instagram servers, try agian later :(', 'wd-instagram-feed'),
483
  'invalid_user' => __('Invalid user:', 'wd-instagram-feed'),
484
  'already_added' => __('already added!', 'wd-instagram-feed'),
@@ -500,15 +484,14 @@ function wdi_load_scripts(){
500
  'do_you_want_to_delete_selected_items' => __('Do you want to delete selected items?', 'wd-instagram-feed'),
501
  'user_field_required' => __('You have not selected a user, the user field is required.', 'wd-instagram-feed'),
502
  'please_write_hashtag' => __('Please write hashtag.', 'wd-instagram-feed'),
503
- 'you_can_add_only_hashtags' => __('You can add only hashtags.', 'wd-instagram-feed'),
504
-
505
  ));
506
  wp_localize_script("wdi_admin", 'wdi_url', array('plugin_url' => WDI_URL . '/'));
507
  wp_localize_script("wdi_admin", 'wdi_admin', array('admin_url' => get_admin_url()));
508
  wp_localize_script("wdi_admin", 'wdi_options', $wdi_options);
509
  }
510
- if(IS_FREE){
511
- wp_register_style(WD_WDI_PREFIX . '-pricing', WDI_URL . '/css/pricing.css', array(), WDI_VERSION);
512
  }
513
  }
514
 
@@ -563,7 +546,7 @@ function wdi_register_widget(){
563
  return register_widget("WDIControllerWidget");
564
  }
565
 
566
- //Editor shortcode button
567
  add_action('media_buttons', 'wdi_add_editor_button');
568
 
569
  function wdi_add_editor_button($context){
@@ -586,7 +569,7 @@ function wdi_add_editor_button($context){
586
  echo ob_get_clean();
587
  }
588
 
589
- //Editor button ajax handler
590
  add_action("wp_ajax_WDIEditorShortcode", 'wdi_editor_button');
591
 
592
  function wdi_editor_button(){
@@ -679,12 +662,6 @@ add_action('init', 'wdi_check_silent_update');
679
  function wdi_check_silent_update() {
680
  $current_version = WDI_VERSION;
681
  $saved_version = get_option('wdi_version');
682
- wdi_get_options();
683
- global $wdi_options;
684
- if ( isset($wdi_options['wdi_plugin_uninstalled']) && $wdi_options['wdi_plugin_uninstalled'] == 'true' ) {
685
- /*we uninstalled plugin, do not create DB tables again*/
686
- return;
687
- }
688
  if ( $current_version != $saved_version ) {
689
  wdi_install();
690
  }
@@ -710,90 +687,90 @@ function wdi_wd_lib_init(){
710
  "prefix" => "wdi",
711
  "plugin_id" => 43, // tenweb
712
  "plugin_title" => "Instagram Feed",
713
- "plugin_wordpress_slug" => "wd-instagram-feed",
714
  "plugin_dir" => WDI_DIR,
715
  "plugin_main_file" => __FILE__,
716
  "description" => __("The most advanced and user-friendly Instagram plugin. Instagram Feed plugin allows you to display image feeds from single or multiple Instagram accounts on a WordPress site.", 'wd-instagram-feed'),
717
  "plugin_features" => array(
718
  0 => array(
719
- "title" => __("Responsive", "wd-instagram-feed"),
720
- "description" => __("Instagram feeds are not only elegantly designed to be displayed on your website, but also come fully responsive for better user experience when using mobile devices and tables.", "wd-instagram-feed"),
721
  ),
722
  1 => array(
723
- "title" => __("SEO Friendly", "wd-instagram-feed"),
724
- "description" => __("Instagram Feed uses clean coding and latest SEO techniques necessary to keep your pages and posts SEO-optimized.", "wd-instagram-feed"),
725
  ),
726
  2 => array(
727
- "title" => __("4 Fully Customizable Layouts", "wd-instagram-feed"),
728
- "description" => __("There are four layout options for Instagram feeds: Thumbnails, Image Browser, Blog Style and Masonry. Display a feed as a simply arranged thumbnails with captions. Use Masonry layout to create a beautiful combination of images and captions. Create a blog feed by simply sharing Instagram posts with captions using blog style layout. Image browser layout saves space, yet allows to display larger images. In addition users can choose the number of the displayed images, layout columns, image order and etc.", "wd-instagram-feed"),
729
  ),
730
  3 => array(
731
- "title" => __("Individual and Mixed Feeds", "wd-instagram-feed"),
732
- "description" => __("Create mixed and single feeds of Instagram posts. Single feeds can be based on public Instagram accounts and single Instagram hashtag. Mixed feeds can contain multiple public Instagram accounts and multiple Instagram hashtags. A front end filter is available for mixed feeds. Click to filter only one feed based on a single hashtag or account.", "wd-instagram-feed"),
733
  ),
734
  4 => array(
735
- "title" => __("Advanced Lightbox", "wd-instagram-feed"),
736
- "description" => __("Upon clicking on image thumbnails an elegant lightbox will be opened, where you will find control buttons for displaying images in larger view, read image comments, captions, view image metadata and easily navigate between images. Lightbox can serve as a slider with various stunning slide transition effects. If the feed contains video, the video will be played within the lightbox as an HTML5 video.", "wd-instagram-feed"),
737
  )
738
  ),
739
  // user guide from web-dorado.com
740
  "user_guide" => array(
741
  0 => array(
742
- "main_title" => __("Installation and configuration", "wd-instagram-feed"),
743
  "url" => "https://help.10web.io/hc/en-us/articles/360016277532-Configuring-Instagram-Access-Token?utm_source=instagram_feed&utm_medium=free_plugin",
744
  "titles" => array(
745
  array(
746
- "title" => __("Getting Instagram Access Token", "wd-instagram-feed"),
747
  "url" => "https://help.10web.io/hc/en-us/articles/360016277532-Configuring-Instagram-Access-Token?utm_source=instagram_feed&utm_medium=free_plugin"
748
  )
749
  )
750
  ),
751
  1 => array(
752
- "main_title" => __("Creating an Instagram Feed", "wd-instagram-feed"),
753
  "url" => "https://help.10web.io/hc/en-us/articles/360016497251-Creating-Instagram-Feed?utm_source=instagram_feed&utm_medium=free_plugin",
754
  "titles" => array(
755
  array(
756
- "title" => __("Thumbnails and Masonry Layouts", "wd-instagram-feed"),
757
  "url" => "https://help.10web.io/hc/en-us/articles/360016277632?utm_source=instagram_feed&utm_medium=free_plugin",
758
  ),
759
  array(
760
- "title" => __("Blog Style Layout", "wd-instagram-feed"),
761
  "url" => "https://help.10web.io/hc/en-us/articles/360016277632?utm_source=instagram_feed&utm_medium=free_plugin",
762
  ),
763
  array(
764
- "title" => __("Image Browser", "wd-instagram-feed"),
765
  "url" => "https://help.10web.io/hc/en-us/articles/360016277632?utm_source=instagram_feed&utm_medium=free_plugin",
766
  ),
767
  array(
768
- "title" => __("Lightbox Settings", "wd-instagram-feed"),
769
  "url" => "https://help.10web.io/hc/en-us/articles/360016277752?utm_source=instagram_feed&utm_medium=free_plugin",
770
  ),
771
  array(
772
- "title" => __("Conditional Filters", "wd-instagram-feed"),
773
  "url" => "https://help.10web.io/hc/en-us/articles/360016497371?utm_source=instagram_feed&utm_medium=free_plugin",
774
  ),
775
  )
776
  ),
777
  2 => array(
778
- "main_title" => __("Publishing Instagram Feed", "wd-instagram-feed"),
779
  "url" => "https://help.10web.io/hc/en-us/articles/360016497391?utm_source=instagram_feed&utm_medium=free_plugin",
780
  "titles" => array(
781
  array(
782
- "title" => __("Publishing in a Page/Post", "wd-instagram-feed"),
783
  "url" => "https://help.10web.io/hc/en-us/articles/360016497391?utm_source=instagram_feed&utm_medium=free_plugin",
784
  ),
785
  array(
786
- "title" => __("Publishing as a Widget", "wd-instagram-feed"),
787
  "url" => "https://help.10web.io/hc/en-us/articles/360016497391?utm_source=instagram_feed&utm_medium=free_plugin",
788
  ),
789
  array(
790
- "title" => __("Publishing by PHP function", "wd-instagram-feed"),
791
  "url" => "https://help.10web.io/hc/en-us/articles/360016497391?utm_source=instagram_feed&utm_medium=free_plugin",
792
  ),
793
  )
794
  ),
795
  3 => array(
796
- "main_title" => __("Styling with Themes", "wd-instagram-feed"),
797
  "url" => "https://help.10web.io/hc/en-us/articles/360016277832?utm_source=instagram_feed&utm_medium=free_plugin",
798
  "titles" => array()
799
  )
@@ -807,13 +784,19 @@ function wdi_wd_lib_init(){
807
  "plugin_wizard_link" => "",
808
  "plugin_menu_title" => "Instagram Feed",
809
  "plugin_menu_icon" => WDI_URL . '/images/menu_icon.png',
810
- "deactivate" => true,
811
  "subscribe" => false,
812
  "custom_post" => '', // if true => edit.php?post_type=contact
813
  "menu_capability" => wdi_get_create_feeds_cap(),
814
  "menu_position" => null,
815
  "display_overview" => false,
816
  );
 
 
 
 
 
 
 
817
 
818
  ten_web_lib_init($wdi_wd_plugin_options);
819
 
@@ -873,8 +856,8 @@ function wdi_backend_ajax() {
873
  $allowed_pages = array(
874
  'settings',
875
  );
876
- $page = str_replace( WDI_PLUGIN_POSTFIX . '_', '', $page );
877
- $action = str_replace( WDI_PLUGIN_POSTFIX . '_', '', $action );
878
  $file = WDI_DIR . '/admin/controllers/' . $page . '.php';
879
 
880
  if ( !file_exists($file) ) {
@@ -888,7 +871,7 @@ function wdi_backend_ajax() {
888
  }
889
 
890
  require_once($file);
891
- $controller_class = ucfirst($page) . '_controller_' . WDI_PLUGIN_POSTFIX;
892
  $controller = new $controller_class();
893
  if ( method_exists($controller, $action) ) {
894
  $controller->$action();
@@ -896,5 +879,4 @@ function wdi_backend_ajax() {
896
  else {
897
  die ( $action . ' not found on ' . ucfirst($page) . ' class.' );
898
  }
899
- }
900
-
3
  Plugin Name: 10Web Social Photo Feed
4
  Plugin URI: https://10web.io/plugins/wordpress-instagram-feed/?utm_source=instagram_feed&utm_medium=free_plugin
5
  Description: 10Web Social Photo Feed is a user-friendly tool for displaying user or hashtag-based feeds on your website. You can create feeds with one of the available layouts. It allows displaying image metadata, open up images in lightbox, download them and even share in social networking websites.
6
+ Version: 1.4.8
7
  Author: 10Web
8
  Author URI: https://10Web.io/plugins/?utm_source=instagram_feed&utm_medium=free_plugin
9
  License: GPLv2 or later
10
  */
11
 
12
  // define constants
13
+ define('WDI_VERSION', '1.4.8');
14
+ define('WDI_IS_FREE', TRUE);
15
+ define('WDI_PREFIX', 'wdi');
16
  define('WDI_DIR', WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__)));
17
  define('WDI_URL', plugins_url(plugin_basename(dirname(__FILE__))));
18
+ define('WDI_MAIN_FILE', plugin_basename(__FILE__));
19
+ define('WDI_META', '_wdi_instagram_meta');
20
+ define('WDI_OPT', 'wdi_instagram_options');
21
+ define('WDI_FSN', 'wdi_feed_settings');
22
+ define('WDI_TSN', 'wdi_theme_settings');
 
 
23
  define('WDI_FEED_TABLE', 'wdi_feeds');
24
  define('WDI_THEME_TABLE', 'wdi_themes');
 
 
25
  $wdi_minify = (isset($_GET['wdi_no_minify']) && rest_sanitize_boolean($_GET['wdi_no_minify']) == 'true') ? FALSE : TRUE;
26
  define('WDI_MINIFY', $wdi_minify);
 
 
27
 
28
  add_action('wp_ajax_wdi_cache', 'wdi_cache');
29
  add_action('wp_ajax_nopriv_wdi_cache', 'wdi_cache');
81
  function wdi_getTagRecentMedia(){
82
  require_once(WDI_DIR . '/framework/WDILibrary.php');
83
  $wdi_nonce = WDILibrary::get('wdi_nonce');
84
+ if ( wp_verify_nonce($wdi_nonce, 'wdi_cache') ) {
85
+ if ( WDILibrary::get('tagname') != '' && WDILibrary::get('endpoint') != '' ) {
86
  $tagname = WDILibrary::get('tagname');
87
  $endpoint = WDILibrary::get('endpoint');
88
  $wdiTagId = FALSE;
104
  require_once ("framework/WDIInstagram.php");
105
  $WDIInstagram = new WDIInstagram();
106
  $data = $WDIInstagram->getTagRecentMedia($tagname, $endpoint, $next_url, $wdiTagId, $user_name);
107
+ echo $data; die;
108
  }
109
  }
110
  }
111
 
 
112
  function wdi_cache(){
113
  require_once(WDI_DIR . '/framework/WDILibrary.php');
114
  $wdi_nonce = WDILibrary::get('wdi_nonce');
178
  }
179
  }
180
 
 
181
  //including admin functions
182
  require_once(WDI_DIR . '/admin-functions.php');
183
  //including shortcode file
185
 
186
  // Plugin activate.
187
  register_activation_hook( __FILE__, 'wdi_instagram_activate' );
188
+
189
  function wdi_instagram_activate( $networkwide ) {
190
  if ( function_exists('is_multisite') && is_multisite() ) {
191
  // Check if it is a network activation - if so, run the activation function for each blog id.
281
  $WDIInstagram->wdi_preload_cache();
282
  }
283
 
 
 
 
284
  add_filter('cron_schedules', 'wdi_autoupdate_interval');
285
 
286
  function wdi_autoupdate_interval( $schedules ) {
301
  add_filter('wdi_sanitize_options', 'wdi_create_sample_feed');
302
  function wdi_create_sample_feed($new_options){
303
  require_once(WDI_DIR . '/framework/WDILibrary.php');
 
 
 
304
 
305
  //submit wdi options
306
  $option_page = WDILibrary::get('option_page');
385
  add_submenu_page($parent_slug, __('Themes', 'wd-instagram-feed'), __('Themes', 'wd-instagram-feed'), $min_feeds_capability, 'wdi_themes', 'WDI_instagram_themes_page');
386
  add_submenu_page($parent_slug, __('Settings', 'wd-instagram-feed'), __('Settings', 'wd-instagram-feed'), 'manage_options', 'wdi_settings', 'WDI_instagram_settings_page');
387
  add_submenu_page("", __('Uninstall', 'wd-instagram-feed'), __('Uninstall', 'wd-instagram-feed'), 'manage_options', 'wdi_uninstall', 'WDI_instagram_uninstall_page');
388
+ if ( WDI_IS_FREE ) {
389
  /* Custom link to wordpress.org*/
390
  global $submenu;
391
  $url = 'https://wordpress.org/support/plugin/wd-instagram-feed/#new-post';
401
 
402
  // Settings page callback
403
  function WDI_instagram_settings_page(){
 
 
404
  require_once(WDI_DIR . '/framework/WDILibrary.php');
405
  require_once(WDI_DIR . '/admin/controllers/settings.php');
406
  $controller = new Settings_controller_wdi();
409
 
410
  // Feeds page callback
411
  function WDI_instagram_feeds_page(){
 
 
412
  require_once(WDI_DIR . '/framework/WDILibrary.php');
413
  require_once(WDI_DIR . '/admin/controllers/feeds.php');
414
  $controller = new Feeds_controller_wdi();
416
  }
417
 
418
  function WDI_instagram_themes_page(){
 
419
  require_once(WDI_DIR . '/framework/WDILibrary.php');
420
  $controller_class = 'WDIControllerThemes_wdi';
421
  require_once(WDI_DIR . '/admin/controllers/' . $controller_class . '.php');
423
  $controller->execute();
424
  }
425
 
426
+ function WDI_instagram_uninstall_page() {
427
+ require_once( WDI_DIR . '/framework/WDILibrary.php' );
428
+ require_once( WDI_DIR . '/admin/controllers/uninstall.php' );
429
+ $controller = new Uninstall_controller_wdi();
 
 
430
  $controller->execute();
431
  }
432
 
433
+ // Loading admin scripts
434
  add_action('admin_enqueue_scripts', 'wdi_load_scripts');
435
 
436
  function wdi_load_scripts(){
438
  global $wdi_options;
439
  $page = WDILibrary::get('page');
440
  if($page === 'wdi_themes' || $page === 'wdi_feeds' || $page === 'wdi_settings' || $page === 'wdi_uninstall') {
441
+ wp_register_style(WDI_PREFIX . '-roboto', 'https://fonts.googleapis.com/css?family=Roboto:300,400,500,700');
442
  wp_enqueue_script('jquery-color');
443
  wp_enqueue_script('wp-color-picker');
444
  wp_enqueue_style('wp-color-picker');
462
 
463
  wp_localize_script("wdi_admin", 'wdi_messages', array(
464
  'uninstall_confirm' => __("All the data will be removed from the database. Continue?", 'wd-instagram-feed'),
465
+ 'uninstall_plugin' => __('Are you sure you want to uninstall plugin?', 'wd-instagram-feed'),
466
  'instagram_server_error' => __('Some error with instagram servers, try agian later :(', 'wd-instagram-feed'),
467
  'invalid_user' => __('Invalid user:', 'wd-instagram-feed'),
468
  'already_added' => __('already added!', 'wd-instagram-feed'),
484
  'do_you_want_to_delete_selected_items' => __('Do you want to delete selected items?', 'wd-instagram-feed'),
485
  'user_field_required' => __('You have not selected a user, the user field is required.', 'wd-instagram-feed'),
486
  'please_write_hashtag' => __('Please write hashtag.', 'wd-instagram-feed'),
487
+ 'you_can_add_only_hashtags' => __('You can add only hashtags.', 'wd-instagram-feed')
 
488
  ));
489
  wp_localize_script("wdi_admin", 'wdi_url', array('plugin_url' => WDI_URL . '/'));
490
  wp_localize_script("wdi_admin", 'wdi_admin', array('admin_url' => get_admin_url()));
491
  wp_localize_script("wdi_admin", 'wdi_options', $wdi_options);
492
  }
493
+ if(WDI_IS_FREE){
494
+ wp_register_style(WDI_PREFIX . '-pricing', WDI_URL . '/css/pricing.css', array(), WDI_VERSION);
495
  }
496
  }
497
 
546
  return register_widget("WDIControllerWidget");
547
  }
548
 
549
+ // Editor shortcode button
550
  add_action('media_buttons', 'wdi_add_editor_button');
551
 
552
  function wdi_add_editor_button($context){
569
  echo ob_get_clean();
570
  }
571
 
572
+ // Editor button ajax handler
573
  add_action("wp_ajax_WDIEditorShortcode", 'wdi_editor_button');
574
 
575
  function wdi_editor_button(){
662
  function wdi_check_silent_update() {
663
  $current_version = WDI_VERSION;
664
  $saved_version = get_option('wdi_version');
 
 
 
 
 
 
665
  if ( $current_version != $saved_version ) {
666
  wdi_install();
667
  }
687
  "prefix" => "wdi",
688
  "plugin_id" => 43, // tenweb
689
  "plugin_title" => "Instagram Feed",
690
+ "plugin_wordpress_slug" => 'wd-instagram-feed',
691
  "plugin_dir" => WDI_DIR,
692
  "plugin_main_file" => __FILE__,
693
  "description" => __("The most advanced and user-friendly Instagram plugin. Instagram Feed plugin allows you to display image feeds from single or multiple Instagram accounts on a WordPress site.", 'wd-instagram-feed'),
694
  "plugin_features" => array(
695
  0 => array(
696
+ "title" => __("Responsive", 'wd-instagram-feed'),
697
+ "description" => __("Instagram feeds are not only elegantly designed to be displayed on your website, but also come fully responsive for better user experience when using mobile devices and tables.", 'wd-instagram-feed'),
698
  ),
699
  1 => array(
700
+ "title" => __("SEO Friendly", 'wd-instagram-feed'),
701
+ "description" => __("Instagram Feed uses clean coding and latest SEO techniques necessary to keep your pages and posts SEO-optimized.", 'wd-instagram-feed'),
702
  ),
703
  2 => array(
704
+ "title" => __("4 Fully Customizable Layouts", 'wd-instagram-feed'),
705
+ "description" => __("There are four layout options for Instagram feeds: Thumbnails, Image Browser, Blog Style and Masonry. Display a feed as a simply arranged thumbnails with captions. Use Masonry layout to create a beautiful combination of images and captions. Create a blog feed by simply sharing Instagram posts with captions using blog style layout. Image browser layout saves space, yet allows to display larger images. In addition users can choose the number of the displayed images, layout columns, image order and etc.", 'wd-instagram-feed'),
706
  ),
707
  3 => array(
708
+ "title" => __("Individual and Mixed Feeds", 'wd-instagram-feed'),
709
+ "description" => __("Create mixed and single feeds of Instagram posts. Single feeds can be based on public Instagram accounts and single Instagram hashtag. Mixed feeds can contain multiple public Instagram accounts and multiple Instagram hashtags. A front end filter is available for mixed feeds. Click to filter only one feed based on a single hashtag or account.", 'wd-instagram-feed'),
710
  ),
711
  4 => array(
712
+ "title" => __("Advanced Lightbox", 'wd-instagram-feed'),
713
+ "description" => __("Upon clicking on image thumbnails an elegant lightbox will be opened, where you will find control buttons for displaying images in larger view, read image comments, captions, view image metadata and easily navigate between images. Lightbox can serve as a slider with various stunning slide transition effects. If the feed contains video, the video will be played within the lightbox as an HTML5 video.", 'wd-instagram-feed'),
714
  )
715
  ),
716
  // user guide from web-dorado.com
717
  "user_guide" => array(
718
  0 => array(
719
+ "main_title" => __("Installation and configuration", 'wd-instagram-feed'),
720
  "url" => "https://help.10web.io/hc/en-us/articles/360016277532-Configuring-Instagram-Access-Token?utm_source=instagram_feed&utm_medium=free_plugin",
721
  "titles" => array(
722
  array(
723
+ "title" => __("Getting Instagram Access Token", 'wd-instagram-feed'),
724
  "url" => "https://help.10web.io/hc/en-us/articles/360016277532-Configuring-Instagram-Access-Token?utm_source=instagram_feed&utm_medium=free_plugin"
725
  )
726
  )
727
  ),
728
  1 => array(
729
+ "main_title" => __("Creating an Instagram Feed", 'wd-instagram-feed'),
730
  "url" => "https://help.10web.io/hc/en-us/articles/360016497251-Creating-Instagram-Feed?utm_source=instagram_feed&utm_medium=free_plugin",
731
  "titles" => array(
732
  array(
733
+ "title" => __("Thumbnails and Masonry Layouts", 'wd-instagram-feed'),
734
  "url" => "https://help.10web.io/hc/en-us/articles/360016277632?utm_source=instagram_feed&utm_medium=free_plugin",
735
  ),
736
  array(
737
+ "title" => __("Blog Style Layout", 'wd-instagram-feed'),
738
  "url" => "https://help.10web.io/hc/en-us/articles/360016277632?utm_source=instagram_feed&utm_medium=free_plugin",
739
  ),
740
  array(
741
+ "title" => __("Image Browser", 'wd-instagram-feed'),
742
  "url" => "https://help.10web.io/hc/en-us/articles/360016277632?utm_source=instagram_feed&utm_medium=free_plugin",
743
  ),
744
  array(
745
+ "title" => __("Lightbox Settings", 'wd-instagram-feed'),
746
  "url" => "https://help.10web.io/hc/en-us/articles/360016277752?utm_source=instagram_feed&utm_medium=free_plugin",
747
  ),
748
  array(
749
+ "title" => __("Conditional Filters", 'wd-instagram-feed'),
750
  "url" => "https://help.10web.io/hc/en-us/articles/360016497371?utm_source=instagram_feed&utm_medium=free_plugin",
751
  ),
752
  )
753
  ),
754
  2 => array(
755
+ "main_title" => __("Publishing Instagram Feed", 'wd-instagram-feed'),
756
  "url" => "https://help.10web.io/hc/en-us/articles/360016497391?utm_source=instagram_feed&utm_medium=free_plugin",
757
  "titles" => array(
758
  array(
759
+ "title" => __("Publishing in a Page/Post", 'wd-instagram-feed'),
760
  "url" => "https://help.10web.io/hc/en-us/articles/360016497391?utm_source=instagram_feed&utm_medium=free_plugin",
761
  ),
762
  array(
763
+ "title" => __("Publishing as a Widget", 'wd-instagram-feed'),
764
  "url" => "https://help.10web.io/hc/en-us/articles/360016497391?utm_source=instagram_feed&utm_medium=free_plugin",
765
  ),
766
  array(
767
+ "title" => __("Publishing by PHP function", 'wd-instagram-feed'),
768
  "url" => "https://help.10web.io/hc/en-us/articles/360016497391?utm_source=instagram_feed&utm_medium=free_plugin",
769
  ),
770
  )
771
  ),
772
  3 => array(
773
+ "main_title" => __("Styling with Themes", 'wd-instagram-feed'),
774
  "url" => "https://help.10web.io/hc/en-us/articles/360016277832?utm_source=instagram_feed&utm_medium=free_plugin",
775
  "titles" => array()
776
  )
784
  "plugin_wizard_link" => "",
785
  "plugin_menu_title" => "Instagram Feed",
786
  "plugin_menu_icon" => WDI_URL . '/images/menu_icon.png',
 
787
  "subscribe" => false,
788
  "custom_post" => '', // if true => edit.php?post_type=contact
789
  "menu_capability" => wdi_get_create_feeds_cap(),
790
  "menu_position" => null,
791
  "display_overview" => false,
792
  );
793
+ if(WDI_IS_FREE){
794
+ $wdi_wd_plugin_options["deactivate"] = TRUE;
795
+ unset($wdi_wd_plugin_options["start_using_url"]);
796
+ }else{
797
+ $wdi_wd_plugin_options["deactivate"] = FALSE;
798
+ $wdi_wd_plugin_options["start_using_url"] = "admin.php?page=wdi_settings";
799
+ }
800
 
801
  ten_web_lib_init($wdi_wd_plugin_options);
802
 
856
  $allowed_pages = array(
857
  'settings',
858
  );
859
+ $page = str_replace( WDI_PREFIX . '_', '', $page );
860
+ $action = str_replace( WDI_PREFIX . '_', '', $action );
861
  $file = WDI_DIR . '/admin/controllers/' . $page . '.php';
862
 
863
  if ( !file_exists($file) ) {
871
  }
872
 
873
  require_once($file);
874
+ $controller_class = ucfirst($page) . '_controller_' . WDI_PREFIX;
875
  $controller = new $controller_class();
876
  if ( method_exists($controller, $action) ) {
877
  $controller->$action();
879
  else {
880
  die ( $action . ' not found on ' . ucfirst($page) . ' class.' );
881
  }
882
+ }
 
wd/.gitignore ADDED
@@ -0,0 +1,2 @@
 
 
1
+ # Created by .ignore support plugin (hsz.mobi)
2
+ .idea/*
wd/assets/js/subsribe.js CHANGED
@@ -1,17 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
  jQuery(document).on("ready", function () {
2
- jQuery(".permissions").on("click", function () {
3
- jQuery(this).toggleClass("active");
4
- jQuery(".list").slideToggle("fast");
5
- return false;
6
- });
7
- jQuery(".allow_and_continue, .skip").on("click", function () {
8
- var url = jQuery(this).attr("href");
9
- if ( url ) {
10
- jQuery(".allow_and_continue, .skip").css("opacity", "0.5");
11
- jQuery(".allow_and_continue, .skip").attr("disabled", "disabled");
12
- jQuery(".allow_and_continue, .skip").removeAttr("href");
13
- jQuery(".wd_loader").css("display", "inline-block");
14
- window.location = url;
15
- }
16
- });
17
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ////////////////////////////////////////////////////////////////////////////////////////
2
+ // Events //
3
+ ////////////////////////////////////////////////////////////////////////////////////////
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Constants //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Variables //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Constructor & Destructor //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
  jQuery(document).on("ready", function () {
14
+ jQuery(".permissions").on("click", function(){
15
+ jQuery(this).toggleClass("active") ;
16
+ jQuery(".list").slideToggle("fast");
17
+ return false;
18
+ });
19
+
20
+ jQuery(".allow_and_continue").on("click", function(){
21
+ jQuery(this).css("opacity", "0.5");
22
+ jQuery(".wd_loader").css("display", "inline-block");
23
+ });
 
 
 
 
 
24
  });
25
+
26
+ ////////////////////////////////////////////////////////////////////////////////////////
27
+ // Public Methods //
28
+ ////////////////////////////////////////////////////////////////////////////////////////
29
+ ////////////////////////////////////////////////////////////////////////////////////////
30
+ // Getters & Setters //
31
+ ////////////////////////////////////////////////////////////////////////////////////////
32
+ ////////////////////////////////////////////////////////////////////////////////////////
33
+ // Private Methods //
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ ////////////////////////////////////////////////////////////////////////////////////////
36
+ // Listeners //
37
+ ////////////////////////////////////////////////////////////////////////////////////////
wd/includes/deactivate.php CHANGED
@@ -1,145 +1,178 @@
1
  <?php
2
  if (!defined('ABSPATH')) {
3
- exit;
4
  }
5
 
6
  class TenWebLibDeactivate
7
  {
8
-
9
- public $deactivate_reasons = array();
10
-
11
- public $config;
12
- // Reason IDs
13
- const REASON_PLUGIN_IS_HARD_TO_USE_TECHNICAL_PROBLEMS = "reason_plugin_is_hard_to_use_technical_problems";
14
- const REASON_FREE_VERSION_IS_LIMITED = "reason_free_version_limited";
15
- const REASON_PRO_EXPENSIVE = "reason_premium_expensive";
16
- const REASON_UPGRADING_TO_PAID_VERSION = "reason_upgrading_to_paid_version";
17
- const REASON_TEMPORARY_DEACTIVATION = "reason_temporary_deactivation";
18
-
19
- public function __construct($config = array())
20
- {
21
- require_once(WDI_DIR . '/framework/WDILibrary.php');
22
- $this->config = $config;
23
- $wd_options = $this->config;
24
-
25
- $this->deactivate_reasons = array(
26
- 1 => array(
27
- 'id' => self::REASON_PLUGIN_IS_HARD_TO_USE_TECHNICAL_PROBLEMS,
28
- 'text' => __('Technical problems / hard to use', $wd_options->prefix),
29
- ),
30
- 2 => array(
31
- 'id' => self::REASON_FREE_VERSION_IS_LIMITED,
32
- 'text' => __('Free version is limited', $wd_options->prefix),
33
- ),
34
- 3 => array(
35
- 'id' => self::REASON_UPGRADING_TO_PAID_VERSION,
36
- 'text' => __('Upgrading to paid version', $wd_options->prefix),
37
- ),
38
- 4 => array(
39
- 'id' => self::REASON_TEMPORARY_DEACTIVATION,
40
- 'text' => __('Temporary deactivation', $wd_options->prefix),
41
- ),
42
- );
43
-
44
- add_action('admin_footer', array($this, 'add_deactivation_feedback_dialog_box'));
45
- add_action('admin_init', array($this, 'submit_and_deactivate'));
46
-
47
- // add_action('admin_enqueue_scripts', array($this, 'scripts'));
48
- // Just enqueue styles/scripts and they will be in the footer.
49
- $this->scripts();
50
- }
51
-
52
- public function add_deactivation_feedback_dialog_box()
53
- {
54
- $deactivate_reasons = $this->deactivate_reasons;
55
- $wd_options = $this->config;
56
-
57
- ?>
58
- <script>
59
- jQuery(document).ready(function () {
60
- tenwebReady("<?php echo $wd_options->prefix; ?>");
61
- });
62
- </script>
63
- <?php
64
-
65
- $deactivate_url =
66
- add_query_arg(
67
- array(
68
- 'action' => 'deactivate',
69
- 'plugin' => plugin_basename($wd_options->plugin_main_file),
70
- '_wpnonce' => wp_create_nonce('deactivate-plugin_' . plugin_basename($wd_options->plugin_main_file))
71
- ),
72
- admin_url('plugins.php')
73
- );
74
-
75
- require($wd_options->wd_dir_templates . '/display_deactivation_popup.php');
76
- }
77
-
78
-
79
- public function scripts()
80
- {
81
- $wd_options = $this->config;
82
- wp_enqueue_style('tenweb-deactivate-popup', $wd_options->wd_url_css . '/deactivate_popup.css', array(), get_option($wd_options->prefix . "_version"));
83
- wp_enqueue_script('tenweb-deactivate-popup', $wd_options->wd_url_js . '/deactivate_popup.js', array(), get_option($wd_options->prefix . "_version"));
84
-
85
- $admin_data = wp_get_current_user();
86
- wp_localize_script('tenweb-deactivate-popup', $wd_options->prefix . 'WDDeactivateVars', array(
87
- "prefix" => $wd_options->prefix,
88
- "deactivate_class" => $wd_options->prefix . '_deactivate_link',
89
- "email" => $admin_data->data->user_email,
90
- "plugin_wd_url" => $wd_options->plugin_wd_url,
91
- ));
92
- }
93
-
94
- public function submit_and_deactivate()
95
- {
96
- $wd_options = $this->config;
97
- $submit_and_deactivate = WDILibrary::get($wd_options->prefix . "_submit_and_deactivate", '');
98
- if ( isset($submit_and_deactivate) ) {
99
-
100
- if ($submit_and_deactivate == 2 || $submit_and_deactivate == 3) {
101
- $data = array();
102
- $reasons = WDILibrary::get($wd_options->prefix . '_reasons', '');
103
- $data["reason"] = $reasons;
104
- $data["site_url"] = site_url();
105
- $data["product_id"] = $wd_options->plugin_id;
106
-
107
- $data["additional_details"] = WDILibrary::get($wd_options->prefix . '_additional_details', '');
108
- $admin_data = wp_get_current_user();
109
- $data["email"] = WDILibrary::get($wd_options->prefix . '_email', $admin_data->data->user_email);
110
- $user_first_name = get_user_meta($admin_data->ID, "first_name", true);
111
- $user_last_name = get_user_meta($admin_data->ID, "last_name", true);
112
-
113
- $data["name"] = $user_first_name || $user_last_name ? $user_first_name . " " . $user_last_name : $admin_data->data->user_login;
114
-
115
- $response = wp_remote_post(TEN_WEB_LIB_DEACTIVATION_URL, array(
116
- 'method' => 'POST',
117
- 'timeout' => 45,
118
- 'redirection' => 5,
119
- 'httpversion' => '1.0',
120
- 'blocking' => true,
121
- 'headers' => array("Accept" => "application/x.10webcore.v1+json"),
122
- 'body' => $data,
123
- 'cookies' => array()
124
- )
125
  );
126
 
127
- $response_body = (!is_wp_error($response) && isset($response["body"])) ? json_decode($response["body"], true) : null;
128
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
 
130
- $submit_and_deactivate = WDILibrary::get($wd_options->prefix . '_submit_and_deactivate', '');
131
- if ( $submit_and_deactivate == 1 || $submit_and_deactivate == 2 ) {
132
  $deactivate_url =
133
- add_query_arg(
134
- array(
135
- 'action' => 'deactivate',
136
- 'plugin' => plugin_basename($wd_options->plugin_main_file),
137
- '_wpnonce' => wp_create_nonce('deactivate-plugin_' . plugin_basename($wd_options->plugin_main_file))
138
- ),
139
- admin_url('plugins.php')
140
- );
141
- echo '<script>window.location.href="' . $deactivate_url . '";</script>';
142
- }
143
  }
144
- }
145
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
  if (!defined('ABSPATH')) {
3
+ exit;
4
  }
5
 
6
  class TenWebLibDeactivate
7
  {
8
+ ////////////////////////////////////////////////////////////////////////////////////////
9
+ // Events //
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ ////////////////////////////////////////////////////////////////////////////////////////
12
+ // Constants //
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ ////////////////////////////////////////////////////////////////////////////////////////
15
+ // Variables //
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ public $deactivate_reasons = array();
18
+ public $config;
19
+ // Reason IDs
20
+ const REASON_PLUGIN_IS_HARD_TO_USE_TECHNICAL_PROBLEMS = "reason_plugin_is_hard_to_use_technical_problems";
21
+ const REASON_FREE_VERSION_IS_LIMITED = "reason_free_version_limited";
22
+ const REASON_PRO_EXPENSIVE = "reason_premium_expensive";
23
+ const REASON_UPGRADING_TO_PAID_VERSION = "reason_upgrading_to_paid_version";
24
+ const REASON_TEMPORARY_DEACTIVATION = "reason_temporary_deactivation";
25
+
26
+ ////////////////////////////////////////////////////////////////////////////////////////
27
+ // Constructor & Destructor //
28
+ ////////////////////////////////////////////////////////////////////////////////////////
29
+ public function __construct($config = array())
30
+ {
31
+ $this->config = $config;
32
+ $wd_options = $this->config;
33
+
34
+ $this->deactivate_reasons = array(
35
+ 1 => array(
36
+ 'id' => self::REASON_PLUGIN_IS_HARD_TO_USE_TECHNICAL_PROBLEMS,
37
+ 'text' => __('Technical problems / hard to use', $wd_options->prefix),
38
+ ),
39
+ 2 => array(
40
+ 'id' => self::REASON_FREE_VERSION_IS_LIMITED,
41
+ 'text' => __('Free version is limited', $wd_options->prefix),
42
+ ),
43
+ 3 => array(
44
+ 'id' => self::REASON_UPGRADING_TO_PAID_VERSION,
45
+ 'text' => __('Upgrading to paid version', $wd_options->prefix),
46
+ ),
47
+ 4 => array(
48
+ 'id' => self::REASON_TEMPORARY_DEACTIVATION,
49
+ 'text' => __('Temporary deactivation', $wd_options->prefix),
50
+ ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  );
52
 
53
+ add_action('admin_footer', array($this, 'add_deactivation_feedback_dialog_box'));
54
+ add_action('admin_init', array($this, 'submit_and_deactivate'));
55
+
56
+
57
+ // add_action('admin_enqueue_scripts', array($this, 'scripts'));
58
+ // Just enqueue styles/scripts and they will be in the footer.
59
+ $this->scripts();
60
+
61
+ }
62
+ ////////////////////////////////////////////////////////////////////////////////////////
63
+ // Public Methods //
64
+ ////////////////////////////////////////////////////////////////////////////////////////
65
+ public function add_deactivation_feedback_dialog_box()
66
+ {
67
+ $deactivate_reasons = $this->deactivate_reasons;
68
+ $wd_options = $this->config;
69
+
70
+ ?>
71
+ <script>
72
+ jQuery(document).ready(function () {
73
+ tenwebReady("<?php echo $wd_options->prefix; ?>");
74
+ });
75
+ </script>
76
+ <?php
77
 
 
 
78
  $deactivate_url =
79
+ add_query_arg(
80
+ array(
81
+ 'action' => 'deactivate',
82
+ 'plugin' => plugin_basename($wd_options->plugin_main_file),
83
+ '_wpnonce' => wp_create_nonce('deactivate-plugin_' . plugin_basename($wd_options->plugin_main_file))
84
+ ),
85
+ admin_url('plugins.php')
86
+ );
87
+
88
+ require($wd_options->wd_dir_templates . '/display_deactivation_popup.php');
89
  }
90
+
91
+
92
+ public function scripts()
93
+ {
94
+ $wd_options = $this->config;
95
+ wp_enqueue_style('tenweb-deactivate-popup', $wd_options->wd_url_css . '/deactivate_popup.css', array(), get_option($wd_options->prefix . "_version"));
96
+ wp_enqueue_script('tenweb-deactivate-popup', $wd_options->wd_url_js . '/deactivate_popup.js', array(), get_option($wd_options->prefix . "_version"));
97
+
98
+ $admin_data = wp_get_current_user();
99
+ wp_localize_script('tenweb-deactivate-popup', $wd_options->prefix . 'WDDeactivateVars', array(
100
+ "prefix" => $wd_options->prefix,
101
+ "deactivate_class" => $wd_options->prefix . '_deactivate_link',
102
+ "email" => $admin_data->data->user_email,
103
+ "plugin_wd_url" => $wd_options->plugin_wd_url,
104
+ ));
105
+
106
+
107
+ }
108
+
109
+ public function submit_and_deactivate()
110
+ {
111
+ $wd_options = $this->config;
112
+ if (isset($_POST[$wd_options->prefix . "_submit_and_deactivate"])) {
113
+
114
+ if ($_POST[$wd_options->prefix . "_submit_and_deactivate"] == 2 || $_POST[$wd_options->prefix . "_submit_and_deactivate"] == 3) {
115
+ //$api = new TenWebLibApi( $wd_options );
116
+
117
+ $data = array();
118
+
119
+ $data["reason"] = isset($_POST[$wd_options->prefix . "_reasons"]) ? $_POST[$wd_options->prefix . "_reasons"] : "";
120
+ $data["site_url"] = site_url();
121
+ $data["product_id"] = $wd_options->plugin_id;
122
+
123
+ $data["additional_details"] = isset($_POST[$wd_options->prefix . "_additional_details"]) ? $_POST[$wd_options->prefix . "_additional_details"] : "";
124
+ $admin_data = wp_get_current_user();
125
+ $data["email"] = isset($_POST[$wd_options->prefix . "_email"]) ? $_POST[$wd_options->prefix . "_email"] : $admin_data->data->user_email;
126
+ $user_first_name = get_user_meta($admin_data->ID, "first_name", true);
127
+ $user_last_name = get_user_meta($admin_data->ID, "last_name", true);
128
+
129
+ $data["name"] = $user_first_name || $user_last_name ? $user_first_name . " " . $user_last_name : $admin_data->data->user_login;
130
+
131
+ $response = wp_remote_post(TEN_WEB_LIB_DEACTIVATION_URL, array(
132
+ 'method' => 'POST',
133
+ 'timeout' => 45,
134
+ 'redirection' => 5,
135
+ 'httpversion' => '1.0',
136
+ 'blocking' => true,
137
+ 'headers' => array("Accept" => "application/x.10webcore.v1+json"),
138
+ 'body' => $data,
139
+ 'cookies' => array()
140
+ )
141
+ );
142
+
143
+ $response_body = (!is_wp_error($response) && isset($response["body"])) ? json_decode($response["body"], true) : null;
144
+ /*if (is_array($response_body) && $response_body["body"]["msg"] == "Access") {
145
+
146
+ }*/
147
+
148
+ }
149
+ if ($_POST[$wd_options->prefix . "_submit_and_deactivate"] == 2 || $_POST[$wd_options->prefix . "_submit_and_deactivate"] == 1) {
150
+ $deactivate_url =
151
+ add_query_arg(
152
+ array(
153
+ 'action' => 'deactivate',
154
+ 'plugin' => plugin_basename($wd_options->plugin_main_file),
155
+ '_wpnonce' => wp_create_nonce('deactivate-plugin_' . plugin_basename($wd_options->plugin_main_file))
156
+ ),
157
+ admin_url('plugins.php')
158
+ );
159
+ echo '<script>window.location.href="' . $deactivate_url . '";</script>';
160
+ }
161
+
162
+ }
163
+ }
164
+
165
+ ////////////////////////////////////////////////////////////////////////////////////////
166
+ // Getters & Setters //
167
+ ////////////////////////////////////////////////////////////////////////////////////////
168
+ ////////////////////////////////////////////////////////////////////////////////////////
169
+ // Private Methods //
170
+ ////////////////////////////////////////////////////////////////////////////////////////
171
+
172
+ ////////////////////////////////////////////////////////////////////////////////////////
173
+ // Listeners //
174
+ ////////////////////////////////////////////////////////////////////////////////////////
175
+
176
+ }
177
+
178
+
wd/includes/notices.php CHANGED
@@ -13,7 +13,6 @@ class TenWebLibNotices {
13
 
14
  // Basic actions to run
15
  public function __construct( $config = array() ) {
16
- require_once(WDI_DIR . '/framework/WDILibrary.php');
17
  $this->config = $config;
18
  // Runs the admin notice ignore function incase a dismiss button has been clicked
19
  add_action( 'admin_init', array( $this, 'admin_notice_ignore' ) );
@@ -132,10 +131,9 @@ class TenWebLibNotices {
132
  public function admin_notice_ignore() {
133
  $wd_options = $this->config;
134
  // If user clicks to ignore the notice, update the option to not show it again
135
- $admin_notice_ignore = WDILibrary::get($wd_options->prefix . '_admin_notice_ignore', '');
136
- if ( !empty( $admin_notice_ignore ) ) {
137
  $admin_notices_option = get_option( $wd_options->prefix . '_admin_notice', array() );
138
- $admin_notices_option[$admin_notice_ignore]['dismissed'] = 1;
139
  update_option( $wd_options->prefix . '_admin_notice', $admin_notices_option );
140
  $query_str = remove_query_arg( $wd_options->prefix . '_admin_notice_ignore' );
141
  wp_redirect( $query_str );
@@ -147,18 +145,16 @@ class TenWebLibNotices {
147
  public function admin_notice_temp_ignore() {
148
  $wd_options = $this->config;
149
  // If user clicks to temp ignore the notice, update the option to change the start date - default interval of 14 days
150
- $admin_notice_temp_ignore = WDILibrary::get($wd_options->prefix . '_admin_notice_temp_ignore', '');
151
- if ( !empty( $admin_notice_temp_ignore ) ) {
152
  $admin_notices_option = get_option( $wd_options->prefix . '_admin_notice', array() );
153
  $current_date = current_time( "n/j/Y" );
154
  $date_array = explode( '/', $current_date );
155
- $interval = (int) WDILibrary::get('wd_int', 14);
156
  $date_array[1] += $interval;
157
  $new_start = date( "n/j/Y", mktime( 0, 0, 0, $date_array[0], $date_array[1], $date_array[2] ) );
158
 
159
- $admin_notice_temp_ignore = WDILibrary::get($wd_options->prefix . '_admin_notice_temp_ignore', '');
160
- $admin_notices_option[$admin_notice_temp_ignore]['start'] = $new_start;
161
- $admin_notices_option[$admin_notice_temp_ignore]['dismissed'] = 0;
162
  update_option( $wd_options->prefix . '_admin_notice', $admin_notices_option );
163
  $query_str = remove_query_arg( array( $wd_options->prefix . '_admin_notice_temp_ignore', 'wd_int' ) );
164
  wp_redirect( $query_str );
@@ -168,11 +164,9 @@ class TenWebLibNotices {
168
 
169
  public function admin_notice_pages($pages) {
170
  $wd_options = $this->config;
171
- $get_page = WDILibrary::get('page', '');
172
- $get_tab = WDILibrary::get('tab', '');
173
  foreach ( $pages as $key => $page ) {
174
  if (is_array($page)) {
175
- if ( isset( $get_page ) && $get_page == $page[0] && isset($get_tab) && $get_tab == $page[1] ) {
176
  return true;
177
  }
178
  }
@@ -183,7 +177,7 @@ class TenWebLibNotices {
183
  if ( get_current_screen()->id === $page ) {
184
  return true;
185
  }
186
- if ( isset($get_page) && $get_page == $page ) {
187
  return true;
188
  }
189
  }
13
 
14
  // Basic actions to run
15
  public function __construct( $config = array() ) {
 
16
  $this->config = $config;
17
  // Runs the admin notice ignore function incase a dismiss button has been clicked
18
  add_action( 'admin_init', array( $this, 'admin_notice_ignore' ) );
131
  public function admin_notice_ignore() {
132
  $wd_options = $this->config;
133
  // If user clicks to ignore the notice, update the option to not show it again
134
+ if ( isset( $_GET[$wd_options->prefix . '_admin_notice_ignore'] ) ) {
 
135
  $admin_notices_option = get_option( $wd_options->prefix . '_admin_notice', array() );
136
+ $admin_notices_option[$_GET[$wd_options->prefix . '_admin_notice_ignore']]['dismissed'] = 1;
137
  update_option( $wd_options->prefix . '_admin_notice', $admin_notices_option );
138
  $query_str = remove_query_arg( $wd_options->prefix . '_admin_notice_ignore' );
139
  wp_redirect( $query_str );
145
  public function admin_notice_temp_ignore() {
146
  $wd_options = $this->config;
147
  // If user clicks to temp ignore the notice, update the option to change the start date - default interval of 14 days
148
+ if ( isset( $_GET[$wd_options->prefix . '_admin_notice_temp_ignore'] ) ) {
 
149
  $admin_notices_option = get_option( $wd_options->prefix . '_admin_notice', array() );
150
  $current_date = current_time( "n/j/Y" );
151
  $date_array = explode( '/', $current_date );
152
+ $interval = (isset($_GET['wd_int']) ? $_GET['wd_int'] : 14);
153
  $date_array[1] += $interval;
154
  $new_start = date( "n/j/Y", mktime( 0, 0, 0, $date_array[0], $date_array[1], $date_array[2] ) );
155
 
156
+ $admin_notices_option[$_GET[$wd_options->prefix . '_admin_notice_temp_ignore']]['start'] = $new_start;
157
+ $admin_notices_option[$_GET[$wd_options->prefix . '_admin_notice_temp_ignore']]['dismissed'] = 0;
 
158
  update_option( $wd_options->prefix . '_admin_notice', $admin_notices_option );
159
  $query_str = remove_query_arg( array( $wd_options->prefix . '_admin_notice_temp_ignore', 'wd_int' ) );
160
  wp_redirect( $query_str );
164
 
165
  public function admin_notice_pages($pages) {
166
  $wd_options = $this->config;
 
 
167
  foreach ( $pages as $key => $page ) {
168
  if (is_array($page)) {
169
+ if ( isset( $_GET['page'] ) && $_GET['page'] == $page[0] && isset($_GET['tab']) && $_GET['tab'] == $page[1] ) {
170
  return true;
171
  }
172
  }
177
  if ( get_current_screen()->id === $page ) {
178
  return true;
179
  }
180
+ if ( isset($_GET['page']) && $_GET['page'] == $page ) {
181
  return true;
182
  }
183
  }
wd/includes/subscribe.php CHANGED
@@ -5,25 +5,41 @@ if (!defined('ABSPATH')) {
5
 
6
  class TenWebLibSubscribe
7
  {
 
 
 
 
 
 
 
 
 
8
  public $config;
9
-
 
 
10
  public function __construct($config = array())
11
  {
12
  $this->config = $config;
13
  add_action('admin_init', array($this, 'after_subscribe'));
14
  }
 
 
 
15
 
16
  public function subscribe_scripts()
17
  {
18
  $wd_options = $this->config;
19
  wp_register_script('subscribe_js', $wd_options->wd_url_js . '/subsribe.js');
20
  wp_enqueue_script('subscribe_js');
 
21
  }
22
 
23
  public function subscribe_styles()
24
  {
25
  $wd_options = $this->config;
26
  wp_enqueue_style($wd_options->prefix . 'subscribe', $wd_options->wd_url_css . '/subscribe.css');
 
27
  }
28
 
29
  public function subscribe_display_page()
@@ -35,9 +51,9 @@ class TenWebLibSubscribe
35
  public function after_subscribe()
36
  {
37
  $wd_options = $this->config;
38
- $sub_action = WDILibrary::get($wd_options->prefix . '_sub_action', '');
39
- if ( !empty($sub_action) ) {
40
- if ( $sub_action == 'allow' ) {
41
  //$api = new TenWebLibApi($wd_options);
42
  $all_plugins = array();
43
  $plugins = get_plugins();
@@ -66,6 +82,7 @@ class TenWebLibSubscribe
66
  $data["product_id"] = $wd_options->plugin_id;
67
  $data["all_plugins"] = json_encode($all_plugins);
68
 
 
69
  $response = wp_remote_post(TEN_WEB_LIB_SUBSCRIBE_URL, array(
70
  'method' => 'POST',
71
  'timeout' => 45,
@@ -81,9 +98,10 @@ class TenWebLibSubscribe
81
  $response_body = (!is_wp_error($response) && isset($response["body"])) ? json_decode($response["body"], true) : null;
82
 
83
  if (is_array($response_body) && $response_body["body"]["msg"] == "ok") {
 
84
  }
85
- }
86
 
 
87
  if (get_option($wd_options->prefix . "_subscribe_done") != 1) {
88
  update_option($wd_options->prefix . "_subscribe_done", 1);
89
  } else {
@@ -92,5 +110,15 @@ class TenWebLibSubscribe
92
 
93
  wp_safe_redirect($wd_options->after_subscribe);
94
  }
 
95
  }
96
- }
 
 
 
 
 
 
 
 
 
5
 
6
  class TenWebLibSubscribe
7
  {
8
+ // //////////////////////////////////////////////////////////////////////////////////////
9
+ // Events //
10
+ // //////////////////////////////////////////////////////////////////////////////////////
11
+ // //////////////////////////////////////////////////////////////////////////////////////
12
+ // Constants //
13
+ // //////////////////////////////////////////////////////////////////////////////////////
14
+ // //////////////////////////////////////////////////////////////////////////////////////
15
+ // Variables //
16
+ // //////////////////////////////////////////////////////////////////////////////////////
17
  public $config;
18
+ // //////////////////////////////////////////////////////////////////////////////////////
19
+ // Constructor & Destructor //
20
+ // //////////////////////////////////////////////////////////////////////////////////////
21
  public function __construct($config = array())
22
  {
23
  $this->config = $config;
24
  add_action('admin_init', array($this, 'after_subscribe'));
25
  }
26
+ // //////////////////////////////////////////////////////////////////////////////////////
27
+ // Public Methods //
28
+ // //////////////////////////////////////////////////////////////////////////////////////
29
 
30
  public function subscribe_scripts()
31
  {
32
  $wd_options = $this->config;
33
  wp_register_script('subscribe_js', $wd_options->wd_url_js . '/subsribe.js');
34
  wp_enqueue_script('subscribe_js');
35
+
36
  }
37
 
38
  public function subscribe_styles()
39
  {
40
  $wd_options = $this->config;
41
  wp_enqueue_style($wd_options->prefix . 'subscribe', $wd_options->wd_url_css . '/subscribe.css');
42
+
43
  }
44
 
45
  public function subscribe_display_page()
51
  public function after_subscribe()
52
  {
53
  $wd_options = $this->config;
54
+ if (isset($_GET[$wd_options->prefix . "_sub_action"])) {
55
+
56
+ if ($_GET[$wd_options->prefix . "_sub_action"] == "allow") {
57
  //$api = new TenWebLibApi($wd_options);
58
  $all_plugins = array();
59
  $plugins = get_plugins();
82
  $data["product_id"] = $wd_options->plugin_id;
83
  $data["all_plugins"] = json_encode($all_plugins);
84
 
85
+
86
  $response = wp_remote_post(TEN_WEB_LIB_SUBSCRIBE_URL, array(
87
  'method' => 'POST',
88
  'timeout' => 45,
98
  $response_body = (!is_wp_error($response) && isset($response["body"])) ? json_decode($response["body"], true) : null;
99
 
100
  if (is_array($response_body) && $response_body["body"]["msg"] == "ok") {
101
+
102
  }
 
103
 
104
+ }
105
  if (get_option($wd_options->prefix . "_subscribe_done") != 1) {
106
  update_option($wd_options->prefix . "_subscribe_done", 1);
107
  } else {
110
 
111
  wp_safe_redirect($wd_options->after_subscribe);
112
  }
113
+
114
  }
115
+ // //////////////////////////////////////////////////////////////////////////////////////
116
+ // Getters & Setters //
117
+ // //////////////////////////////////////////////////////////////////////////////////////
118
+ // //////////////////////////////////////////////////////////////////////////////////////
119
+ // Private Methods //
120
+ // //////////////////////////////////////////////////////////////////////////////////////
121
+ // //////////////////////////////////////////////////////////////////////////////////////
122
+ // Listeners //
123
+ // //////////////////////////////////////////////////////////////////////////////////////
124
+ }
wd/templates/display_overview.php CHANGED
@@ -24,8 +24,8 @@
24
  <div class="plan_features tenweb_clear">
25
  <div class="plan_feature pro_plugins">
26
  <div class="logo"></div>
27
- <h3><?php _e("60+ pro plugins/Extensions", $wd_options->prefix); ?></h3>
28
- <p><?php _e("Access 60+ plugins and extensions, including key plugins, such as gallery, form, slider, social plugins and more.", $wd_options->prefix); ?></p>
29
  </div>
30
  <div class="plan_feature dashboard">
31
  <div class="logo"></div>
24
  <div class="plan_features tenweb_clear">
25
  <div class="plan_feature pro_plugins">
26
  <div class="logo"></div>
27
+ <h3><?php _e("60+ pro plugins/Add-ons", $wd_options->prefix); ?></h3>
28
+ <p><?php _e("Access 60+ plugins and add-ons, including key plugins, such as gallery, form, slider, social plugins and more.", $wd_options->prefix); ?></p>
29
  </div>
30
  <div class="plan_feature dashboard">
31
  <div class="logo"></div>
wd/wd.php CHANGED
@@ -1,124 +1,161 @@
1
  <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- }
5
-
6
- class TenWebLib {
7
-
8
- public static $instance;
9
- public $overview_instance;
10
- public $subscribe_instance;
11
- public $config;
12
- private $version = "1.1.1";
13
-
14
- public function __construct() {
15
- // Add menu for Overview page
16
- add_action( 'admin_menu', array( $this, 'wd_overview_menu_page' ), 10 );
17
- }
18
-
19
- // Init plugin data
20
- public function wd_init( $options ) {
21
- if(!is_array($options)){
22
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  }
24
- $config = new TenWebLibConfig();
25
- $config->set_options( $options );
26
- $this->config = $config;
27
- if( !class_exists("TenWebLibApi") ){
28
- $this->wd_includes();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  }
30
- $this->init_classes();
31
- $this->register_hooks();
32
- }
33
 
34
- // Create overview menu page
35
- public function wd_overview_menu_page() {
36
- $wd_options = $this->config;
37
 
38
- $capability = $wd_options->menu_capability ? $wd_options->menu_capability : "manage_options";
39
- if( get_option( $wd_options->prefix . "_subscribe_done" ) == 1 || $wd_options->subscribe === false ){
40
- $parent_slug = $wd_options->custom_post;
 
 
 
 
 
 
 
 
 
 
 
41
  }
42
- else{
 
 
 
 
 
 
 
 
 
 
43
 
44
- $subscribe_page = add_menu_page( $wd_options->plugin_menu_title, $wd_options->plugin_menu_title, "manage_options", $wd_options->prefix . '_subscribe' , array( $this, 'display_subscribew_page' ), $wd_options->plugin_menu_icon, $wd_options->menu_position );
45
 
46
- $subscribe_instance = new TenWebLibSubscribe($this->config);
47
- $this->subscribe_instance = $subscribe_instance;
48
- add_action( 'admin_print_styles-' . $subscribe_page, array( $subscribe_instance, 'subscribe_styles' ) );
49
- add_action( 'admin_print_scripts-' . $subscribe_page, array( $subscribe_instance, 'subscribe_scripts' ) );
50
 
51
- $parent_slug = null;
52
- }
53
-
54
- if ($wd_options->display_overview) {
55
- $title = __( 'Premium', $wd_options->prefix );
56
- if ( FALSE && !get_transient( $wd_options->prefix . '_overview_visited' ) ) {
57
- $title .= ' <span class="update-plugins count-2" > <span class="plugin-count">1</span></span>';
58
- }
59
- $overview_page = add_submenu_page( $parent_slug, __( 'Premium', $wd_options->prefix ), '<span style="color:#4481ea;">' . $title . '</span>', $capability, 'overview_' . $wd_options->prefix, array( $this, 'display_overview_page' ) );
60
-
61
- $overview_instance = new TenWebLibOverview( $this->config );
62
- $this->overview_instance = $overview_instance;
63
- add_action( 'admin_print_styles-' . $overview_page, array( $overview_instance, 'overview_styles' ) );
64
- add_action( 'admin_print_scripts-' . $overview_page, array( $overview_instance, 'overview_scripts' ) );
65
- }
66
- }
67
-
68
- public function display_subscribew_page(){
69
- $this->subscribe_instance->subscribe_display_page();
70
- }
71
-
72
- // Display overview page
73
- public function display_overview_page() {
74
- $this->overview_instance->display_overview_page();
75
- }
76
-
77
- // Includs
78
- public function wd_includes(){
79
- $wd_options = $this->config;
80
-
81
- require_once $wd_options->wd_dir_includes . '/deactivate.php' ;
82
- // notices
83
- require_once $wd_options->wd_dir_includes . '/api.php';
84
- require_once $wd_options->wd_dir_includes . '/notices.php';
85
- require_once $wd_options->wd_dir_includes . "/overview.php";
86
- require_once $wd_options->wd_dir_includes . "/subscribe.php";
87
- }
88
-
89
- public function init_classes(){
90
- $wd_options = $this->config;
91
-
92
- $current_url = $_SERVER['REQUEST_URI'];
93
- if( $wd_options->deactivate === true ){
94
- if(strpos( $current_url, "plugins.php" ) !== false ){
95
- new TenWebLibDeactivate( $this->config );
96
- }
97
- }
98
-
99
- new TenWebLibNotices( $this->config );
100
- }
101
 
102
- public function register_hooks(){
103
- $wd_options = $this->config;
104
- if( $wd_options->deactivate === true ){
105
- add_filter( 'plugin_action_links_' . plugin_basename( $wd_options->plugin_main_file ), array( $this, 'change_deactivation_link' ) );
106
- }
107
- }
108
-
109
- public function change_deactivation_link ( $links ) {
110
- $wd_options = $this->config;
111
- $deactivate_url =
112
- add_query_arg(
113
- array(
114
- 'action' => 'deactivate',
115
- 'plugin' => plugin_basename( $wd_options->plugin_main_file ),
116
- '_wpnonce' => wp_create_nonce( 'deactivate-plugin_' . plugin_basename( $wd_options->plugin_main_file ) )
117
- ),
118
- admin_url( 'plugins.php' )
119
- );
120
-
121
- $links["deactivate"] = '<a href="'.$deactivate_url.'" class="' . $wd_options->prefix . '_deactivate_link">Deactivate</a>';
122
- return $links;
123
- }
124
- }
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
5
+
6
+ class TenWebLib {
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Events //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Constants //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Variables //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public static $instance;
17
+ public $overview_instance;
18
+ public $subscribe_instance;
19
+ public $config;
20
+ private $version = "1.1.1";
21
+
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Constructor & Destructor //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function __construct() {
26
+ // Add menu for Overview page
27
+ add_action( 'admin_menu', array( $this, 'wd_overview_menu_page' ), 10 );
28
+
29
+ }
30
+ ////////////////////////////////////////////////////////////////////////////////////////
31
+ // Public Methods //
32
+ ////////////////////////////////////////////////////////////////////////////////////////
33
+
34
+ // Init plugin data
35
+ public function wd_init( $options ) {
36
+
37
+ if(!is_array($options)){
38
+ return false;
39
+ }
40
+ $config = new TenWebLibConfig();
41
+ $config->set_options( $options );
42
+ $this->config = $config;
43
+ if( !class_exists("TenWebLibApi") ){
44
+ $this->wd_includes();
45
+ }
46
+
47
+ $this->init_classes();
48
+ $this->register_hooks();
49
+
50
+ }
51
+
52
+ // Create overview menu page
53
+ public function wd_overview_menu_page() {
54
+ $wd_options = $this->config;
55
+
56
+ $capability = $wd_options->menu_capability ? $wd_options->menu_capability : "manage_options";
57
+ if( get_option( $wd_options->prefix . "_subscribe_done" ) == 1 || $wd_options->subscribe === false ){
58
+ $parent_slug = $wd_options->custom_post;
59
+ }
60
+ else{
61
+
62
+ $subscribe_page = add_menu_page( $wd_options->plugin_menu_title, $wd_options->plugin_menu_title, "manage_options", $wd_options->prefix . '_subscribe' , array( $this, 'display_subscribew_page' ), $wd_options->plugin_menu_icon, $wd_options->menu_position );
63
+
64
+ $subscribe_instance = new TenWebLibSubscribe($this->config);
65
+ $this->subscribe_instance = $subscribe_instance;
66
+ add_action( 'admin_print_styles-' . $subscribe_page, array( $subscribe_instance, 'subscribe_styles' ) );
67
+ add_action( 'admin_print_scripts-' . $subscribe_page, array( $subscribe_instance, 'subscribe_scripts' ) );
68
+
69
+ $parent_slug = null;
70
+ }
71
+ if ($wd_options->display_overview) {
72
+ $title = __( 'Premium', $wd_options->prefix );
73
+ if ( FALSE && !get_transient( $wd_options->prefix . '_overview_visited' ) ) {
74
+ $title .= ' <span class="update-plugins count-2" > <span class="plugin-count">1</span></span>';
75
+ }
76
+ $overview_page = add_submenu_page( $parent_slug, __( 'Premium', $wd_options->prefix ), '<span style="color:#4481ea;">' . $title . '</span>', $capability, 'overview_' . $wd_options->prefix, array( $this, 'display_overview_page' ) );
77
+
78
+
79
+ $overview_instance = new TenWebLibOverview( $this->config );
80
+ $this->overview_instance = $overview_instance;
81
+ add_action( 'admin_print_styles-' . $overview_page, array( $overview_instance, 'overview_styles' ) );
82
+ add_action( 'admin_print_scripts-' . $overview_page, array( $overview_instance, 'overview_scripts' ) );
83
+ }
84
+ }
85
+
86
+ public function display_subscribew_page(){
87
+ $this->subscribe_instance->subscribe_display_page();
88
  }
89
+
90
+ // Display overview page
91
+ public function display_overview_page() {
92
+ $this->overview_instance->display_overview_page();
93
+ }
94
+
95
+
96
+ // Includs
97
+ public function wd_includes(){
98
+ $wd_options = $this->config;
99
+
100
+ require_once $wd_options->wd_dir_includes . '/deactivate.php' ;
101
+ // notices
102
+ require_once $wd_options->wd_dir_includes . '/api.php';
103
+ require_once $wd_options->wd_dir_includes . '/notices.php';
104
+ require_once $wd_options->wd_dir_includes . "/overview.php";
105
+ require_once $wd_options->wd_dir_includes . "/subscribe.php";
106
+
107
+ }
108
+ public function init_classes(){
109
+ $wd_options = $this->config;
110
+
111
+ $current_url = $_SERVER['REQUEST_URI'];
112
+ if( $wd_options->deactivate === true ){
113
+ if(strpos( $current_url, "plugins.php" ) !== false ){
114
+ new TenWebLibDeactivate( $this->config );
115
+ }
116
+ }
117
+
118
+ new TenWebLibNotices( $this->config );
119
+
120
+ }
121
+
122
+ public function register_hooks(){
123
+ $wd_options = $this->config;
124
+ if( $wd_options->deactivate === true ){
125
+ add_filter( 'plugin_action_links_' . plugin_basename( $wd_options->plugin_main_file ), array( $this, 'change_deactivation_link' ) );
126
+ }
127
+
128
  }
 
 
 
129
 
 
 
 
130
 
131
+ public function change_deactivation_link ( $links ) {
132
+ $wd_options = $this->config;
133
+ $deactivate_url =
134
+ add_query_arg(
135
+ array(
136
+ 'action' => 'deactivate',
137
+ 'plugin' => plugin_basename( $wd_options->plugin_main_file ),
138
+ '_wpnonce' => wp_create_nonce( 'deactivate-plugin_' . plugin_basename( $wd_options->plugin_main_file ) )
139
+ ),
140
+ admin_url( 'plugins.php' )
141
+ );
142
+
143
+ $links["deactivate"] = '<a href="'.$deactivate_url.'" class="' . $wd_options->prefix . '_deactivate_link">Deactivate</a>';
144
+ return $links;
145
  }
146
+
147
+ ////////////////////////////////////////////////////////////////////////////////////////
148
+ // Getters & Setters //
149
+ ////////////////////////////////////////////////////////////////////////////////////////
150
+ ////////////////////////////////////////////////////////////////////////////////////////
151
+ // Private Methods //
152
+ ////////////////////////////////////////////////////////////////////////////////////////
153
+
154
+ ////////////////////////////////////////////////////////////////////////////////////////
155
+ // Listeners //
156
+ ////////////////////////////////////////////////////////////////////////////////////////
157
 
158
+ }
159
 
 
 
 
 
160
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161