WD Instagram Feed – Instagram Gallery - Version 1.0.6

Version Description

Download this release

Release Info

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

Code changes from version 1.0.5 to 1.0.6

admin-functions.php CHANGED
@@ -16,55 +16,7 @@ function wdi_check_necessary_params(){
16
 
17
  }
18
 
19
-
20
- /**
21
- * uninstall action callback
22
- * this functions finds and deletes all plugin related tables from wordpress database
23
- * also it deletes from options table plugin options sets uninstalled option as true
24
- */
25
-
26
- add_action('wp_ajax_wdiUninstallPlugin','wdi_uninstall_ajax');
27
-
28
- function wdi_uninstall_ajax(){
29
- $nonce = isset($_REQUEST['uninstall_nonce']) ? $_REQUEST['uninstall_nonce'] : "";
30
- if(!wp_verify_nonce( $nonce, 'wdiUninstallPlugin' )){
31
- wp_die();
32
- }
33
- else{
34
- global $wpdb;
35
- $removed = false;
36
- $table_name = $wpdb->prefix.WDI_FEED_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
- $table_name = $wpdb->prefix.WDI_THEME_TABLE;
45
- $checktable = $wpdb->query("SHOW TABLES LIKE '$table_name'");
46
- $table_exists = $checktable > 0;
47
- if($table_exists){
48
- $sql = "DROP TABLE ". $table_name;
49
- $wpdb->query($sql);
50
- $removed = true;
51
- }
52
- if($removed == true) {
53
- wdi_uninstall_notice(1);
54
- }
55
- else{
56
- wdi_uninstall_notice(2);
57
- };
58
 
59
- delete_option(WDI_OPT);
60
-
61
- $default_option=array();
62
- $default_option['wdi_plugin_uninstalled'] = 'true';
63
- add_option(WDI_OPT,$default_option);
64
- delete_option('wdi_version');
65
- }
66
- wp_die();
67
- }
68
 
69
  /**
70
  * checks if argument is 1 it displays success message on settings page after uninstalling plugin
@@ -129,9 +81,13 @@ function wdi_install(){
129
  $newer = version_compare($new_version, $old_version, '>');
130
 
131
  if($newer){
132
- //require_once WDI_DIR . '/update/wdi_update.php';
133
  /*adds new params for new versions*/
134
- //wdi_update_diff($new_version, $old_version);
 
 
 
 
135
  }
136
  wdi_set_options_defaults();
137
  return;
@@ -208,7 +164,10 @@ function wdi_install(){
208
  enable_loop varchar(1) NOT NULL,
209
  popup_image_right_click varchar(1) NOT NULL,
210
 
211
-
 
 
 
212
  UNIQUE KEY id (id)
213
  ) $charset_collate;";
214
 
@@ -395,7 +354,8 @@ function wdi_install(){
395
  th_overlay_hover_transparent varchar(32) NOT NULL,
396
  th_overlay_hover_icon_color varchar(32) NOT NULL,
397
  th_overlay_hover_icon_font_size varchar(32) NOT NULL,
398
-
 
399
 
400
  mas_photo_wrap_padding varchar(32) NOT NULL,
401
  mas_photo_wrap_border_size varchar(32) NOT NULL,
@@ -415,6 +375,8 @@ function wdi_install(){
415
  mas_overlay_hover_transparent varchar(32) NOT NULL,
416
  mas_overlay_hover_icon_color varchar(32) NOT NULL,
417
  mas_overlay_hover_icon_font_size varchar(32) NOT NULL,
 
 
418
 
419
  blog_style_photo_wrap_padding varchar(32) NOT NULL,
420
  blog_style_photo_wrap_border_size varchar(32) NOT NULL,
@@ -566,6 +528,7 @@ function wdi_get_settings(){
566
  $settings = array(
567
  'wdi_access_token' => array('name' => 'wdi_access_token','sanitize_type'=>'text', 'required' =>'required','input_size'=>'55','type'=>'input','readonly'=>'readonly','default'=>'','field_or_not'=>'field','section'=>'wdi_configure_section','title'=>__('Access Token',"wdi")),
568
  'wdi_user_name' => array('name' => 'wdi_user_name','sanitize_type'=>'text','required' =>'required','type'=>'input','section'=>'wdi_configure_section','readonly'=>'readonly','field_or_not'=>'field','default'=>'','title'=>__('Username',"wdi")),
 
569
  'wdi_custom_css'=>array('name'=>'wdi_custom_css','sanitize_type'=>'css','type'=>'textarea','section'=>'wdi_customize_section','field_or_not'=>'field','default'=>'','title'=>__('Custom CSS',"wdi")),
570
  'wdi_custom_js'=>array('name'=>'wdi_custom_js','sanitize_type'=>'css','type'=>'textarea','section'=>'wdi_customize_section','field_or_not'=>'field','default'=>'','title'=>__('Custom JavaScript',"wdi")),
571
  //'wdi_preserve_settings_when_remove'=>array('name'=>'wdi_preserve_settings_when_remove','field_or_not'=>'field','type'=>'checkbox','default'=>'1', 'section'=>'wdi_configure_section','title'=>__('Preserve Settings When Remove',"wdi")),
@@ -580,29 +543,24 @@ function wdi_get_settings(){
580
  function wdi_set_options_defaults(){
581
  $db_options = array();
582
  $options = get_option(WDI_OPT);
583
- $wdi_plugin_uninstalled = isset( $options['wdi_plugin_uninstalled']) ? $options['wdi_plugin_uninstalled'] : '';
584
- $old_access_token = isset( $options['wdi_access_token']) ? $options['wdi_access_token']:'';
585
- $old_user_name = isset( $options['wdi_user_name']) ? $options['wdi_user_name'] : '';
586
 
587
  $settings = wdi_get_settings();
588
  foreach ($settings as $setting) {
589
  $settingDefault = isset($setting['default'])? $setting['default'] : '';
590
- if(!$settingDefault==''){
591
- if($setting['default']!=NULL){
592
- $db_options[$setting['name']]=$setting['default'];
593
- }
594
- }
595
  }
596
 
597
 
598
- //check if deactivation/activation occured that keep settings instead of deleting
599
- if($wdi_plugin_uninstalled == 'false'){
600
- $db_options['wdi_access_token'] = $old_access_token;
601
- $db_options['wdi_user_name'] = $old_user_name;
602
  }
603
- // $db_options['wdi_plugin_uninstalled'] = 'false';
604
- add_option(WDI_OPT,$db_options,'','yes');
605
- update_option(WDI_OPT,$db_options,'yes');
606
  wdi_get_options();
607
 
608
  }
16
 
17
  }
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
 
 
 
 
 
 
 
 
 
20
 
21
  /**
22
  * checks if argument is 1 it displays success message on settings page after uninstalling plugin
81
  $newer = version_compare($new_version, $old_version, '>');
82
 
83
  if($newer){
84
+ require_once WDI_DIR . '/update/wdi_update.php';
85
  /*adds new params for new versions*/
86
+ wdi_update_diff($new_version, $old_version);
87
+
88
+ if(!update_option('wdi_version',WDI_VERSION )){
89
+ add_option('wdi_version', WDI_VERSION);
90
+ }
91
  }
92
  wdi_set_options_defaults();
93
  return;
164
  enable_loop varchar(1) NOT NULL,
165
  popup_image_right_click varchar(1) NOT NULL,
166
 
167
+ conditional_filters varchar(10000) NOT NULL,
168
+ conditional_filter_type varchar(32) NOT NULL,
169
+ show_username_on_thumb varchar(32) NOT NULL,
170
+ conditional_filter_enable varchar(1) NOT NULL,
171
  UNIQUE KEY id (id)
172
  ) $charset_collate;";
173
 
354
  th_overlay_hover_transparent varchar(32) NOT NULL,
355
  th_overlay_hover_icon_color varchar(32) NOT NULL,
356
  th_overlay_hover_icon_font_size varchar(32) NOT NULL,
357
+ th_thumb_user_bg_color varchar(32) NOT NULL,
358
+ th_thumb_user_color varchar(32) NOT NULL,
359
 
360
  mas_photo_wrap_padding varchar(32) NOT NULL,
361
  mas_photo_wrap_border_size varchar(32) NOT NULL,
375
  mas_overlay_hover_transparent varchar(32) NOT NULL,
376
  mas_overlay_hover_icon_color varchar(32) NOT NULL,
377
  mas_overlay_hover_icon_font_size varchar(32) NOT NULL,
378
+ mas_thumb_user_bg_color varchar(32) NOT NULL,
379
+ mas_thumb_user_color varchar(32) NOT NULL,
380
 
381
  blog_style_photo_wrap_padding varchar(32) NOT NULL,
382
  blog_style_photo_wrap_border_size varchar(32) NOT NULL,
528
  $settings = array(
529
  'wdi_access_token' => array('name' => 'wdi_access_token','sanitize_type'=>'text', 'required' =>'required','input_size'=>'55','type'=>'input','readonly'=>'readonly','default'=>'','field_or_not'=>'field','section'=>'wdi_configure_section','title'=>__('Access Token',"wdi")),
530
  'wdi_user_name' => array('name' => 'wdi_user_name','sanitize_type'=>'text','required' =>'required','type'=>'input','section'=>'wdi_configure_section','readonly'=>'readonly','field_or_not'=>'field','default'=>'','title'=>__('Username',"wdi")),
531
+ 'wdi_user_id' => array('name' => 'wdi_user_id','sanitize_type'=>'text','type'=>'input','section'=>'wdi_configure_section','readonly'=>'readonly','default'=>'','field_or_not'=>'no_field'),
532
  'wdi_custom_css'=>array('name'=>'wdi_custom_css','sanitize_type'=>'css','type'=>'textarea','section'=>'wdi_customize_section','field_or_not'=>'field','default'=>'','title'=>__('Custom CSS',"wdi")),
533
  'wdi_custom_js'=>array('name'=>'wdi_custom_js','sanitize_type'=>'css','type'=>'textarea','section'=>'wdi_customize_section','field_or_not'=>'field','default'=>'','title'=>__('Custom JavaScript',"wdi")),
534
  //'wdi_preserve_settings_when_remove'=>array('name'=>'wdi_preserve_settings_when_remove','field_or_not'=>'field','type'=>'checkbox','default'=>'1', 'section'=>'wdi_configure_section','title'=>__('Preserve Settings When Remove',"wdi")),
543
  function wdi_set_options_defaults(){
544
  $db_options = array();
545
  $options = get_option(WDI_OPT);
546
+
547
+
548
+
549
 
550
  $settings = wdi_get_settings();
551
  foreach ($settings as $setting) {
552
  $settingDefault = isset($setting['default'])? $setting['default'] : '';
553
+ $db_options[$setting['name']]=$setting['default'];
 
 
 
 
554
  }
555
 
556
 
557
+ $options = wp_parse_args( $options, $db_options );
558
+ if(isset($options['wdi_plugin_uninstalled']) && $options['wdi_plugin_uninstalled'] == 'true'){
559
+ $options['wdi_plugin_uninstalled'] = 'false';
 
560
  }
561
+
562
+ add_option(WDI_OPT,$options,'','yes');
563
+ update_option(WDI_OPT,$options,'yes');
564
  wdi_get_options();
565
 
566
  }
admin/controllers/WDIControllerFeeds_wdi.php CHANGED
@@ -59,6 +59,7 @@ class WDIControllerFeeds_wdi {
59
  '%d',/*show_likes*/
60
  '%d',/*show_description*/
61
  '%d',/*show_comments*/
 
62
  '%d',/*show_usernames*/
63
  '%d',/*display_user_info*/
64
  '%d',//'display_user_post_follow_number'
@@ -92,6 +93,10 @@ class WDIControllerFeeds_wdi {
92
  '%d',//'show_image_counts'=>'bool',
93
  '%d',//'enable_loop'=>'bool'
94
  '%d',//popup_image_right_click=>'bool'
 
 
 
 
95
  );
96
  }
97
  private function display() {
@@ -211,6 +216,7 @@ class WDIControllerFeeds_wdi {
211
  private function cancel(){
212
  $this->display();
213
  }
 
214
  private function reset_changes(){
215
  require_once WDI_DIR . "/admin/models/WDIModelFeeds_wdi.php";
216
  $model = new WDIModelFeeds_wdi();
@@ -375,9 +381,10 @@ class WDIControllerFeeds_wdi {
375
  }
376
 
377
  private function check_settings($settings){
378
- if(count(explode(',', $settings['feed_users']))){
379
- $settings['feed_users'] = explode(',', $settings['feed_users']);
380
- $settings['feed_users'] = $settings['feed_users'][0];
 
381
  };
382
  if(intval($settings['theme_id']) > 1){
383
  $settings['theme_id'] = '1';
@@ -423,6 +430,14 @@ private function check_settings($settings){
423
  if($settings['show_comments'] == '1'){
424
  $settings['show_comments'] = '0';
425
  }
 
 
 
 
 
 
 
 
426
  return $settings;
427
  }
428
 
59
  '%d',/*show_likes*/
60
  '%d',/*show_description*/
61
  '%d',/*show_comments*/
62
+ '%d',/*show_username_on_thumb*/
63
  '%d',/*show_usernames*/
64
  '%d',/*display_user_info*/
65
  '%d',//'display_user_post_follow_number'
93
  '%d',//'show_image_counts'=>'bool',
94
  '%d',//'enable_loop'=>'bool'
95
  '%d',//popup_image_right_click=>'bool'
96
+
97
+ '%s',//'conditional_filters' => 'string',
98
+ '%d',//'conditional_filter_enable'=>'0',
99
+ '%s',//'conditional_filter_type' => 'string'
100
  );
101
  }
102
  private function display() {
216
  private function cancel(){
217
  $this->display();
218
  }
219
+
220
  private function reset_changes(){
221
  require_once WDI_DIR . "/admin/models/WDIModelFeeds_wdi.php";
222
  $model = new WDIModelFeeds_wdi();
381
  }
382
 
383
  private function check_settings($settings){
384
+
385
+ if($settings['feed_users']){
386
+ $settings['feed_users'] = json_decode($settings['feed_users']);
387
+ $settings['feed_users'] = json_encode(array($settings['feed_users'][0]));
388
  };
389
  if(intval($settings['theme_id']) > 1){
390
  $settings['theme_id'] = '1';
430
  if($settings['show_comments'] == '1'){
431
  $settings['show_comments'] = '0';
432
  }
433
+
434
+ if($settings['show_username_on_thumb'] == '1'){
435
+ $settings['show_username_on_thumb'] = '0';
436
+ }
437
+
438
+ if($settings['conditional_filter_enable'] == '1'){
439
+ $settings['conditional_filter_enable'] = '0';
440
+ }
441
  return $settings;
442
  }
443
 
admin/controllers/WDIControllerThemes_wdi.php CHANGED
@@ -220,6 +220,8 @@ class WDIControllerThemes_wdi {
220
  '%d',//'th_overlay_hover_transparent'=>'number',
221
  '%s',//'th_overlay_hover_icon_color'=>'color',
222
  '%s',//'th_overlay_hover_icon_font_size'=>'length',
 
 
223
 
224
  '%s',/*mas_photo_wrap_padding*/
225
  '%s',/*mas_photo_wrap_border_size*/
@@ -239,6 +241,8 @@ class WDIControllerThemes_wdi {
239
  '%d',//'mas_overlay_hover_transparent'=>'number',
240
  '%s',//'mas_overlay_hover_icon_color'=>'color',
241
  '%s',//'mas_overlay_hover_icon_font_size'=>'length',
 
 
242
 
243
  '%s',/*blog_style_photo_wrap_padding*/
244
  '%s',/*blog_style_photo_wrap_border_size*/
220
  '%d',//'th_overlay_hover_transparent'=>'number',
221
  '%s',//'th_overlay_hover_icon_color'=>'color',
222
  '%s',//'th_overlay_hover_icon_font_size'=>'length',
223
+ '%s',//'th_thumb_user_bg_color'=>'color',
224
+ '%s',//'th_thumb_user_color'=>'color'
225
 
226
  '%s',/*mas_photo_wrap_padding*/
227
  '%s',/*mas_photo_wrap_border_size*/
241
  '%d',//'mas_overlay_hover_transparent'=>'number',
242
  '%s',//'mas_overlay_hover_icon_color'=>'color',
243
  '%s',//'mas_overlay_hover_icon_font_size'=>'length',
244
+ '%s',//'mas_thumb_user_bg_color'=>'color',
245
+ '%s',//'mas_thumb_user_color'=>'color'
246
 
247
  '%s',/*blog_style_photo_wrap_padding*/
248
  '%s',/*blog_style_photo_wrap_border_size*/
admin/models/WDIModelFeeds_wdi.php CHANGED
@@ -74,14 +74,16 @@ class WDIModelFeeds_wdi {
74
  global $wpdb;
75
  $query = $wpdb->prepare("SELECT id FROM ". $wpdb->prefix.WDI_THEME_TABLE." WHERE default_theme='%d'",1);
76
  $default_theme = WDILibrary::objectToArray($wpdb->get_results($query));
77
-
 
 
78
  $settings = array(
79
  'thumb_user'=> $wdi_options['wdi_user_name'],
80
  'feed_name' => 'Sample Feed',
81
  'feed_thumb'=> WDI_URL . '/images/no-image.png',
82
  'published' => '1',
83
  'theme_id'=> $default_theme[0]['id'],
84
- 'feed_users'=> $wdi_options['wdi_user_name'],
85
  'feed_display_view' =>'load_more_btn',
86
  'sort_images_by' => 'date',
87
  'display_order'=> 'desc',
@@ -98,6 +100,7 @@ class WDIModelFeeds_wdi {
98
  'show_likes'=> '0',
99
  'show_description'=> '0' ,
100
  'show_comments'=> '0',
 
101
  'show_usernames' =>'1',
102
  'display_user_info'=>'1',
103
  'display_user_post_follow_number' => '1',
@@ -132,7 +135,11 @@ class WDIModelFeeds_wdi {
132
  'popup_enable_tumblr'=>'0',
133
  'show_image_counts'=>'0',
134
  'enable_loop'=>'1',
135
- 'popup_image_right_click'=> '1'
 
 
 
 
136
  );
137
  return $settings;
138
  }
@@ -161,6 +168,7 @@ class WDIModelFeeds_wdi {
161
  'show_likes'=> 'bool',
162
  'show_description'=> 'bool' ,
163
  'show_comments'=> 'bool',
 
164
  'show_usernames'=>'bool',
165
  'display_user_info'=>'bool',
166
  'display_user_post_follow_number'=>'bool',
@@ -195,7 +203,11 @@ class WDIModelFeeds_wdi {
195
  'popup_enable_tumblr'=>'bool',
196
  'show_image_counts'=>'bool',
197
  'enable_loop'=>'bool',
198
- 'popup_image_right_click'=>'bool'
 
 
 
 
199
  );
200
  return $sanitize_types;
201
  }
@@ -206,10 +218,13 @@ public function get_feed_row($current_id){
206
  return $feed_row;
207
  }
208
  private function check_settings($settings){
 
 
209
  $settings = WDILibrary::objectToArray($settings);
210
- if(isset($settings['feed_users']) && count(explode(',', $settings['feed_users']))>1){
211
- $settings['feed_users'] = explode(',', $settings['feed_users']);
212
- $settings['feed_users'] = $settings['feed_users'][0];
 
213
  };
214
  if(isset($settings['theme_id']) && intval($settings['theme_id']) > 1){
215
  $settings['theme_id'] = '1';
@@ -223,6 +238,15 @@ private function check_settings($settings){
223
  if(isset($settings['popup_enable_filmstrip']) && $settings['popup_enable_filmstrip'] == '1'){
224
  $settings['popup_enable_filmstrip'] = '0';
225
  }
 
 
 
 
 
 
 
 
 
226
  if(isset($settings['popup_filmstrip_height']) && $settings['popup_filmstrip_height'] != '70'){
227
  $settings['popup_filmstrip_height'] = '70';
228
  }
74
  global $wpdb;
75
  $query = $wpdb->prepare("SELECT id FROM ". $wpdb->prefix.WDI_THEME_TABLE." WHERE default_theme='%d'",1);
76
  $default_theme = WDILibrary::objectToArray($wpdb->get_results($query));
77
+ $default_user = new stdClass();
78
+ $default_user->username = $wdi_options['wdi_user_name'];
79
+ $default_user->id = $wdi_options['wdi_user_id'];
80
  $settings = array(
81
  'thumb_user'=> $wdi_options['wdi_user_name'],
82
  'feed_name' => 'Sample Feed',
83
  'feed_thumb'=> WDI_URL . '/images/no-image.png',
84
  'published' => '1',
85
  'theme_id'=> $default_theme[0]['id'],
86
+ 'feed_users'=> json_encode(array($default_user)),
87
  'feed_display_view' =>'load_more_btn',
88
  'sort_images_by' => 'date',
89
  'display_order'=> 'desc',
100
  'show_likes'=> '0',
101
  'show_description'=> '0' ,
102
  'show_comments'=> '0',
103
+ 'show_username_on_thumb'=>'0',
104
  'show_usernames' =>'1',
105
  'display_user_info'=>'1',
106
  'display_user_post_follow_number' => '1',
135
  'popup_enable_tumblr'=>'0',
136
  'show_image_counts'=>'0',
137
  'enable_loop'=>'1',
138
+ 'popup_image_right_click'=> '1',
139
+
140
+ 'conditional_filters' => '',
141
+ 'conditional_filter_enable'=>'0',
142
+ 'conditional_filter_type' => 'none'
143
  );
144
  return $settings;
145
  }
168
  'show_likes'=> 'bool',
169
  'show_description'=> 'bool' ,
170
  'show_comments'=> 'bool',
171
+ 'show_username_on_thumb'=>'bool',
172
  'show_usernames'=>'bool',
173
  'display_user_info'=>'bool',
174
  'display_user_post_follow_number'=>'bool',
203
  'popup_enable_tumblr'=>'bool',
204
  'show_image_counts'=>'bool',
205
  'enable_loop'=>'bool',
206
+ 'popup_image_right_click'=>'bool',
207
+
208
+ 'conditional_filters' => 'string',
209
+ 'conditional_filter_enable'=>'bool',
210
+ 'conditional_filter_type' => 'string'
211
  );
212
  return $sanitize_types;
213
  }
218
  return $feed_row;
219
  }
220
  private function check_settings($settings){
221
+
222
+
223
  $settings = WDILibrary::objectToArray($settings);
224
+
225
+ if(isset($settings['feed_users'])){
226
+ $settings['feed_users'] = json_decode($settings['feed_users']);
227
+ $settings['feed_users'] = json_encode(array($settings['feed_users'][0]));
228
  };
229
  if(isset($settings['theme_id']) && intval($settings['theme_id']) > 1){
230
  $settings['theme_id'] = '1';
238
  if(isset($settings['popup_enable_filmstrip']) && $settings['popup_enable_filmstrip'] == '1'){
239
  $settings['popup_enable_filmstrip'] = '0';
240
  }
241
+
242
+ if(isset($settings['show_username_on_thumb']) && $settings['show_username_on_thumb'] == '1'){
243
+ $settings['show_username_on_thumb'] = '0';
244
+ }
245
+
246
+ if(isset($settings['conditional_filter_enable']) && $settings['conditional_filter_enable'] == '1'){
247
+ $settings['conditional_filter_enable'] = '0';
248
+ }
249
+
250
  if(isset($settings['popup_filmstrip_height']) && $settings['popup_filmstrip_height'] != '70'){
251
  $settings['popup_filmstrip_height'] = '70';
252
  }
admin/models/WDIModelThemes_wdi.php CHANGED
@@ -93,7 +93,7 @@ class WDIModelThemes_wdi {
93
  'user_horizontal_margin' => '',//*
94
  'user_border_size' => '0px',//*
95
  'user_border_color' => '',//*
96
- 'user_img_width' => '40',//enabled
97
 
98
  'user_border_radius' => '0',//enabled
99
  'user_background_color' => '',//*
@@ -233,6 +233,8 @@ class WDIModelThemes_wdi {
233
  'th_overlay_hover_transparent'=>'50',
234
  'th_overlay_hover_icon_color'=>'#FFFFFF',
235
  'th_overlay_hover_icon_font_size'=>'25px',
 
 
236
  //////////////////////////////////////////////////////////
237
  'mas_photo_wrap_padding' => '10px',
238
  'mas_photo_wrap_border_size' => '0px',
@@ -252,7 +254,8 @@ class WDIModelThemes_wdi {
252
  'mas_overlay_hover_transparent'=>'50',
253
  'mas_overlay_hover_icon_color'=>'#FFFFFF',
254
  'mas_overlay_hover_icon_font_size'=>'25px',
255
-
 
256
  /////////////////////////////////////////////////////////
257
  //////////////////////////////////////////////////////////
258
  'blog_style_photo_wrap_padding' => '10px',
@@ -483,7 +486,8 @@ class WDIModelThemes_wdi {
483
  'th_overlay_hover_transparent'=>'number',
484
  'th_overlay_hover_icon_color'=>'color',
485
  'th_overlay_hover_icon_font_size'=>'length',
486
-
 
487
  /////////////////////////////////////////////////////////
488
  'mas_photo_wrap_padding' => 'length',
489
  'mas_photo_wrap_border_size' => 'length',
@@ -503,6 +507,8 @@ class WDIModelThemes_wdi {
503
  'mas_overlay_hover_transparent'=>'number',
504
  'mas_overlay_hover_icon_color'=>'color',
505
  'mas_overlay_hover_icon_font_size'=>'length',
 
 
506
  /////////////////////////////////////////////////
507
 
508
  'blog_style_photo_wrap_padding' => 'length',
93
  'user_horizontal_margin' => '',//*
94
  'user_border_size' => '0px',//*
95
  'user_border_color' => '',//*
96
+ 'user_img_width' => '40px',//enabled
97
 
98
  'user_border_radius' => '0',//enabled
99
  'user_background_color' => '',//*
233
  'th_overlay_hover_transparent'=>'50',
234
  'th_overlay_hover_icon_color'=>'#FFFFFF',
235
  'th_overlay_hover_icon_font_size'=>'25px',
236
+ 'th_thumb_user_bg_color'=>'#429FFF',
237
+ 'th_thumb_user_color'=>'#FFFFFF',
238
  //////////////////////////////////////////////////////////
239
  'mas_photo_wrap_padding' => '10px',
240
  'mas_photo_wrap_border_size' => '0px',
254
  'mas_overlay_hover_transparent'=>'50',
255
  'mas_overlay_hover_icon_color'=>'#FFFFFF',
256
  'mas_overlay_hover_icon_font_size'=>'25px',
257
+ 'mas_thumb_user_bg_color'=>'#429FFF',
258
+ 'mas_thumb_user_color'=>'#FFFFFF',
259
  /////////////////////////////////////////////////////////
260
  //////////////////////////////////////////////////////////
261
  'blog_style_photo_wrap_padding' => '10px',
486
  'th_overlay_hover_transparent'=>'number',
487
  'th_overlay_hover_icon_color'=>'color',
488
  'th_overlay_hover_icon_font_size'=>'length',
489
+ 'th_thumb_user_bg_color'=>'color',
490
+ 'th_thumb_user_color'=>'color',
491
  /////////////////////////////////////////////////////////
492
  'mas_photo_wrap_padding' => 'length',
493
  'mas_photo_wrap_border_size' => 'length',
507
  'mas_overlay_hover_transparent'=>'number',
508
  'mas_overlay_hover_icon_color'=>'color',
509
  'mas_overlay_hover_icon_font_size'=>'length',
510
+ 'mas_thumb_user_bg_color'=>'color',
511
+ 'mas_thumb_user_color'=>'color',
512
  /////////////////////////////////////////////////
513
 
514
  'blog_style_photo_wrap_padding' => 'length',
admin/views/WDIViewFeeds_wdi.php CHANGED
@@ -182,6 +182,8 @@ class WDIViewFeeds_wdi {
182
  });</script>
183
  <?php
184
  }else{
 
 
185
  $current_id = $type;
186
  $feed_row= $this->model->get_feed_row($current_id);
187
  $view_id = $feed_row->feed_type;
@@ -224,6 +226,7 @@ public function getFormElements($current_id=''){
224
  'show_likes' => array('switched'=>'off','name'=>'show_likes','title'=>__('Show Likes',"wdi"),'type'=>'checkbox','label'=>array('place'=>'after','class'=>'wdi_pro_only','text'=>__("This Feature is Available Only in PRO version","wdi"),'br'=>'true'),'tooltip'=>'','attr'=>array(array('name'=>'tab','value'=>'feed_settings'),array('name'=>'section','value'=>'thumbnails,masonry,blog_style,image_browser'))),
225
  'show_description' => array('switched'=>'off','name'=>'show_description','title'=>__('Show Description',"wdi"),'type'=>'checkbox','label'=>array('place'=>'after','class'=>'wdi_pro_only','text'=>__("This Feature is Available Only in PRO version","wdi"),'br'=>'true'),'tooltip'=>'','attr'=>array(array('name'=>'tab','value'=>'feed_settings'),array('name'=>'section','value'=>'thumbnails,masonry,blog_style,image_browser'))),
226
  'show_comments' => array('switched'=>'off','name'=>'show_comments','title'=>__('Show Comments',"wdi"),'type'=>'checkbox','label'=>array('place'=>'after','class'=>'wdi_pro_only','text'=>__("This Feature is Available Only in PRO version","wdi"),'br'=>'true'),'tooltip'=>'','attr'=>array(array('name'=>'tab','value'=>'feed_settings'),array('name'=>'section','value'=>'thumbnails,masonry,blog_style,image_browser'))),
 
227
  'show_usernames' => array('name'=>'show_usernames','title'=>__('Show User Data',"wdi"),'type'=>'checkbox','tooltip'=>'','attr'=>array(array('name'=>'tab','value'=>'feed_settings'),array('name'=>'section','value'=>'thumbnails,masonry,blog_style,image_browser'))),
228
  'display_user_info' => array('name'=>'display_user_info','title'=>__('Display User Bio',"wdi"),'type'=>'checkbox','tooltip'=>__('User bio will be displayed if feed has only one user',"wdi"),'attr'=>array(array('name'=>'tab','value'=>'feed_settings'),array('name'=>'section','value'=>'thumbnails,masonry,blog_style,image_browser'))),
229
  'display_user_post_follow_number' => array('name'=>'display_user_post_follow_number','title'=>__('Display User Posts and Followers count',"wdi"),'type'=>'checkbox','tooltip'=>'','attr'=>array(array('name'=>'tab','value'=>'feed_settings'),array('name'=>'section','value'=>'thumbnails,masonry,blog_style,image_browser'))),
@@ -258,7 +261,9 @@ public function getFormElements($current_id=''){
258
  'popup_enable_tumblr' => array('status'=>'disabled','name'=>'popup_enable_tumblr','title'=>__('Enable Tumblr button',"wdi"),'type'=>'radio','valid_options'=>array('1'=>__('Yes',"wdi"),'0'=>__('No',"wdi")),'tooltip'=>'','attr'=>array(array('name'=>'tab','value'=>'lightbox_settings'))),
259
  'show_image_counts' => array('status'=>'disabled','name'=>'show_image_counts','title'=>__('Show Images Count',"wdi"),'type'=>'radio','valid_options'=>array('1'=>__('Yes',"wdi"),'0'=>__('No',"wdi")),'tooltip'=>'','attr'=>array(array('name'=>'tab','value'=>'lightbox_settings'))),
260
 
261
-
 
 
262
  );
263
  $return = array('elements'=>$elements,'current_id'=>$current_id);
264
  return $return;
@@ -298,6 +303,7 @@ public function generateTabs(){
298
  <div id="wdi_feed_tabs">
299
  <div class="wdi_feed_tabs" id="wdi_feed_settings" onclick="wdi_controller.switchFeedTabs('feed_settings');"><?php _e('Feed Settings',"wdi")?></div>
300
  <div class="wdi_feed_tabs" id="wdi_lightbox_settings" onclick="wdi_controller.switchFeedTabs('lightbox_settings');"><?php _e('Lightbox Settings',"wdi")?></div>
 
301
  <br class="clear">
302
  </div>
303
  <?php
@@ -351,6 +357,7 @@ public function generateForm($current_id = ''){
351
  <input type="hidden" id="wdi_add_or_edit" name="add_or_edit" value="<?php echo $current_id;?>">
352
  <input type="hidden" id="wdi_thumb_user" value="<?php echo isset($feed_row['thumb_user'])?$feed_row['thumb_user']:$wdi_options['wdi_user_name'];?>">
353
  <input type="hidden" id="wdi_default_user" value="<?php echo $wdi_options['wdi_user_name'];?>">
 
354
  <input type="hidden" name="<?php echo WDI_FSN.'[published]'?>" value="<?php echo isset($feed_row['published'])?$feed_row['published']: '1';?>">
355
  <input type="hidden" id="wdi_current_id" name="current_id" value=''>
356
  <input type="hidden" id="wdi_refresh_tab" name="wdi_refresh_tab">
@@ -358,23 +365,44 @@ public function generateForm($current_id = ''){
358
  <tbody>
359
  <?php
360
  foreach ($elements as $element) {
 
 
 
 
 
 
 
 
 
 
 
 
361
  if(isset($element['status'])){
362
  if($element['status'] == 'disabled'){
363
  continue;
364
  }
365
  }
366
- ?><tr>
 
 
 
 
 
367
  <th scope="row"><a href="#" <?php echo ($element['tooltip']!='' && isset($element['tooltip'])) ? 'class="wdi_tooltip" wdi-tooltip="'.$element['tooltip'].'"' : 'class="wdi_settings_link"'; ?> ><?php echo $element['title'];?></a></th>
368
- <td><?php $this->buildField($element,$feed_row);?>
369
- <?php if($element['name']=='feed_users'){
370
- ?>
371
- <input type="text" id="wdi_add_user_ajax_input">
372
- <div id="wdi_add_user_ajax" class="button"><?php _e('Add', "wdi"); ?></div>
373
- <div id="wdi_feed_users">
374
- <?php $this->display_feed_users($feed_row);?>
375
- </div>
376
- <?php
377
- }?>
 
 
 
 
378
 
379
  </td>
380
  </tr><?php
@@ -419,13 +447,34 @@ private function buildField($element,$feed_row=''){
419
  }
420
 
421
 
422
- public function display_feed_users($feed_row){
423
- $users = isset($feed_row['feed_users'])?$feed_row['feed_users']:"";
424
- $users = explode(',', $users);
425
- foreach ($users as $user) {
426
- ?><script>wdi_controller.requestUserData(<?php echo '"'.$user.'"'?>);</script><?php
 
 
 
427
  }
428
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
429
 
430
 
431
  }
182
  });</script>
183
  <?php
184
  }else{
185
+ global $wdi_new_feed;
186
+ $wdi_new_feed = true;
187
  $current_id = $type;
188
  $feed_row= $this->model->get_feed_row($current_id);
189
  $view_id = $feed_row->feed_type;
226
  'show_likes' => array('switched'=>'off','name'=>'show_likes','title'=>__('Show Likes',"wdi"),'type'=>'checkbox','label'=>array('place'=>'after','class'=>'wdi_pro_only','text'=>__("This Feature is Available Only in PRO version","wdi"),'br'=>'true'),'tooltip'=>'','attr'=>array(array('name'=>'tab','value'=>'feed_settings'),array('name'=>'section','value'=>'thumbnails,masonry,blog_style,image_browser'))),
227
  'show_description' => array('switched'=>'off','name'=>'show_description','title'=>__('Show Description',"wdi"),'type'=>'checkbox','label'=>array('place'=>'after','class'=>'wdi_pro_only','text'=>__("This Feature is Available Only in PRO version","wdi"),'br'=>'true'),'tooltip'=>'','attr'=>array(array('name'=>'tab','value'=>'feed_settings'),array('name'=>'section','value'=>'thumbnails,masonry,blog_style,image_browser'))),
228
  'show_comments' => array('switched'=>'off','name'=>'show_comments','title'=>__('Show Comments',"wdi"),'type'=>'checkbox','label'=>array('place'=>'after','class'=>'wdi_pro_only','text'=>__("This Feature is Available Only in PRO version","wdi"),'br'=>'true'),'tooltip'=>'','attr'=>array(array('name'=>'tab','value'=>'feed_settings'),array('name'=>'section','value'=>'thumbnails,masonry,blog_style,image_browser'))),
229
+ 'show_username_on_thumb' => array('switched'=>'off','name'=>'show_username_on_thumb','title'=>__('Show Username On Image Thumb',"wdi"),'type'=>'checkbox','label'=>array('place'=>'after','class'=>'wdi_pro_only','text'=>__("This Feature is Available Only in PRO version","wdi"),'br'=>'true'),'tooltip'=>'','attr'=>array(array('name'=>'tab','value'=>'feed_settings'),array('name'=>'section','value'=>'thumbnails,masonry'))),
230
  'show_usernames' => array('name'=>'show_usernames','title'=>__('Show User Data',"wdi"),'type'=>'checkbox','tooltip'=>'','attr'=>array(array('name'=>'tab','value'=>'feed_settings'),array('name'=>'section','value'=>'thumbnails,masonry,blog_style,image_browser'))),
231
  'display_user_info' => array('name'=>'display_user_info','title'=>__('Display User Bio',"wdi"),'type'=>'checkbox','tooltip'=>__('User bio will be displayed if feed has only one user',"wdi"),'attr'=>array(array('name'=>'tab','value'=>'feed_settings'),array('name'=>'section','value'=>'thumbnails,masonry,blog_style,image_browser'))),
232
  'display_user_post_follow_number' => array('name'=>'display_user_post_follow_number','title'=>__('Display User Posts and Followers count',"wdi"),'type'=>'checkbox','tooltip'=>'','attr'=>array(array('name'=>'tab','value'=>'feed_settings'),array('name'=>'section','value'=>'thumbnails,masonry,blog_style,image_browser'))),
261
  'popup_enable_tumblr' => array('status'=>'disabled','name'=>'popup_enable_tumblr','title'=>__('Enable Tumblr button',"wdi"),'type'=>'radio','valid_options'=>array('1'=>__('Yes',"wdi"),'0'=>__('No',"wdi")),'tooltip'=>'','attr'=>array(array('name'=>'tab','value'=>'lightbox_settings'))),
262
  'show_image_counts' => array('status'=>'disabled','name'=>'show_image_counts','title'=>__('Show Images Count',"wdi"),'type'=>'radio','valid_options'=>array('1'=>__('Yes',"wdi"),'0'=>__('No',"wdi")),'tooltip'=>'','attr'=>array(array('name'=>'tab','value'=>'lightbox_settings'))),
263
 
264
+ //filters
265
+ 'conditional_filter_enable' => array('name'=>'conditional_filter_enable','title'=>__('Enable Conditional Filters',"wdi"),'type'=>'radio','valid_options'=>array('1'=>__('Yes',"wdi"),'0'=>__('No',"wdi")),'tooltip'=>'','attr'=>array(array('name'=>'tab','value'=>'conditional_filters'))),
266
+ 'conditional_filter_type' => array('name'=>'conditional_filter_type','title'=>__('Filter Logic',"wdi"),'type'=>'select','label'=>array('text'=>'','place'=>'after'),'valid_options'=>array('AND'=>'AND','OR'=>'OR','NOR'=>'NOR'),'tooltip'=>'','attr'=>array(array('name'=>'tab','value'=>'conditional_filters'))),
267
  );
268
  $return = array('elements'=>$elements,'current_id'=>$current_id);
269
  return $return;
303
  <div id="wdi_feed_tabs">
304
  <div class="wdi_feed_tabs" id="wdi_feed_settings" onclick="wdi_controller.switchFeedTabs('feed_settings');"><?php _e('Feed Settings',"wdi")?></div>
305
  <div class="wdi_feed_tabs" id="wdi_lightbox_settings" onclick="wdi_controller.switchFeedTabs('lightbox_settings');"><?php _e('Lightbox Settings',"wdi")?></div>
306
+ <div class="wdi_feed_tabs" id="wdi_conditional_filters" onclick="wdi_controller.switchFeedTabs('conditional_filters');"><?php _e('Conditional Filters',"wdi")?></div>
307
  <br class="clear">
308
  </div>
309
  <?php
357
  <input type="hidden" id="wdi_add_or_edit" name="add_or_edit" value="<?php echo $current_id;?>">
358
  <input type="hidden" id="wdi_thumb_user" value="<?php echo isset($feed_row['thumb_user'])?$feed_row['thumb_user']:$wdi_options['wdi_user_name'];?>">
359
  <input type="hidden" id="wdi_default_user" value="<?php echo $wdi_options['wdi_user_name'];?>">
360
+ <input type="hidden" id="wdi_default_user_id" value="<?php echo $wdi_options['wdi_user_id'];?>">
361
  <input type="hidden" name="<?php echo WDI_FSN.'[published]'?>" value="<?php echo isset($feed_row['published'])?$feed_row['published']: '1';?>">
362
  <input type="hidden" id="wdi_current_id" name="current_id" value=''>
363
  <input type="hidden" id="wdi_refresh_tab" name="wdi_refresh_tab">
365
  <tbody>
366
  <?php
367
  foreach ($elements as $element) {
368
+ if( $element['name'] == 'conditional_filter_enable' ){ continue; }
369
+
370
+ if( $element['name'] == 'conditional_filter_type' ){
371
+ ?>
372
+
373
+ <div id="wdi-conditional-filters-ui" class="wdi_demo_img">
374
+ <div class="wdi_pro_notice"> <?php _e("This is FREE version, Conditional filters are available only in PRO version","wdi"); ?> </div>
375
+ <div class="wdi-pro-overlay"> <img src="<?php echo WDI_URL . '/demo_images/filters.png'; ?>" alt=""></div>
376
+ </div><?php
377
+ continue;
378
+ }
379
+
380
  if(isset($element['status'])){
381
  if($element['status'] == 'disabled'){
382
  continue;
383
  }
384
  }
385
+ ?>
386
+
387
+
388
+
389
+
390
+ <tr>
391
  <th scope="row"><a href="#" <?php echo ($element['tooltip']!='' && isset($element['tooltip'])) ? 'class="wdi_tooltip" wdi-tooltip="'.$element['tooltip'].'"' : 'class="wdi_settings_link"'; ?> ><?php echo $element['title'];?></a></th>
392
+ <td>
393
+
394
+ <?php $this->buildField($element,$feed_row);?>
395
+ <!-- FEED USERS -->
396
+ <?php if($element['name']=='feed_users'):?>
397
+ <input type="text" id="wdi_add_user_ajax_input">
398
+ <div id="wdi_add_user_ajax" class="button"><?php _e('Add', "wdi"); ?></div>
399
+ <div id="wdi_feed_users">
400
+ <?php $this->display_feed_users($feed_row);?>
401
+ </div>
402
+ <?php endif; ?>
403
+ <!-- END FEED USERS -->
404
+
405
+
406
 
407
  </td>
408
  </tr><?php
447
  }
448
 
449
 
450
+ public function display_feed_users($feed_row){
451
+ global $wdi_options;
452
+
453
+ $users = isset($feed_row['feed_users']) ? $feed_row['feed_users']: "";
454
+
455
+ $users = json_decode($users);
456
+ if($users === null){
457
+ $users = array();
458
  }
459
+
460
+
461
+
462
+ ?>
463
+ <script>
464
+ wdi_controller.instagram = new WDIInstagram();
465
+ wdi_controller.feed_users = [];
466
+ wdi_controller.instagram.addToken(<?php echo '"'.$wdi_options['wdi_access_token'].'"'; ?>);
467
+ jQuery(document).ready(function(){
468
+ wdi_controller.updateFeaturedImageSelect(<?php echo '"'.$wdi_options['wdi_user_name'].'"'; ?>,'add','selected');
469
+ });
470
+ <?php foreach ($users as $user) : ?>
471
+ wdi_controller.makeInstagramUserRequest(<?php echo '"'.$user->username.'"'?>,true);
472
+ <?php endforeach; ?>
473
+
474
+ </script>
475
+ <?php
476
+
477
+ }
478
 
479
 
480
  }
admin/views/WDIViewLicensing_wdi.php CHANGED
@@ -39,6 +39,7 @@ class WDIViewLicensing_wdi {
39
  <span><?php _e("Slideshow/Lightbox Effects", 'wdi'); ?></span>
40
 
41
 
 
42
  <span><?php _e("Infinite Scroll Load More", 'wdi'); ?></span>
43
  <span><?php _e("Full Style Customization With Themes", 'wdi'); ?></span>
44
  <span><?php _e("Filmstrip", 'wdi'); ?></span>
@@ -74,6 +75,7 @@ class WDIViewLicensing_wdi {
74
  <span class="no"></span>
75
  <span class="no"></span>
76
  <span class="no"></span>
 
77
  <span> <?php _e('Only Bug Fixes',"wdi"); ?> </span>
78
  </div>
79
  <div id="featurs_table3">
@@ -99,6 +101,7 @@ class WDIViewLicensing_wdi {
99
  <span class="yes"></span>
100
  <span class="yes"></span>
101
  <span class="yes"></span>
 
102
  <span> <?php _e('Full Support',"wdi"); ?> </span>
103
  </div>
104
 
39
  <span><?php _e("Slideshow/Lightbox Effects", 'wdi'); ?></span>
40
 
41
 
42
+ <span><?php _e("Conditional Filters", 'wdi'); ?></span>
43
  <span><?php _e("Infinite Scroll Load More", 'wdi'); ?></span>
44
  <span><?php _e("Full Style Customization With Themes", 'wdi'); ?></span>
45
  <span><?php _e("Filmstrip", 'wdi'); ?></span>
75
  <span class="no"></span>
76
  <span class="no"></span>
77
  <span class="no"></span>
78
+ <span class="no"></span>
79
  <span> <?php _e('Only Bug Fixes',"wdi"); ?> </span>
80
  </div>
81
  <div id="featurs_table3">
101
  <span class="yes"></span>
102
  <span class="yes"></span>
103
  <span class="yes"></span>
104
+ <span class="yes"></span>
105
  <span> <?php _e('Full Support',"wdi"); ?> </span>
106
  </div>
107
 
admin/views/WDIViewSettings_wdi.php CHANGED
@@ -18,6 +18,7 @@ private $model;
18
  if(isset($_GET['access_token'])) {
19
  ?>
20
  <script>
 
21
  if(wdi_controller.getCookie('wdi_autofill') != 'false'){
22
  wdi_controller.apiRedirected();
23
  document.cookie = "wdi_autofill=false";
@@ -48,7 +49,7 @@ private $model;
48
 
49
  <h1 id="settings_wdi_title"><?php _e('Instagram WD Settings', "wdi"); ?></h1>
50
  <form method="post" action="options.php">
51
-
52
  <?php settings_fields('wdi_all_settings'); ?>
53
  <?php do_settings_sections('settings_wdi'); ?>
54
  <div id="wdi_reset_access_token" class="button button-secondary"><?php _e("Reset Access Token and Username","wdi")?></div>
18
  if(isset($_GET['access_token'])) {
19
  ?>
20
  <script>
21
+ wdi_controller.instagram = new WDIInstagram();
22
  if(wdi_controller.getCookie('wdi_autofill') != 'false'){
23
  wdi_controller.apiRedirected();
24
  document.cookie = "wdi_autofill=false";
49
 
50
  <h1 id="settings_wdi_title"><?php _e('Instagram WD Settings', "wdi"); ?></h1>
51
  <form method="post" action="options.php">
52
+ <input type="hidden"id="wdi_user_id" name="<?php echo WDI_OPT.'[wdi_user_id]' ?>">
53
  <?php settings_fields('wdi_all_settings'); ?>
54
  <?php do_settings_sections('settings_wdi'); ?>
55
  <div id="wdi_reset_access_token" class="button button-secondary"><?php _e("Reset Access Token and Username","wdi")?></div>
admin/views/WDIViewUninstall_wdi.php CHANGED
@@ -61,7 +61,7 @@ public function display(){
61
  <?php
62
  }
63
  public function already_uninstalled(){
64
- $deactivate_url = wp_nonce_url('plugins.php?action=deactivate&amp;plugin=wd-instagram-feed/instagram-wd.php', 'deactivate-plugin_wd-instagram-feed/instagram-wd.php');
65
  ?>
66
  <span class="uninstall-icon"></span>
67
  <h2>
@@ -73,7 +73,7 @@ public function display(){
73
  }
74
  public function successfully_uninstalled(){
75
  global $wpdb;
76
- $deactivate_url = wp_nonce_url('plugins.php?action=deactivate&amp;plugin=wd-instagram-feed/instagram-wd.php', 'deactivate-plugin_wd-instagram-feed/instagram-wd.php');
77
  ?>
78
  <span class="uninstall-icon"></span>
79
  <h2>
61
  <?php
62
  }
63
  public function already_uninstalled(){
64
+ $deactivate_url = wp_nonce_url('plugins.php?action=deactivate&amp;plugin=wd-instagram-feed/wd-instagram-feed.php', 'deactivate-plugin_wd-instagram-feed/wd-instagram-feed.php');
65
  ?>
66
  <span class="uninstall-icon"></span>
67
  <h2>
73
  }
74
  public function successfully_uninstalled(){
75
  global $wpdb;
76
+ $deactivate_url = wp_nonce_url('plugins.php?action=deactivate&amp;plugin=wd-instagram-feed/wd-instagram-feed.php', 'deactivate-plugin_wd-instagram-feed/wd-instagram-feed.php');
77
  ?>
78
  <span class="uninstall-icon"></span>
79
  <h2>
css/wdi_backend.css CHANGED
@@ -55,7 +55,7 @@ background-image: -o-linear-gradient(top, #eeeeee, #cccccc);
55
  .wdi_pro_only{
56
  font-style: italic;
57
  color: #4E4E4E !important;
58
- background-color: #cccccc;
59
  text-decoration: none;
60
  }
61
  .wdi_pro_only_op{
@@ -64,13 +64,16 @@ background-image: -o-linear-gradient(top, #eeeeee, #cccccc);
64
  .wdi_pro_notice{
65
  text-align: right;
66
  color: #15699F;
67
- font-size: 20px;
68
  padding: 10px;
69
  }
70
  .wdi_pro_only_btn{
71
  background-color: #c5c0c0 !important;
72
  border-top-color: #c5c0c0 !important;
73
  }
 
 
 
74
 
75
 
76
 
@@ -216,4 +219,122 @@ padding: 5px;
216
 
217
  .wdi_hide{
218
  display: none;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
219
  }
55
  .wdi_pro_only{
56
  font-style: italic;
57
  color: #4E4E4E !important;
58
+ background-color: #cccccc !important;
59
  text-decoration: none;
60
  }
61
  .wdi_pro_only_op{
64
  .wdi_pro_notice{
65
  text-align: right;
66
  color: #15699F;
67
+ font-size: 20px !important;
68
  padding: 10px;
69
  }
70
  .wdi_pro_only_btn{
71
  background-color: #c5c0c0 !important;
72
  border-top-color: #c5c0c0 !important;
73
  }
74
+ .wdi-pro-overlay img{
75
+ opacity: 0.7;
76
+ }
77
 
78
 
79
 
219
 
220
  .wdi_hide{
221
  display: none;
222
+ }
223
+
224
+
225
+ /*---------------------------------------------------------
226
+ ------------------Conditional Filters Ui-------------------
227
+ ---------------------------------------------------------*/
228
+ .wdi_hidden{
229
+ display: none !important;
230
+ }
231
+ .selectoff{
232
+ -webkit-user-select: none; /* Chrome/Safari */
233
+ -moz-user-select: none; /* Firefox */
234
+ -ms-user-select: none; /* IE10+ */
235
+
236
+ /* Rules below not implemented in browsers yet */
237
+ -o-user-select: none;
238
+ user-select: none;
239
+ }
240
+ .wdi_filter_radio {
241
+ margin: 5px;
242
+ display: inline-block;
243
+ }
244
+
245
+ .wdi_filter_radio label {
246
+ vertical-align: text-bottom;
247
+ }
248
+
249
+ .wdi_filter_input {
250
+ margin-top: 10px;
251
+ }
252
+
253
+ .wdi_filter_input input {
254
+ height: 28px;
255
+ width: 250px;
256
+ margin-right: 0;
257
+ padding-right: 0;
258
+ line-height: 28px;
259
+ }
260
+ #wdi_filter_type{
261
+ line-height: 28px;
262
+ margin: 0;
263
+ padding: 0;
264
+ position: relative;
265
+ right: 2px;
266
+ top: -1px;
267
+ font-weight: 400;
268
+ }
269
+ .wdi_filter_item {
270
+ display: inline-block;
271
+ padding: 6px;
272
+ margin-top: 5px;
273
+ border-radius: 5px;
274
+ }
275
+
276
+ .wdi_filter_by_username {
277
+ background-color: #00A0D2;
278
+ color: white;
279
+ }
280
+
281
+ .wdi_filter_by_hashtag {
282
+ background-color: #E08D11;
283
+ color: white;
284
+ }
285
+ .wdi_logic{
286
+ display: inline-block;
287
+ padding: 5px;
288
+ font-weight: bold;
289
+ }
290
+ .wdi_filter_by_location {
291
+ background-color: #509833;
292
+ color: white;
293
+ }
294
+
295
+ .wdi_filter_by_mention {
296
+ background-color: #833888;
297
+ color: white;
298
+ }
299
+
300
+ .wdi_filter_by_description {
301
+ background-color: #BD242B;
302
+ color: white;
303
+ }
304
+ .wdi_filter_by_url {
305
+ background-color: #004EFF;
306
+ color: white;
307
+ }
308
+
309
+ .wdi_remove_filter{
310
+ padding-left: 5px;
311
+ color: white;
312
+ font-size: 13px;
313
+ }
314
+ .wdi_remove_filter:hover{
315
+ cursor: pointer;
316
+ }
317
+
318
+
319
+ .wdi_source_user{
320
+ display: inline-block;
321
+ padding: 5px;
322
+ }
323
+ .wdi_source_img{
324
+ display: inline-block;
325
+ }
326
+ .wdi_source_img img{
327
+ width: 30px;
328
+ height: 30px;
329
+ border-radius: 15px;
330
+ display: block;
331
+ }
332
+ .wdi_source_username{
333
+ display: inline-block;
334
+ line-height: 25px;
335
+ font-size: 15px !important;
336
+ height: 30px;
337
+ vertical-align: bottom;
338
+ padding: 0 5px;
339
+ font-weight: bold;
340
  }
demo_images/filters.png ADDED
Binary file
framework/WDILibraryEmbed.php CHANGED
@@ -882,6 +882,57 @@ class WDILibraryEmbed {
882
  $autoupdate_interval = $row->autoupdate_interval;
883
  return $autoupdate_interval;
884
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
885
  ////////////////////////////////////////////////////////////////////////////////////////
886
  // Private Methods //
887
  ////////////////////////////////////////////////////////////////////////////////////////
882
  $autoupdate_interval = $row->autoupdate_interval;
883
  return $autoupdate_interval;
884
  }
885
+
886
+
887
+
888
+
889
+
890
+
891
+ /**
892
+ * @return user id by username
893
+ * @return flase on failure
894
+ */
895
+ public static function get_instagram_id_by_username($instagram_user) {
896
+
897
+ $instagram_user_response = wp_remote_get('https://api.instagram.com/v1/users/search?q=' . $instagram_user . '&access_token=2276055961.145c5c2.c37b17e530f245a29716f748137c84a9');
898
+ if ( is_wp_error( $instagram_user_response ) ) {
899
+ return false;
900
+ }
901
+ $user_json = wp_remote_retrieve_body($instagram_user_response);
902
+ $response_code = json_decode($user_json)->meta->code;
903
+
904
+ /*
905
+ instagram API returns
906
+
907
+ *wrong username
908
+ {"meta":{"code":200},"data":[]}
909
+
910
+ *wrong client_id
911
+ {"meta":{"error_type":"OAuthParameterException","code":400,"error_message":"The client_id provided is invalid and does not match a valid application."}}
912
+
913
+ */
914
+
915
+ if($response_code != 200){
916
+ return false;
917
+ }
918
+
919
+
920
+ if(!property_exists(json_decode($user_json), 'data')){
921
+ return false;
922
+ }
923
+ if(empty(json_decode($user_json)->data)){
924
+ return false;
925
+ }
926
+ $user_data = json_decode($user_json)->data[0];
927
+ $user_id = $user_data->id;
928
+
929
+ return $user_id;
930
+
931
+ }
932
+
933
+
934
+
935
+
936
  ////////////////////////////////////////////////////////////////////////////////////////
937
  // Private Methods //
938
  ////////////////////////////////////////////////////////////////////////////////////////
frontend/shortcode.php CHANGED
@@ -116,7 +116,10 @@ function wdi_feed($atts,$widget_params='') {
116
 
117
  function wdi_load_frontend_scripts(){
118
 
119
- wp_enqueue_script('wdi_frontend',plugins_url('../js/wdi_frontend.js', __FILE__),array("jquery"), WDI_VERSION);
 
 
 
120
  wp_enqueue_script('wdi_responsive',plugins_url('../js/wdi_responsive.js', __FILE__),array("jquery"), WDI_VERSION);
121
  wp_localize_script("wdi_frontend", 'wdi_ajax',array( 'ajax_url' => admin_url( 'admin-ajax.php' )), WDI_VERSION);
122
  wp_localize_script("wdi_frontend", 'wdi_url',array('plugin_url'=>plugin_dir_url(__FILE__),
116
 
117
  function wdi_load_frontend_scripts(){
118
 
119
+ wp_enqueue_script('wdi_instagram',plugins_url('../js/wdi_instagram.js', __FILE__),array("jquery"), WDI_VERSION );
120
+
121
+ wp_enqueue_script('wdi_frontend',plugins_url('../js/wdi_frontend.js', __FILE__),array("jquery",'wdi_instagram'), WDI_VERSION);
122
+
123
  wp_enqueue_script('wdi_responsive',plugins_url('../js/wdi_responsive.js', __FILE__),array("jquery"), WDI_VERSION);
124
  wp_localize_script("wdi_frontend", 'wdi_ajax',array( 'ajax_url' => admin_url( 'admin-ajax.php' )), WDI_VERSION);
125
  wp_localize_script("wdi_frontend", 'wdi_url',array('plugin_url'=>plugin_dir_url(__FILE__),
js/wdi_admin.js CHANGED
@@ -1,75 +1,80 @@
1
- jQuery(document).ready(function(){
2
- wdi_controller.bindUnistallEvent();
 
3
 
4
  /*Feeds page*/
5
  wdi_controller.bindSaveFeedEvent();
6
  wdi_controller.bindAddNewUserOrHashtagEvent();
7
- jQuery('.display_type input').on('click',function(){
8
- wdi_controller.displaySettingsSection(jQuery(this));
9
- });
 
 
10
  /*Themes page*/
11
  wdi_controller.bindSaveThemeEvent();
12
 
 
 
13
 
14
- jQuery('#wdi_add_user_ajax').after(jQuery("<br><label class='wdi_pro_only' for='wdi_add_user_ajax_input'>"+wdi_messages.username_hashtag_multiple+"</label>"));
15
  });
16
- function wdi_controller(){};
17
- wdi_controller.bindUnistallEvent = function (){
18
- jQuery('#wdi_unistall').on('click',function(){
19
- var wdi_confirm = confirm(wdi_messages.uninstall_confirm);
20
- if (wdi_confirm === true){
21
- jQuery.ajax({
22
- type: 'POST',
23
- url: wdi_ajax.uninstall_url,
24
- dataType: 'html',
25
- data: {
26
- action: 'wdiUninstallPlugin'
27
- },
28
- success: function(response){
29
- $msg = response;
30
- jQuery('#settings_wdi_title').after($msg);
31
- window.location = wdi_admin.admin_url + 'plugins.php#instagram-feed-wd';
32
- }
33
- });
34
- }
35
- });
36
- }
37
 
38
- wdi_getParameterByName = function(name){
 
 
 
 
 
 
 
39
  name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
40
- var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
41
- results = regex.exec(location.search);
42
- return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
43
  }
44
- wdi_controller.apiRedirected = function(){
45
- var access_token_raw = wdi_getParameterByName('access_token');
 
 
 
 
 
46
  var arr = access_token_raw.split('.');
47
  var validRegEx = /^[^\\\/&?><"']*$/;
48
- for(i=0;i<arr.length;i++){
49
- if(arr[i].match(validRegEx) === null){return;}
 
 
50
  }
51
  var access_token = arr.join('.');
52
- jQuery(document).ready(function(){jQuery('#wdi_access_token').attr('value',access_token);});
 
 
 
 
 
53
  wdi_controller.getUserInfo(access_token);
54
  }
55
 
56
- function wdi_NumAndTwoDecimals(e , field) {
57
-
58
- }
59
 
60
- wdi_controller.getUserInfo = function(access_token){
61
- jQuery.ajax({
62
- type: 'GET',
63
- url : 'https://api.instagram.com/v1/users/self/?access_token=' + access_token,
64
- dataType:'jsonp',
65
- success: function(response){
66
- jQuery('#wdi_user_name').attr('value',response['data']['username']);
 
 
 
 
 
67
  jQuery(document).trigger('wdi_settings_filled');
68
  }
69
  })
70
  }
71
 
72
 
 
73
  wdi_controller.oldDisplayType = {};
74
  wdi_controller.displayTypeMemory = {};
75
 
@@ -77,505 +82,485 @@ wdi_controller.displayTypeMemory = {};
77
  /*
78
  * Switches between feeds admin page tabs
79
  */
80
- wdi_controller.switchFeedTabs = function(tabname,section){
81
-
82
  //add tabname in hidden field
83
- jQuery('#wdi_refresh_tab').attr('value',tabname);
84
 
85
  //hiding options of other tabs
86
- jQuery('[tab]').each(function(){
87
- if(jQuery(this).attr('tab') != tabname){
88
- jQuery(this).parent().parent().parent().parent().parent().filter('tr').css('display','none');
89
- }else{
90
- jQuery(this).parent().parent().parent().parent().parent().filter('tr').css('display','block');
91
- }
92
  });
93
  //hiding all display_type elements
94
- jQuery('.display_type').css('display','none');
95
  //showing only requested display_type tab elements
96
- jQuery('.display_type[tab="'+tabname+'"]').css('display','block');
97
 
98
  //swap active tab class
99
- jQuery('.wdi_feed_tabs').filter('.wdi_feed_tab_active').each(function(){jQuery(this).removeClass('wdi_feed_tab_active');});
100
- jQuery('#wdi_'+tabname).addClass('wdi_feed_tab_active');
 
 
101
  var selectedSection = jQuery();
102
  var sectionSelectedFLag = false;
103
- if(section != undefined && section != ''){
104
  //check value which came from backend
105
- selectedSection = jQuery('.display_type #'+section).prop('checked',true);
106
- jQuery('#wdi_feed_type').attr('value',section);
107
  //sectionSelectedFLag = true;
108
  }
109
  //find the selected feed_type option
110
- if(!sectionSelectedFLag){
111
- selectedSection = jQuery('.display_type[tab="'+tabname+'"] input[name="feed_type"]:checked');
112
- if(selectedSection.length != 0) {
113
  sectionSelectedFLag = true;
114
  }
115
  }
116
  //if there are no selected feed_type option then set default option
117
- if(!sectionSelectedFLag){
118
  //make default section as selected
119
- selectedSection = jQuery('.display_type[tab="'+tabname+'"] #thumbnails');
120
- if(selectedSection.length != 0) {
121
  sectionSelectedFLag = true;
122
- selectedSection.prop('checked',true);
123
- jQuery('#wdi_feed_type').attr('value','thumbnails');
124
  };
125
-
126
  }
127
  //if under currect tab we have feed_type section then show it
128
- if(sectionSelectedFLag){
129
  wdi_controller.displaySettingsSection(selectedSection);
130
  }
131
-
 
 
 
 
 
 
 
 
 
 
 
 
132
  }
 
133
  /*
134
  * Displays Settings Section for admin pages
135
  */
136
- wdi_controller.displaySettingsSection = function($this){
137
- var sectionName = $this.attr('id').toLowerCase().trim();
138
- var tab = $this.parent().parent().attr('tab');
139
- var sectionHiddenField = jQuery('#wdi_refresh_section');
140
- wdi_controller.oldDisplayType = {
141
- 'section' : sectionName,
142
- 'tab':tab
143
- };
144
- wdi_controller.displayTypeMemory[tab] = wdi_controller.oldDisplayType;
145
- //works only in theme page, because only theme page has #wdi_refresh_section hidden field
146
- if(sectionHiddenField != undefined){
147
- sectionHiddenField.attr('value',sectionName);
148
- }
149
-
150
- var formTable = jQuery('.wdi_border_wrapper .form-table');
151
- jQuery('#wdi_feed_type').attr('value',sectionName);
152
- var i=0,j=0;
153
- var sectionFlag = false;
154
- formTable.find('tr').each(function(){
155
- i++;
156
-
157
- var sectionStr = jQuery(this).children().children().children().children().children().attr('section');
158
-
159
- if(sectionStr !== undefined) {
160
- sectionFlag = false;
161
- var sections = sectionStr.toLowerCase().trim().split(',');
162
- for(j=0;j<sections.length;j++){
163
- if(sections[j]===sectionName){
164
- jQuery(this).css('display','block');
165
- sectionFlag = true;
166
- }
167
- }
168
- if(sectionFlag === false){
169
- jQuery(this).css('display','none');
170
  }
171
  }
172
- });
 
 
 
 
173
  }
174
 
175
  /*
176
  * Switches between themes admin page tabs
177
  */
178
- wdi_controller.switchThemeTabs = function(tabname,section){
179
-
180
 
181
  //swap active tab class
182
- jQuery('.wdi_feed_tabs').filter('.wdi_feed_tab_active').each(function(){jQuery(this).removeClass('wdi_feed_tab_active');});
183
- jQuery('#wdi_'+tabname).addClass('wdi_feed_tab_active');
184
-
 
 
185
 
186
  //hiding options of other tabs
187
- jQuery('[tab]').each(function(){
188
- if(jQuery(this).attr('tab') != tabname){
189
- jQuery(this).parent().parent().parent().parent().parent().filter('tr').css('display','none');
190
- }else{
191
- jQuery(this).parent().parent().parent().parent().parent().filter('tr').css('display','block');
192
- }
193
  });
194
 
195
  //hiding all display_type elements
196
- jQuery('.display_type').css('display','none');
197
  //showing only requested display_type tab elements
198
- jQuery('.display_type[tab="'+tabname+'"]').css('display','block');
199
 
200
 
201
  //add tabname in hidden field
202
- jQuery('#wdi_refresh_tab').attr('value',tabname);
203
  //add sectionname in hidden field
204
- if(section != undefined && section != ''){
205
- jQuery('#wdi_refresh_section').attr('value',section);
206
  }
207
 
208
  //check if any section was previously clicked then set to that section
209
- if(section == undefined && section != ''){
210
  if (wdi_controller.displayTypeMemory[tabname] != undefined) {
211
- jQuery('.display_type #'+wdi_controller.displayTypeMemory[tabname]['section']).trigger('click');
212
- }else{
213
  //default section
214
- jQuery('.display_type[tab="'+tabname+'"]').first().find('input').trigger('click');
215
  }
216
- }else{
217
- jQuery('.display_type #'+section).trigger('click');
218
  }
219
 
220
  }
221
 
222
- wdi_controller.showLightboxSettings = function(obj){
223
 
224
- jQuery('[tab="feed_settings"]').parent().parent().parent().parent().parent().filter('tr').each(function(){
225
- jQuery(this).css('display','none');
226
- });
227
- jQuery('.display_type[tab="feed_settings"]').css('display','none');
228
- jQuery('.display_type[tab="lightbox_settings"]').css('display','block');
229
- jQuery('[tab="lightbox_settings"]').parent().parent().parent().parent().parent().filter('tr').each(function(){
230
- jQuery(this).css('display','block');
231
- })
232
 
233
-
234
- //check if no tab was clicked then set default tab
235
- if(wdi_controller.displayTypeMemory['lightbox_settings'] === undefined){
236
- jQuery('.display_type[tab="lightbox_settings"] #'+obj).trigger('click');
237
- }else{
238
- jQuery('.display_type[tab="lightbox_settings"] #'+wdi_controller.displayTypeMemory['lightbox_settings'].section).trigger('click');
239
- }
240
-
241
-
242
 
243
- jQuery('.wdi_feed_tabs').filter('.wdi_feed_tab_active').each(function(){jQuery(this).removeClass('wdi_feed_tab_active');});
244
- jQuery('#wdi_lightbox_settings').addClass('wdi_feed_tab_active');
 
245
  }
246
 
247
 
 
 
 
 
 
 
248
 
249
- wdi_controller.bindSaveFeedEvent = function(){
 
 
250
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
251
 
252
- function save_feed(task){
253
- jQuery('#task').attr('value',task);
 
 
254
 
255
- if(task=='apply_changes' || task=='reset_changes'){
256
- var id = jQuery('#wdi_add_or_edit').attr('value');
257
- jQuery('#wdi_current_id').attr('value',id);
258
- }
259
- if(task == 'cancel'){
260
- jQuery('#wdi_save_feed').submit();
261
- }
262
 
263
- //check if user input field is not empty then cancel save process and make an ajax request
264
- //add user in input field and then after it trigger save,apply or whatever
265
- wdi_controller.checkIfUserNotSaved(task);
266
- if(wdi_controller.waitingAjaxRequestEnd.button != 0){
267
- return;
268
- };
269
 
270
- var username,usernames;
271
- var thumb_user = jQuery('#WDI_thumb_user').val();
272
- var errorInfo = '';
273
- username = thumb_user;
274
- //usernames= jQuery('#WDI_feed_users').val().trim().split(',');
275
- // for(var i = 0; i<usernames.length;i++){
276
- // if(thumb_user===usernames[i]){
277
- // username = usernames[i];
278
- // break;
279
- // }
280
- // }
281
- var accessToken = jQuery("#wdi_access_token").val();
282
- var correctUserFlag = false;
283
- var input_type = '';
284
- if(username[0]==='#'){
285
- input_type = "hashtag";
286
- }else{
287
- input_type = "user";
288
- }
289
- switch(input_type){
290
- case 'user':{
291
- jQuery.ajax({
292
- type: 'POST',
293
- dataType: 'jsonp',
294
- url: 'https://api.instagram.com/v1/users/search?q='+username+'&access_token='+accessToken,
295
- success: function(response){
296
-
297
- if(accessToken === ''){
298
- alert('Please get your access Token, go to settings section');
299
- }else if(response == ''){
300
- errorInfo = wdi_messages.instagram_server_error;
301
- }
302
- else if(response['meta']['code']!=200){
303
- correctUserFlag = false;
304
-
305
- }
306
- else{
307
- for(var i=0;i<response['data'].length;i++){
308
- if(username===response['data'][i]['username']){
309
- jQuery('#wdi_feed_thumb').attr('value',response['data'][i]['profile_picture']);
310
- correctUserFlag = true;
311
- break;
312
- }
313
- }
314
- }
315
-
316
- checkAndSubmit();
317
- }
318
- });
319
- break;
320
- }
321
- case "hashtag":{
322
- jQuery.ajax({
323
- type: 'POST',
324
- dataType: 'jsonp',
325
- url: 'https://api.instagram.com/v1/tags/'+username.substr(1,username.length)+'/media/recent?access_token='+accessToken,
326
- success: function(response){
327
- if(response['data'].length!=0){
328
- img = response['data'][0]['images']['low_resolution']['url'];
329
- jQuery('#wdi_feed_thumb').attr('value',img);
330
- }
331
- correctUserFlag=true;
332
- checkAndSubmit();
333
  }
334
- });
335
- break;
336
  }
337
- }
338
-
339
- function checkAndSubmit(){
340
- if(correctUserFlag === true){
341
- jQuery('#wdi_save_feed').submit();
342
- }else{
343
- if(errorInfo!=''){
344
- alert(errorInfo);
345
- }else{
346
- alert(wdi_messages.invalid_user +" " + username);
347
- }
348
- }
349
- }
350
  }
351
-
352
- jQuery('#wdi_save_feed_submit').on('click',function(){save_feed('save_feed')});
353
- jQuery('#wdi_save_feed_apply').on('click',function(){save_feed('apply_changes')});
354
- jQuery('#wdi_save_feed_reset').on('click',function(){save_feed('reset_changes')});
355
- jQuery('#wdi_cancel_changes').on('click',function(){save_feed('cancel')});
356
  }
357
- wdi_controller.getUserInput = function(){
358
- var user_input = jQuery('#wdi_add_user_ajax_input').val().trim().toLowerCase();
359
- var accessToken = jQuery("#wdi_access_token").val();
360
- var correctUserFlag = false;
361
- var newUser;
362
- var ajaxFinished = false;
363
- var input_type='';
364
- var errorInfo ='';
365
- if(user_input[0]==='#'){
366
- input_type = 'hashtag';
367
- }else{
368
- input_type = 'user';
369
- }
370
- if(wdi_version.is_pro == 'false'){
371
- if(jQuery('.wdi_user').length == 1){
372
- alert(wdi_messages.only_one_user_or_hashtag);
373
- return;
374
- }
 
 
 
 
 
 
375
  }
376
- switch(input_type){
377
- case 'user':{
378
- jQuery.ajax({
379
- type: 'POST',
380
- dataType: 'jsonp',
381
- url: 'https://api.instagram.com/v1/users/search?q='+user_input+'&access_token='+accessToken,
382
- success:function(response){
383
- if(response === undefined){
384
- errorInfo = wdi_messages.instagram_server_error;
385
- }
386
- else if(response['meta']['code'] !==200){
387
- correctUserFlag = false;
388
- errorInfo =response['meta']['error_message'];
389
- }
390
- else if(response['data'].length===0){
391
- correctUserFlag = false;
392
- }
393
- else{
394
- for(var i=0;i<response['data'].length;i++){
395
- if(user_input===response['data'][i]['username']){
396
- correctUserFlag = true;
397
- break;
398
- }
399
- }
400
- if(correctUserFlag === true){
401
- newUser = jQuery('<div class="wdi_user"><a target="_blank" href="http://www.instagram.com/'+user_input+'">'+'<img class="wdi_profile_pic" src="'+response['data'][i]['profile_picture']+'"><span class="wdi_username">'+user_input+'</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>');
402
- if(checkForDuplicate(newUser)==false){
403
- jQuery('#wdi_feed_users').append(newUser);
404
- jQuery('#wdi_add_user_ajax_input').attr('value','');
405
- }else{
406
- alert(wdi_messages.already_added);
407
- }
408
-
409
 
410
- if(wdi_version.is_pro == 'false'){
411
- if( jQuery('.wdi_user').length == 1 ){
412
- jQuery('#wdi_add_user_ajax_input').attr('disabled','disabled');
413
- jQuery('#wdi_add_user_ajax_input').attr('placeholder',wdi_messages.available_in_pro);
414
- }
415
- }
416
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
417
  }
418
- }
419
-
420
- if(correctUserFlag===false){
421
- if(errorInfo!=''){
422
- alert(errorInfo);
423
- }else{
424
- alert(wdi_messages.user_not_exist);
425
  }
426
-
427
- }
428
-
429
- wdi_controller.updateHiddenField();
430
- if(correctUserFlag){
431
- wdi_controller.updateFeaturedImageSelect(user_input,'add');
432
  }
433
 
434
- ////////////////////////////////////
435
- wdi_controller.saveFeedAfterAjaxWait(correctUserFlag);
436
- //////////////////////////////////////
437
-
438
  }
439
- });
440
  break;
441
  }
442
- case 'hashtag':{
443
- requestUrl = 'https://api.instagram.com/v1/tags/'+user_input.substr(1,user_input.length)+'/media/recent?access_token='+accessToken;
444
- jQuery.ajax({
445
- type: "POST",
446
- url: requestUrl,
447
- dataType: 'jsonp',
448
- success: function(response){
449
- if(response == '' || response == undefined || response == null){
450
- alert(wdi_messages.network_error);
451
- return;
452
- }
453
- if(response['meta']['code'] != 200){
454
- alert(user_input +': '+ response['meta']['error_message']);
455
- return;
456
- }
457
- var newHashtag = jQuery('<div class="wdi_user"><a target="_blank" href="https://instagram.com/explore/tags/'+user_input.substr(1,user_input.length)+'">'+'<img class="wdi_profile_pic" src="'+wdi_url.plugin_url+'/images/hashtag.png"><span class="wdi_hashtag">'+user_input.substr(1,user_input.length)+'</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>');
458
- var pattern = /[~!@$%&*#^()<>?]/;
459
- if(user_input.substr(1,user_input.length).match(pattern)== null && checkForDuplicate(newHashtag)==false){
460
- jQuery('#wdi_feed_users').append(newHashtag);
461
- jQuery('#wdi_add_user_ajax_input').attr('value','');
462
-
463
- if(wdi_version.is_pro == 'false'){
464
- if( jQuery('.wdi_user').length == 1 ){
465
- jQuery('#wdi_add_user_ajax_input').attr('disabled','disabled');
466
- jQuery('#wdi_add_user_ajax_input').attr('placeholder',wdi_messages.available_in_pro);
467
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
468
  }
469
 
470
- }else if(checkForDuplicate(newHashtag)){
471
- alert(wdi_messages.already_added);
472
- }
473
- else{
474
- alert(wdi_messages.invalid_hashtag);
475
  }
476
- wdi_controller.updateHiddenField();
477
- wdi_controller.updateFeaturedImageSelect(user_input,'add');
478
 
479
- ////////////////////////////////////
480
- wdi_controller.saveFeedAfterAjaxWait(true);
481
- //////////////////////////////////////
482
  }
483
  });
484
-
485
 
486
  break;
487
  }
488
- }
489
-
490
 
491
-
492
- //
493
- function checkForDuplicate(user){
494
- var duplicate = false;
495
- var spanText = '';
496
- var userText = '';
497
- if(user.find('span').hasClass('wdi_hashtag')){
498
- userText = '#'+user.find('span').text();
499
- }else{
500
- userText = user.find('span').text();
501
- }
502
 
503
- jQuery('.wdi_user').each(function(){
504
-
505
- if(jQuery(this).find('span').hasClass('wdi_hashtag')){
506
- spanText = '#'+ jQuery(this).find('span').text();
507
- }else{
508
- spanText = jQuery(this).find('span').text();
509
- }
510
- if(spanText==userText){
511
- duplicate = true;
512
- }
513
- });
514
 
515
- return duplicate;
516
- }
517
-
518
-
519
-
520
  }
521
- wdi_controller.updateHiddenField = function(){
522
- var users = [];
523
- jQuery('#wdi_feed_users .wdi_user').each(function(){
524
- var span = jQuery(this).find('span');
525
- if(span.hasClass('wdi_hashtag')){
526
- users.push('#'+span.text());
527
- }
528
- if(span.hasClass('wdi_username')){
529
- users.push(span.text());
530
- }
531
- });
532
 
533
- userStr = users.join(',');
534
- if(userStr != ''){
535
- jQuery('#WDI_feed_users').attr('value',userStr);
536
- }else{
537
- jQuery('#WDI_feed_users').attr('value',jQuery('#wdi_default_user').val());
 
 
 
 
 
538
  }
 
539
  }
540
- function uniqueAdd(arr,value){
541
- var duplicate = 0;
542
- if(arr.length===0){
543
- arr.push(value);
544
- }else {
545
- for(var i=0;i<arr.length;i++){
546
- if(arr[i]===value){
547
- duplicate = true;
548
  }
549
- }
550
- if(duplicate = false){
551
- arr.push(value);
552
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
553
  }
 
554
  }
555
- wdi_controller.bindAddNewUserOrHashtagEvent = function(){
556
- jQuery('#wdi_add_user_ajax').on('click',function(){
557
- wdi_controller.getUserInput();
 
 
 
 
 
 
 
 
558
  });
559
  jQuery('#wdi_add_user_ajax_input').on("keypress", function(e) {
560
- if (e.keyCode == 13) {
561
- wdi_controller.getUserInput();
562
- return false; // prevent the button click from happening
563
- }
 
564
  });
565
 
566
  }
567
- wdi_controller.removeFeedUser = function($this){
 
 
 
 
 
 
 
568
 
569
 
570
  var username = $this.parent().find('a span').text();
571
- if($this.parent().find('a span').hasClass('wdi_hashtag')){
572
  username = '#' + username;
573
  }
574
-
 
 
 
 
 
 
 
575
  $this.parent().remove();
576
- wdi_controller.updateHiddenField();
577
- if(username !== jQuery('#wdi_default_user').val()){
578
- wdi_controller.updateFeaturedImageSelect(username,'remove');
579
  }
580
 
581
  if(wdi_version.is_pro == 'false'){
@@ -584,329 +569,772 @@ wdi_controller.removeFeedUser = function($this){
584
  jQuery('#wdi_add_user_ajax_input').attr('placeholder','');
585
  }
586
  }
587
-
588
  }
589
 
590
 
591
- wdi_controller.requestUserData = function(user_input){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
592
 
593
- var accessToken = jQuery("#wdi_access_token").val();
594
- var correctUserFlag = false;
595
- var newUser;
596
- var ajaxFinished = false;
597
- var input_type='';
598
- if(user_input[0]==='#'){
599
- input_type = 'hashtag';
600
- }else{
601
- input_type = 'user';
602
- }
603
-
604
- switch(input_type){
605
- case 'user':{
606
- jQuery.ajax({
607
- type: 'POST',
608
- dataType: 'jsonp',
609
- url: 'https://api.instagram.com/v1/users/search?q='+user_input+'&access_token='+accessToken,
610
- success:function(response){
611
- if(response['meta']['code'] !==200){
612
- correctUserFlag = false;
613
- }
614
- else if(response['data'].length===0){
615
- correctUserFlag = false;
616
- }
617
- else{
618
- for(var i=0;i<response['data'].length;i++){
619
- if(user_input===response['data'][i]['username']){
620
- correctUserFlag = true;
621
- break;
622
- }
623
- }
624
- if(correctUserFlag === true){
625
- newUser = jQuery('<div class="wdi_user" thumb="false"><a target="_blank" href="http://www.instagram.com/'+user_input+'">'+'<img class="wdi_profile_pic" src="'+response['data'][i]['profile_picture']+'"><span class="wdi_username">'+user_input+'</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>');
626
- jQuery('#wdi_feed_users').append(newUser);
627
- ////wdi_controller.removeFeedUser();
628
- jQuery('#wdi_add_user_ajax_input').attr('value','');
629
-
630
-
631
- if(wdi_version.is_pro == 'false'){
632
- if( jQuery('.wdi_user').length == 1 ){
633
- jQuery('#wdi_add_user_ajax_input').attr('disabled','disabled');
634
- jQuery('#wdi_add_user_ajax_input').attr('placeholder',wdi_messages.available_in_pro);
635
- }
636
- }
637
 
 
638
 
639
 
640
- }
641
- }
642
- wdi_controller.updateHiddenField();
643
- wdi_controller.updateFeaturedImageSelect(user_input,'add','backend');
644
- }
645
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
646
  break;
647
  }
648
- case 'hashtag':{
649
- requestUrl = 'https://api.instagram.com/v1/tags/'+user_input.substr(1,user_input.length)+'/media/recent?access_token='+accessToken;
650
- jQuery.ajax({
651
- type: 'POST',
652
- url: requestUrl,
653
- dataType: 'jsonp',
654
- success: function(response){
655
- if(response=='' || response == undefined || response == null){
656
- alert(wdi_messages.network_error);
657
- return;
658
- }
659
- if(response['meta']['code'] != 200){
660
- alert(user_input + ': ' +response['meta']['error_message']);
661
- return;
662
- }
663
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
664
 
665
- var newHashtag = jQuery('<div class="wdi_user"><a target="_blank" href="https://instagram.com/explore/tags/'+user_input.substr(1,user_input.length)+'">'+'<img class="wdi_profile_pic" src="'+wdi_url.plugin_url+'/images/hashtag.png"><span class="wdi_hashtag">'+user_input.substr(1,user_input.length)+'</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>');
666
- var pattern = /[~!@$%&*#^()<>?]/;
667
- if(user_input.substr(1,user_input.length).match(pattern)== null){
668
- jQuery('#wdi_feed_users').append(newHashtag);
669
- ////wdi_controller.removeFeedUser();
670
- jQuery('#wdi_add_user_ajax_input').attr('value','');
671
 
 
 
 
 
 
 
 
 
 
672
 
673
 
674
- if(wdi_version.is_pro == 'false'){
675
- if( jQuery('.wdi_user').length == 1 ){
676
- jQuery('#wdi_add_user_ajax_input').attr('disabled','disabled');
677
- jQuery('#wdi_add_user_ajax_input').attr('placeholder',wdi_messages.available_in_pro);
678
- }
679
- }
 
 
 
 
680
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
681
 
682
 
683
- }else{
684
- alert(wdi_messages.invalid_hashtag);
685
- }
686
- wdi_controller.updateHiddenField();
687
- wdi_controller.updateFeaturedImageSelect(user_input,'add','backend');
688
- }
689
- });
690
-
691
- break;
692
- }
693
- }
694
-
695
 
696
-
697
- //updating hidden field
 
 
 
 
 
 
698
  }
699
- wdi_controller.updateFeaturedImageSelect = function(username,action,origin){
700
- var select = jQuery('#WDI_thumb_user');
701
- switch(action){
702
- case 'add':{
703
- if(origin == 'backend' && username == ''){
704
- break;
705
- }
706
- //check if there is no duplicate then add
707
- var flag = select.find('option[value="'+username+'"]').length;
708
- if(!flag){
709
- var option = jQuery('<option value="'+username+'">'+username+'</option>');
710
- select.append(option);
711
- }
712
-
713
- break;
714
- }
715
- case 'remove':{
716
- select.find('option[value="'+username+'"]').remove();
717
- break;
718
  }
719
  }
720
- if(origin == 'backend'){
721
- var defaultUser = jQuery('#wdi_default_user').val();
722
- var defaultUserflag = select.find('option[value="'+defaultUser+'"]').length;
723
- if(!defaultUserflag){
724
- var option = jQuery('<option value="'+defaultUser+'">'+defaultUser+'</option>');
725
- select.append(option);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
726
  }
727
 
728
- var thumb_user = jQuery('#wdi_thumb_user').val();
729
- if(select.find('option[value="'+thumb_user+'"]').length != 0){
730
- select.find('option[value="'+thumb_user+'"]').attr('selected',true);
 
 
 
 
 
 
 
 
 
731
  }
 
 
 
732
 
733
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
734
  }
 
 
 
 
 
 
 
 
 
735
  }
736
 
737
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
738
 
739
- ////////////////////////////////////////////////////////////////////////////////
740
- ///////////////////////////////Themes Page//////////////////////////////////////
741
- ////////////////////////////////////////////////////////////////////////////////
742
- wdi_controller.bindSaveThemeEvent = function(){
743
- jQuery('#wdi_save_theme_submit').on('click',function(){
744
- if(wdi_version.is_pro == 'true'){
745
- jQuery('#task').attr('value','save_feed');
746
- jQuery('#wdi_save_feed').submit();
747
- }else{
748
- alert(wdi_messages.theme_save_message_free);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
749
  }
750
-
751
  });
752
- jQuery('#wdi_save_theme_apply').on('click',function(){
753
- if(wdi_version.is_pro == 'true'){
754
- jQuery('#task').attr('value','apply_changes');
755
- var id = jQuery('#wdi_add_or_edit').attr('value');
756
- jQuery('#wdi_current_id').attr('value',id);
757
- jQuery('#wdi_save_feed').submit();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
758
  }else{
759
- alert(wdi_messages.theme_save_message_free);
760
  }
761
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
762
  });
763
- jQuery('#wdi_save_theme_reset').on('click',function(){
764
- if(wdi_version.is_pro == 'true'){
765
- jQuery('#task').attr('value','reset_changes');
766
- var id = jQuery('#wdi_add_or_edit').attr('value');
767
- jQuery('#wdi_current_id').attr('value',id);
768
- jQuery('#wdi_save_feed').submit();
769
- }else{
770
- alert(wdi_messages.theme_save_message_free);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
771
  }
 
 
 
 
 
 
 
 
 
 
 
772
 
773
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
774
  }
775
 
776
- wdi_controller.checkIfUserNotSaved = function(task){
777
- switch(task){
778
- case 'save_feed':{
779
- task = 'submit';
 
 
 
 
 
 
780
  break;
781
  }
782
- case 'apply_changes':{
783
- task = "apply";
784
  break;
785
  }
786
- case 'reset_changes':{
787
- task = 'reset';
 
 
 
 
788
  break;
789
  }
790
  }
791
-
792
- //checking if user has typed username in input field but didn't saved it, trigger add action
793
- if (jQuery('#wdi_add_user_ajax_input').val().trim() != '') {
794
- wdi_controller.getUserInput();
795
- wdi_controller.waitingAjaxRequestEnd = {
796
- button: task
797
- };
798
- return 1;
799
- }else{
800
- wdi_controller.waitingAjaxRequestEnd = {
801
- button : 0
802
- };
803
- return 0;
804
- }
 
 
805
  }
806
- //if user was clicked save before ajax request then trigger save after getting info
807
- wdi_controller.saveFeedAfterAjaxWait = function(correctUserFlag){
808
- if(wdi_controller.waitingAjaxRequestEnd != undefined){
809
- //if save button was clicked before ajax request then retrigger save button
810
- var save_type_btn = wdi_controller.waitingAjaxRequestEnd.button;
811
- if(correctUserFlag && save_type_btn != 0){
812
- jQuery('#wdi_save_feed_'+save_type_btn).trigger('click');
 
 
 
813
  }
814
- wdi_controller.waitingAjaxRequestEnd = undefined;
815
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
816
  }
817
 
818
 
 
 
 
 
 
 
 
 
 
 
 
 
 
819
 
820
 
821
  ///////////////////////////////////////////////////////////////////////////////
822
  ///////////////Feeds and themes first view functions///////////////////////////
823
  ////////////////////////////////////////////////////////////////////////////////
824
 
 
825
  function wdi_spider_select_value(obj) {
826
- obj.focus();
827
- obj.select();
828
  }
829
 
830
  // Set value by id.
831
  function wdi_spider_set_input_value(input_id, input_value) {
832
- if(input_value==='add'){
833
- if(jQuery('#wdi_access_token').attr('value')==''){
834
- alert('Please get your access token');
835
- }
836
- }
837
- if (document.getElementById(input_id)) {
838
- document.getElementById(input_id).value = input_value;
839
- }
840
  }
841
 
842
  // Submit form by id.
843
  function wdi_spider_form_submit(event, form_id) {
844
- if (document.getElementById(form_id)) {
845
- document.getElementById(form_id).submit();
846
- }
847
- if (event.preventDefault) {
848
- event.preventDefault();
849
- }
850
- else {
851
- event.returnValue = false;
852
- }
853
  }
854
 
855
 
856
 
857
-
858
  // Check all items.
859
  function wdi_spider_check_all_items() {
860
- wdi_spider_check_all_items_checkbox();
861
- // if (!jQuery('#check_all').attr('checked')) {
862
- jQuery('#check_all').trigger('click');
863
- // }
864
  }
865
 
866
  function wdi_spider_check_all_items_checkbox() {
867
- if (jQuery('#check_all_items').attr('checked')) {
868
- jQuery('#check_all_items').attr('checked', false);
869
- jQuery('#draganddrop').hide();
870
- }
871
- else {
872
- var saved_items = (parseInt(jQuery(".displaying-num").html()) ? parseInt(jQuery(".displaying-num").html()) : 0);
873
- var added_items = (jQuery('input[id^="check_pr_"]').length ? parseInt(jQuery('input[id^="check_pr_"]').length) : 0);
874
- var items_count = added_items + saved_items;
875
- jQuery('#check_all_items').attr('checked', true);
876
- if (items_count) {
877
- jQuery('#draganddrop').html("<strong><p>Selected " + items_count + " item" + (items_count > 1 ? "s" : "") + ".</p></strong>");
878
- jQuery('#draganddrop').show();
879
- }
880
- }
881
  }
882
 
883
  function wdi_spider_check_all(current) {
884
- if (!jQuery(current).attr('checked')) {
885
- jQuery('#check_all_items').attr('checked', false);
886
- jQuery('#draganddrop').hide();
887
- }
888
  }
889
 
890
  // Set value by id.
891
  function wdi_spider_set_input_value(input_id, input_value) {
892
- if(input_value==='add'){
893
- if(jQuery('#wdi_access_token').attr('value')==''){
894
- alert('Please get your access token');
895
- }
896
- }
897
- if (document.getElementById(input_id)) {
898
- document.getElementById(input_id).value = input_value;
899
- }
900
- }
901
-
902
-
903
-
904
-
905
-
906
-
907
-
908
- wdi_controller.getCookie = function(name) {
909
- var value = "; " + document.cookie;
910
- var parts = value.split("; " + name + "=");
911
- if (parts.length == 2) return parts.pop().split(";").shift();
912
- }
1
+ jQuery(document).ready(function() {
2
+
3
+
4
 
5
  /*Feeds page*/
6
  wdi_controller.bindSaveFeedEvent();
7
  wdi_controller.bindAddNewUserOrHashtagEvent();
8
+ jQuery('.display_type input').on('click', function() {
9
+ wdi_controller.displaySettingsSection(jQuery(this));
10
+ });
11
+ /*-----------Conditional Filters-----------*/
12
+ wdi_controller.conditionalFiltersTabInit();
13
  /*Themes page*/
14
  wdi_controller.bindSaveThemeEvent();
15
 
16
+ jQuery('#wdi_add_user_ajax').after(jQuery("<br><label class='wdi_pro_only' for='wdi_add_user_ajax_input'>" + wdi_messages.username_hashtag_multiple + "</label>"));
17
+
18
 
 
19
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
+ function wdi_controller() {};
22
+
23
+ /**
24
+ * Gets query parameter by name
25
+ * @param {String} name [parameter name]
26
+ * @return {String} [parameter value]
27
+ */
28
+ wdi_controller.getParameterByName = function(name) {
29
  name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
30
+ var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
31
+ results = regex.exec(location.search);
32
+ return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
33
  }
34
+
35
+ /**
36
+ * Was tirggerd when redirected from api page
37
+ * Sets access token from query string to input
38
+ */
39
+ wdi_controller.apiRedirected = function() {
40
+ var access_token_raw = this.getParameterByName('access_token');
41
  var arr = access_token_raw.split('.');
42
  var validRegEx = /^[^\\\/&?><"']*$/;
43
+ for (i = 0; i < arr.length; i++) {
44
+ if (arr[i].match(validRegEx) === null) {
45
+ return;
46
+ }
47
  }
48
  var access_token = arr.join('.');
49
+ jQuery(document).ready(function() {
50
+ jQuery('#wdi_access_token').attr('value', access_token);
51
+ });
52
+
53
+ //if access token is getted then overwrite it
54
+ wdi_controller.instagram.addToken(access_token);
55
  wdi_controller.getUserInfo(access_token);
56
  }
57
 
 
 
 
58
 
59
+
60
+ /**
61
+ * Used in Settings page for finding access token owners username
62
+ * and and for filling it in username input field
63
+ *
64
+ * @param {String} access_token [Instagram API access token]
65
+ */
66
+ wdi_controller.getUserInfo = function(access_token) {
67
+ this.instagram.getSelfInfo({
68
+ success: function(response) {
69
+ jQuery('#wdi_user_name').attr('value', response['data']['username']);
70
+ jQuery('#wdi_user_id').attr('value', response['data']['id']);
71
  jQuery(document).trigger('wdi_settings_filled');
72
  }
73
  })
74
  }
75
 
76
 
77
+
78
  wdi_controller.oldDisplayType = {};
79
  wdi_controller.displayTypeMemory = {};
80
 
82
  /*
83
  * Switches between feeds admin page tabs
84
  */
85
+ wdi_controller.switchFeedTabs = function(tabname, section) {
86
+
87
  //add tabname in hidden field
88
+ jQuery('#wdi_refresh_tab').attr('value', tabname);
89
 
90
  //hiding options of other tabs
91
+ jQuery('[tab]').each(function() {
92
+ if (jQuery(this).attr('tab') != tabname) {
93
+ jQuery(this).parent().parent().parent().parent().parent().filter('tr').css('display', 'none');
94
+ } else {
95
+ jQuery(this).parent().parent().parent().parent().parent().filter('tr').css('display', 'block');
96
+ }
97
  });
98
  //hiding all display_type elements
99
+ jQuery('.display_type').css('display', 'none');
100
  //showing only requested display_type tab elements
101
+ jQuery('.display_type[tab="' + tabname + '"]').css('display', 'block');
102
 
103
  //swap active tab class
104
+ jQuery('.wdi_feed_tabs').filter('.wdi_feed_tab_active').each(function() {
105
+ jQuery(this).removeClass('wdi_feed_tab_active');
106
+ });
107
+ jQuery('#wdi_' + tabname).addClass('wdi_feed_tab_active');
108
  var selectedSection = jQuery();
109
  var sectionSelectedFLag = false;
110
+ if (section != undefined && section != '') {
111
  //check value which came from backend
112
+ selectedSection = jQuery('.display_type #' + section).prop('checked', true);
113
+ jQuery('#wdi_feed_type').attr('value', section);
114
  //sectionSelectedFLag = true;
115
  }
116
  //find the selected feed_type option
117
+ if (!sectionSelectedFLag) {
118
+ selectedSection = jQuery('.display_type[tab="' + tabname + '"] input[name="feed_type"]:checked');
119
+ if (selectedSection.length != 0) {
120
  sectionSelectedFLag = true;
121
  }
122
  }
123
  //if there are no selected feed_type option then set default option
124
+ if (!sectionSelectedFLag) {
125
  //make default section as selected
126
+ selectedSection = jQuery('.display_type[tab="' + tabname + '"] #thumbnails');
127
+ if (selectedSection.length != 0) {
128
  sectionSelectedFLag = true;
129
+ selectedSection.prop('checked', true);
130
+ jQuery('#wdi_feed_type').attr('value', 'thumbnails');
131
  };
132
+
133
  }
134
  //if under currect tab we have feed_type section then show it
135
+ if (sectionSelectedFLag) {
136
  wdi_controller.displaySettingsSection(selectedSection);
137
  }
138
+
139
+ if( tabname != 'conditional_filters' ){
140
+ jQuery( '#wdi-conditional-filters-ui' ).addClass('wdi_hidden');
141
+ jQuery( '#wdi_save_feed_apply' ).removeClass( 'wdi_hidden' );
142
+ jQuery( '#wdi_cancel_changes' ).removeClass( 'wdi_hidden' );
143
+ jQuery( '#wdi_save_feed_submit' ).removeClass( 'wdi_hidden' );
144
+ }else{
145
+ jQuery( '#wdi-conditional-filters-ui' ).removeClass('wdi_hidden');
146
+ jQuery( '#wdi_save_feed_apply' ).addClass( 'wdi_hidden' );
147
+ jQuery( '#wdi_cancel_changes' ).addClass( 'wdi_hidden' );
148
+ jQuery( '#wdi_save_feed_submit' ).addClass( 'wdi_hidden' );
149
+ }
150
+
151
  }
152
+
153
  /*
154
  * Displays Settings Section for admin pages
155
  */
156
+ wdi_controller.displaySettingsSection = function($this) {
157
+ var sectionName = $this.attr('id').toLowerCase().trim();
158
+ var tab = $this.parent().parent().attr('tab');
159
+ var sectionHiddenField = jQuery('#wdi_refresh_section');
160
+ wdi_controller.oldDisplayType = {
161
+ 'section': sectionName,
162
+ 'tab': tab
163
+ };
164
+ wdi_controller.displayTypeMemory[tab] = wdi_controller.oldDisplayType;
165
+ //works only in theme page, because only theme page has #wdi_refresh_section hidden field
166
+ if (sectionHiddenField != undefined) {
167
+ sectionHiddenField.attr('value', sectionName);
168
+ }
169
+
170
+ var formTable = jQuery('.wdi_border_wrapper .form-table');
171
+ jQuery('#wdi_feed_type').attr('value', sectionName);
172
+ var i = 0,
173
+ j = 0;
174
+ var sectionFlag = false;
175
+ formTable.find('tr').each(function() {
176
+ i++;
177
+
178
+ var sectionStr = jQuery(this).children().children().children().children().children().attr('section');
179
+
180
+ if (sectionStr !== undefined) {
181
+ sectionFlag = false;
182
+ var sections = sectionStr.toLowerCase().trim().split(',');
183
+ for (j = 0; j < sections.length; j++) {
184
+ if (sections[j] === sectionName) {
185
+ jQuery(this).css('display', 'block');
186
+ sectionFlag = true;
 
 
 
187
  }
188
  }
189
+ if (sectionFlag === false) {
190
+ jQuery(this).css('display', 'none');
191
+ }
192
+ }
193
+ });
194
  }
195
 
196
  /*
197
  * Switches between themes admin page tabs
198
  */
199
+ wdi_controller.switchThemeTabs = function(tabname, section) {
200
+
201
 
202
  //swap active tab class
203
+ jQuery('.wdi_feed_tabs').filter('.wdi_feed_tab_active').each(function() {
204
+ jQuery(this).removeClass('wdi_feed_tab_active');
205
+ });
206
+ jQuery('#wdi_' + tabname).addClass('wdi_feed_tab_active');
207
+
208
 
209
  //hiding options of other tabs
210
+ jQuery('[tab]').each(function() {
211
+ if (jQuery(this).attr('tab') != tabname) {
212
+ jQuery(this).parent().parent().parent().parent().parent().filter('tr').css('display', 'none');
213
+ } else {
214
+ jQuery(this).parent().parent().parent().parent().parent().filter('tr').css('display', 'block');
215
+ }
216
  });
217
 
218
  //hiding all display_type elements
219
+ jQuery('.display_type').css('display', 'none');
220
  //showing only requested display_type tab elements
221
+ jQuery('.display_type[tab="' + tabname + '"]').css('display', 'block');
222
 
223
 
224
  //add tabname in hidden field
225
+ jQuery('#wdi_refresh_tab').attr('value', tabname);
226
  //add sectionname in hidden field
227
+ if (section != undefined && section != '') {
228
+ jQuery('#wdi_refresh_section').attr('value', section);
229
  }
230
 
231
  //check if any section was previously clicked then set to that section
232
+ if (section == undefined && section != '') {
233
  if (wdi_controller.displayTypeMemory[tabname] != undefined) {
234
+ jQuery('.display_type #' + wdi_controller.displayTypeMemory[tabname]['section']).trigger('click');
235
+ } else {
236
  //default section
237
+ jQuery('.display_type[tab="' + tabname + '"]').first().find('input').trigger('click');
238
  }
239
+ } else {
240
+ jQuery('.display_type #' + section).trigger('click');
241
  }
242
 
243
  }
244
 
 
245
 
246
+ /**
247
+ * Binds events to control buttons
248
+ */
249
+ wdi_controller.bindSaveFeedEvent = function() {
250
+ var _this = this;
 
 
 
251
 
252
+ jQuery('#wdi_save_feed_submit').on('click', function() {
253
+ _this.save_feed('save_feed')
254
+ });
255
+ jQuery('#wdi_save_feed_apply').on('click', function() {
256
+ _this.save_feed('apply_changes')
257
+ });
 
 
 
258
 
259
+ jQuery('#wdi_cancel_changes').on('click', function() {
260
+ _this.save_feed('cancel')
261
+ });
262
  }
263
 
264
 
265
+ /**
266
+ * Submits form baset on given task
267
+ * if task is cancel then it reloades the page
268
+ * @param {String} task [this is self explanatory]
269
+ */
270
+ wdi_controller.save_feed = function(task) {
271
 
272
+ if ("cancel" == task) {
273
+ window.location = window.location.href;
274
+ }
275
 
276
+ //check if user input field is not empty then cancel save process and make an ajax request
277
+ //add user in input field and then after it trigger save,apply or whatever
278
+ wdi_controller.checkIfUserNotSaved(task);
279
+ if (wdi_controller.waitingAjaxRequestEnd.button != 0) {
280
+ return;
281
+ };
282
+
283
+ jQuery('#task').attr('value', task);
284
+ var feed_users = this.feed_users,
285
+ feed_users_json,
286
+ id,
287
+ username,
288
+ errorInfo,
289
+ profile_picture,
290
+ defaultUser = {
291
+ username: jQuery('#wdi_default_user').val(),
292
+ id: jQuery('#wdi_default_user_id').val()
293
+ };
294
 
295
+ if (feed_users.length == 0) {
296
+ feed_users.push(defaultUser);
297
+ this.updateFeaturedImageSelect(defaultUser['username'], 'add', 'selected');
298
+ }
299
 
300
+ feed_users_json = this.stringifyUserData(feed_users);
 
 
 
 
 
 
301
 
302
+ jQuery('#WDI_feed_users').val(feed_users_json);
 
 
 
 
 
303
 
304
+
305
+ if (task == 'apply_changes' || task == 'save_feed') {
306
+ id = jQuery('#wdi_add_or_edit').attr('value');
307
+ jQuery('#wdi_current_id').attr('value', id);
308
+ }
309
+
310
+
311
+
312
+ username = jQuery('#WDI_thumb_user').val();
313
+ //errorInfo = '';
314
+ profile_picture = this.getUserProfilePic(username);
315
+
316
+ //if username is selected default user and we don't have default users image then request it
317
+ //typeof profile_picture will be undefined when user without adding any user submits form
318
+ if ('false' == profile_picture || typeof profile_picture == 'undefined') {
319
+ var _this = this;
320
+ this.instagram.searchForUsersByName(username, {
321
+ success: function(response) {
322
+ var vObj = _this.isValidResponse(response),
323
+ user = _this.findUser(username, response),
324
+ profile_picture;
325
+ if (vObj.valid && _this.hasData(response) && user) {
326
+ profile_picture = user['profile_picture'];
327
+ } else {
328
+ profile_picture = '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
329
  }
330
+ jQuery('#wdi_feed_thumb').attr('value', profile_picture);
331
+ jQuery('#wdi_save_feed').submit();
332
  }
333
+ });
334
+ } else {
335
+ jQuery('#wdi_feed_thumb').attr('value', profile_picture);
336
+ jQuery('#wdi_save_feed').submit();
 
 
 
 
 
 
 
 
 
337
  }
 
 
 
 
 
338
  }
339
+
340
+
341
+
342
+ /**
343
+ * Takes user input as argument and makes an
344
+ * instagram request for getting meta info such as username and user id
345
+ * stores getted data in wdi_controller.feed_users array and updates some admin elements which
346
+ * depend on users
347
+ *
348
+ * @param {String} user_input [username or hashtag, Note. hashtags should start with #]
349
+ * @param {String} backend [if is set to 'backend' all confirms will be ignored while making requests]
350
+ * @return {Void}
351
+ */
352
+ wdi_controller.makeInstagramUserRequest = function(user_input, ignoreConfirm) {
353
+
354
+ var newUser, input_type, _this = this,
355
+ selected;
356
+
357
+ input_type = this.getInputType(user_input);
358
+
359
+ if (wdi_version.is_pro == 'false') {
360
+ if (jQuery('.wdi_user').length == 1) {
361
+ alert(wdi_messages.only_one_user_or_hashtag);
362
+ return;
363
  }
364
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
365
 
 
 
 
 
 
 
366
 
367
+
368
+ switch (input_type) {
369
+ case 'user':
370
+ {
371
+ this.instagram.searchForUsersByName(user_input, {
372
+ success: function(response) {
373
+
374
+ //contains information about response such as error messages and if
375
+ //response is valid or not
376
+ var vObj = _this.isValidResponse(response),
377
+ //this is the user object we are searching for, of user does not exists then it is false
378
+ user = _this.findUser(user_input, response);
379
+ if (vObj.valid && _this.hasData(response) && user) {
380
+ _this.addUser(user);
381
+
382
+ if (wdi_version.is_pro == 'false') {
383
+ if (jQuery('.wdi_user').length == 1) {
384
+ jQuery('#wdi_add_user_ajax_input').attr('disabled', 'disabled');
385
+ jQuery('#wdi_add_user_ajax_input').attr('placeholder', wdi_messages.available_in_pro);
386
+ }
387
  }
388
+
389
+ } else {
390
+ if (!user) {
391
+ alert(wdi_messages.user_not_exist)
392
+ } else {
393
+ alert(vObj.msg);
 
394
  }
395
+
 
 
 
 
 
396
  }
397
 
398
+
 
 
 
399
  }
400
+ });
401
  break;
402
  }
403
+ case 'hashtag':
404
+ {
405
+
406
+ var tagname = user_input.substr(1, user_input.length);
407
+ this.instagram.getTagRecentMedia(tagname, {
408
+ success: function(response) {
409
+ //contain information about response such as error messages and if
410
+ //response is valid or not
411
+ var vObj = _this.isValidResponse(response);
412
+ if (vObj.valid && _this.hasData(response)) {
413
+ _this.addHashtag(tagname, response);
414
+
415
+ if (wdi_version.is_pro == 'false') {
416
+ if (jQuery('.wdi_user').length == 1) {
417
+ jQuery('#wdi_add_user_ajax_input').attr('disabled', 'disabled');
418
+ jQuery('#wdi_add_user_ajax_input').attr('placeholder', wdi_messages.available_in_pro);
419
+ }
420
+ }
421
+
422
+ } else {
423
+ if (!_this.hasData(response) && vObj.msg == 'success') {
424
+ if (ignoreConfirm != true) {
425
+ if (confirm(wdi_messages.hashtag_no_data)) {
426
+ _this.addHashtag(tagname, response);
427
+
428
+ if (wdi_version.is_pro == 'false') {
429
+ if (jQuery('.wdi_user').length == 1) {
430
+ jQuery('#wdi_add_user_ajax_input').attr('disabled', 'disabled');
431
+ jQuery('#wdi_add_user_ajax_input').attr('placeholder', wdi_messages.available_in_pro);
432
+ }
433
+ }
434
+
435
+ } else {
436
+ jQuery('#wdi_add_user_ajax_input').val('');
437
+ };
438
+ } else {
439
+ _this.addHashtag(tagname, response);
440
+
441
+ if (wdi_version.is_pro == 'false') {
442
+ if (jQuery('.wdi_user').length == 1) {
443
+ jQuery('#wdi_add_user_ajax_input').attr('disabled', 'disabled');
444
+ jQuery('#wdi_add_user_ajax_input').attr('placeholder', wdi_messages.available_in_pro);
445
+ }
446
+ }
447
+ }
448
+ } else {
449
+ alert(vObj.msg);
450
  }
451
 
 
 
 
 
 
452
  }
 
 
453
 
 
 
 
454
  }
455
  });
 
456
 
457
  break;
458
  }
459
+ }
 
460
 
 
 
 
 
 
 
 
 
 
 
 
461
 
 
 
 
 
 
 
 
 
 
 
 
462
 
 
 
 
 
 
463
  }
 
 
 
 
 
 
 
 
 
 
 
464
 
465
+ /**
466
+ * Scans wdi_controller.feed_users array and if duplicate matched then returns false else true
467
+ * @param {String} username [name of user we want to check]
468
+ * @return {Boolean}
469
+ */
470
+ wdi_controller.checkForDuplicateUser = function(username) {
471
+ for (var i = 0; i < this.feed_users.length; i++) {
472
+ if (username == this.feed_users[i]['username']) {
473
+ return true;
474
+ }
475
  }
476
+ return false;
477
  }
478
+
479
+ wdi_controller.getInputType = function(input) {
480
+ switch (input[0]) {
481
+ case '#':
482
+ {
483
+ return 'hashtag';
484
+ break;
 
485
  }
486
+ case '%':
487
+ {
488
+ return 'location';
489
+ break;
490
+ }
491
+ default:
492
+ {
493
+ return 'user';
494
+ break;
495
+ }
496
+
497
+ }
498
+ }
499
+
500
+
501
+
502
+ /**
503
+ * Makes username and id pairs from users array and return json_encoded string
504
+ * @param {Array} feed_users [array of feed_users containing username and id and other parameters]
505
+ * @return {String} [JSON encoded data]
506
+ */
507
+ wdi_controller.stringifyUserData = function(feed_users) {
508
+ var users = [];
509
+ for (var i = 0; i < feed_users.length; i++) {
510
+ users.push({
511
+ username: feed_users[i]['username'],
512
+ id: feed_users[i]['id']
513
+ })
514
  }
515
+ return JSON.stringify(users);
516
  }
517
+
518
+
519
+
520
+ /**
521
+ * Binds 'click' and 'enter' event to add user button
522
+ *
523
+ */
524
+ wdi_controller.bindAddNewUserOrHashtagEvent = function() {
525
+ jQuery('#wdi_add_user_ajax').on('click', function() {
526
+ var user_input = jQuery('#wdi_add_user_ajax_input').val().trim().toLowerCase();
527
+ wdi_controller.makeInstagramUserRequest(user_input);
528
  });
529
  jQuery('#wdi_add_user_ajax_input').on("keypress", function(e) {
530
+ if (e.keyCode == 13) {
531
+ var user_input = jQuery('#wdi_add_user_ajax_input').val().trim().toLowerCase();
532
+ wdi_controller.makeInstagramUserRequest(user_input);
533
+ return false; // prevent the button click from happening
534
+ }
535
  });
536
 
537
  }
538
+
539
+ /**
540
+ * Removes users from internal wdi_controller.feed_users array and also
541
+ * updates GUI (by removing user elements)
542
+ *
543
+ * @param {Object} $this [jQuery object of remove user button]
544
+ */
545
+ wdi_controller.removeFeedUser = function($this) {
546
 
547
 
548
  var username = $this.parent().find('a span').text();
549
+ if ($this.parent().find('a span').hasClass('wdi_hashtag')) {
550
  username = '#' + username;
551
  }
552
+
553
+ for (var i = 0; i < this.feed_users.length; i++) {
554
+ if (this.feed_users[i]['username'] == username) {
555
+ this.feed_users.splice(i, 1);
556
+ break;
557
+ }
558
+ }
559
+
560
  $this.parent().remove();
561
+ //wdi_controller.updateHiddenField();
562
+ if (username !== jQuery('#wdi_default_user').val()) {
563
+ wdi_controller.updateFeaturedImageSelect(username, 'remove');
564
  }
565
 
566
  if(wdi_version.is_pro == 'false'){
569
  jQuery('#wdi_add_user_ajax_input').attr('placeholder','');
570
  }
571
  }
572
+
573
  }
574
 
575
 
576
+ /**
577
+ * Adds or removes users from featured image select
578
+ *
579
+ * @param {String} username [username of user we want to add/remove]
580
+ * @param {String} action [valid options are 'add' and 'remove']
581
+ * @param {String} selected [if is set 'selected' then user will be marked as selected in select element]
582
+ */
583
+ wdi_controller.updateFeaturedImageSelect = function(username, action, selected) {
584
+ var select = jQuery('#WDI_thumb_user');
585
+ if (selected != 'selected') {
586
+ selected = '';
587
+ }
588
+ switch (action) {
589
+ case 'add':
590
+ {
591
+ //check if there is no duplicate then add
592
+ var flag = select.find('option[value="' + username + '"]').length;
593
+ if (!flag) {
594
+
595
+ var option = jQuery('<option ' + selected + ' value="' + username + '">' + username + '</option>');
596
+ select.append(option);
597
+ }
598
 
599
+ break;
600
+ }
601
+ case 'remove':
602
+ {
603
+ select.find('option[value="' + username + '"]').remove();
604
+ break;
605
+ }
606
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
607
 
608
+ }
609
 
610
 
611
+
612
+ ////////////////////////////////////////////////////////////////////////////////
613
+ ///////////////////////////////Themes Page//////////////////////////////////////
614
+ ////////////////////////////////////////////////////////////////////////////////
615
+ wdi_controller.bindSaveThemeEvent = function() {
616
+ jQuery('#wdi_save_theme_submit').on('click', function() {
617
+ jQuery('#task').attr('value', 'save_feed');
618
+ jQuery('#wdi_save_feed').submit();
619
+ });
620
+ jQuery('#wdi_save_theme_apply').on('click', function() {
621
+ jQuery('#task').attr('value', 'apply_changes');
622
+ var id = jQuery('#wdi_add_or_edit').attr('value');
623
+ jQuery('#wdi_current_id').attr('value', id);
624
+ jQuery('#wdi_save_feed').submit();
625
+ });
626
+ jQuery('#wdi_save_theme_reset').on('click', function() {
627
+ jQuery('#task').attr('value', 'reset_changes');
628
+ var id = jQuery('#wdi_add_or_edit').attr('value');
629
+ jQuery('#wdi_current_id').attr('value', id);
630
+ jQuery('#wdi_save_feed').submit();
631
+ });
632
+ }
633
+
634
+
635
+ /**
636
+ * This function is called when one of controll buttons are being clicked
637
+ * it checks if user has typed any username in unsername input
638
+ * but forgetted to add it then it creates an object called wdi_controller.waitingAjaxRequestEnd
639
+ * which previous task
640
+ *
641
+ * @param {String} task [how to save element save/apply/reset]
642
+ * @return {Boolean} [1 if user forgotted to save and 0 if input field was empty]
643
+ */
644
+ wdi_controller.checkIfUserNotSaved = function(task) {
645
+ switch (task) {
646
+ case 'save_feed':
647
+ {
648
+ task = 'submit';
649
  break;
650
  }
651
+ case 'apply_changes':
652
+ {
653
+ task = "apply";
654
+ break;
655
+ }
656
+ case 'reset_changes':
657
+ {
658
+ task = 'reset';
659
+ break;
660
+ }
661
+ }
 
 
 
 
662
 
663
+ //checking if user has typed username in input field but didn't saved it, trigger add action
664
+ if (jQuery('#wdi_add_user_ajax_input').val().trim() != '') {
665
+ var user_input = jQuery('#wdi_add_user_ajax_input').val().trim().toLowerCase();
666
+ wdi_controller.waitingAjaxRequestEnd = {
667
+ button: task
668
+ };
669
+ //making request
670
+ wdi_controller.makeInstagramUserRequest(user_input);
671
+ return 1;
672
+ } else {
673
+ wdi_controller.waitingAjaxRequestEnd = {
674
+ button: 0
675
+ };
676
+ return 0;
677
+ }
678
+ }
679
 
680
+ /**
681
+ * if user was clicked save before ajax request then trigger save after getting info
682
+ *
683
+ * @param {String} correctUserFlag [if set to false form wouldn't be submitted]
684
+ */
685
+ wdi_controller.saveFeedAfterAjaxWait = function(correctUserFlag) {
686
 
687
+ if (wdi_controller.waitingAjaxRequestEnd != undefined) {
688
+ //if save button was clicked before ajax request then trigger save button
689
+ var save_type_btn = wdi_controller.waitingAjaxRequestEnd.button;
690
+ if (correctUserFlag && save_type_btn != 0) {
691
+ jQuery('#wdi_save_feed_' + save_type_btn).trigger('click');
692
+ }
693
+ wdi_controller.waitingAjaxRequestEnd = undefined;
694
+ }
695
+ }
696
 
697
 
698
+ /**
699
+ * Gets cookie value by name
700
+ * @param {String} name [cookie name]
701
+ * @return {String} [cookie value]
702
+ */
703
+ wdi_controller.getCookie = function(name) {
704
+ var value = "; " + document.cookie;
705
+ var parts = value.split("; " + name + "=");
706
+ if (parts.length == 2) return parts.pop().split(";").shift();
707
+ }
708
 
709
+ /**
710
+ * Checks if response has meta code other then 200 or if it has not any data in it
711
+ * then returns false
712
+ * @param {Object} response [Instagram API response]
713
+ * @return {Boolean}
714
+ */
715
+ wdi_controller.isValidResponse = function(response) {
716
+
717
+ var obj = {};
718
+ if (typeof response == 'undefined' || typeof response['meta']['code'] == 'undefined' || response['meta']['code'] != 200) {
719
+ obj.valid = false;
720
+ if (typeof response == 'undefined') {
721
+ obj.msg = wdi_messages.instagram_server_error;
722
+ } else if (response['meta']['code'] !== 200) {
723
+ obj.msg = response['meta']['error_message'];
724
+ } else {
725
+ obj.msg = '';
726
+ }
727
+ } else {
728
+ obj.valid = true;
729
+ obj.msg = 'success';
730
+ }
731
+ return obj;
732
+ }
733
 
734
 
735
+ /**
736
+ * Return true if response has data object which is not empty
737
+ * @param {Onject} response [instagram API response]
738
+ * @return {Boolean} [true or false]
739
+ */
740
+ wdi_controller.hasData = function(response) {
741
+ if (typeof response != 'undefined' && typeof response['data'] != 'undefined' && response['data'].length != 0) {
742
+ return true;
743
+ } else {
744
+ return false;
745
+ }
746
+ }
747
 
748
+
749
+ /**
750
+ * Return true if user is featured user
751
+ * @param {String} [user] username we want to check
752
+ * @return {Boolean} true or false
753
+ */
754
+ wdi_controller.thumbUser = function(user) {
755
+ return (jQuery('#wdi_thumb_user').val() == user) ? true : false;
756
  }
757
+
758
+
759
+ /**
760
+ * finds user by username in instagram api request object
761
+ * if user is found then returns user object otherwise returns false
762
+ *
763
+ * @param {String} username [username we are searching for]
764
+ * @param {Object} response [instagram API response]
765
+ * @return {Boolenan || Object}
766
+ */
767
+ wdi_controller.findUser = function(username, response) {
768
+ var data = [];
769
+ if (typeof response != 'undefined' && typeof response['data'] != 'undefined') {
770
+ data = response['data'];
771
+ }
772
+
773
+ for (var i = 0; i < data.length; i++) {
774
+ if (data[i]['username'] == username) {
775
+ return data[i];
776
  }
777
  }
778
+ return false;
779
+ }
780
+
781
+ /**
782
+ * Sanitizes hashtag and if it's ok then add it to internal wdi_controller.feed_users array
783
+ * besodes that it also updates GUI
784
+ *
785
+ * @param {String} tagname [name of hashtag to add without '#']
786
+ * @param {Object} response [instagram API response]
787
+ */
788
+ wdi_controller.addHashtag = function(tagname, response) {
789
+ //if tagname doesn't contain invalid characters
790
+ if (tagname.match(/[~!@$%&*#^()<>?]/) == null) {
791
+ if (this.checkForDuplicateUser('#' + tagname) == false) {
792
+ var newHashtag = jQuery('<div class="wdi_user"><a target="_blank" href="https://instagram.com/explore/tags/' + tagname + '">' + '<img class="wdi_profile_pic" src="' + wdi_url.plugin_url + '/images/hashtag.png"><span class="wdi_hashtag">' + tagname + '</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>');
793
+ jQuery('#wdi_feed_users').append(newHashtag);
794
+ jQuery('#wdi_add_user_ajax_input').attr('value', '');
795
+ var profile_picture;
796
+ if (typeof response != 'undefined') {
797
+ profile_picture = (response['data'].length != 0) ? response['data'][0]['images']['thumbnail']['url'] : '';
798
+ } else {
799
+ profile_picture = '';
800
  }
801
 
802
+ this.feed_users.push({
803
+ username: '#' + tagname,
804
+ id: '#' + tagname,
805
+ profile_picture: profile_picture
806
+ });
807
+
808
+ var user_input = '#' + tagname;
809
+ selected = this.thumbUser(user_input) ? 'selected' : '';
810
+
811
+ wdi_controller.updateFeaturedImageSelect(user_input, 'add', selected);
812
+ } else {
813
+ alert('#' + tagname + ' ' + wdi_messages.already_added);
814
  }
815
+ } else {
816
+ alert(wdi_messages.invalid_hashtag);
817
+ }
818
 
819
+ this.updateConditionalFiltersUi();
820
+
821
+ wdi_controller.saveFeedAfterAjaxWait(true);
822
+
823
+ }
824
+
825
+
826
+ /**
827
+ * Adds given user to internal array wdi_controller.feed_users and also updates GUI
828
+ *
829
+ * @param {Object} user [Object conatining user information such as id, username and profile picture]
830
+ */
831
+ wdi_controller.addUser = function(user) {
832
+
833
+ if (this.checkForDuplicateUser(user.username) == false) {
834
+ newUser = jQuery('<div class="wdi_user"><a target="_blank" href="http://www.instagram.com/' + user.username + '">' + '<img class="wdi_profile_pic" src="' + user['profile_picture'] + '"><span class="wdi_username">' + user.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>');
835
+ jQuery('#wdi_feed_users').append(newUser);
836
+ jQuery('#wdi_add_user_ajax_input').attr('value', '');
837
+ this.feed_users.push({
838
+ username: user['username'],
839
+ id: user['id'],
840
+ profile_picture: user['profile_picture']
841
+ });
842
+
843
+ } else {
844
+ alert(user.username + ' ' + wdi_messages.already_added);
845
  }
846
+
847
+ //_this.updateHiddenField();
848
+ selected = this.thumbUser(user.username) ? 'selected' : '';
849
+
850
+ this.updateFeaturedImageSelect(user.username, 'add', selected);
851
+
852
+ this.updateConditionalFiltersUi();
853
+
854
+ wdi_controller.saveFeedAfterAjaxWait(true);
855
  }
856
 
857
 
858
+ /**
859
+ * Scans internal wdi_controller.feed_users array and return profile picture url of given user
860
+ * if there is no profile picture then returns blank string
861
+ *
862
+ * @param {String} username
863
+ * @return {String} ['profile picture url of user']
864
+ */
865
+ wdi_controller.getUserProfilePic = function(username) {
866
+ for (var i = 0; i < this.feed_users.length; i++) {
867
+ if (username == this.feed_users[i]['username']) {
868
+ return this.feed_users[i]['profile_picture'];
869
+ }
870
+ }
871
+ return 'false';
872
+ }
873
 
874
+
875
+
876
+ /*-------------------------------------------------------------
877
+ ----------------Conditional Filters Tab Methods----------------
878
+ -------------------------------------------------------------*/
879
+
880
+ /**
881
+ * Initiailizes conditional filter tabs with variables and methods
882
+ */
883
+ wdi_controller.conditionalFiltersTabInit = function() {
884
+ //get data from textarea and display it
885
+ this.setInitialFilters();
886
+ this.updateFiltersUi();
887
+
888
+ var _this = this;
889
+ jQuery('#wdi_add_filter').on('click', function() {
890
+ _this.addConditionalFilter();
891
+ jQuery('#wdi_filter_input').val('');
892
+ })
893
+
894
+
895
+ jQuery('.wdi_filter_radio').on('click', function() {
896
+ jQuery('#wdi_filter_input').trigger('focus');
897
+ });
898
+
899
+ jQuery('#wdi_filter_input').on('keypress', function(e) {
900
+ if (e.keyCode == 13) {
901
+ _this.addConditionalFilter();
902
+ jQuery(this).val('');
903
+ return false; // prevent the button click from happening
904
  }
 
905
  });
906
+
907
+
908
+
909
+
910
+
911
+ conditional_filters_toggler();
912
+ jQuery('#WDI_wrap_conditional_filter_enable input').on('change',function(){
913
+ conditional_filters_toggler();
914
+ })
915
+
916
+ function conditional_filters_toggler(){
917
+ switch(jQuery('#WDI_wrap_conditional_filter_enable input:checked').val()){
918
+ case '0':{
919
+ jQuery('#WDI_conditional_filters').parent().parent().addClass('wdi_hidden');
920
+ jQuery('#WDI_conditional_filter_type').parent().parent().parent().parent().parent().addClass('wdi_hidden');
921
+ jQuery('#wdi_final_condition').addClass('wdi_hidden');
922
+ jQuery('#WDI_filter_source').addClass('wdi_hidden');
923
+ break;
924
+ }
925
+ case '1':{
926
+ jQuery('#WDI_conditional_filters').parent().parent().removeClass('wdi_hidden');
927
+ jQuery('#WDI_conditional_filter_type').parent().parent().parent().parent().parent().removeClass('wdi_hidden');
928
+ jQuery('#wdi_final_condition').removeClass('wdi_hidden');
929
+ jQuery('#WDI_filter_source').removeClass('wdi_hidden');
930
+ break;
931
+ }
932
+ }
933
+ }
934
+
935
+ jQuery('#WDI_conditional_filter_type').on('change',function(){
936
+ if(jQuery(this).val() == 'none'){
937
+
938
  }else{
939
+ jQuery('#WDI_conditional_filters').css('display','block');
940
  }
941
+
942
+ jQuery(this).parent().find('label').css({
943
+ 'line-height' : '24px',
944
+ 'height' : '24px',
945
+ 'padding' : '2px 5px',
946
+ 'display' : 'inline-block',
947
+ 'font-size': '15px',
948
+ 'color': 'black',
949
+ 'font-weight': '500',
950
+ '-webkit-user-select': 'none', /* Chrome/Safari */
951
+ '-moz-user-select': 'none', /* Firefox */
952
+ '-ms-user-select': 'none', /* IE10+ */
953
+
954
+ /* Rules below not implemented in browsers yet */
955
+ '-o-user-select': 'none',
956
+ 'user-select': 'none',
957
+ });
958
+
959
+ switch( jQuery(this).val()){
960
+ case 'AND':{
961
+ jQuery('#WDI_conditional_filters').css('display','block');
962
+ jQuery(this).parent().find('label').html(wdi_messages.and_descr);
963
+ break;
964
+ }
965
+ case 'OR':{
966
+ jQuery('#WDI_conditional_filters').css('display','block');
967
+ jQuery(this).parent().find('label').html(wdi_messages.or_descr);
968
+ break;
969
+ }
970
+ case 'NOR':{
971
+ jQuery('#WDI_conditional_filters').css('display','block');
972
+ jQuery(this).parent().find('label').html(wdi_messages.nor_descr);
973
+ break;
974
+ }
975
+ }
976
+
977
+ wdi_controller.updateFiltersUi();
978
  });
979
+ //triggering change for updating first time
980
+ jQuery('#WDI_conditional_filter_type').trigger('change');
981
+
982
+ }
983
+
984
+ /**
985
+ * Takes user input and adds new filter based on filter type and user input
986
+ */
987
+ wdi_controller.addConditionalFilter = function() {
988
+ var input = jQuery('#wdi_filter_input').val(),
989
+ //filter_type = jQuery('input[name="wdi_filter_type"]:checked').val(),
990
+ filter_type = jQuery('#wdi_filter_type').val(),
991
+ filter = {};
992
+
993
+ if( input == '' ) { return; }
994
+
995
+ input = input.trim();
996
+
997
+ switch(filter_type){
998
+ case 'username':{
999
+ if( input[0] == '@' ){
1000
+ input = input.substr(1,input.length);
1001
+ }
1002
+ break;
1003
+ }
1004
+ case 'mention':{
1005
+ if( input[0] == '@' ){
1006
+ input = input.substr(1,input.length);
1007
+ }
1008
+ break;
1009
+ }
1010
+ case 'hashtag':{
1011
+ if( input[0] == '#' ){
1012
+ input = input.substr(1,input.length);
1013
+ }
1014
+ break;
1015
+ }
1016
+ case 'url':{
1017
+ var urlRegex = /^(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;
1018
+ if(!urlRegex.test(input)){
1019
+ alert(wdi_messages.invalid_url);
1020
+ return;
1021
+ }
1022
+ break;
1023
+ }
1024
+ }
1025
+
1026
+
1027
+ filter = {
1028
+ 'filter_type': filter_type,
1029
+ 'filter_by': input,
1030
+ 'id': this.randomId()
1031
+ };
1032
+
1033
+ if( filter_type != null ){
1034
+ if( !this.filterExists(filter) ){
1035
+ this.conditionalFilters.push(filter);
1036
+ this.updateFiltersUi();
1037
+ }else{
1038
+ alert(input + ' ' + wdi_messages.already_added);
1039
+ }
1040
+ }else{
1041
+ alert(wdi_messages.selectConditionType);
1042
+ }
1043
+
1044
+ }
1045
+
1046
+ /**
1047
+ * Returns true if filter exists else returns false
1048
+ * @param {Object} filter [Filter objecr]
1049
+ * @return {Booleans} [true or false]
1050
+ */
1051
+ wdi_controller.filterExists = function(filter) {
1052
+ for (var i = 0; i < this.conditionalFilters.length; i++) {
1053
+ if (this.conditionalFilters[i].filter_type == filter.filter_type && this.conditionalFilters[i].filter_by == filter.filter_by) {
1054
+ return true;
1055
  }
1056
+ }
1057
+ return false;
1058
+ }
1059
+
1060
+
1061
+ /**
1062
+ * Updates #wdi_filters_ui div to the latest version of filters according wdi_controller.conditionalFilters
1063
+ */
1064
+ wdi_controller.updateFiltersUi = function(){
1065
+ var uiElement = jQuery('#wdi_filters_ui').html('');
1066
+ for( var i = 0; i < this.conditionalFilters.length; i++ ){
1067
 
1068
+ if( i == 0 ){
1069
+ if( this.conditionalFilters.length != 1 ){
1070
+ switch( jQuery('#WDI_conditional_filter_type').val() ){
1071
+ case 'AND':{
1072
+
1073
+ break;
1074
+ }
1075
+ case 'OR':{
1076
+ uiElement.append(jQuery('<span class="wdi_logic">'+wdi_messages.either+'</span>'));
1077
+ break;
1078
+ }
1079
+ case 'NOR':{
1080
+ uiElement.append(jQuery('<span class="wdi_logic">'+wdi_messages.neither+'</span>'));
1081
+ break;
1082
+ }
1083
+ }
1084
+ }else{
1085
+ switch( jQuery('#WDI_conditional_filter_type').val() ){
1086
+ case 'AND':{
1087
+ break;
1088
+ }
1089
+ case 'OR':{
1090
+ break;
1091
+ }
1092
+ case 'NOR':{
1093
+ uiElement.append(jQuery('<span class="wdi_logic">'+wdi_messages.not+'</span>'));
1094
+ break;
1095
+ }
1096
+ }
1097
+ }
1098
+
1099
+ }
1100
+
1101
+ var glue;
1102
+ switch(jQuery('#WDI_conditional_filter_type').val()){
1103
+ case 'AND':{
1104
+ glue = wdi_messages.and;
1105
+ break;
1106
+ }
1107
+ case 'OR':{
1108
+ glue = wdi_messages.or;
1109
+ break;
1110
+ }
1111
+ case 'NOR': {
1112
+ glue = wdi_messages.nor;
1113
+ break;
1114
+ }
1115
+ }
1116
+
1117
+ if( i>=1 ){
1118
+ uiElement.append(jQuery('<span class="wdi_logic">'+glue+'</span>'));
1119
+ }
1120
+
1121
+ uiElement.append(this.createUiElement(this.conditionalFilters[i]));
1122
+
1123
+ }
1124
+ this.updateFilterTextarea();
1125
  }
1126
 
1127
+ /**
1128
+ * Creates jQuery element for filter
1129
+ * @param {Object} filter [filter object]
1130
+ * @return {Object} [jQuery Object]
1131
+ */
1132
+ wdi_controller.createUiElement = function(filter){
1133
+ var specialChar;
1134
+ switch(filter['filter_type']){
1135
+ case 'mention':{
1136
+ specialChar = '@';
1137
  break;
1138
  }
1139
+ case 'hashtag':{
1140
+ specialChar = '#';
1141
  break;
1142
  }
1143
+ case 'location':{
1144
+ specialChar = '%';
1145
+ break;
1146
+ }
1147
+ default:{
1148
+ specialChar = '';
1149
  break;
1150
  }
1151
  }
1152
+
1153
+ var filter_item = jQuery('<span data-id="'+filter['id']+'" class="wdi_filter_item wdi_filter_by_'+ filter['filter_type'] +'"></span>').
1154
+ html(specialChar + filter['filter_by'] + '<span onclick="wdi_controller.removeConditionalFilter(jQuery(this));" class="wdi_remove_filter">X</span>');
1155
+ return filter_item;
1156
+ }
1157
+
1158
+ /**
1159
+ * Used for generating random ids
1160
+ * @return {String} [random 5 length string]
1161
+ */
1162
+ wdi_controller.randomId = function() {
1163
+ var text = "";
1164
+ var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
1165
+ for (var i = 0; i < 5; i++)
1166
+ text += possible.charAt(Math.floor(Math.random() * possible.length));
1167
+ return text;
1168
  }
1169
+
1170
+ /**
1171
+ * Removes filter from wdi_controller.conditionalFilters array and updates #wdi_filters_ui
1172
+ * @param {Object} element [jQuery object]
1173
+ */
1174
+ wdi_controller.removeConditionalFilter = function(element) {
1175
+ var id = element.parent().attr('data-id');
1176
+ for (var i = 0; i < this.conditionalFilters.length; i++) {
1177
+ if (this.conditionalFilters[i]['id'] == id) {
1178
+ this.conditionalFilters.splice(i, 1);
1179
  }
 
1180
  }
1181
+ this.updateFiltersUi();
1182
+ }
1183
+
1184
+ /**
1185
+ * Updates textarea to the latest version of conditionalFilters json
1186
+ */
1187
+ wdi_controller.updateFilterTextarea = function() {
1188
+ var json,
1189
+ filters = this.conditionalFilters;
1190
+
1191
+ json = JSON.stringify(filters);
1192
+ jQuery('#wdi_conditional_filters_textarea').val(json);
1193
+ }
1194
+
1195
+ /**
1196
+ * Gets json from textarea and sets them as conditionalfilters array
1197
+ */
1198
+ wdi_controller.setInitialFilters = function() {
1199
+ var filters = [],
1200
+ json = jQuery('#wdi_conditional_filters_textarea').val();
1201
+
1202
+ if (this.isJsonString(json)) {
1203
+ filters = JSON.parse(json);
1204
+ }
1205
+
1206
+ this.conditionalFilters = filters;
1207
+ }
1208
+
1209
+
1210
+
1211
+ /**
1212
+ * Updates Conditional Filter User interfaces
1213
+ */
1214
+ wdi_controller.updateConditionalFiltersUi = function(){
1215
+ wdi_controller.updateFilterSource();
1216
+ }
1217
+
1218
+ /**
1219
+ * Updates Conditinal filter source
1220
+ */
1221
+ wdi_controller.updateFilterSource = function(){
1222
+ var users = [],
1223
+ username,
1224
+ userThumb;
1225
+
1226
+ jQuery('.wdi_user').each(function(){
1227
+ if ( jQuery( this ).find( '.wdi_username' ).length != 0 ) {
1228
+ username = jQuery( this ).find( '.wdi_username' ).text();
1229
+ }else{
1230
+ username = jQuery( this ).find( '.wdi_hashtag' ).text();
1231
+ }
1232
+ userThumb = jQuery( this ).find( 'img' ).attr('src');
1233
+ users.push( {
1234
+ 'username' : username,
1235
+ 'image' : userThumb
1236
+ } )
1237
+ });
1238
+
1239
+ var sourceDiv = jQuery('#wdi_filter_source').html('');
1240
+ for ( var i = 0; i < users.length; i++ ){
1241
+ var singleUserHtml = "<div class='wdi_source_user'><span class='wdi_source_img'><img src='" + users[i].image + "'></span><span class='wdi_source_username'>"+users[i].username+"</span></div>";
1242
+ sourceDiv.html( sourceDiv.html() + singleUserHtml );
1243
+ }
1244
+
1245
  }
1246
 
1247
 
1248
+ /**
1249
+ * Checks if given string is JSON string
1250
+ * @param {String} str [string to check]
1251
+ * @return {Boolean} [true or false]
1252
+ */
1253
+ wdi_controller.isJsonString = function(str) {
1254
+ try {
1255
+ JSON.parse(str);
1256
+ } catch (e) {
1257
+ return false;
1258
+ }
1259
+ return true;
1260
+ }
1261
 
1262
 
1263
  ///////////////////////////////////////////////////////////////////////////////
1264
  ///////////////Feeds and themes first view functions///////////////////////////
1265
  ////////////////////////////////////////////////////////////////////////////////
1266
 
1267
+
1268
  function wdi_spider_select_value(obj) {
1269
+ obj.focus();
1270
+ obj.select();
1271
  }
1272
 
1273
  // Set value by id.
1274
  function wdi_spider_set_input_value(input_id, input_value) {
1275
+ if (input_value === 'add') {
1276
+ if (jQuery('#wdi_access_token').attr('value') == '') {
1277
+ alert('Please get your access token');
1278
+ }
1279
+ }
1280
+ if (document.getElementById(input_id)) {
1281
+ document.getElementById(input_id).value = input_value;
1282
+ }
1283
  }
1284
 
1285
  // Submit form by id.
1286
  function wdi_spider_form_submit(event, form_id) {
1287
+ if (document.getElementById(form_id)) {
1288
+ document.getElementById(form_id).submit();
1289
+ }
1290
+ if (event.preventDefault) {
1291
+ event.preventDefault();
1292
+ } else {
1293
+ event.returnValue = false;
1294
+ }
 
1295
  }
1296
 
1297
 
1298
 
 
1299
  // Check all items.
1300
  function wdi_spider_check_all_items() {
1301
+ wdi_spider_check_all_items_checkbox();
1302
+ // if (!jQuery('#check_all').attr('checked')) {
1303
+ jQuery('#check_all').trigger('click');
1304
+ // }
1305
  }
1306
 
1307
  function wdi_spider_check_all_items_checkbox() {
1308
+ if (jQuery('#check_all_items').attr('checked')) {
1309
+ jQuery('#check_all_items').attr('checked', false);
1310
+ jQuery('#draganddrop').hide();
1311
+ } else {
1312
+ var saved_items = (parseInt(jQuery(".displaying-num").html()) ? parseInt(jQuery(".displaying-num").html()) : 0);
1313
+ var added_items = (jQuery('input[id^="check_pr_"]').length ? parseInt(jQuery('input[id^="check_pr_"]').length) : 0);
1314
+ var items_count = added_items + saved_items;
1315
+ jQuery('#check_all_items').attr('checked', true);
1316
+ if (items_count) {
1317
+ jQuery('#draganddrop').html("<strong><p>Selected " + items_count + " item" + (items_count > 1 ? "s" : "") + ".</p></strong>");
1318
+ jQuery('#draganddrop').show();
1319
+ }
1320
+ }
 
1321
  }
1322
 
1323
  function wdi_spider_check_all(current) {
1324
+ if (!jQuery(current).attr('checked')) {
1325
+ jQuery('#check_all_items').attr('checked', false);
1326
+ jQuery('#draganddrop').hide();
1327
+ }
1328
  }
1329
 
1330
  // Set value by id.
1331
  function wdi_spider_set_input_value(input_id, input_value) {
1332
+ if (input_value === 'add') {
1333
+ if (jQuery('#wdi_access_token').attr('value') == '') {
1334
+ alert('Please get your access token');
1335
+ }
1336
+ }
1337
+ if (document.getElementById(input_id)) {
1338
+ document.getElementById(input_id).value = input_value;
1339
+ }
1340
+ }
 
 
 
 
 
 
 
 
 
 
 
 
js/wdi_frontend.js CHANGED
@@ -1,343 +1,368 @@
1
- if(typeof wdi_front == 'undefined'){
2
  wdi_front = {
3
  type: 'not_declared'
4
  };
5
  }
6
- jQuery(document).ready(function(){
7
- if(wdi_front['type'] != 'not_declared'){
8
- wdi_front.clickOrTouch = wdi_front.detectEvent();
9
  //initializing all feeds in the page
10
  wdi_front.globalInit();
11
- }else{
12
  return;
13
  }
14
-
15
  });
16
 
17
 
18
- wdi_front.detectEvent = function(){
19
  var isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
20
- if(isMobile){
21
  return "touchend";
22
- }else{
23
  return 'click';
24
  }
25
  }
26
- wdi_front.globalInit = function(){
 
27
  var num = wdi_front['feed_counter'];
28
- var currentFeed = '';
29
 
30
-
31
 
32
- for(var i = 0; i <= num; i++){
33
- currentFeed = window['wdi_feed_'+i];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  wdi_front.access_token = currentFeed['feed_row']['access_token'];
 
35
  currentFeed.dataStorage = []; //stores all avialable data
36
- currentFeed.dataStorageList = [];
37
- currentFeed.allResponseLength = 0;
38
  //number of instagram objects which has been got by single request
39
  currentFeed.currentResponseLength = 0;
40
 
41
  //temprorary usersData which is uses in case when getted data is smaller then needed
42
  currentFeed.temproraryUsersData = [];
43
 
44
- currentFeed.removedUsers = 0;
45
  currentFeed.nowLoadingImages = true;
46
  currentFeed.imageIndex = 0; //index for image indexes
47
- currentFeed.resIndex = 0; //responsive indexes used for pagination
48
  currentFeed.currentPage = 1; //pagination page number
49
  currentFeed.userSortFlags = []; //array for descripbing user based filter options
50
  currentFeed.customFilterChanged = false; //flag to notice filter change, onclick on username
51
- window.onload = function(){
52
- for(var i = 0; i <= wdi_front.feed_counter;i++){
53
- window['wdi_feed_'+i]['nowLoadingImages'] = false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  }
55
  }
56
 
57
- if(currentFeed.feed_row.feed_type == 'masonry'){
58
  currentFeed.displayedData = [];
59
  }
60
 
61
 
62
 
63
  //if pagination is on then set pagination parameters
64
- if(currentFeed.feed_row.feed_display_view == 'pagination'){
65
  currentFeed.feed_row.resort_after_load_more = 0;
66
- if(currentFeed.feed_row.feed_type != 'image_browser'){
67
  currentFeed.feed_row.load_more_number = parseInt(currentFeed.feed_row.pagination_per_page_number);
68
- currentFeed.feed_row.number_of_photos = (1 + parseInt(currentFeed.feed_row.pagination_preload_number))*currentFeed.feed_row.load_more_number;
69
- }else{
70
  currentFeed.feed_row.number_of_photos = 1 + parseInt(currentFeed.feed_row.image_browser_preload_number);
71
  currentFeed.feed_row.load_more_number = parseInt(currentFeed.feed_row.image_browser_load_number);
72
  }
73
-
74
-
75
- currentFeed.freeSpaces =(Math.floor(currentFeed.feed_row.pagination_per_page_number/currentFeed.feed_row.number_of_columns)+1)*currentFeed.feed_row.number_of_columns - currentFeed.feed_row.pagination_per_page_number;
76
- }else{
77
  currentFeed.freeSpaces = 0;
78
  }
79
-
 
80
 
81
  wdi_front.bindEvents(currentFeed);
82
 
83
 
84
 
85
  //initializing function for lightbox
86
- currentFeed.galleryBox = function(image_id){
87
- wdi_spider_createpopup(wdi_url.ajax_url+'?gallery_id=' + this.feed_row['id'] + '&image_id=' + image_id, wdi_front.feed_counter, this.feed_row['lightbox_width'], this.feed_row['lightbox_height'], 1, 'testpopup', 5,this);
88
- }
89
- //calling responive javascript
90
  wdi_responsive.columnControl(currentFeed);
91
 
92
  //if feed type is masonry then trigger resize event for building proper column layout
93
- if(currentFeed.feed_row.feed_type == 'masonry'){
94
  jQuery(window).trigger('resize');
95
  }
 
 
 
 
 
 
 
96
  //initializing each feed
97
  wdi_front.init(currentFeed);
98
- }
99
 
100
  }
101
 
102
- wdi_front.init = function(currentFeed){
 
103
 
104
-
105
  //some varables used in code
106
- currentFeed.photoCounter = currentFeed.feed_row["number_of_photos"];
107
 
108
 
109
- //loading feed
110
- //requesting user photos and adding ajax loading
111
- currentFeed.feed_users = currentFeed.feed_row['feed_users'].split(',');
112
- currentFeed.dataCount = currentFeed.feed_users.length;
113
- for(var i=0;i<currentFeed.feed_users.length;i++){
114
- wdi_front.instagramRequest(i,currentFeed,33);
 
 
 
 
115
  }
116
 
117
 
 
 
 
 
 
 
118
 
119
- if(currentFeed.feed_row["number_of_photos"] > 0){
120
  wdi_front.ajaxLoader(currentFeed);
121
  }
122
-
 
123
  //setting feed name
124
- if(currentFeed['feed_row']['display_header']==='1'){
125
- wdi_front.show('header',currentFeed);
126
  }
127
- if(currentFeed['feed_row']['show_usernames'] === '1'){
128
- wdi_front.show('users',currentFeed);
129
  }
130
-
131
 
132
  }
133
 
134
 
135
- /* checks if input is username or hashtag and then generates proper request
136
- * url for each type of input
137
- * after that if input is hashtag it simply requests
138
- * hashtag recent images and saves it in currentFeed.usersData array
139
- * if input is username it first requests for user ID and then calls wdi_front.requestUserPhotos()
140
- * method.
141
  */
142
- wdi_front.instagramRequest = function(id,currentFeed,htCount){
143
- var username = currentFeed.feed_users[id];
144
- var access_token = currentFeed.feed_row['access_token'];
145
- var errorMessage = '';
146
- var userFound = false;
147
- var userId = '';
148
- var requestUrl='';
149
- var hashtag = false;
150
- var hashtagCount = currentFeed.feed_row['number_of_photos'];
151
- if(htCount != undefined){
152
- hashtagCount = htCount;
153
  }
 
 
154
 
155
-
156
- if(isHashtag(username)){
157
- var tag = username.substr(1,username.length);
158
- requestUrl = 'https://api.instagram.com/v1/tags/'+tag+'/media/recent?access_token='+access_token+'&count='+hashtagCount;
159
- hashtag = true;
160
- }else{
161
- requestUrl = 'https://api.instagram.com/v1/users/search?q='+username+'&access_token='+access_token;
162
- }
163
-
164
- jQuery.ajax({
165
- url: requestUrl,
166
- type: 'POST',
167
- dataType: 'jsonp',
168
- async: false,
169
- success: function(response){
170
- if(response == '' || response == undefined || response == null){
171
- errorMessage = wdi_front_messages.connection_error;
172
- currentFeed.dataCount--;
173
- alert(errorMessage);
174
- return;
175
- }
176
- if(response['meta']['code'] != 200){
177
- errorMessage = response['meta']['error_message'];
178
- currentFeed.dataCount--;
179
- alert(errorMessage);
180
- return;
181
- }
182
- if(hashtag === false){
183
- for(var i=0;i<response['data'].length;i++){
184
- if(response['data'][i]['username'] === username){
185
- userFound = true;
186
- userId = response['data'][i]['id'];
187
- break;
188
  }
189
- }
190
- }else{
191
- var user = {
192
- 'userId' : username,
193
- 'username' : username,
194
- };
195
-
196
- wdi_front.saveUserData(response,user,currentFeed);
197
  }
198
-
199
- if(!userFound && hashtag===false){
200
- errorMessage = username+' '+ wdi_front_messages.user_not_found ;
201
- currentFeed.dataCount--;
202
- alert(errorMessage);
203
- return;
204
- }else{
205
- if(hashtag === false){
206
- var user = {
207
- 'userId' : userId,
208
- 'username' : username,
209
- };
210
- wdi_front.requestUserPhotos(user,currentFeed);
211
- }
212
-
213
  }
214
- }
215
- });
216
- function isHashtag(str){
217
- return (str[0]==='#');
218
  }
219
  }
220
 
221
- /*
222
- * generates Instagram request url based on arguments
 
 
223
  */
224
- wdi_front.generateRequestUrl = function(arg,currentFeed){
225
- var access_token = currentFeed.feed_row['access_token'];
226
- var baseUrl = 'https://api.instagram.com/v1/users/'+arg.userId+'/media/recent/?access_token='+access_token;
227
- if(arg.count != '' && arg.count != undefined && arg.count != null){
228
- baseUrl+='&count='+arg.count;
229
- }
230
- if(arg.min_timestamp != '' && arg.min_timestamp != undefined && arg.min_timestamp != null){
231
- baseUrl+='&min_timestamp='+arg.min_timestamp;
232
- }
233
- if(arg.max_timestamp != '' && arg.max_timestamp != undefined && arg.max_timestamp != null){
234
- baseUrl+='&max_timestamp='+arg.max_timestamp;
235
- }
236
- return baseUrl;
237
  }
 
 
238
  /*
239
  * Saves each user data on seperate index in currentFeed.usersData array
240
  * And also checks if all data form all users is already avialable if yes it displays feed
241
  */
242
- wdi_front.saveUserData = function(data,user,currentFeed){
 
243
  data['username'] = user.username;
244
- data['user_id'] = user.userId;
245
 
246
  //checking if user type is hashtag then manually add hashtag to each object, for later use
247
  //hashtag based filters
248
- if(data['user_id'][0]==='#'){
249
- data['data'] = wdi_front.appendRequestHashtag(data['data'],data['user_id']);
250
  }
251
-
252
-
253
  currentFeed.usersData.push(data);
254
 
255
 
256
- currentFeed.currentResponseLength = wdi_front.getArrayContentLength(currentFeed.usersData,'data');
257
  currentFeed.allResponseLength += currentFeed.currentResponseLength;
258
 
259
 
260
 
261
- if(currentFeed.dataCount == currentFeed.usersData.length){
262
-
263
  //if getted objects is not enough then recuest new ones
264
-
265
- if(currentFeed.currentResponseLength < currentFeed.feed_row.number_of_photos && !wdi_front.userHasNoPhoto(currentFeed)){
266
- /*here we are calling loadMore function out of recursion cylce, after this initial-keep kall
 
267
  loadMore will be called with 'initial' recursivly until the desired number of photos is reached
268
  if possible*/
269
- wdi_front.loadMore('initial-keep',currentFeed);
270
- }else{
271
-
 
 
 
272
  wdi_front.displayFeed(currentFeed);
273
  //when all data us properly displayed check for any active filters and then apply them
274
  wdi_front.applyFilters(currentFeed);
275
-
276
  }
277
 
278
-
279
  }
280
-
281
  }
282
- /*
283
- checks weather all feed users have any photos after first time request
284
- */
285
- wdi_front.userHasNoPhoto = function(currentFeed,cstData){
 
286
  var counter = 0;
287
  var data = currentFeed.usersData;
288
- if(cstData != undefined){
289
  data = cstData;
290
  }
291
- for(var i = 0; i < data.length;i++){
292
- if(data[i]['pagination']['next_max_id'] == undefined){
293
  counter++
294
  }
295
  }
296
- if(counter == data.length){
297
  return 1;
298
- }else{
299
  return 0;
300
  }
301
  }
 
302
  /*
303
  *gives each instagram object custom hashtag parameter, which is used for searching image/video
304
  */
305
- wdi_front.appendRequestHashtag = function(data,hashtag){
306
- for(var i = 0; i < data.length; i++){
307
  data[i]['wdi_hashtag'] = hashtag;
308
  }
309
  return data;
310
  }
311
- /*
312
- * Requests for user phots based on request url and saves it in currentFeed.usersData array
313
- */
314
- wdi_front.requestUserPhotos = function(user,currentFeed){
315
- //var count = currentFeed.feed_row['number_of_photos'];
316
- count = 33;
317
- var argument = {
318
- 'userId' : user.userId,
319
- 'count' : count,
320
- 'min_timestamp' :'',
321
- 'max_timestamp': ''
322
- };
323
- var errorMessage = '';
324
- var ajax_url = wdi_front.generateRequestUrl(argument,currentFeed);
325
- jQuery.ajax({
326
- type: "POST",
327
- url: ajax_url,
328
- dataType: 'jsonp',
329
- success: function(response){
330
- if(response['meta']['code'] != 200){
331
- errorMessage = response['meta']['error_message'];
332
- alert(user.username +' : '+ errorMessage);
333
- currentFeed.dataCount--;
334
- return;
335
- }
336
- wdi_front.saveUserData(response,user,currentFeed);
337
- }
338
- });
339
- }
340
-
341
 
342
 
343
 
@@ -346,626 +371,753 @@ wdi_front.requestUserPhotos = function(user,currentFeed){
346
  * also checks if one request is not enough for displaying all images user wanted
347
  * it recursively calls wdi_front.loadMore() until the desired number of photos is reached
348
  */
349
- wdi_front.displayFeed = function(currentFeed,load_more_number){
350
-
351
-
352
- if(currentFeed.customFilterChanged == false){
 
353
  //sorting data...
354
- var data = wdi_front.feedSort(currentFeed,load_more_number);
355
  }
356
-
357
-
 
 
 
 
 
358
  // if custom filter changed then display custom data
359
- if(currentFeed.customFilterChanged == true){
360
  var data = currentFeed.customFilteredData;
361
  //parsing data for lightbox
362
- currentFeed.parsedData = wdi_front.parseLighboxData(currentFeed,true);
363
  }
364
 
365
-
366
  //storing all sorted data in array for later use in user based filters
367
- if(currentFeed.feed_row.resort_after_load_more != '1'){
368
  // filter changes when user clicks to usernames in header
369
  // at that point displayFeed triggers but we don't have any new data so
370
  // we are not adding new data to our list
371
- if(currentFeed.customFilterChanged == false){
372
  currentFeed.dataStorageList = currentFeed.dataStorageList.concat(data);
373
  }
374
- }else{
375
  // filter changes when user clicks to usernames in header
376
  // at that point displayFeed triggers but we don't have any new data so
377
  // we are not adding new data to our list
378
- if(currentFeed.customFilterChanged == false){
379
  currentFeed.dataStorageList = data;
380
  }
381
  }
382
 
383
  //checking feed_type and calling proper rendering functions
384
- if(currentFeed.feed_row.feed_type == 'masonry'){
385
- wdi_front.masonryDisplayFeedItems(data,currentFeed);
386
  }
387
- if(currentFeed.feed_row.feed_type == 'thumbnails' || currentFeed.feed_row.feed_type == 'blog_style' || currentFeed.feed_row.feed_type == 'image_browser'){
388
- wdi_front.displayFeedItems(data,currentFeed);
389
  }
 
 
 
 
 
 
390
 
391
 
 
 
 
 
 
392
 
 
393
 
394
 
395
- //recursively calling load more to get photos
396
- var dataLength = wdi_front.getDataLength(currentFeed);
397
- if (dataLength < currentFeed.photoCounter){
398
- wdi_front.loadMore('',currentFeed);
399
-
400
- }else{
 
401
 
 
 
 
 
 
402
  }
 
403
 
404
  //checking if display_view is pagination and we are not on the last page then enable
405
  //last page button
406
- if(currentFeed.feed_row.feed_display_view == 'pagination' && currentFeed.currentPage<currentFeed.paginator){
407
- jQuery('#wdi_feed_'+currentFeed.feed_row.wdi_feed_counter).find('#wdi_last_page').removeClass('wdi_disabled');
408
- }
409
-
410
- }
411
-
412
-
413
- wdi_front.masonryDisplayFeedItems = function(data,currentFeed){
414
- var masonryColEnds = [];
415
- var masonryColumns = [];
416
-
417
-
418
- jQuery('#wdi_feed_'+currentFeed.feed_row['wdi_feed_counter']+' .wdi_masonry_column').each(function(){
419
-
420
- //if resorte after load more is on then reset columns on every load more
421
- if(currentFeed.feed_row.resort_after_load_more == 1 ){
422
- jQuery(this).html('');
423
- currentFeed.imageIndex = 0;
424
- }
425
-
426
- //if custom filter is set or changed then reset masonry columns
427
- if(currentFeed.customFilterChanged == true){
428
- jQuery(this).html('');
429
- currentFeed.imageIndex = 0;
430
- }
431
-
432
- //check if pagination is enabled then each page should have resetted colEnds
433
- //else give previous colEnds
434
- if(currentFeed.feed_row.feed_display_view == 'pagination'){
435
- masonryColEnds.push(0);
436
- }else{
437
- masonryColEnds.push(jQuery(this).height());
438
- }
439
-
440
- masonryColumns.push(jQuery(this));
441
- });
442
-
443
- //if custom filter is set or changed then reset masonry columns
444
- if(currentFeed.customFilterChanged == true){
445
- currentFeed.customFilterChanged = false;
446
- }
447
-
448
-
449
- //loop for displaying items
450
- for(var i=0;i<data.length;i++){
451
-
452
- currentFeed.displayedData.push(data[i]);
453
- if(data[i]['type'] == 'image'){
454
- var photoTemplate = wdi_front.getPhotoTemplate(currentFeed);
455
- }else{
456
- var photoTemplate = wdi_front.getVideoTemplate(currentFeed);
457
- }
458
-
459
- var rawItem = data[i];
460
- var item = wdi_front.createObject(rawItem,currentFeed);
461
- var html = photoTemplate(item);
462
 
463
- //find column with minumum height and append to it new object
464
- var shortCol = wdi_front.array_min(masonryColEnds);
465
- var imageResolution = wdi_front.getImageResolution(data[i]);
466
-
467
- masonryColumns[shortCol['index']].html(masonryColumns[shortCol['index']].html()+html);
468
- masonryColEnds[shortCol['index']] += masonryColumns[shortCol['index']].width()*imageResolution;
469
- currentFeed.imageIndex++;
470
-
471
 
472
- //changing responsive indexes for pagination
473
- if(currentFeed.feed_row.feed_display_view == 'pagination'){
474
- if((i+1)%currentFeed.feed_row.pagination_per_page_number === 0){
475
- currentFeed.resIndex+=currentFeed.freeSpaces+1;
476
- }else{
477
- currentFeed.resIndex++;
478
- }
479
- }
480
- }
481
 
 
 
482
 
483
- //binding onload event for ajax loader
484
- currentFeed.wdi_loadedImages = 0;
485
- var columnFlag = false;
486
- currentFeed.wdi_load_count = i;
487
- var wdi_feed_counter = currentFeed.feed_row['wdi_feed_counter'];
488
- var feed_wrapper = jQuery('#wdi_feed_'+wdi_feed_counter + ' img.wdi_img').on('load',function(){
489
- currentFeed.wdi_loadedImages++;
490
- checkLoaded();
491
 
492
- //calls wdi_responsive.columnControl() which calculates column number on page
493
- //and gives feed_wrapper proper column class
494
- if(columnFlag === false){
495
- wdi_responsive.columnControl(currentFeed,1);
496
- columnFlag = true;
497
- }
498
 
499
- //Binds caption opening and closing event to each image photo_title
500
- if(currentFeed.feed_row.feed_type != 'blog_style'){
501
- wdi_responsive.bindMasonryCaptionEvent(jQuery(this).parent().parent().parent().parent().find('.wdi_photo_title'),currentFeed);
502
- }
503
-
504
- });
505
 
506
- //checks if all iamges have been succesfully loaded then it updates variables for next time use
507
- function checkLoaded(){
 
 
 
 
 
 
 
 
 
 
508
 
509
- if(currentFeed.wdi_load_count===currentFeed.wdi_loadedImages && currentFeed.wdi_loadedImages!=0){
510
- currentFeed.loadedImages = 0;
511
- currentFeed.wdi_load_count = 0;
512
- wdi_front.allImagesLoaded(currentFeed);
513
-
 
 
 
 
 
 
 
 
 
 
 
514
  }
515
  }
 
 
516
 
517
- //checking if pagination next button was clicked then change page
518
- if(currentFeed.paginatorNextFlag == true){
519
- wdi_front.updatePagination(currentFeed,'next');
520
- }
521
 
522
- //check if load more done successfully then set infinite scroll flag to false
523
- currentFeed.infiniteScrollFlag = false;
524
-
525
-
526
- }
527
 
 
 
 
 
 
 
 
 
528
 
529
 
 
530
 
531
- /*
532
- * Calcuates image resolution
533
- */
534
- wdi_front.getImageResolution = function(data){
535
-
536
- var originalWidth = data['images']['standard_resolution']['width'];
537
- var originalHeight = data['images']['standard_resolution']['height'];
538
- var resolution = originalHeight/originalWidth;
539
- return resolution;
540
- }
541
- /*
542
- * Calculates data count on global Storage and if custom storage provied
543
- * it adds custom storage data count to golbals data count and returns length of all storages
544
- */
545
- wdi_front.getDataLength = function(currentFeed,customStorage){
546
- var length = 0;
547
- if(customStorage===undefined){
548
- for(var j=0;j<currentFeed.dataStorage.length;j++){
549
- length += currentFeed.dataStorage[j].length;
550
- }
551
- }else{
552
- for(var j=0;j<customStorage.length;j++){
553
- length += customStorage[j].length;
554
- }
555
  }
556
-
557
- return length;
558
- }
559
 
560
- wdi_front.getArrayContentLength = function(array,data){
561
- var sum = 0;
562
- for(var i = 0; i < array.length; i++){
563
- if(array[i]['finished']=='finished'){
564
- continue;
565
  }
566
- sum+=array[i][data].length;
567
- }
568
- return sum;
569
- }
570
- /*
571
- *
572
- */
573
- wdi_front.displayFeedItems = function(data,currentFeed){
574
 
575
- //gets ready data, gets data template, and appens it into feed_wrapper
576
- var wdi_feed_counter = currentFeed.feed_row['wdi_feed_counter'];
577
- var feed_wrapper = jQuery('#wdi_feed_'+wdi_feed_counter + ' .wdi_feed_wrapper');
578
-
579
- //if resort_after_pagination is on then rewrite feed data
580
- if(currentFeed.feed_row['resort_after_load_more'] === '1'){
581
- feed_wrapper.html('');
582
- currentFeed.imageIndex = 0;
583
- }
584
-
 
585
  //if custom filter is set or changed then reset masonry columns
586
- if(currentFeed.customFilterChanged == true){
587
- feed_wrapper.html('');
588
- currentFeed.imageIndex = 0;
589
  currentFeed.customFilterChanged = false;
590
  }
591
-
592
 
593
- var lastIndex = wdi_front.getImgCount(currentFeed)-data.length-1;
594
 
595
- for (var i=0;i<data.length;i++){
596
- if(data[i]['type'] == 'image'){
 
 
 
597
  var photoTemplate = wdi_front.getPhotoTemplate(currentFeed);
598
- }else{
599
  var photoTemplate = wdi_front.getVideoTemplate(currentFeed);
600
  }
601
-
602
  var rawItem = data[i];
603
- var item = wdi_front.createObject(rawItem,currentFeed);
604
  var html = photoTemplate(item);
605
- feed_wrapper.html(feed_wrapper.html()+html);
606
 
 
 
 
 
 
 
607
  currentFeed.imageIndex++;
608
-
609
 
610
  //changing responsive indexes for pagination
611
- if(currentFeed.feed_row.feed_display_view == 'pagination'){
612
- if((i+1)%currentFeed.feed_row.pagination_per_page_number === 0){
613
- currentFeed.resIndex+=currentFeed.freeSpaces+1;
614
- }else{
615
  currentFeed.resIndex++;
616
  }
617
- }
618
-
619
  }
620
 
621
 
622
- //fixing last row in case of full caption is open
623
- //for that triggering click twice to open and close caption text that will fix last row
624
- jQuery('#wdi_feed_'+currentFeed.feed_row['wdi_feed_counter']+' .wdi_feed_wrapper [wdi_index='+lastIndex+'] .wdi_photo_title').trigger(wdi_front.clickOrTouch);
625
- jQuery('#wdi_feed_'+currentFeed.feed_row['wdi_feed_counter']+' .wdi_feed_wrapper [wdi_index='+lastIndex+'] .wdi_photo_title').trigger(wdi_front.clickOrTouch);
626
-
627
-
628
  //binding onload event for ajax loader
629
  currentFeed.wdi_loadedImages = 0;
630
  var columnFlag = false;
631
  currentFeed.wdi_load_count = i;
632
  var wdi_feed_counter = currentFeed.feed_row['wdi_feed_counter'];
633
- var feed_wrapper = jQuery('#wdi_feed_'+wdi_feed_counter + ' img.wdi_img').on('load',function(){
634
  currentFeed.wdi_loadedImages++;
635
  checkLoaded();
636
 
637
  //calls wdi_responsive.columnControl() which calculates column number on page
638
  //and gives feed_wrapper proper column class
639
-
640
- if(columnFlag === false){
641
- // var eachFlag = false;
642
- // jQuery('#wdi_feed_'+currentFeed.feed_row.wdi_feed_counter+' .wdi_feed_item').each(function(){
643
- // if(!jQuery(this).hasClass('wdi_hidden') && eachFlag==false){
644
- // cstWidth = jQuery(this).width();
645
- // eachFlag = true;
646
- // }
647
- // });
648
-
649
- wdi_responsive.columnControl(currentFeed,1);
650
  columnFlag = true;
651
  }
652
 
653
-
654
  //Binds caption opening and closing event to each image photo_title
655
- if(currentFeed.feed_row.feed_type != 'blog_style'){
656
- wdi_responsive.bindCaptionEvent(jQuery(this).parent().parent().parent().parent().find('.wdi_photo_title'),currentFeed);
657
- }
 
658
  });
659
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
660
  //checks if all iamges have been succesfully loaded then it updates variables for next time use
661
- function checkLoaded(){
662
- if(currentFeed.wdi_load_count===currentFeed.wdi_loadedImages && currentFeed.wdi_loadedImages!=0){
 
663
  currentFeed.loadedImages = 0;
664
  currentFeed.wdi_load_count = 0;
665
  wdi_front.allImagesLoaded(currentFeed);
666
-
667
  }
668
  }
669
 
670
  //checking if pagination next button was clicked then change page
671
- if(currentFeed.paginatorNextFlag == true){
672
- wdi_front.updatePagination(currentFeed,'next');
673
  }
674
 
675
  //check if load more done successfully then set infinite scroll flag to false
676
  currentFeed.infiniteScrollFlag = false;
677
-
 
678
  }
679
- wdi_front.checkFeedFinished = function(currentFeed){
680
- for(var i = 0; i < currentFeed.usersData.length; i++){
681
- if(currentFeed.usersData[i]['finished'] == undefined){
682
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
683
  }
684
  }
685
- return true;
 
686
  }
687
- wdi_front.sortingOperator = function(sortImagesBy,sortOrder){
688
- var operator;
689
- switch(sortImagesBy){
690
- case 'date':{
691
- switch(sortOrder){
692
- case 'asc':{
693
- operator = function(a,b){
694
- return (a['created_time']>b['created_time']) ? 1 : -1;
695
- }
696
- break;
697
- }
698
- case 'desc':{
699
- operator = function(a,b){
700
- return (a['created_time']>b['created_time']) ? -1 : 1;
701
- }
702
- break;
703
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
704
  }
705
- break;
706
  }
707
- case 'likes':{
708
- switch(sortOrder){
709
- case 'asc':{
710
- operator = function(a,b){
711
- return (a['likes']['count']<b['likes']['count']) ? -1 : 1;
712
- }
713
- break;
714
- }
715
- case 'desc':{
716
- operator = function(a,b){
717
- return (a['likes']['count']<b['likes']['count']) ? 1 : -1;
718
- }
719
- break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
720
  }
 
721
  }
722
- break;
723
- }
724
- case 'comments':{
725
- switch(sortOrder){
726
- case 'asc':{
727
- operator = function(a,b){
728
- return (a['comments']['count']<b['comments']['count']) ? -1 : 1;
729
- }
730
- break;
 
 
 
 
 
 
 
 
731
  }
732
- case 'desc':{
733
- operator = function(a,b){
734
- return (a['comments']['count']<b['comments']['count']) ? 1 : -1;
735
- }
736
- break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
737
  }
 
738
  }
739
- break;
740
- }
741
- case 'random':{
742
- operator = function(a,b){
743
- var num = Math.random();
744
- return (num>0.5) ? 1 : -1;
 
745
  }
746
- break;
747
- }
748
  }
749
  return operator;
750
  }
 
751
  /*
752
  * Calls smart picker method and then after receiving data it sorts data based on user choice
753
  */
754
- wdi_front.feedSort = function(currentFeed,load_more_number){
755
 
756
  var sortImagesBy = currentFeed.feed_row['sort_images_by'];
757
  var sortOrder = currentFeed.feed_row['display_order'];
758
-
759
- if(currentFeed.feed_row['resort_after_load_more'] === '1'){
760
- currentFeed['data'] = currentFeed['data'].concat(wdi_front.smartPicker(currentFeed,load_more_number));
761
- }else{
762
- currentFeed['data'] = wdi_front.smartPicker(currentFeed,load_more_number);
763
  }
764
 
765
-
766
-
767
- var operator = wdi_front.sortingOperator(sortImagesBy,sortOrder);
768
  currentFeed['data'].sort(operator);
769
  return currentFeed['data'];
770
 
771
  }
 
772
  /*
773
  * Filters all requested data and takes some amount of sata for each user
774
  * and stops picking when it reaches number_of_photos limit
775
  */
776
- wdi_front.smartPicker = function(currentFeed,load_more_number){
777
  var dataStorage = [];
778
  var dataLength = 0;
779
  var readyData = [];
780
- var perUser = Math.ceil(currentFeed['feed_row']['number_of_photos']/currentFeed['usersData'].length);
781
  var number_of_photos = parseInt(currentFeed['feed_row']['number_of_photos']);
782
  var remainder = 0;
783
 
784
  //check if loadmore was clicked
785
- if(load_more_number != '' && load_more_number != undefined && load_more_number!=null){
786
  number_of_photos = parseInt(load_more_number);
787
- perUser = Math.ceil(number_of_photos/wdi_front.activeUsersCount(currentFeed));
788
  }
789
 
790
 
791
- var sortOperator = function(a,b){
792
- return (a['data'].length>b['data'].length) ? 1 : -1;
793
  }
794
-
795
  //sorts user data desc
796
  var usersData = currentFeed['usersData'].sort(sortOperator);
797
 
798
  //picks data from users and updates pagination in request json
799
  //for next time call
800
- for (var i = 0; i < usersData.length; i++){
801
- remainder+=perUser;
802
- if(usersData[i]['data'].length <= remainder){
803
-
804
  var pagination = usersData[i]['pagination']['next_url'];
805
- if(usersData[i]['finished'] === undefined){
806
  dataStorage.push(usersData[i]['data']);
807
- remainder-=usersData[i]['data'].length;
808
- dataLength+=usersData[i]['data'].length;
809
  }
810
 
811
- if(usersData[i]['finished'] === undefined){
812
- if(pagination === undefined || pagination==='' || pagination === null){
813
  usersData[i]['finished'] = 'finished';
814
  }
815
  }
816
- }
817
- else{
818
- if( (dataLength + remainder) > number_of_photos){
819
  remainder = number_of_photos - dataLength;
820
  }
821
  var pickedData = [];
822
  var indexPuller = 0;
823
- for(var j = 0; j < remainder; j++){
824
- if(currentFeed['auto_trigger'] === false){
825
- if(usersData[i]['finished'] === undefined){
826
- pickedData.push(usersData[i]['data'][j]);
827
- }
828
- }else{
829
- if(pickedData.length + wdi_front.getDataLength(currentFeed) + wdi_front.getDataLength(currentFeed,dataStorage) <currentFeed['feed_row']['number_of_photos']){
830
- if(usersData[i]['finished'] === undefined){
831
  pickedData.push(usersData[i]['data'][j]);
832
  }
833
- }else{
834
  indexPuller++;
835
  }
836
  }
837
-
838
  }
839
- j-=indexPuller;
840
 
841
  remainder = 0;
842
  //updating pagination
843
- if(pickedData.length != 0){
844
- var newMaxId = pickedData[j-1]['id'];
845
  var newMaxTagId = usersData[i]['data'][j]['id'];
846
  var oldPagination = usersData[i]['pagination'];
847
  var oldUrl = oldPagination['next_url'];
848
 
849
  //updating pagination url
850
- if(oldUrl != undefined && oldUrl != null && oldUrl != ''){
851
  var urlFragments = oldUrl.split('&');
852
  var urlKeyValue = [];
853
- for(var k = 0; k<urlFragments.length; k++){
854
-
855
  urlKeyValue.push(urlFragments[k].split('='));
856
- if(urlKeyValue[k][0] === 'max_id'){
857
  urlKeyValue[k][1] = newMaxId;
858
  }
859
- if(urlKeyValue[k][0] === 'max_tag_id'){
860
  urlKeyValue[k][1] = newMaxTagId.split('_')[0];
861
  }
862
  urlKeyValue[k] = urlKeyValue[k].join('=');
863
  }
864
-
865
  var newUrl = urlKeyValue.join('&');
866
-
867
  oldPagination['next_max_id'] = newMaxId;
868
  oldPagination['next_url'] = newUrl;
869
-
870
- }else{
871
  //if pagination is not provided ie there are no more images to paginate
872
  //it generates pagination url manually
873
- switch(currentFeed.usersData[i]['username'][0]){
874
- case '#':{
875
-
876
- oldPagination['next_url'] = 'https://api.instagram.com/v1/tags/'
877
- +usersData[i]['user_id'].substr(1,usersData[i]['user_id'].length)+
878
- '/media/recent?access_token='+currentFeed.feed_row.access_token+'&callback=jQuery111205299771015997976_1438177624435&max_tag_id='
879
- +newMaxTagId.split('_')[0]+
880
- '&_=1438177624450';
881
- oldPagination['next_max_tag_id'] = newMaxId;
882
- break;
883
- }
884
- default:{
885
-
886
- oldPagination['next_url'] = 'https://api.instagram.com/v1/users/'
887
- +usersData[i]['user_id']+
888
- '/media/recent?access_token='+currentFeed.feed_row.access_token+'&callback=jQuery111205299771015997976_1438177624435&max_id='
889
- +newMaxId+
890
- '&_=1438177624450';
891
- oldPagination['next_max_id'] = newMaxId;
892
- break;
893
- }
894
  }
895
-
896
  }
897
  }
898
-
899
-
900
  //pushes picked data into local storage
901
- dataLength+=pickedData.length;
902
  dataStorage.push(pickedData);
903
 
904
  }
905
  }
906
-
907
  //checks if in golbal storage user already exisit then it adds new data to user old data
908
  //else it simple puches new user with it's data to global storage
909
- for(i = 0; i<dataStorage.length; i++){
910
- if(currentFeed.dataStorage[i] === undefined){
911
  currentFeed.dataStorage.push(dataStorage[i]);
912
- }else{
913
- currentFeed.dataStorage[i] = currentFeed.dataStorage[i].concat(dataStorage[i]);
914
- }
915
  }
916
 
917
  //parsing data for lightbox
918
  currentFeed.parsedData = wdi_front.parseLighboxData(currentFeed);
919
 
920
  //combines together all avialable data in global storage and returns it
921
- for (i = 0 ; i < dataStorage.length; i++){
922
  readyData = readyData.concat(dataStorage[i]);
923
  }
924
-
925
  return readyData;
926
  }
927
 
928
  /*
929
  * returns json object for inserting photo template
930
  */
931
- wdi_front.createObject = function(obj,currentFeed){
932
-
933
- var caption = (obj['caption']!=null)? obj['caption']['text'] : '&nbsp';
934
  var image_url;
935
- if(window.innerWidth>=640){
936
  image_url = obj['images']['standard_resolution']['url'];
937
- if(currentFeed.feed_row.feed_type=='blog_style' || currentFeed.feed_row.feed_type=='image_browser'){
938
- image_url = obj['link']+'media?size=l';
939
  }
940
  }
941
- if(window.innerWidth>=150 && window.innerWidth<640){
942
  image_url = obj['images']['low_resolution']['url'];
943
- if(currentFeed.feed_row.feed_type=='blog_style' || currentFeed.feed_row.feed_type=='image_browser'){
944
- image_url = obj['link']+'media?size=l';
945
  }
946
  }
947
- if(window.innerWidth<150){
948
  image_url = obj['images']['thumbnail']['url'];
949
- if(currentFeed.feed_row.feed_type=='blog_style' || currentFeed.feed_row.feed_type=='image_browser'){
950
- image_url = obj['link']+'media?size=m';
951
  }
952
  }
953
  var videoUrl = '';
954
- if(obj['type']=='video'){
955
  videoUrl = obj['videos']['standard_resolution']['url'];
956
  }
957
  var imageIndex = currentFeed.imageIndex;
958
-
959
  var photoObject = {
960
- 'id' : obj['id'],
961
- 'caption' : caption,
962
  'image_url': image_url,
963
  'likes': obj['likes']['count'],
964
- 'comments' : obj['comments']['count'],
965
  'wdi_index': imageIndex,
966
  'wdi_res_index': currentFeed.resIndex,
967
  'link': obj['link'],
968
- 'video_url':videoUrl
 
969
  };
970
  return photoObject;
971
  }
@@ -973,276 +1125,289 @@ wdi_front.createObject = function(obj,currentFeed){
973
  /*
974
  * If pagination is on sets the proper page number
975
  */
976
- wdi_front.setPage = function(currentFeed){
977
  var display_type = currentFeed.feed_row.feed_display_view;
978
  var feed_type = currentFeed.feed_row.feed_type;
979
- if (display_type != 'pagination'){
980
  return '';
981
  }
982
  var imageIndex = currentFeed.imageIndex;
983
- if(feed_type == 'image_browser'){
984
  var divider = 1;
985
- }else{
986
  var divider = Math.abs(currentFeed.feed_row.pagination_per_page_number);
987
  }
988
-
989
- currentFeed.paginator = Math.ceil((imageIndex+1)/divider);
990
-
991
-
992
  return currentFeed.paginator;
993
- }
994
 
995
  /*
996
  * Template for all feed items which have type=image
997
  */
998
- wdi_front.getPhotoTemplate = function(currentFeed){
999
  var page = wdi_front.setPage(currentFeed);
1000
- var customClass='';
1001
- var pagination='';
1002
  var onclick = '';
1003
  var overlayCustomClass = '';
1004
  var thumbClass = 'fa-fullscreen';
1005
- if(currentFeed.feed_row.feed_type=='blog_style' || currentFeed.feed_row.feed_type=='image_browser'){
 
1006
  thumbClass = '';
1007
  }
1008
- if(page != ''){
1009
- pagination = 'wdi_page="'+page+'"';
 
 
 
1010
  }
1011
- if(page!= '' && page != 1){
 
1012
  customClass = 'wdi_hidden';
1013
  }
1014
 
 
 
 
 
1015
  //checking if caption is opend by default then add wdi_full_caption class
1016
  //only in masonry
1017
- if(currentFeed.feed_row.show_full_description == 1 && currentFeed.feed_row.feed_type == 'masonry'){
1018
  customClass += ' wdi_full_caption';
1019
  }
1020
 
1021
  //creating onclick string for different options
1022
- switch(currentFeed.feed_row.feed_item_onclick){
1023
- case 'lightbox':{
1024
- onclick="onclick=wdi_feed_"+currentFeed.feed_row.wdi_feed_counter+".galleryBox('<%=id%>')";
1025
- break;
1026
- }
1027
- case 'instagram':{
1028
- onclick='onclick="window.open (\'<%= link%>\',\'_blank\')"';
1029
- overlayCustomClass = 'wdi_hover_off';
1030
- thumbClass = '';
1031
- break;
1032
- }
1033
- case 'none':{
1034
- onclick = '';
1035
- overlayCustomClass = 'wdi_cursor_off wdi_hover_off';
1036
- thumbClass='';
1037
- }
1038
- }
1039
- var wdi_feed_counter = currentFeed.feed_row['wdi_feed_counter'];
1040
- var source = '<div class="wdi_feed_item '+customClass+'" wdi_index=<%= wdi_index%> wdi_res_index=<%= wdi_res_index%> '+pagination+' wdi_type="image" id="wdi_'+wdi_feed_counter+'_<%=id%>">'+
1041
- '<div class="wdi_photo_wrap">'+
1042
- '<div class="wdi_photo_wrap_inner">'+
1043
- '<div class="wdi_photo_img">'+
1044
- '<img class="wdi_img" src="<%=image_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);">'+
1045
- '<div class="wdi_photo_overlay '+overlayCustomClass+'" >'+
1046
- '<div class="wdi_thumb_icon" '+onclick+' style="display:table;width:100%;height:100%;">'+
1047
- '<div style="display:table-cell;vertical-align:middle;text-align:center;color:white;">'+
1048
- '<i class="fa '+thumbClass+'"></i>'+
1049
- '</div>'+
1050
- '</div>'+
1051
- '</div>'+
1052
- '</div>'+
1053
- '</div>'+
1054
- '</div>';
1055
- if(currentFeed['feed_row']['show_likes'] === '1' || currentFeed['feed_row']['show_comments'] === '1' || currentFeed['feed_row']['show_description'] ==='1'){
1056
- source+='<div class="wdi_photo_meta">';
1057
- if(currentFeed['feed_row']['show_likes'] === '1'){
1058
- source+='<div class="wdi_thumb_likes"><i class="fa fa-heart-o">&nbsp;<%= likes%></i></div>';
1059
  }
1060
- if(currentFeed['feed_row']['show_comments'] === '1'){
1061
- source+='<div class="wdi_thumb_comments"><i class="fa fa-comment-o">&nbsp;<%= comments%></i></div>';
 
 
 
 
1062
  }
1063
- source+='<div class="clear"></div>';
1064
- if(currentFeed['feed_row']['show_description'] ==='1'){
1065
- source+='<div class="wdi_photo_title" >'+
1066
- '<%=caption%>'+
1067
- '</div>';
1068
  }
1069
- source+='</div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1070
  }
1071
-
1072
- source+='</div>';
 
 
 
 
 
 
 
 
 
 
 
1073
  var template = _.template(source);
1074
  return template;
1075
  }
1076
 
1077
- wdi_front.replaceToVideo = function(url,index,feed_counter){
1078
 
1079
- overlayHtml = "<video style='width:auto !important; height:auto !important; max-width:100% !important; max-height:100% !important; margin:0 !important;' controls=''>"+
1080
- "<source src='"+url+"' type='video/mp4'>"+
1081
- "Your browser does not support the video tag. </video>";
1082
 
1083
- jQuery('#wdi_feed_'+feed_counter+' [wdi_index="'+index+'"] .wdi_photo_wrap_inner').html(overlayHtml);
1084
- jQuery('#wdi_feed_'+feed_counter+' [wdi_index="'+index+'"] .wdi_photo_wrap_inner video').get(0).play();
1085
  }
 
1086
  /*
1087
  * Template for all feed items which have type=video
1088
  */
1089
- wdi_front.getVideoTemplate = function(currentFeed){
1090
  var page = wdi_front.setPage(currentFeed);
1091
- var customClass='';
1092
- var pagination='';
1093
  var thumbClass = 'fa-play';
1094
  var onclick = '';
1095
  var overlayCustomClass = '';
1096
-
1097
-
1098
- if(page != ''){
1099
- pagination = 'wdi_page="'+page+'"';
 
 
 
 
 
 
1100
  }
1101
- if(page!= '' && page != 1){
1102
  customClass = 'wdi_hidden';
1103
  }
1104
 
 
 
 
 
1105
  //checking if caption is opend by default then add wdi_full_caption class
1106
  //only in masonry
1107
- if(currentFeed.feed_row.show_full_description == 1 && currentFeed.feed_row.feed_type == 'masonry'){
1108
  customClass += ' wdi_full_caption';
1109
  }
1110
-
1111
  //creating onclick string for different options
1112
- switch(currentFeed.feed_row.feed_item_onclick){
1113
- case 'lightbox':{
1114
- onclick="onclick=wdi_feed_"+currentFeed.feed_row.wdi_feed_counter+".galleryBox('<%=id%>')";
1115
- break;
1116
- }
1117
- case 'instagram':{
1118
- onclick='onclick="window.open (\'<%= link%>\',\'_blank\')"';
1119
- overlayCustomClass = 'wdi_hover_off';
1120
- thumbClass = '';
1121
- break;
1122
- }
1123
- case 'none':{
1124
- overlayCustomClass = 'wdi_cursor_off wdi_hover_off';
1125
- thumbClass='';
1126
- if(currentFeed.feed_row.feed_type=='blog_style' || currentFeed.feed_row.feed_type=='image_browser'){
1127
- thumbClass='fa-play';
 
 
 
 
 
 
1128
  }
1129
- }
1130
  }
1131
 
1132
 
1133
  var wdi_feed_counter = currentFeed.feed_row['wdi_feed_counter'];
1134
- var source = '<div class="wdi_feed_item '+customClass+'" wdi_index=<%= wdi_index%> wdi_res_index=<%= wdi_res_index%> '+pagination+' wdi_type="image" id="wdi_'+wdi_feed_counter+'_<%=id%>">'+
1135
- '<div class="wdi_photo_wrap">'+
1136
- '<div class="wdi_photo_wrap_inner">'+
1137
- '<div class="wdi_photo_img">'+
1138
- '<img class="wdi_img" src="<%=image_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);">'+
1139
- '<div class="wdi_photo_overlay '+overlayCustomClass+'" '+onclick+'>'+
1140
- '<div class="wdi_thumb_icon" style="display:table;width:100%;height:100%;">'+
1141
- '<div style="display:table-cell;vertical-align:middle;text-align:center;color:white;">'+
1142
- '<i class="fa '+thumbClass+'"></i>'+
1143
- '</div>'+
1144
- '</div>'+
1145
- '</div>'+
1146
- '</div>'+
1147
- '</div>'+
1148
  '</div>';
1149
- if(currentFeed['feed_row']['show_likes'] === '1' || currentFeed['feed_row']['show_comments'] === '1' || currentFeed['feed_row']['show_description'] ==='1'){
1150
- source+='<div class="wdi_photo_meta">';
1151
- if(currentFeed['feed_row']['show_likes'] === '1'){
1152
- source+='<div class="wdi_thumb_likes"><i class="fa fa-heart-o">&nbsp;<%= likes%></i></div>';
1153
  }
1154
- if(currentFeed['feed_row']['show_comments'] === '1'){
1155
- source+='<div class="wdi_thumb_comments"><i class="fa fa-comment-o">&nbsp;<%= comments%></i></div>';
1156
  }
1157
- source+='<div class="clear"></div>';
1158
- if(currentFeed['feed_row']['show_description'] ==='1'){
1159
- source+='<div class="wdi_photo_title" >'+
1160
- '<%=caption%>'+
1161
- '</div>';
1162
  }
1163
- source+='</div>';
1164
  }
1165
- source+='</div>';
1166
  var template = _.template(source);
1167
  return template;
1168
  }
1169
 
1170
- wdi_front.bindEvents = function(currentFeed){
1171
- if(currentFeed.feed_row.feed_display_view == 'load_more_btn'){
1172
  //binding load more event
1173
- jQuery('#wdi_feed_'+currentFeed.feed_row['wdi_feed_counter']+' .wdi_load_more_container').on(wdi_front.clickOrTouch,function(){
1174
  //do the actual load more operation
1175
  wdi_front.loadMore(jQuery(this).find('.wdi_load_more_wrap'));
1176
  });
1177
  }
1178
-
1179
- if(currentFeed.feed_row.feed_display_view == 'pagination'){
1180
  //binding pagination events
1181
- jQuery('#wdi_feed_'+currentFeed.feed_row['wdi_feed_counter']+' #wdi_next').on(wdi_front.clickOrTouch,function(){
1182
- wdi_front.paginatorNext(jQuery(this),currentFeed);
1183
  });
1184
- jQuery('#wdi_feed_'+currentFeed.feed_row['wdi_feed_counter']+' #wdi_prev').on(wdi_front.clickOrTouch,function(){
1185
- wdi_front.paginatorPrev(jQuery(this),currentFeed);
1186
  });
1187
- jQuery('#wdi_feed_'+currentFeed.feed_row['wdi_feed_counter']+' #wdi_last_page').on(wdi_front.clickOrTouch,function(){
1188
- wdi_front.paginationLastPage(jQuery(this),currentFeed);
1189
  });
1190
- jQuery('#wdi_feed_'+currentFeed.feed_row['wdi_feed_counter']+' #wdi_first_page').on(wdi_front.clickOrTouch,function(){
1191
- wdi_front.paginationFirstPage(jQuery(this),currentFeed);
1192
  });
1193
  //setting pagiantion flags
1194
  currentFeed.paginatorNextFlag = false;
1195
  }
1196
- if(currentFeed.feed_row.feed_display_view == 'infinite_scroll'){
1197
  //binding infinite scroll Events
1198
- jQuery(window).on('scroll',function(){
1199
  wdi_front.infiniteScroll(currentFeed);
1200
  });
1201
  //infinite scroll flags
1202
  currentFeed.infiniteScrollFlag = false;
1203
  }
1204
 
1205
-
1206
- }
1207
- wdi_front.infiniteScroll = function(currentFeed){
1208
 
 
1209
 
 
1210
 
1211
- //console.log(jQuery(window).scrollTop());
1212
- //console.log(jQuery('#wdi_feed_'+currentFeed.feed_row['wdi_feed_counter']+' #wdi_infinite_scroll').offset().top);
1213
- if(jQuery(window).scrollTop()<=jQuery('#wdi_feed_'+currentFeed.feed_row['wdi_feed_counter']+' #wdi_infinite_scroll').offset().top){
1214
- if(currentFeed.infiniteScrollFlag === false){
1215
  currentFeed.infiniteScrollFlag = true;
1216
- wdi_front.loadMore(jQuery('#wdi_feed_'+currentFeed.feed_row['wdi_feed_counter']+' #wdi_infinite_scroll'),currentFeed);
 
 
1217
  }
1218
-
1219
  }
1220
  }
1221
 
1222
 
1223
 
1224
-
1225
-
1226
-
1227
-
1228
-
1229
-
1230
-
1231
-
1232
-
1233
-
1234
-
1235
-
1236
-
1237
-
1238
- wdi_front.paginationFirstPage = function(btn,currentFeed){
1239
- if(currentFeed.paginator == 1 || currentFeed.currentPage == 1){
1240
  btn.addClass('wdi_disabled');
1241
  return;
1242
  }
1243
  var oldPage = currentFeed.currentPage;
1244
  currentFeed.currentPage = 1;
1245
- wdi_front.updatePagination(currentFeed,'custom',oldPage);
1246
 
1247
  //enable last page button
1248
  var last_page_btn = btn.parent().find('#wdi_last_page');
@@ -1252,13 +1417,14 @@ wdi_front.paginationFirstPage = function(btn,currentFeed){
1252
  btn.addClass('wdi_disabled');
1253
 
1254
  }
1255
- wdi_front.paginationLastPage = function(btn,currentFeed){
1256
- if(currentFeed.paginator == 1 || currentFeed.currentPage==currentFeed.paginator){
 
1257
  return;
1258
  }
1259
  var oldPage = currentFeed.currentPage;
1260
  currentFeed.currentPage = currentFeed.paginator;
1261
- wdi_front.updatePagination(currentFeed,'custom',oldPage);
1262
 
1263
  //disableing last page button
1264
  btn.addClass('wdi_disabled');
@@ -1267,139 +1433,146 @@ wdi_front.paginationLastPage = function(btn,currentFeed){
1267
  var first_page_btn = btn.parent().find('#wdi_first_page');
1268
  first_page_btn.removeClass('wdi_disabled');
1269
  }
1270
- wdi_front.paginatorNext = function(btn,currentFeed){
 
 
1271
  var last_page_btn = btn.parent().find('#wdi_last_page');
1272
  var first_page_btn = btn.parent().find('#wdi_first_page');
1273
  currentFeed.paginatorNextFlag = true;
1274
- if(currentFeed.paginator == currentFeed.currentPage && !wdi_front.checkFeedFinished(currentFeed)){
1275
  currentFeed.currentPage++;
1276
  var number_of_photos = currentFeed.feed_row.number_of_photos;
1277
- wdi_front.loadMore(btn,currentFeed,number_of_photos);
1278
  //on the last page don't show got to last page button
1279
  last_page_btn.addClass('wdi_disabled');
1280
- }else if(currentFeed.paginator > currentFeed.currentPage){
1281
  currentFeed.currentPage++;
1282
- wdi_front.updatePagination(currentFeed,'next');
1283
  //check if new page isn't the last one then enable last page button
1284
- if(currentFeed.paginator > currentFeed.currentPage){
1285
  last_page_btn.removeClass('wdi_disabled');
1286
- }else{
1287
  last_page_btn.addClass('wdi_disabled');
1288
  }
1289
  }
1290
 
1291
  //enable first page button
1292
  first_page_btn.removeClass('wdi_disabled');
1293
-
1294
-
1295
  }
1296
- wdi_front.paginatorPrev = function(btn,currentFeed){
 
1297
  var last_page_btn = btn.parent().find('#wdi_last_page');
1298
  var first_page_btn = btn.parent().find('#wdi_first_page');
1299
- if(currentFeed.currentPage == 1){
1300
  first_page_btn.addClass('wdi_disabled');
1301
  return;
1302
  }
1303
-
1304
  currentFeed.currentPage--;
1305
- wdi_front.updatePagination(currentFeed,'prev');
1306
-
1307
  //enable last page button
1308
  last_page_btn.removeClass('wdi_disabled');
1309
 
1310
- if(currentFeed.currentPage == 1){
1311
  first_page_btn.addClass('wdi_disabled');
1312
  }
1313
 
1314
  }
1315
 
1316
  //displays proper images for specific page after pagination buttons click event
1317
- wdi_front.updatePagination = function (currentFeed,dir,oldPage){
1318
- var currentFeedString = '#wdi_feed_'+currentFeed.feed_row['wdi_feed_counter'];
1319
- jQuery(currentFeedString+' [wdi_page="'+currentFeed.currentPage+'"]').each(function(){
1320
  jQuery(this).removeClass('wdi_hidden');
1321
  });
1322
- switch (dir){
1323
- case 'next':{
1324
- var oldPage = currentFeed.currentPage-1;
1325
- jQuery(currentFeedString+' .wdi_feed_wrapper').height(jQuery('.wdi_feed_wrapper').height());
1326
- jQuery(currentFeedString+' [wdi_page="'+oldPage+'"]').each(function(){
1327
- jQuery(this).addClass('wdi_hidden');
1328
- });
1329
- break;
1330
- }
1331
- case 'prev':{
1332
- var oldPage = currentFeed.currentPage+1;
1333
- jQuery(currentFeedString+' .wdi_feed_wrapper').height(jQuery('.wdi_feed_wrapper').height());
1334
- jQuery(currentFeedString+' [wdi_page="'+oldPage+'"]').each(function(){
1335
- jQuery(this).addClass('wdi_hidden');
1336
- });
1337
- break;
1338
- }
1339
- case 'custom':{
1340
- var oldPage = oldPage;
1341
- if(oldPage!=currentFeed.currentPage){
1342
- jQuery(currentFeedString+' .wdi_feed_wrapper').height(jQuery('.wdi_feed_wrapper').height());
1343
- jQuery(currentFeedString+' [wdi_page="'+oldPage+'"]').each(function(){
1344
  jQuery(this).addClass('wdi_hidden');
1345
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1346
  }
1347
-
1348
- break;
1349
- }
1350
  }
1351
  currentFeed.paginatorNextFlag = false;
1352
-
1353
- jQuery(currentFeedString+' .wdi_feed_wrapper').css('height','auto');
1354
- jQuery(currentFeedString+' #wdi_current_page').text(currentFeed.currentPage);
1355
  }
1356
 
1357
 
1358
- wdi_front.loadMore = function(button,_currentFeed){
1359
-
1360
 
1361
  var dataCounter = 0;
1362
- if(button != '' && button != undefined && button != 'initial' && button != 'initial-keep'){
1363
  var currentFeed = window[button.parent().parent().parent().parent().attr('id')];
1364
  }
1365
- if(_currentFeed != undefined){
1366
  var currentFeed = _currentFeed;
1367
  }
1368
  //check if any filter is enabled and filter user images has finished
1369
  //then stop any load more action
1370
- var activeFilter = 0,finishedFilter = 0;
1371
- for(var i = 0; i < currentFeed.userSortFlags.length; i++){
1372
- if(currentFeed.userSortFlags[i].flag === true){
 
1373
  activeFilter++;
1374
- for(var j = 0; j < currentFeed.usersData.length; j++){
1375
- if(currentFeed.userSortFlags[i]['id'] === currentFeed.usersData[j]['user_id']){
1376
- if(currentFeed.usersData[j]['finished']==='finished'){
1377
  finishedFilter++;
1378
  }
1379
  }
1380
  }
1381
  }
1382
  }
1383
- if(activeFilter===finishedFilter && activeFilter != 0){
1384
  return;
1385
  }
1386
 
1387
 
1388
  //if button is not provided than it enables auto_tiggering and recursively loads images
1389
- if(button === ''){
1390
  currentFeed['auto_trigger'] = true;
1391
- }else{
1392
  currentFeed['auto_trigger'] = false;
1393
  }
1394
  //ading ajax loading
1395
  wdi_front.ajaxLoader(currentFeed);
1396
-
1397
 
1398
-
 
1399
  //check if masonry view is on and and feed display type is pagination then
1400
  //close all captions before loading more pages for porper pagination rendering
1401
- if(currentFeed.feed_row.feed_type === 'masonry' && currentFeed.feed_row.feed_display_view=='pagination'){
1402
- jQuery('#wdi_feed_'+wdi_front.feed_counter+' .wdi_full_caption').each(function(){
1403
  jQuery(this).find('.wdi_photo_title').trigger(wdi_front.clickOrTouch);
1404
  });
1405
  }
@@ -1407,38 +1580,36 @@ wdi_front.loadMore = function(button,_currentFeed){
1407
 
1408
 
1409
  //check if all data loaded then remove ajaxLoader
1410
- for(var i=0 ;i< currentFeed.usersData.length;i++){
1411
- if(currentFeed.usersData[i]['finished'] === 'finished'){
1412
  dataCounter++;
1413
  }
1414
  }
1415
- if(dataCounter === currentFeed.usersData.length){
1416
  wdi_front.allImagesLoaded(currentFeed);
1417
- jQuery('#wdi_feed_'+currentFeed['feed_row']['wdi_feed_counter']+' .wdi_load_more').remove();
1418
-
1419
  }
1420
 
1421
  var usersData = currentFeed['usersData'];
1422
  currentFeed.loadMoreDataCount = currentFeed.feed_users.length;
1423
-
1424
- for(var i=0; i<usersData.length;i++){
1425
 
1426
  var pagination = usersData[i]['pagination'];
1427
  var user = {
1428
- user_id : usersData[i]['user_id'],
1429
- username : usersData[i]['username']
1430
- }
1431
- //checking if pagination url exists then load images, else skip
1432
- if(pagination['next_url'] != '' && pagination['next_url'] != null && pagination['next_url'] != undefined){
1433
  var next_url = pagination['next_url'];
1434
- wdi_front.loadMoreRequest(user,next_url,currentFeed,button);
1435
- }else{
1436
-
1437
- //usersData[i]['finished'] = 'finished';
1438
-
1439
- if(button == 'initial-keep'){
1440
-
1441
- currentFeed.temproraryUsersData[i] = currentFeed.usersData[i];
1442
  }
1443
  currentFeed.loadMoreDataCount--;
1444
  continue;
@@ -1451,83 +1622,84 @@ wdi_front.loadMore = function(button,_currentFeed){
1451
  /*
1452
  * Requests images based on provided pagination url
1453
  */
1454
- wdi_front.loadMoreRequest = function(user,next_url,currentFeed,button){
1455
 
1456
  var usersData = currentFeed['usersData'];
1457
  var errorMessage = '';
1458
-
1459
- jQuery.ajax({
1460
- type: 'POST',
1461
- url: next_url,
1462
- dataType: 'jsonp',
1463
- success: function(response){
1464
-
1465
- if(response === '' || response==undefined || response==null){
1466
- errorMessage=wdi_front_messages.network_error;
1467
- currentFeed.loadMoreDataCount--;
1468
- alert(errorMessage);
1469
- return;
1470
- }
1471
- if(response['meta']['code'] != 200){
1472
- errorMessage = response['meta']['error_message'];
1473
- currentFeed.loadMoreDataCount--;
1474
- alert(errorMessage);
1475
- return;
1476
- }
1477
-
1478
- response['user_id'] = user.user_id;
1479
- response['username'] = user.username;
1480
-
1481
- for(var i=0;i<currentFeed['usersData'].length;i++){
1482
- if(response['user_id'] === currentFeed['usersData'][i]['user_id']){
1483
-
1484
- ///mmm!!!
1485
- if(response['user_id'][0]==='#'){
1486
- response['data'] = wdi_front.appendRequestHashtag(response['data'],response['user_id']);
1487
- }
1488
- ////////////////
1489
- /*if button is initial-keep then we will lose currentFeed['usersData'][i]
1490
- for not loosing it we keep it in currentFeed.temproraryUsersData, which value will be
1491
- used later in wdi_front.checkForLoadMoreDone(), in other cases when button is set to
1492
- initial we already keep data in that variable, so we don't deed to keep it again, it will give us duplicate value
1493
- */
1494
- if(button == 'initial-keep'){
1495
- currentFeed.temproraryUsersData[i] = currentFeed.usersData[i];
1496
- }
1497
- currentFeed['usersData'][i] = response;
1498
- currentFeed.loadMoreDataCount--;
1499
- }
1500
- }
1501
- //checks if load more done then displays feed
1502
- wdi_front.checkForLoadMoreDone(currentFeed,button);
1503
  }
1504
- });
1505
-
1506
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1507
  }
1508
- wdi_front.checkForLoadMoreDone = function(currentFeed,button){
 
1509
  var load_more_number = currentFeed.feed_row['load_more_number'];
1510
  var number_of_photos = currentFeed.feed_row['number_of_photos'];
1511
 
1512
- if(currentFeed.loadMoreDataCount == 0){
1513
-
1514
- currentFeed.temproraryUsersData = wdi_front.mergeData(currentFeed.temproraryUsersData,currentFeed.usersData);
1515
- var gettedDataLength = wdi_front.getArrayContentLength(currentFeed.temproraryUsersData,'data');
1516
  /*this will happen when we call loadMore first time
1517
  initial-keep is the same as initial except that if loadMore is called
1518
- with initial-keep we store data on currentFee.temproraryUsersData before checkLoadMoreDone()
1519
  function call*/
1520
- if(button == 'initial-keep'){
1521
  button = 'initial';
1522
  }
1523
  //if button is set to inital load number_of_photos photos
1524
- if(button == 'initial'){
1525
  /*if existing data length is smaller then load_more_number then get more objects until desired number is reached
1526
  also if it is not possible to reach the desired number (this will happen when all users has no more photos) then
1527
  displayFeed()*/
1528
- if(gettedDataLength < number_of_photos && !wdi_front.userHasNoPhoto(currentFeed,currentFeed.temproraryUsersData)){
1529
- wdi_front.loadMore('initial',currentFeed);
1530
- }else{
 
 
1531
 
1532
  currentFeed.usersData = currentFeed.temproraryUsersData;
1533
 
@@ -1539,17 +1711,18 @@ wdi_front.checkForLoadMoreDone = function(currentFeed,button){
1539
  currentFeed.temproraryUsersData = [];
1540
  }
1541
 
1542
- }else{
1543
  //else load load_more_number photos
1544
  //if existing data length is smaller then load_more_number then get more objects until desired number is reached
1545
-
1546
- if(gettedDataLength < load_more_number && !wdi_front.userHasNoPhoto(currentFeed,currentFeed.temproraryUsersData)){
1547
- wdi_front.loadMore(undefined,currentFeed);
1548
- }else{
 
1549
 
1550
  currentFeed.usersData = currentFeed.temproraryUsersData;
1551
 
1552
- wdi_front.displayFeed(currentFeed,load_more_number);
1553
  //when all data us properly displayed check for any active filters and then apply them
1554
  wdi_front.applyFilters(currentFeed);
1555
 
@@ -1558,22 +1731,21 @@ wdi_front.checkForLoadMoreDone = function(currentFeed,button){
1558
  }
1559
  }
1560
 
1561
-
1562
-
1563
 
1564
  }
1565
  }
1566
 
1567
- wdi_front.mergeData = function(array1, array2){
1568
-
1569
-
1570
- for(var i = 0; i <array2.length; i++){
1571
- if(array1[i] != undefined){
1572
- if(array2[i]['finished'] == 'finished'){
1573
  continue;
1574
  }
1575
  //if user data is finished then dont add duplicate data
1576
- if(array1[i]['pagination']['next_max_id'] == undefined){
1577
  continue;
1578
  }
1579
  //extend data
@@ -1582,258 +1754,195 @@ wdi_front.mergeData = function(array1, array2){
1582
  array1[i]['user_id'] = array2[i]['user_id'];
1583
  array1[i]['username'] = array2[i]['username'];
1584
  array1[i]['meta'] = array2[i]['meta'];
1585
- }else{
1586
  array1.push(array2[i]);
1587
  }
1588
  }
1589
  return array1;
1590
  }
1591
 
1592
-
1593
-
1594
 
1595
 
1596
  //broken image handling
1597
- wdi_front.brokenImageHandler = function(source){
1598
- source.src = wdi_url.plugin_url+"../images/missing.png";
1599
- source.onerror = "";
1600
- return true;
1601
 
1602
  }
1603
 
1604
 
1605
  //ajax loading
1606
- wdi_front.ajaxLoader = function(currentFeed){
1607
  var wdi_feed_counter = currentFeed.feed_row['wdi_feed_counter'];
1608
- var feed_container = jQuery('#wdi_feed_'+wdi_feed_counter);
1609
-
1610
- if(currentFeed.feed_row.feed_display_view == 'load_more_btn'){
1611
  feed_container.find('.wdi_load_more').addClass('wdi_hidden');
1612
  feed_container.find('.wdi_spinner').removeClass('wdi_hidden');
1613
  }
1614
- /////////////////////////////////////////////////////
1615
- if(currentFeed.feed_row.feed_display_view == 'infinite_scroll'){
1616
  var loadingDiv;
1617
- if(feed_container.find('.wdi_ajax_loading').length == 0){
1618
- 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>');
1619
  feed_container.append(loadingDiv);
1620
- }else{
1621
  loadingDiv = feed_container.find('.wdi_ajax_loading');
1622
  }
1623
  loadingDiv.removeClass('wdi_hidden');
1624
  }
1625
-
 
 
 
 
1626
  }
 
1627
  //if all images loaded then clicking load more causes it's removal
1628
- wdi_front.allImagesLoaded = function(currentFeed){
 
 
1629
  //clearInterval(currentFeed.loadingInterval);
1630
  //jQuery('#wdi_feed_'+currentFeed.feed_row['wdi_feed_counter']+' .wdi_ajax_loading').remove();
1631
 
 
 
 
1632
  //if all images loaded then enable load more button and hide spinner
1633
  var wdi_feed_counter = currentFeed.feed_row['wdi_feed_counter'];
1634
- var feed_container = jQuery('#wdi_feed_'+wdi_feed_counter);
1635
-
1636
- if(currentFeed.feed_row.feed_display_view == 'load_more_btn'){
1637
  feed_container.find('.wdi_load_more').removeClass('wdi_hidden');
1638
  feed_container.find('.wdi_spinner').addClass('wdi_hidden');
1639
  }
1640
 
1641
- if(currentFeed.feed_row.feed_display_view == 'infinite_scroll'){
1642
- jQuery('#wdi_feed_'+currentFeed.feed_row['wdi_feed_counter']+' .wdi_ajax_loading').addClass('wdi_hidden');
1643
  }
1644
 
 
 
 
1645
  //custom event fired for user based custom js
1646
  feed_container.trigger('wdi_feed_loaded');
1647
 
 
1648
  }
1649
 
1650
 
1651
  //shows different parts of the feed based user choice
1652
- wdi_front.show = function(name,currentFeed){
1653
  var wdi_feed_counter = currentFeed.feed_row['wdi_feed_counter'];
1654
- var feed_container = jQuery('#wdi_feed_'+wdi_feed_counter + ' .wdi_feed_container');
1655
-
1656
- switch (name){
1657
- case 'header':{
1658
- show_header();
1659
- break;
1660
- }
1661
- case 'users':{
1662
- show_users(currentFeed);
1663
- break;
1664
- }
1665
-
1666
- }
1667
- function show_header(){
1668
 
1669
- var templateData = {
1670
- 'feed_thumb': currentFeed['feed_row']['feed_thumb'],
1671
- 'feed_name':currentFeed['feed_row']['feed_name'],
1672
- };
1673
-
1674
- var headerTemplate = wdi_front.getHeaderTemplate(),
1675
- html = headerTemplate(templateData),
1676
- containerHtml = feed_container.find('.wdi_feed_header').html();
1677
 
1678
- feed_container.find('.wdi_feed_header').html(containerHtml+html);
1679
 
 
 
 
 
1680
 
 
 
 
1681
 
 
1682
 
1683
 
1684
 
1685
  }
1686
- function show_users(currentFeed){
 
1687
  feed_container.find('.wdi_feed_users').html('');
1688
  var users = currentFeed['feed_users'];
1689
  var access_token = currentFeed['feed_row']['access_token'];
1690
-
1691
  var i = 0;
1692
  currentFeed.headerUserinfo = [];
1693
  getThumb();
1694
  //recursively calls itself until all user data is ready then displyes it with escapeRequest
1695
- function getThumb(){
1696
-
1697
- if(currentFeed.headerUserinfo.length == users.length){
1698
- escapeRequest(currentFeed.headerUserinfo,currentFeed);
1699
  return;
1700
  }
1701
- switch(users[currentFeed.headerUserinfo.length][0]){
1702
- case '#':{
1703
-
1704
- var errorMessage = '';
1705
- var url ='https://api.instagram.com/v1/tags/'+users[i].substr(1,users[i].length)+'/media/recent?access_token='+access_token;
1706
- jQuery.ajax({
1707
- 'type': 'POST',
1708
- 'url' : url,
1709
- dataType: 'jsonp',
1710
- success: function(response){
1711
-
1712
- if(response == '' || response == undefined || response == null){
1713
- errorMessage = wdi_front_messages.network_error;
1714
- alert(errorMessage);
1715
- return;
1716
- }
1717
- if(response['meta']['code']!=200){
1718
- errorMessage = response['meta']['error_message'];
1719
- alert(errorMessage);
1720
- return;
1721
- }
1722
- if(response['data'].length === 0){
1723
- errorMessage = wdi_front_messages.hashtag_nodata;
1724
- alert(errorMessage);
1725
- return;
1726
- }
1727
-
1728
- thumb_img = response['data'][0]['images']['thumbnail']['url'];
1729
- var obj = {
1730
- name: users[i],
1731
- url: thumb_img,
1732
- };
1733
- i++;
1734
- currentFeed.headerUserinfo.push(obj);
1735
- getThumb();
1736
- }
1737
- });
1738
- break;
1739
- }
1740
- default:{
1741
- var errorMessage = '';
1742
- var url = 'https://api.instagram.com/v1/users/search?q='+users[i]+'&access_token='+access_token;
1743
- var userIndex = i;
1744
- jQuery.ajax({
1745
- 'type': 'POST',
1746
- 'url' : url,
1747
- 'dataType' : 'jsonp',
1748
- success: function(response){
1749
-
1750
- if(response == '' || response == undefined || response == null){
1751
- errorMessage = wdi_front_messages.network_error;
1752
- alert(errorMessage);
1753
- return;
1754
- }
1755
- if(response['meta']['code']!=200){
1756
- errorMessage = response['meta']['error_message'];
1757
- alert(errorMessage);
1758
- return;
1759
- }
1760
- if(response['data'].length === 0){
1761
- errorMessage = wdi_front_messages.hashtag_nodata;
1762
- alert(errorMessage);
1763
- return;
1764
- }
1765
- for(var j=0; j,response['data'].length;j++){
1766
- if(response['data'][j]['username'] === users[i]){
1767
- thumb_img = response['data'][j]['profile_picture'];
1768
-
1769
  var obj = {
1770
- id : response['data'][j]['id'],
1771
- name: users[i],
1772
  url: thumb_img,
1773
  };
1774
-
1775
- if(/*currentFeed.feed_row.display_user_info == '1'*/1){
1776
- //getting user full info
1777
- var nurl = 'https://api.instagram.com/v1/users/'+response['data'][j]['id']+'/?access_token='+access_token;
1778
- jQuery.ajax({
1779
- 'type': 'POST',
1780
- 'url' : nurl,
1781
- 'dataType' : 'jsonp',
1782
- success: function(response){
1783
- if(response == '' || response == undefined || response == null){
1784
- errorMessage = wdi_front_messages.network_error;
1785
- alert(errorMessage);
1786
- return;
1787
- }
1788
- if(response['meta']['code']!=200){
1789
- errorMessage = response['meta']['error_message'];
1790
- alert(errorMessage);
1791
- return;
1792
- }
1793
- if(response['data'].length === 0){
1794
- errorMessage = wdi_front_messages.hashtag_nodata;
1795
- alert(errorMessage);
1796
- return;
1797
- }
1798
- var obj = {
1799
- id : response['data']['id'],
1800
- name: response['data']['username'],
1801
- url: response['data']['profile_picture'],
1802
- bio: response['data']['bio'],
1803
- counts: response['data']['counts'],
1804
- website: response['data']['website'],
1805
- full_name: response['data']['full_name']
1806
- }
1807
-
1808
- currentFeed.headerUserinfo.push(obj);
1809
- i++;
1810
- getThumb();
1811
-
1812
- }
1813
- });
1814
-
1815
- }else{
1816
-
1817
- currentFeed.headerUserinfo.push(obj);
1818
- i++;
1819
- getThumb();
1820
  }
1821
-
1822
- break;
 
1823
  }
1824
- }
1825
-
1826
- }
1827
- });
1828
- break;
1829
- }
1830
- }
 
1831
  }
1832
  //when all user data is ready break recursion and create user elements
1833
- function escapeRequest(info,currentFeed){
1834
-
1835
  feed_container.find('.wdi_feed_users').html('');
1836
- for(var k = 0; k< info.length;k++){
1837
  //setting all user filters to false
1838
 
1839
  var userFilter = {
@@ -1841,338 +1950,355 @@ wdi_front.show = function(name,currentFeed){
1841
  'id': info[k]['id'],
1842
  'name': info[k]['name']
1843
  };
1844
-
1845
 
1846
  //user inforamtion
1847
- var feed_users_arr = currentFeed.feed_row.feed_users.split(',');
1848
  var hashtagClass = (info[k]['name'][0] == '#') ? 'wdi_header_hashtag' : '';
1849
 
1850
  var templateData = {
1851
- 'user_index' : k,
1852
  'user_img_url': info[k]['url'],
1853
  'counts': info[k]["counts"],
1854
- 'feed_counter':currentFeed.feed_row.wdi_feed_counter,
1855
- 'user_name':info[k]['name'],
1856
  'bio': info[k]['bio'],
1857
- 'usersCount': feed_users_arr.length,
1858
- 'hashtagClass':hashtagClass
1859
 
1860
  };
1861
-
1862
-
1863
- var userTemplate = wdi_front.getUserTemplate(currentFeed,info[k]['name']),
1864
- html = userTemplate(templateData),
1865
- containerHtml = feed_container.find('.wdi_feed_users').html();
1866
 
1867
- feed_container.find('.wdi_feed_users').html(containerHtml+html);
 
 
 
 
 
 
1868
 
1869
  currentFeed.userSortFlags.push(userFilter);
1870
-
1871
  var clearFloat = jQuery('<div class="clear"></div>');
1872
 
1873
  }
1874
  feed_container.find('.wdi_feed_users').append(clearFloat);
 
1875
  };
1876
  }
1877
 
1878
  }
1879
 
1880
 
1881
- wdi_front.getUserTemplate =function(currentFeed,username){
1882
  var usersCount = currentFeed.feed_row.feed_users.split(',').length,
1883
- instagramLink,instagramLinkOnClick,js;
1884
 
1885
- switch(username[0]){
1886
- case '#':{
1887
- instagramLink = '//instagram.com/explore/tags/'+username.substr(1,username.length);
1888
- break;
1889
- }
1890
- default:{
1891
- instagramLink = '//instagram.com/'+username;
1892
- break;
1893
- }
 
 
1894
  }
1895
- js = 'window.open("'+instagramLink+'","_blank")';
1896
- instagramLinkOnClick = "onclick='"+js+"'";
1897
 
1898
- var source ='<div class="wdi_single_user" user_index="<%=user_index%>">'+
1899
- '<div class="wdi_header_user_text <%=hashtagClass%>">'+
1900
 
1901
- '<div class="wdi_user_img_wrap">'+
1902
- '<img src="<%= user_img_url%>">';
1903
- if(usersCount > 1){
1904
- source+='<div title="'+wdi_front_messages.filter_title+'" class="wdi_filter_overlay">'+
1905
- '<div class="wdi_filter_icon">'+
1906
- '<span onclick="wdi_front.addFilter(<%=user_index%>,<%=feed_counter%>);" class="fa fa-filter"></span>'+
1907
- '</div>'+
1908
- '</div>';
1909
- }
1910
- source+='</div>';
1911
- source += '<h3 '+instagramLinkOnClick+'><%= user_name%></h3>';
1912
-
1913
- if(username[0] !== '#'){
1914
- if(currentFeed.feed_row.follow_on_instagram_btn == '1'){
1915
- source+='<div class="wdi_user_controls">'+
1916
- '<div class="wdi_follow_btn" onclick="window.open(\'//instagram.com/<%= user_name%>\',\'_blank\')"><span> Follow</span></div>'+
1917
- '</div>';
1918
- }
1919
- source+='<div class="wdi_media_info">'+
1920
- '<p class="wdi_posts"><span class="fa fa-camera-retro"><%= counts.media%></span></p>'+
1921
- '<p class="wdi_followers"><span class="fa fa-user"><%= counts.followed_by%></span></p>'+
1922
- '</div>';
1923
- }else{
1924
- source+='<div class="wdi_user_controls">'+
1925
- '</div>'+
1926
- '<div class="wdi_media_info">'+
1927
- '<p class="wdi_posts"><span></span></p>'+
1928
- '<p class="wdi_followers"><span></span></p>'+
1929
- '</div>';
1930
- }
1931
-
1932
- if(usersCount == 1 && username[0] !== '#' && currentFeed.feed_row.display_user_info == '1'){
1933
- source+='<div class="wdi_bio"><%= bio%></div>';
1934
- }
1935
-
1936
-
1937
-
1938
-
1939
 
1940
- source+='</div>'+
 
 
 
1941
  '</div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1942
  var template = _.template(source);
1943
  return template;
1944
  }
1945
 
1946
 
1947
 
1948
- wdi_front.getHeaderTemplate = function(){
1949
- var source='<div class="wdi_header_wrapper">'+
1950
- '<div class="wdi_header_img_wrap">'+
1951
- '<img src="<%=feed_thumb%>">'+
1952
- '</div>'+
1953
- '<div class="wdi_header_text"><%=feed_name%></div>'+
1954
- '<div class="clear">'+
1955
- '</div>';
1956
  var template = _.template(source);
1957
  return template;
1958
  }
1959
 
1960
 
1961
  //sets user filter to true and applys filter to feed
1962
- wdi_front.addFilter = function(index,feed_counter){
1963
- var currentFeed = window['wdi_feed_'+feed_counter];
1964
  var usersCount = currentFeed.feed_row.feed_users.split(',').length;
1965
- if(usersCount<2){
1966
  return;
1967
  }
1968
 
1969
- if(currentFeed.nowLoadingImages != false){
1970
  return;
1971
- }else{
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1972
 
1973
- var userDiv = jQuery('#wdi_feed_'+currentFeed.feed_row.wdi_feed_counter+'_users [user_index="'+index+'"]');
1974
- userDiv.find('.wdi_filter_overlay').toggleClass('wdi_filter_active_bg');
1975
- userDiv.find('.wdi_header_user_text h3').toggleClass('wdi_filter_active_col');
1976
- userDiv.find('.wdi_media_info').toggleClass('wdi_filter_active_col');
1977
- userDiv.find('.wdi_follow_btn').toggleClass('wdi_filter_active_col');
1978
-
1979
- currentFeed.customFilterChanged = true;
1980
- //setting filter flag to true
1981
- if(currentFeed.userSortFlags[index]['flag'] == false){
1982
- currentFeed.userSortFlags[index]['flag'] = true;
1983
- }else{
1984
- currentFeed.userSortFlags[index]['flag'] = false;
1985
- }
1986
- //getting active filter count
1987
- var activeFilterCount = 0;
1988
- for(var j = 0; j < currentFeed.userSortFlags.length; j++){
1989
- if(currentFeed.userSortFlags[j]['flag']==true){
1990
- activeFilterCount++;
1991
- }
1992
- }
1993
 
1994
 
 
 
 
 
1995
 
1996
- if(currentFeed.feed_row.feed_display_view == 'pagination'){
1997
- //reset responsive indexes because number of feed images may change after using filter
1998
- currentFeed.resIndex = 0;
1999
- }
2000
 
 
 
 
 
 
 
 
 
2001
 
2002
- //applying filters
2003
- if(activeFilterCount != 0){
2004
- wdi_front.filterData(currentFeed);
2005
- wdi_front.displayFeed(currentFeed);
2006
- }else{
2007
- currentFeed.customFilteredData = currentFeed.dataStorageList;
2008
- wdi_front.displayFeed(currentFeed);
2009
- }
2010
 
2011
-
2012
- if(currentFeed.feed_row.feed_display_view == 'pagination'){
2013
- //reset paginator because while filtering images become more or less so pages also become more or less
2014
- currentFeed.paginator = Math.ceil((currentFeed.imageIndex)/parseInt(currentFeed.feed_row.pagination_per_page_number));
2015
- //setting current page as the last loaded page when filter is active
2016
- currentFeed.currentPage = currentFeed.paginator; //pagination page number
2017
- //when feed is displayed we are by default in the first page
2018
- //so we are navigating from page 1 to current page using custom navigation method
2019
- wdi_front.updatePagination(currentFeed,'custom',1);
2020
 
2021
- jQuery('#wdi_first_page').removeClass('wdi_disabled');
2022
- jQuery('#wdi_last_page').addClass('wdi_disabled');
2023
- }
2024
-
2025
  }
 
 
2026
  }
2027
- wdi_front.filterData = function(currentFeed){
2028
-
 
2029
  var users = currentFeed.userSortFlags;
2030
  currentFeed.customFilteredData = [];
2031
- for(var i = 0; i < currentFeed.dataStorageList.length; i++){
2032
- for(var j = 0; j < users.length; j++){
2033
- if((currentFeed.dataStorageList[i]['user']['id']==users[j]['id'] ||currentFeed.dataStorageList[i]['wdi_hashtag'] == users[j]['name']) && users[j]['flag']==true){
2034
  currentFeed.customFilteredData.push(currentFeed.dataStorageList[i]);
2035
  }
2036
 
2037
  }
2038
  }
2039
-
2040
  }
2041
- wdi_front.applyFilters = function(currentFeed){
2042
- for(var i = 0; i < currentFeed.userSortFlags.length; i++){
2043
- if(currentFeed.userSortFlags[i]['flag'] == true){
2044
- var userDiv = jQuery('#wdi_feed_'+currentFeed.feed_row.wdi_feed_counter+ '[user_index="'+i+'"]');
2045
- wdi_front.addFilter(i,currentFeed.feed_row.wdi_feed_counter);
2046
- wdi_front.addFilter(i,currentFeed.feed_row.wdi_feed_counter);
 
2047
  }
2048
  }
2049
 
2050
  }
2051
 
2052
  //gets data Count from global storage
2053
- wdi_front.getImgCount = function(currentFeed){
2054
  var dataStorage = currentFeed.dataStorage;
2055
  var count = 0;
2056
- for(var i = 0; i<dataStorage.length;i++){
2057
- count+=dataStorage[i].length;
2058
  }
2059
  return count;
2060
  }
2061
 
2062
  //parses image data for lightbox popup
2063
- wdi_front.parseLighboxData =function (currentFeed,filterFlag){
2064
-
2065
  var dataStorage = currentFeed.dataStorage;
2066
  var sortImagesBy = currentFeed.feed_row['sort_images_by'];
2067
  var sortOrder = currentFeed.feed_row['display_order'];
2068
- var sortOperator = wdi_front.sortingOperator(sortImagesBy,sortOrder);
2069
  var data = [];
2070
 
2071
  var popupData = [];
2072
  var obj = {};
2073
-
2074
  //if filterFlag is true, it means that some filter for frontend content is enabled so give
2075
  //lightbox only those images which are visible at that moment else give all avialable
2076
- if(filterFlag == true){
2077
  data = currentFeed.customFilteredData;
2078
- }else{
2079
- for(var i = 0; i<dataStorage.length;i++){
2080
- for(var j=0; j<dataStorage[i].length;j++){
2081
  data.push(dataStorage[i][j]);
2082
  }
2083
  }
2084
  data.sort(sortOperator);
2085
  }
2086
-
2087
-
2088
-
2089
- for(i = 0;i < data.length;i++){
2090
  obj = {
2091
- 'alt':'',
2092
- 'avg_rating':'',
2093
- 'comment_count':data[i]['comments']['count'],
2094
- 'date': wdi_front.convertUnixDate(data[i]['created_time']),
2095
- 'description':wdi_front.getDescription((data[i]['caption']!==null) ? data[i]['caption']['text'] : ''),
2096
- 'filename': wdi_front.getFileName(data[i]),
2097
- 'filetype': wdi_front.getFileType(data[i]['type']),
2098
- 'hit_count':'0',
2099
- 'id':data[i]['id'],
2100
- 'image_url': data[i]['link'],
2101
- 'number' : 0,
2102
- 'rate':'',
2103
- 'rate_count': '0',
2104
- 'username' : data[i]['user']['username'],
2105
- 'profile_picture': data[i]['user']['profile_picture'],
2106
- 'thumb_url' :data[i]['link']+'media/?size=t',
2107
- 'comments_data': data[i]['comments']['data']
2108
- }
2109
- popupData.push(obj);
2110
  }
2111
  return popupData;
2112
  }
2113
- wdi_front.convertUnixDate = function(date){
 
2114
  var utcSeconds = parseInt(date);
2115
  var newDate = new Date(0);
2116
  newDate.setUTCSeconds(utcSeconds);
2117
- var str = newDate.getFullYear() + '-' + newDate.getMonth() + '-' +newDate.getDate();
2118
- str+= ' '+newDate.getHours()+':'+newDate.getMinutes();
2119
  return str;
2120
  }
2121
- wdi_front.getDescription = function(desc){
2122
- desc = desc.replace(/\r?\n|\r/g,' ');
 
2123
 
2124
 
2125
  return desc;
2126
  }
2127
- wdi_front.getFileName = function(data){
 
2128
  var link = data['link'];
2129
  var type = data['type'];
2130
- var linkFragments = link.split('/');
2131
- return linkFragments[linkFragments.length-2];
 
 
 
 
2132
 
2133
  }
2134
- wdi_front.getFileType = function(type){
2135
- return "EMBED_OEMBED_INSTAGRAM_IMAGE";
 
 
 
 
 
 
2136
  }
2137
 
2138
 
2139
 
2140
- wdi_front.array_max = function(array){
2141
- var max = array[0];
2142
- var minIndex = 0;
2143
- for(var i = 1; i< array.length;i++){
2144
- if(max<array[i]){
2145
- max = array[i];
2146
- minIndex = i;
2147
- }
2148
- }
2149
- return {
2150
- 'value': max,
2151
- 'index': minIndex
2152
- };
2153
- }
2154
- wdi_front.array_min = function(array){
2155
- var min = array[0];
2156
- var minIndex = 0;
2157
- for(var i = 1; i <array.length;i++){
2158
- if(min>array[i]){
2159
- min = array[i];
2160
- minIndex = i;
2161
- }
2162
- }
2163
- return {
2164
- 'value': min,
2165
- 'index': minIndex
2166
- };
2167
- }
 
2168
 
2169
  /*
2170
  * Returns users count whose feed is not finished
2171
  */
2172
- wdi_front.activeUsersCount = function(currentFeed){
2173
  var counter = 0;
2174
- for(var i = 0; i < currentFeed.usersData.length; i++){
2175
- if(currentFeed.usersData[i].finished != 'finished'){
2176
  counter++;
2177
  }
2178
  }
@@ -2181,13 +2307,593 @@ wdi_front.activeUsersCount = function(currentFeed){
2181
 
2182
 
2183
 
 
 
 
 
 
 
2184
 
 
 
 
 
 
 
 
 
 
 
 
 
2185
 
2186
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2187
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2188
 
 
 
2189
 
2190
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2191
 
2192
 
2193
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if (typeof wdi_front == 'undefined') {
2
  wdi_front = {
3
  type: 'not_declared'
4
  };
5
  }
6
+ jQuery(document).ready(function() {
7
+ if (wdi_front['type'] != 'not_declared') {
8
+ wdi_front.clickOrTouch = wdi_front.detectEvent();
9
  //initializing all feeds in the page
10
  wdi_front.globalInit();
11
+ } else {
12
  return;
13
  }
14
+
15
  });
16
 
17
 
18
+ wdi_front.detectEvent = function() {
19
  var isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
20
+ if (isMobile) {
21
  return "touchend";
22
+ } else {
23
  return 'click';
24
  }
25
  }
26
+
27
+ wdi_front.globalInit = function() {
28
  var num = wdi_front['feed_counter'];
 
29
 
 
30
 
31
+
32
+ for (var i = 0; i <= num; i++) {
33
+
34
+ var currentFeed = new WDIFeed(window['wdi_feed_' + i]);
35
+
36
+ /*initializing instagram object which will handle all instagram api requests*/
37
+ currentFeed.instagram = new WDIInstagram();
38
+
39
+ /**
40
+ * this object will be passed to filtering function of currentFeed.instagram as second parameter
41
+ * @type {Object}
42
+ */
43
+ currentFeed.instagram.filterArguments = {
44
+ feed: currentFeed
45
+ };
46
+
47
+ currentFeed.instagram.filters = [{
48
+ 'where': 'getUserRecentMedia',
49
+ 'what': function(response, args, cArgs) {
50
+ return args.feed.conditionalFilter(response, cArgs);
51
+ }
52
+ }, {
53
+ 'where': 'getTagRecentMedia',
54
+ 'what': function(response, args, cArgs) {
55
+ return args.feed.conditionalFilter(response, cArgs);
56
+ }
57
+ }, {
58
+ 'where': 'requestByUrl',
59
+ 'what': function(response, args, cArgs) {
60
+ return args.feed.conditionalFilter(response, cArgs);
61
+ }
62
+ }, ];
63
+
64
+
65
+ currentFeed.instagram.addToken(currentFeed['feed_row']['access_token']);
66
+
67
  wdi_front.access_token = currentFeed['feed_row']['access_token'];
68
+
69
  currentFeed.dataStorage = []; //stores all avialable data
70
+ currentFeed.dataStorageList = []; //?
71
+ currentFeed.allResponseLength = 0; //?
72
  //number of instagram objects which has been got by single request
73
  currentFeed.currentResponseLength = 0;
74
 
75
  //temprorary usersData which is uses in case when getted data is smaller then needed
76
  currentFeed.temproraryUsersData = [];
77
 
78
+ currentFeed.removedUsers = 0;
79
  currentFeed.nowLoadingImages = true;
80
  currentFeed.imageIndex = 0; //index for image indexes
81
+ currentFeed.resIndex = 0; //responsive indexes used for pagination
82
  currentFeed.currentPage = 1; //pagination page number
83
  currentFeed.userSortFlags = []; //array for descripbing user based filter options
84
  currentFeed.customFilterChanged = false; //flag to notice filter change, onclick on username
85
+
86
+ /**
87
+ * This variable describes after how many requests program will stop searching for content
88
+ * this number is very important and should not be set too high, because when feed has conditional filter
89
+ * and filtered items are rare then the program will recursively request new photos and will filter them
90
+ * if no image was fount it will go into infinite loop if feed images are "infinite" ( very huge number )
91
+ * and if requests count in 1 hour exeed 5000 instagram will block access token for one hour
92
+ *
93
+ * @type {Number}
94
+ */
95
+ currentFeed.maxConditionalFiltersRequestCount = 10;
96
+
97
+ /**
98
+ * This variable shows us how many times program has been recursively called,
99
+ * it changes it value within filtering function, and resets itself to 0 when feed is being displayed
100
+ *
101
+ * @type {Number}
102
+ */
103
+ currentFeed.instagramRequestCounter = 0;
104
+
105
+ /**
106
+ * This array stores data from each request,
107
+ * it is used to determine and remove duplicate photos caused by multiple hashtags
108
+ * it is resetted to its inital [] value after displaying feed
109
+ *
110
+ * @type {Array}
111
+ */
112
+ currentFeed.conditionalFilterBuffer = [];
113
+
114
+
115
+ currentFeed.stopInfiniteScrollFlag = false;
116
+
117
+ window.onload = function() {
118
+ for (var i = 0; i <= wdi_front.feed_counter; i++) {
119
+ window['wdi_feed_' + i]['nowLoadingImages'] = false;
120
  }
121
  }
122
 
123
+ if (currentFeed.feed_row.feed_type == 'masonry') {
124
  currentFeed.displayedData = [];
125
  }
126
 
127
 
128
 
129
  //if pagination is on then set pagination parameters
130
+ if (currentFeed.feed_row.feed_display_view == 'pagination') {
131
  currentFeed.feed_row.resort_after_load_more = 0;
132
+ if (currentFeed.feed_row.feed_type != 'image_browser') {
133
  currentFeed.feed_row.load_more_number = parseInt(currentFeed.feed_row.pagination_per_page_number);
134
+ currentFeed.feed_row.number_of_photos = (1 + parseInt(currentFeed.feed_row.pagination_preload_number)) * currentFeed.feed_row.load_more_number;
135
+ } else {
136
  currentFeed.feed_row.number_of_photos = 1 + parseInt(currentFeed.feed_row.image_browser_preload_number);
137
  currentFeed.feed_row.load_more_number = parseInt(currentFeed.feed_row.image_browser_load_number);
138
  }
139
+
140
+
141
+ currentFeed.freeSpaces = (Math.floor(currentFeed.feed_row.pagination_per_page_number / currentFeed.feed_row.number_of_columns) + 1) * currentFeed.feed_row.number_of_columns - currentFeed.feed_row.pagination_per_page_number;
142
+ } else {
143
  currentFeed.freeSpaces = 0;
144
  }
145
+
146
+
147
 
148
  wdi_front.bindEvents(currentFeed);
149
 
150
 
151
 
152
  //initializing function for lightbox
153
+ currentFeed.galleryBox = function(image_id) {
154
+ wdi_spider_createpopup(wdi_url.ajax_url + '?gallery_id=' + this.feed_row['id'] + '&image_id=' + image_id, wdi_front.feed_counter, this.feed_row['lightbox_width'], this.feed_row['lightbox_height'], 1, 'testpopup', 5, this);
155
+ }
156
+ //calling responive javascript
157
  wdi_responsive.columnControl(currentFeed);
158
 
159
  //if feed type is masonry then trigger resize event for building proper column layout
160
+ if (currentFeed.feed_row.feed_type == 'masonry') {
161
  jQuery(window).trigger('resize');
162
  }
163
+
164
+
165
+
166
+ window['wdi_feed_' + i] = currentFeed;
167
+
168
+
169
+
170
  //initializing each feed
171
  wdi_front.init(currentFeed);
172
+ } //endfor
173
 
174
  }
175
 
176
+ wdi_front.init = function(currentFeed) {
177
+
178
 
 
179
  //some varables used in code
180
+ currentFeed.photoCounter = currentFeed.feed_row["number_of_photos"];
181
 
182
 
183
+
184
+ if (wdi_front.isJsonString(currentFeed.feed_row.feed_users)) {
185
+ /**
186
+ * Contains username and user_id of each user
187
+ * @type {[Array}
188
+ */
189
+ currentFeed.feed_users = JSON.parse(currentFeed.feed_row.feed_users);
190
+ } else {
191
+ alert('provided feed users are invalid or obsolete for this version of plugin');
192
+ return;
193
  }
194
 
195
 
196
+ //wdi_front.loadInstagramMedia( currentFeed, currentFeed.feed_row.number_of_photos);
197
+ currentFeed.dataCount = currentFeed.feed_users.length;
198
+ for (var i = 0; i < currentFeed.feed_users.length; i++) {
199
+ wdi_front.instagramRequest(i, currentFeed);
200
+ }
201
+
202
 
203
+ if (currentFeed.feed_row["number_of_photos"] > 0) {
204
  wdi_front.ajaxLoader(currentFeed);
205
  }
206
+
207
+
208
  //setting feed name
209
+ if (currentFeed['feed_row']['display_header'] === '1') {
210
+ wdi_front.show('header', currentFeed);
211
  }
212
+ if (currentFeed['feed_row']['show_usernames'] === '1') {
213
+ wdi_front.show('users', currentFeed);
214
  }
215
+
216
 
217
  }
218
 
219
 
220
+
221
+ /**
222
+ * Checks if given string is JSON string
223
+ * @param {String} str [string to check]
224
+ * @return {Boolean} [true or false]
 
225
  */
226
+ wdi_front.isJsonString = function(str) {
227
+ try {
228
+ JSON.parse(str);
229
+ } catch (e) {
230
+ return false;
 
 
 
 
 
 
231
  }
232
+ return true;
233
+ }
234
 
235
+
236
+
237
+ /**
238
+ * Makes an ajax request for given user from feed_users array
239
+ * if response is ok then calls saveUserData function
240
+ * @param {Number} id [index of user in current_feed.feed_users array]
241
+ * @param {Object} currentFeed
242
+ */
243
+ wdi_front.instagramRequest = function(id, currentFeed) {
244
+
245
+ var feed_users = currentFeed.feed_users,
246
+ _this = this;
247
+
248
+ switch (this.getInputType(feed_users[id]['username'])) {
249
+ case 'hashtag':
250
+ {
251
+ currentFeed.instagram.getTagRecentMedia(this.stripHashtag(feed_users[id]['username']), {
252
+ success: function(response) {
253
+ response = _this.checkMediaResponse(response);
254
+ if (response != false) {
255
+ _this.saveUserData(response, currentFeed.feed_users[id], currentFeed);
256
+ }
 
 
 
 
 
 
 
 
 
 
 
257
  }
258
+ });
259
+ break;
 
 
 
 
 
 
260
  }
261
+ case 'user':
262
+ {
263
+ currentFeed.instagram.getUserRecentMedia(feed_users[id]['id'], {
264
+ success: function(response) {
265
+ response = _this.checkMediaResponse(response);
266
+ if (response != false) {
267
+ _this.saveUserData(response, currentFeed.feed_users[id], currentFeed);
268
+ }
269
+ }
270
+ })
271
+ break;
 
 
 
 
272
  }
 
 
 
 
273
  }
274
  }
275
 
276
+ /**
277
+ * Returns true is given string starts with dash ( # )
278
+ * @param {String} str
279
+ * @return {Boolean} [true or false]
280
  */
281
+ wdi_front.isHashtag = function(str) {
282
+ return (str[0] === '#');
 
 
 
 
 
 
 
 
 
 
 
283
  }
284
+
285
+
286
  /*
287
  * Saves each user data on seperate index in currentFeed.usersData array
288
  * And also checks if all data form all users is already avialable if yes it displays feed
289
  */
290
+ wdi_front.saveUserData = function(data, user, currentFeed) {
291
+
292
  data['username'] = user.username;
293
+ data['user_id'] = user.id;
294
 
295
  //checking if user type is hashtag then manually add hashtag to each object, for later use
296
  //hashtag based filters
297
+ if (data['user_id'][0] === '#') {
298
+ data['data'] = wdi_front.appendRequestHashtag(data['data'], data['user_id']);
299
  }
300
+
301
+
302
  currentFeed.usersData.push(data);
303
 
304
 
305
+ currentFeed.currentResponseLength = wdi_front.getArrayContentLength(currentFeed.usersData, 'data');
306
  currentFeed.allResponseLength += currentFeed.currentResponseLength;
307
 
308
 
309
 
310
+ if (currentFeed.dataCount == currentFeed.usersData.length) {
311
+
312
  //if getted objects is not enough then recuest new ones
313
+
314
+ if (currentFeed.currentResponseLength < currentFeed.feed_row.number_of_photos && !wdi_front.userHasNoPhoto(currentFeed)) {
315
+ //console.log('initial recursion');
316
+ /*here we are calling loadMore function out of recursion cylce, after this initial-keep call
317
  loadMore will be called with 'initial' recursivly until the desired number of photos is reached
318
  if possible*/
319
+ wdi_front.loadMore('initial-keep', currentFeed);
320
+ } else {
321
+
322
+
323
+
324
+ //display feed
325
  wdi_front.displayFeed(currentFeed);
326
  //when all data us properly displayed check for any active filters and then apply them
327
  wdi_front.applyFilters(currentFeed);
328
+
329
  }
330
 
331
+
332
  }
333
+
334
  }
335
+
336
+ /**
337
+ * checks weather all feed users have any photos after first time request
338
+ */
339
+ wdi_front.userHasNoPhoto = function(currentFeed, cstData) {
340
  var counter = 0;
341
  var data = currentFeed.usersData;
342
+ if (cstData != undefined) {
343
  data = cstData;
344
  }
345
+ for (var i = 0; i < data.length; i++) {
346
+ if (data[i]['pagination']['next_max_id'] == undefined) {
347
  counter++
348
  }
349
  }
350
+ if (counter == data.length) {
351
  return 1;
352
+ } else {
353
  return 0;
354
  }
355
  }
356
+
357
  /*
358
  *gives each instagram object custom hashtag parameter, which is used for searching image/video
359
  */
360
+ wdi_front.appendRequestHashtag = function(data, hashtag) {
361
+ for (var i = 0; i < data.length; i++) {
362
  data[i]['wdi_hashtag'] = hashtag;
363
  }
364
  return data;
365
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
366
 
367
 
368
 
371
  * also checks if one request is not enough for displaying all images user wanted
372
  * it recursively calls wdi_front.loadMore() until the desired number of photos is reached
373
  */
374
+ wdi_front.displayFeed = function(currentFeed, load_more_number) {
375
+
376
+
377
+
378
+ if (currentFeed.customFilterChanged == false) {
379
  //sorting data...
380
+ var data = wdi_front.feedSort(currentFeed, load_more_number);
381
  }
382
+
383
+
384
+ //becomes true when user clicks in frontend filter
385
+ //if isset to true then loadmore recursion would not start
386
+ var frontendCustomFilterClicked = currentFeed.customFilterChanged;
387
+
388
+
389
  // if custom filter changed then display custom data
390
+ if (currentFeed.customFilterChanged == true) {
391
  var data = currentFeed.customFilteredData;
392
  //parsing data for lightbox
393
+ currentFeed.parsedData = wdi_front.parseLighboxData(currentFeed, true);
394
  }
395
 
396
+
397
  //storing all sorted data in array for later use in user based filters
398
+ if (currentFeed.feed_row.resort_after_load_more != '1') {
399
  // filter changes when user clicks to usernames in header
400
  // at that point displayFeed triggers but we don't have any new data so
401
  // we are not adding new data to our list
402
+ if (currentFeed.customFilterChanged == false) {
403
  currentFeed.dataStorageList = currentFeed.dataStorageList.concat(data);
404
  }
405
+ } else {
406
  // filter changes when user clicks to usernames in header
407
  // at that point displayFeed triggers but we don't have any new data so
408
  // we are not adding new data to our list
409
+ if (currentFeed.customFilterChanged == false) {
410
  currentFeed.dataStorageList = data;
411
  }
412
  }
413
 
414
  //checking feed_type and calling proper rendering functions
415
+ if ( currentFeed.feed_row.feed_type == 'masonry' ) {
416
+ wdi_front.masonryDisplayFeedItems(data, currentFeed);
417
  }
418
+ if ( currentFeed.feed_row.feed_type == 'thumbnails' || currentFeed.feed_row.feed_type == 'blog_style' || currentFeed.feed_row.feed_type == 'image_browser') {
419
+ wdi_front.displayFeedItems( data, currentFeed );
420
  }
421
+
422
+
423
+
424
+ //recursively calling load more to get photos
425
+ var dataLength = wdi_front.getDataLength( currentFeed );
426
+
427
 
428
 
429
+ if ( dataLength < currentFeed.photoCounter && !frontendCustomFilterClicked && currentFeed.instagramRequestCounter <= currentFeed.maxConditionalFiltersRequestCount) {
430
+ //console.log( 'wtf recursion' );
431
+ wdi_front.loadMore( '', currentFeed );
432
+
433
+ } else {
434
 
435
+ }
436
 
437
 
438
+ /**
439
+ * if maximum number of requests are reached then stop laoding more images and show images which are available
440
+ * @param {Number} currentFeed.instagramRequestCounter > currentFeed.maxConditionalFiltersRequestCount [description]
441
+ * @return {Boolean}
442
+ */
443
+ if (currentFeed.instagramRequestCounter > currentFeed.maxConditionalFiltersRequestCount) {
444
+ wdi_front.allImagesLoaded(currentFeed);
445
 
446
+ //if no data was received then
447
+ if (data.length == 0) {
448
+ //if feed_display_view is set to infinite scroll then after reaching the limit once set this flag to false
449
+ //this will stop infinite scrolling and will not load any images even when scrolling
450
+ currentFeed.stopInfiniteScrollFlag = true;
451
  }
452
+ }
453
 
454
  //checking if display_view is pagination and we are not on the last page then enable
455
  //last page button
456
+ if (currentFeed.feed_row.feed_display_view == 'pagination' && currentFeed.currentPage < currentFeed.paginator) {
457
+ jQuery('#wdi_feed_' + currentFeed.feed_row.wdi_feed_counter).find('#wdi_last_page').removeClass('wdi_disabled');
458
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
459
 
 
 
 
 
 
 
 
 
460
 
 
 
 
 
 
 
 
 
 
461
 
462
+ // reset instagram request counter to zero for next set of requests
463
+ currentFeed.instagramRequestCounter = 0;
464
 
465
+ //reset conditional filter buffer for the next bunch of requests
466
+ currentFeed.conditionalFilterBuffer = [];
 
 
 
 
 
 
467
 
468
+ //if there are any missing images in header then replace them with new ones if possible
469
+ wdi_front.updateUsersImages(currentFeed);
 
 
 
 
470
 
 
 
 
 
 
 
471
 
472
+ /**
473
+ * Enable image lazy laoding if pagination is not enabeled because pagination has option for preloading images
474
+ * which is the opposide of lazy load
475
+ */
476
+ // if( currentFeed.feed_row.feed_display_view != 'pagination' ){
477
+ // jQuery(function() {
478
+ // jQuery('img.wdi_img').lazyload();
479
+ // });
480
+
481
+ // }
482
+
483
+ }
484
 
485
+ /**
486
+ * checks if user images in header have empty source or source is missing.png then if it is available data
487
+ * then update source
488
+ * @param {Object} currentFeed [description]
489
+ */
490
+ wdi_front.updateUsersImages = function(currentFeed) {
491
+ var elements = jQuery('#wdi_feed_' + currentFeed.feed_row.wdi_feed_counter).find('.wdi_single_user .wdi_user_img_wrap img');
492
+ elements.each(function() {
493
+ if (jQuery(this).attr('src') == wdi_url.plugin_url + '../images/missing.png' || jQuery(this).attr('src') == '') {
494
+ //console.log('missing');
495
+ for (var j = 0; j < currentFeed.usersData.length; j++) {
496
+ if (currentFeed.usersData[j]['username'] == jQuery(this).parent().parent().find('h3').text()) {
497
+ if (currentFeed.usersData[j]['data'].length != 0) {
498
+ jQuery(this).attr('src', currentFeed.usersData[j]['data'][0]['images']['thumbnail']['url']);
499
+ }
500
+ }
501
  }
502
  }
503
+ });
504
+ }
505
 
 
 
 
 
506
 
 
 
 
 
 
507
 
508
+ /**
509
+ * Displays data in masonry layout
510
+ * @param {Object} data data to be displayed
511
+ * @param {Object} currentFeed
512
+ */
513
+ wdi_front.masonryDisplayFeedItems = function(data, currentFeed) {
514
+ var masonryColEnds = [];
515
+ var masonryColumns = [];
516
 
517
 
518
+ jQuery('#wdi_feed_' + currentFeed.feed_row['wdi_feed_counter'] + ' .wdi_masonry_column').each(function() {
519
 
520
+ //if resorte after load more is on then reset columns on every load more
521
+ if (currentFeed.feed_row.resort_after_load_more == 1) {
522
+ jQuery(this).html('');
523
+ currentFeed.imageIndex = 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
524
  }
 
 
 
525
 
526
+ //if custom filter is set or changed then reset masonry columns
527
+ if (currentFeed.customFilterChanged == true) {
528
+ jQuery(this).html('');
529
+ currentFeed.imageIndex = 0;
 
530
  }
 
 
 
 
 
 
 
 
531
 
532
+ //check if pagination is enabled then each page should have resetted colEnds
533
+ //else give previous colEnds
534
+ if (currentFeed.feed_row.feed_display_view == 'pagination') {
535
+ masonryColEnds.push(0);
536
+ } else {
537
+ masonryColEnds.push(jQuery(this).height());
538
+ }
539
+
540
+ masonryColumns.push(jQuery(this));
541
+ });
542
+
543
  //if custom filter is set or changed then reset masonry columns
544
+ if (currentFeed.customFilterChanged == true) {
 
 
545
  currentFeed.customFilterChanged = false;
546
  }
 
547
 
 
548
 
549
+ //loop for displaying items
550
+ for (var i = 0; i < data.length; i++) {
551
+
552
+ currentFeed.displayedData.push(data[i]);
553
+ if (data[i]['type'] == 'image') {
554
  var photoTemplate = wdi_front.getPhotoTemplate(currentFeed);
555
+ } else {
556
  var photoTemplate = wdi_front.getVideoTemplate(currentFeed);
557
  }
558
+
559
  var rawItem = data[i];
560
+ var item = wdi_front.createObject(rawItem, currentFeed);
561
  var html = photoTemplate(item);
 
562
 
563
+ //find column with minumum height and append to it new object
564
+ var shortCol = wdi_front.array_min(masonryColEnds);
565
+ var imageResolution = wdi_front.getImageResolution(data[i]);
566
+
567
+ masonryColumns[shortCol['index']].html(masonryColumns[shortCol['index']].html() + html);
568
+ masonryColEnds[shortCol['index']] += masonryColumns[shortCol['index']].width() * imageResolution;
569
  currentFeed.imageIndex++;
570
+
571
 
572
  //changing responsive indexes for pagination
573
+ if (currentFeed.feed_row.feed_display_view == 'pagination') {
574
+ if ((i + 1) % currentFeed.feed_row.pagination_per_page_number === 0) {
575
+ currentFeed.resIndex += currentFeed.freeSpaces + 1;
576
+ } else {
577
  currentFeed.resIndex++;
578
  }
579
+ }
 
580
  }
581
 
582
 
 
 
 
 
 
 
583
  //binding onload event for ajax loader
584
  currentFeed.wdi_loadedImages = 0;
585
  var columnFlag = false;
586
  currentFeed.wdi_load_count = i;
587
  var wdi_feed_counter = currentFeed.feed_row['wdi_feed_counter'];
588
+ var feed_wrapper = jQuery('#wdi_feed_' + wdi_feed_counter + ' img.wdi_img').on('load', function() {
589
  currentFeed.wdi_loadedImages++;
590
  checkLoaded();
591
 
592
  //calls wdi_responsive.columnControl() which calculates column number on page
593
  //and gives feed_wrapper proper column class
594
+ if (columnFlag === false) {
595
+ wdi_responsive.columnControl(currentFeed, 1);
 
 
 
 
 
 
 
 
 
596
  columnFlag = true;
597
  }
598
 
 
599
  //Binds caption opening and closing event to each image photo_title
600
+ // if (currentFeed.feed_row.feed_type != 'blog_style') {
601
+ // wdi_responsive.bindMasonryCaptionEvent(jQuery(this).parent().parent().parent().parent().find('.wdi_photo_title'), currentFeed);
602
+ // }
603
+
604
  });
605
 
606
+ /**
607
+ * if feed type is not blog style then after displaying images assign click evetns to their captions
608
+ * this part of code is a bit differenet from free version because of image lazy loading feature
609
+ *
610
+ * in free version events are assigned directly in onload event, but when lazy loading added it cased duplicate event fireing
611
+ * so event assigning moved to here
612
+ *
613
+ */
614
+ if ( currentFeed.feed_row.feed_type != 'blog_style' ){
615
+ jQuery('#wdi_feed_'+currentFeed.feed_row.wdi_feed_counter+' .wdi_photo_title').each(function(){
616
+ wdi_responsive.bindMasonryCaptionEvent(jQuery(this),currentFeed);
617
+ });
618
+ }
619
+
620
  //checks if all iamges have been succesfully loaded then it updates variables for next time use
621
+ function checkLoaded() {
622
+
623
+ if (currentFeed.wdi_load_count === currentFeed.wdi_loadedImages && currentFeed.wdi_loadedImages != 0) {
624
  currentFeed.loadedImages = 0;
625
  currentFeed.wdi_load_count = 0;
626
  wdi_front.allImagesLoaded(currentFeed);
627
+
628
  }
629
  }
630
 
631
  //checking if pagination next button was clicked then change page
632
+ if (currentFeed.paginatorNextFlag == true) {
633
+ wdi_front.updatePagination(currentFeed, 'next');
634
  }
635
 
636
  //check if load more done successfully then set infinite scroll flag to false
637
  currentFeed.infiniteScrollFlag = false;
638
+
639
+
640
  }
641
+
642
+
643
+
644
+ /*
645
+ * Calcuates image resolution
646
+ */
647
+ wdi_front.getImageResolution = function(data) {
648
+
649
+ var originalWidth = data['images']['standard_resolution']['width'];
650
+ var originalHeight = data['images']['standard_resolution']['height'];
651
+ var resolution = originalHeight / originalWidth;
652
+ return resolution;
653
+ }
654
+
655
+ /*
656
+ * Calculates data count on global Storage and if custom storage provied
657
+ * it adds custom storage data count to golbals data count and returns length of all storages
658
+ */
659
+ wdi_front.getDataLength = function(currentFeed, customStorage) {
660
+ var length = 0;
661
+ if (customStorage === undefined) {
662
+ for (var j = 0; j < currentFeed.dataStorage.length; j++) {
663
+ length += currentFeed.dataStorage[j].length;
664
+ }
665
+ } else {
666
+ for (var j = 0; j < customStorage.length; j++) {
667
+ length += customStorage[j].length;
668
  }
669
  }
670
+
671
+ return length;
672
  }
673
+
674
+ wdi_front.getArrayContentLength = function(array, data) {
675
+ var sum = 0;
676
+ for (var i = 0; i < array.length; i++) {
677
+ if (array[i]['finished'] == 'finished') {
678
+ continue;
679
+ }
680
+ sum += array[i][data].length;
681
+ }
682
+ return sum;
683
+ }
684
+
685
+
686
+
687
+ /**
688
+ * Displays data in thumbnail layout
689
+ * @param {Object} data data to be displayed
690
+ * @param {Object} currentFeed
691
+ */
692
+ wdi_front.displayFeedItems = function(data, currentFeed) {
693
+
694
+ //gets ready data, gets data template, and appens it into feed_wrapper
695
+ var wdi_feed_counter = currentFeed.feed_row['wdi_feed_counter'];
696
+ var feed_wrapper = jQuery('#wdi_feed_' + wdi_feed_counter + ' .wdi_feed_wrapper');
697
+
698
+ //if resort_after_pagination is on then rewrite feed data
699
+ if (currentFeed.feed_row['resort_after_load_more'] === '1') {
700
+ feed_wrapper.html('');
701
+ currentFeed.imageIndex = 0;
702
+ }
703
+
704
+ //if custom filter is set or changed then reset masonry columns
705
+ if (currentFeed.customFilterChanged == true) {
706
+ feed_wrapper.html('');
707
+ currentFeed.imageIndex = 0;
708
+ currentFeed.customFilterChanged = false;
709
+ }
710
+
711
+
712
+ var lastIndex = wdi_front.getImgCount(currentFeed) - data.length - 1;
713
+
714
+ /**
715
+ * if feed display view is set to pagination then check if the current page has not enough photos to be a complete page then
716
+ * --currentPage so that after loading new images we stay on the same page and see new images which will be located in that page
717
+ * also do the same thing when recievied data has lenght equal to zero
718
+ */
719
+ if (currentFeed.feed_row.feed_display_view == 'pagination') {
720
+ if (jQuery('#wdi_feed_' + currentFeed.feed_row.wdi_feed_counter + ' [wdi_page="' + (currentFeed.currentPage - 1) + '"]').length < currentFeed.feed_row.load_more_number || data.length == 0) {
721
+ currentFeed.currentPage = (--currentFeed.currentPage <= 1) ? 1 : currentFeed.currentPage;
722
+ }
723
+ }
724
+
725
+
726
+
727
+ for (var i = 0; i < data.length; i++) {
728
+ if (data[i]['type'] == 'image') {
729
+ var photoTemplate = wdi_front.getPhotoTemplate(currentFeed);
730
+ } else {
731
+ var photoTemplate = wdi_front.getVideoTemplate(currentFeed);
732
+ }
733
+
734
+ var rawItem = data[i];
735
+ var item = wdi_front.createObject(rawItem, currentFeed);
736
+ var html = photoTemplate(item);
737
+ feed_wrapper.html(feed_wrapper.html() + html);
738
+
739
+ currentFeed.imageIndex++;
740
+
741
+
742
+ //changing responsive indexes for pagination
743
+ if (currentFeed.feed_row.feed_display_view == 'pagination') {
744
+ if ((i + 1) % currentFeed.feed_row.pagination_per_page_number === 0) {
745
+ currentFeed.resIndex += currentFeed.freeSpaces + 1;
746
+ } else {
747
+ currentFeed.resIndex++;
748
  }
749
+
750
  }
751
+
752
+ }
753
+
754
+
755
+ //fixing last row in case of full caption is open
756
+ //for that triggering click twice to open and close caption text that will fix last row
757
+ jQuery('#wdi_feed_' + currentFeed.feed_row['wdi_feed_counter'] + ' .wdi_feed_wrapper [wdi_index=' + lastIndex + '] .wdi_photo_title').trigger(wdi_front.clickOrTouch);
758
+ jQuery('#wdi_feed_' + currentFeed.feed_row['wdi_feed_counter'] + ' .wdi_feed_wrapper [wdi_index=' + lastIndex + '] .wdi_photo_title').trigger(wdi_front.clickOrTouch);
759
+
760
+
761
+ //binding onload event for ajax loader
762
+ currentFeed.wdi_loadedImages = 0;
763
+ var columnFlag = false;
764
+ currentFeed.wdi_load_count = i;
765
+ var wdi_feed_counter = currentFeed.feed_row['wdi_feed_counter'];
766
+ var feed_wrapper = jQuery('#wdi_feed_' + wdi_feed_counter + ' img.wdi_img').on('load', function() {
767
+ currentFeed.wdi_loadedImages++;
768
+ checkLoaded();
769
+
770
+ //calls wdi_responsive.columnControl() which calculates column number on page
771
+ //and gives feed_wrapper proper column class
772
+ if (columnFlag === false) {
773
+
774
+
775
+ wdi_responsive.columnControl(currentFeed, 1);
776
+ columnFlag = true;
777
+ }
778
+
779
+
780
+ //Binds caption opening and closing event to each image photo_title
781
+ // if (currentFeed.feed_row.feed_type != 'blog_style') {
782
+ // wdi_responsive.bindCaptionEvent(jQuery(this).parent().parent().parent().parent().find('.wdi_photo_title'), currentFeed);
783
+ // }
784
+ });
785
+
786
+ /**
787
+ * if feed type is not blog style then after displaying images assign click evetns to their captions
788
+ * this part of code is a bit differenet from free version because of image lazy loading feature
789
+ *
790
+ * in free version events are assigned directly in onload event, but when lazy loading added it cased duplicate event fireing
791
+ * so event assigning moved to here
792
+ *
793
+ */
794
+ if ( currentFeed.feed_row.feed_type != 'blog_style' ){
795
+ jQuery('#wdi_feed_'+currentFeed.feed_row.wdi_feed_counter+' .wdi_photo_title').each(function(){
796
+ wdi_responsive.bindCaptionEvent(jQuery(this),currentFeed);
797
+ });
798
+ }
799
+
800
+ //checks if all iamges have been succesfully loaded then it updates variables for next time use
801
+ function checkLoaded() {
802
+ if (currentFeed.wdi_load_count === currentFeed.wdi_loadedImages && currentFeed.wdi_loadedImages != 0) {
803
+ currentFeed.loadedImages = 0;
804
+ currentFeed.wdi_load_count = 0;
805
+ wdi_front.allImagesLoaded(currentFeed);
806
+
807
+ }
808
+ }
809
+
810
+ //checking if pagination next button was clicked then change page
811
+ if (currentFeed.paginatorNextFlag == true) {
812
+ wdi_front.updatePagination(currentFeed, 'next');
813
+ }
814
+
815
+ //check if load more done successfully then set infinite scroll flag to false
816
+ currentFeed.infiniteScrollFlag = false;
817
+
818
+ }
819
+
820
+ wdi_front.checkFeedFinished = function(currentFeed) {
821
+ for (var i = 0; i < currentFeed.usersData.length; i++) {
822
+ if (currentFeed.usersData[i]['finished'] == undefined) {
823
+ return false;
824
+ }
825
+ }
826
+ return true;
827
+ }
828
+
829
+ wdi_front.sortingOperator = function(sortImagesBy, sortOrder) {
830
+ var operator;
831
+ switch (sortImagesBy) {
832
+ case 'date':
833
+ {
834
+ switch (sortOrder) {
835
+ case 'asc':
836
+ {
837
+ operator = function(a, b) {
838
+ return (a['created_time'] > b['created_time']) ? 1 : -1;
839
+ }
840
+ break;
841
+ }
842
+ case 'desc':
843
+ {
844
+ operator = function(a, b) {
845
+ return (a['created_time'] > b['created_time']) ? -1 : 1;
846
+ }
847
+ break;
848
+ }
849
  }
850
+ break;
851
  }
852
+ case 'likes':
853
+ {
854
+ switch (sortOrder) {
855
+ case 'asc':
856
+ {
857
+ operator = function(a, b) {
858
+ return (a['likes']['count'] < b['likes']['count']) ? -1 : 1;
859
+ }
860
+ break;
861
+ }
862
+ case 'desc':
863
+ {
864
+ operator = function(a, b) {
865
+ return (a['likes']['count'] < b['likes']['count']) ? 1 : -1;
866
+ }
867
+ break;
868
+ }
869
  }
870
+ break;
871
+ }
872
+ case 'comments':
873
+ {
874
+ switch (sortOrder) {
875
+ case 'asc':
876
+ {
877
+ operator = function(a, b) {
878
+ return (a['comments']['count'] < b['comments']['count']) ? -1 : 1;
879
+ }
880
+ break;
881
+ }
882
+ case 'desc':
883
+ {
884
+ operator = function(a, b) {
885
+ return (a['comments']['count'] < b['comments']['count']) ? 1 : -1;
886
+ }
887
+ break;
888
+ }
889
  }
890
+ break;
891
  }
892
+ case 'random':
893
+ {
894
+ operator = function(a, b) {
895
+ var num = Math.random();
896
+ return (num > 0.5) ? 1 : -1;
897
+ }
898
+ break;
899
  }
 
 
900
  }
901
  return operator;
902
  }
903
+
904
  /*
905
  * Calls smart picker method and then after receiving data it sorts data based on user choice
906
  */
907
+ wdi_front.feedSort = function(currentFeed, load_more_number) {
908
 
909
  var sortImagesBy = currentFeed.feed_row['sort_images_by'];
910
  var sortOrder = currentFeed.feed_row['display_order'];
911
+
912
+ if (currentFeed.feed_row['resort_after_load_more'] === '1') {
913
+ currentFeed['data'] = currentFeed['data'].concat(wdi_front.smartPicker(currentFeed, load_more_number));
914
+ } else {
915
+ currentFeed['data'] = wdi_front.smartPicker(currentFeed, load_more_number);
916
  }
917
 
918
+
919
+
920
+ var operator = wdi_front.sortingOperator(sortImagesBy, sortOrder);
921
  currentFeed['data'].sort(operator);
922
  return currentFeed['data'];
923
 
924
  }
925
+
926
  /*
927
  * Filters all requested data and takes some amount of sata for each user
928
  * and stops picking when it reaches number_of_photos limit
929
  */
930
+ wdi_front.smartPicker = function(currentFeed, load_more_number) {
931
  var dataStorage = [];
932
  var dataLength = 0;
933
  var readyData = [];
934
+ var perUser = Math.ceil(currentFeed['feed_row']['number_of_photos'] / currentFeed['usersData'].length);
935
  var number_of_photos = parseInt(currentFeed['feed_row']['number_of_photos']);
936
  var remainder = 0;
937
 
938
  //check if loadmore was clicked
939
+ if (load_more_number != '' && load_more_number != undefined && load_more_number != null) {
940
  number_of_photos = parseInt(load_more_number);
941
+ perUser = Math.ceil(number_of_photos / wdi_front.activeUsersCount(currentFeed));
942
  }
943
 
944
 
945
+ var sortOperator = function(a, b) {
946
+ return (a['data'].length > b['data'].length) ? 1 : -1;
947
  }
948
+
949
  //sorts user data desc
950
  var usersData = currentFeed['usersData'].sort(sortOperator);
951
 
952
  //picks data from users and updates pagination in request json
953
  //for next time call
954
+ for (var i = 0; i < usersData.length; i++) {
955
+ remainder += perUser;
956
+ if (usersData[i]['data'].length <= remainder) {
957
+
958
  var pagination = usersData[i]['pagination']['next_url'];
959
+ if (usersData[i]['finished'] === undefined) {
960
  dataStorage.push(usersData[i]['data']);
961
+ remainder -= usersData[i]['data'].length;
962
+ dataLength += usersData[i]['data'].length;
963
  }
964
 
965
+ if (usersData[i]['finished'] === undefined) {
966
+ if (pagination === undefined || pagination === '' || pagination === null) {
967
  usersData[i]['finished'] = 'finished';
968
  }
969
  }
970
+ } else {
971
+ if ((dataLength + remainder) > number_of_photos) {
 
972
  remainder = number_of_photos - dataLength;
973
  }
974
  var pickedData = [];
975
  var indexPuller = 0;
976
+ for (var j = 0; j < remainder; j++) {
977
+ if (currentFeed['auto_trigger'] === false) {
978
+ if (usersData[i]['finished'] === undefined) {
979
+ pickedData.push(usersData[i]['data'][j]);
980
+ }
981
+ } else {
982
+ if (pickedData.length + wdi_front.getDataLength(currentFeed) + wdi_front.getDataLength(currentFeed, dataStorage) < currentFeed['feed_row']['number_of_photos']) {
983
+ if (usersData[i]['finished'] === undefined) {
984
  pickedData.push(usersData[i]['data'][j]);
985
  }
986
+ } else {
987
  indexPuller++;
988
  }
989
  }
990
+
991
  }
992
+ j -= indexPuller;
993
 
994
  remainder = 0;
995
  //updating pagination
996
+ if (pickedData.length != 0) {
997
+ var newMaxId = pickedData[j - 1]['id'];
998
  var newMaxTagId = usersData[i]['data'][j]['id'];
999
  var oldPagination = usersData[i]['pagination'];
1000
  var oldUrl = oldPagination['next_url'];
1001
 
1002
  //updating pagination url
1003
+ if (oldUrl != undefined && oldUrl != null && oldUrl != '') {
1004
  var urlFragments = oldUrl.split('&');
1005
  var urlKeyValue = [];
1006
+ for (var k = 0; k < urlFragments.length; k++) {
1007
+
1008
  urlKeyValue.push(urlFragments[k].split('='));
1009
+ if (urlKeyValue[k][0] === 'max_id') {
1010
  urlKeyValue[k][1] = newMaxId;
1011
  }
1012
+ if (urlKeyValue[k][0] === 'max_tag_id') {
1013
  urlKeyValue[k][1] = newMaxTagId.split('_')[0];
1014
  }
1015
  urlKeyValue[k] = urlKeyValue[k].join('=');
1016
  }
1017
+
1018
  var newUrl = urlKeyValue.join('&');
1019
+
1020
  oldPagination['next_max_id'] = newMaxId;
1021
  oldPagination['next_url'] = newUrl;
1022
+
1023
+ } else {
1024
  //if pagination is not provided ie there are no more images to paginate
1025
  //it generates pagination url manually
1026
+ switch (currentFeed.usersData[i]['username'][0]) {
1027
+ case '#':
1028
+ {
1029
+
1030
+ oldPagination['next_url'] = 'https://api.instagram.com/v1/tags/' + usersData[i]['user_id'].substr(1, usersData[i]['user_id'].length) +
1031
+ '/media/recent?access_token=' + currentFeed.feed_row.access_token + '&callback=jQuery111205299771015997976_1438177624435&max_tag_id=' + newMaxTagId.split('_')[0] +
1032
+ '&_=1438177624450';
1033
+ oldPagination['next_max_tag_id'] = newMaxId;
1034
+ break;
1035
+ }
1036
+ default:
1037
+ {
1038
+
1039
+ oldPagination['next_url'] = 'https://api.instagram.com/v1/users/' + usersData[i]['user_id'] +
1040
+ '/media/recent?access_token=' + currentFeed.feed_row.access_token + '&callback=jQuery111205299771015997976_1438177624435&max_id=' + newMaxId +
1041
+ '&_=1438177624450';
1042
+ oldPagination['next_max_id'] = newMaxId;
1043
+ break;
1044
+ }
 
 
1045
  }
1046
+
1047
  }
1048
  }
1049
+
1050
+
1051
  //pushes picked data into local storage
1052
+ dataLength += pickedData.length;
1053
  dataStorage.push(pickedData);
1054
 
1055
  }
1056
  }
1057
+
1058
  //checks if in golbal storage user already exisit then it adds new data to user old data
1059
  //else it simple puches new user with it's data to global storage
1060
+ for (i = 0; i < dataStorage.length; i++) {
1061
+ if (currentFeed.dataStorage[i] === undefined) {
1062
  currentFeed.dataStorage.push(dataStorage[i]);
1063
+ } else {
1064
+ currentFeed.dataStorage[i] = currentFeed.dataStorage[i].concat(dataStorage[i]);
1065
+ }
1066
  }
1067
 
1068
  //parsing data for lightbox
1069
  currentFeed.parsedData = wdi_front.parseLighboxData(currentFeed);
1070
 
1071
  //combines together all avialable data in global storage and returns it
1072
+ for (i = 0; i < dataStorage.length; i++) {
1073
  readyData = readyData.concat(dataStorage[i]);
1074
  }
1075
+
1076
  return readyData;
1077
  }
1078
 
1079
  /*
1080
  * returns json object for inserting photo template
1081
  */
1082
+ wdi_front.createObject = function(obj, currentFeed) {
1083
+
1084
+ var caption = (obj['caption'] != null) ? obj['caption']['text'] : '&nbsp';
1085
  var image_url;
1086
+ if (window.innerWidth >= 640) {
1087
  image_url = obj['images']['standard_resolution']['url'];
1088
+ if (currentFeed.feed_row.feed_type == 'blog_style' || currentFeed.feed_row.feed_type == 'image_browser') {
1089
+ image_url = obj['link'] + 'media?size=l';
1090
  }
1091
  }
1092
+ if (window.innerWidth >= 150 && window.innerWidth < 640) {
1093
  image_url = obj['images']['low_resolution']['url'];
1094
+ if (currentFeed.feed_row.feed_type == 'blog_style' || currentFeed.feed_row.feed_type == 'image_browser') {
1095
+ image_url = obj['link'] + 'media?size=l';
1096
  }
1097
  }
1098
+ if (window.innerWidth < 150) {
1099
  image_url = obj['images']['thumbnail']['url'];
1100
+ if (currentFeed.feed_row.feed_type == 'blog_style' || currentFeed.feed_row.feed_type == 'image_browser') {
1101
+ image_url = obj['link'] + 'media?size=m';
1102
  }
1103
  }
1104
  var videoUrl = '';
1105
+ if (obj['type'] == 'video') {
1106
  videoUrl = obj['videos']['standard_resolution']['url'];
1107
  }
1108
  var imageIndex = currentFeed.imageIndex;
1109
+
1110
  var photoObject = {
1111
+ 'id': obj['id'],
1112
+ 'caption': caption,
1113
  'image_url': image_url,
1114
  'likes': obj['likes']['count'],
1115
+ 'comments': obj['comments']['count'],
1116
  'wdi_index': imageIndex,
1117
  'wdi_res_index': currentFeed.resIndex,
1118
  'link': obj['link'],
1119
+ 'video_url': videoUrl,
1120
+ 'wdi_username': obj['user']['username']
1121
  };
1122
  return photoObject;
1123
  }
1125
  /*
1126
  * If pagination is on sets the proper page number
1127
  */
1128
+ wdi_front.setPage = function(currentFeed) {
1129
  var display_type = currentFeed.feed_row.feed_display_view;
1130
  var feed_type = currentFeed.feed_row.feed_type;
1131
+ if (display_type != 'pagination') {
1132
  return '';
1133
  }
1134
  var imageIndex = currentFeed.imageIndex;
1135
+ if (feed_type == 'image_browser') {
1136
  var divider = 1;
1137
+ } else {
1138
  var divider = Math.abs(currentFeed.feed_row.pagination_per_page_number);
1139
  }
1140
+
1141
+ currentFeed.paginator = Math.ceil((imageIndex + 1) / divider);
1142
+
1143
+
1144
  return currentFeed.paginator;
1145
+ }
1146
 
1147
  /*
1148
  * Template for all feed items which have type=image
1149
  */
1150
+ wdi_front.getPhotoTemplate = function(currentFeed) {
1151
  var page = wdi_front.setPage(currentFeed);
1152
+ var customClass = '';
1153
+ var pagination = '';
1154
  var onclick = '';
1155
  var overlayCustomClass = '';
1156
  var thumbClass = 'fa-fullscreen';
1157
+ var showUsernameOnThumb = '';
1158
+ if (currentFeed.feed_row.feed_type == 'blog_style' || currentFeed.feed_row.feed_type == 'image_browser') {
1159
  thumbClass = '';
1160
  }
1161
+ if (page != '') {
1162
+ pagination = 'wdi_page="' + page + '"';
1163
+ sourceAttr = 'src';
1164
+ }else{
1165
+ sourceAttr = 'src';
1166
  }
1167
+
1168
+ if (page != '' && page != 1) {
1169
  customClass = 'wdi_hidden';
1170
  }
1171
 
1172
+ if(currentFeed.feed_row.show_username_on_thumb == '1'){
1173
+ showUsernameOnThumb = '<span class="wdi_media_user">@<%= wdi_username%></span>';
1174
+ }
1175
+
1176
  //checking if caption is opend by default then add wdi_full_caption class
1177
  //only in masonry
1178
+ if (currentFeed.feed_row.show_full_description == 1 && currentFeed.feed_row.feed_type == 'masonry') {
1179
  customClass += ' wdi_full_caption';
1180
  }
1181
 
1182
  //creating onclick string for different options
1183
+ switch (currentFeed.feed_row.feed_item_onclick) {
1184
+ case 'lightbox':
1185
+ {
1186
+ onclick = "onclick=wdi_feed_" + currentFeed.feed_row.wdi_feed_counter + ".galleryBox('<%=id%>')";
1187
+ break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1188
  }
1189
+ case 'instagram':
1190
+ {
1191
+ onclick = 'onclick="window.open (\'<%= link%>\',\'_blank\')"';
1192
+ overlayCustomClass = 'wdi_hover_off';
1193
+ thumbClass = '';
1194
+ break;
1195
  }
1196
+ case 'none':
1197
+ {
1198
+ onclick = '';
1199
+ overlayCustomClass = 'wdi_cursor_off wdi_hover_off';
1200
+ thumbClass = '';
1201
  }
1202
+ }
1203
+ var wdi_feed_counter = currentFeed.feed_row['wdi_feed_counter'];
1204
+ var source = '<div class="wdi_feed_item ' + customClass + '" wdi_index=<%= wdi_index%> wdi_res_index=<%= wdi_res_index%> ' + pagination + ' wdi_type="image" id="wdi_' + wdi_feed_counter + '_<%=id%>">' +
1205
+ '<div class="wdi_photo_wrap">' +
1206
+ '<div class="wdi_photo_wrap_inner">' +
1207
+ '<div class="wdi_photo_img">' +
1208
+ '<img class="wdi_img" '+sourceAttr+'="<%=image_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);">' +
1209
+ '<div class="wdi_photo_overlay ' + overlayCustomClass + '" >' + showUsernameOnThumb +
1210
+ '<div class="wdi_thumb_icon" ' + onclick + ' style="display:table;width:100%;height:100%;">' +
1211
+ '<div style="display:table-cell;vertical-align:middle;text-align:center;color:white;">' +
1212
+ '<i class="fa ' + thumbClass + '"></i>' +
1213
+ '</div>' +
1214
+ '</div>' +
1215
+ '</div>' +
1216
+ '</div>' +
1217
+ '</div>' +
1218
+ '</div>';
1219
+ if (currentFeed['feed_row']['show_likes'] === '1' || currentFeed['feed_row']['show_comments'] === '1' || currentFeed['feed_row']['show_description'] === '1') {
1220
+ source += '<div class="wdi_photo_meta">';
1221
+ if (currentFeed['feed_row']['show_likes'] === '1') {
1222
+ source += '<div class="wdi_thumb_likes"><i class="fa fa-heart-o">&nbsp;<%= likes%></i></div>';
1223
  }
1224
+ if (currentFeed['feed_row']['show_comments'] === '1') {
1225
+ source += '<div class="wdi_thumb_comments"><i class="fa fa-comment-o">&nbsp;<%= comments%></i></div>';
1226
+ }
1227
+ source += '<div class="clear"></div>';
1228
+ if (currentFeed['feed_row']['show_description'] === '1') {
1229
+ source += '<div class="wdi_photo_title" >' +
1230
+ '<%=caption%>' +
1231
+ '</div>';
1232
+ }
1233
+ source += '</div>';
1234
+ }
1235
+
1236
+ source += '</div>';
1237
  var template = _.template(source);
1238
  return template;
1239
  }
1240
 
1241
+ wdi_front.replaceToVideo = function(url, index, feed_counter) {
1242
 
1243
+ overlayHtml = "<video style='width:auto !important; height:auto !important; max-width:100% !important; max-height:100% !important; margin:0 !important;' controls=''>" +
1244
+ "<source src='" + url + "' type='video/mp4'>" +
1245
+ "Your browser does not support the video tag. </video>";
1246
 
1247
+ jQuery('#wdi_feed_' + feed_counter + ' [wdi_index="' + index + '"] .wdi_photo_wrap_inner').html(overlayHtml);
1248
+ jQuery('#wdi_feed_' + feed_counter + ' [wdi_index="' + index + '"] .wdi_photo_wrap_inner video').get(0).play();
1249
  }
1250
+
1251
  /*
1252
  * Template for all feed items which have type=video
1253
  */
1254
+ wdi_front.getVideoTemplate = function(currentFeed) {
1255
  var page = wdi_front.setPage(currentFeed);
1256
+ var customClass = '';
1257
+ var pagination = '';
1258
  var thumbClass = 'fa-play';
1259
  var onclick = '';
1260
  var overlayCustomClass = '';
1261
+ var sourceAttr;
1262
+ var showUsernameOnThumb = '';
1263
+
1264
+
1265
+
1266
+ if (page != '') {
1267
+ pagination = 'wdi_page="' + page + '"';
1268
+ sourceAttr = 'src';
1269
+ }else{
1270
+ sourceAttr = 'src';
1271
  }
1272
+ if (page != '' && page != 1) {
1273
  customClass = 'wdi_hidden';
1274
  }
1275
 
1276
+ if(currentFeed.feed_row.show_username_on_thumb == '1'){
1277
+ showUsernameOnThumb = '<span class="wdi_media_user">@<%= wdi_username%></span>';
1278
+ }
1279
+
1280
  //checking if caption is opend by default then add wdi_full_caption class
1281
  //only in masonry
1282
+ if (currentFeed.feed_row.show_full_description == 1 && currentFeed.feed_row.feed_type == 'masonry') {
1283
  customClass += ' wdi_full_caption';
1284
  }
1285
+
1286
  //creating onclick string for different options
1287
+ switch (currentFeed.feed_row.feed_item_onclick) {
1288
+ case 'lightbox':
1289
+ {
1290
+ onclick = "onclick=wdi_feed_" + currentFeed.feed_row.wdi_feed_counter + ".galleryBox('<%=id%>')";
1291
+ break;
1292
+ }
1293
+ case 'instagram':
1294
+ {
1295
+ onclick = 'onclick="window.open (\'<%= link%>\',\'_blank\')"';
1296
+ overlayCustomClass = 'wdi_hover_off';
1297
+ thumbClass = '';
1298
+ break;
1299
+ }
1300
+ case 'none':
1301
+ {
1302
+ overlayCustomClass = 'wdi_cursor_off wdi_hover_off';
1303
+ thumbClass = '';
1304
+ if (currentFeed.feed_row.feed_type == 'blog_style' || currentFeed.feed_row.feed_type == 'image_browser') {
1305
+ onclick = "onclick=wdi_front.replaceToVideo('<%= video_url%>','<%= wdi_index%>'," + currentFeed.feed_row.wdi_feed_counter + ")";
1306
+ overlayCustomClass = '';
1307
+ thumbClass = 'fa-play';
1308
+ }
1309
  }
 
1310
  }
1311
 
1312
 
1313
  var wdi_feed_counter = currentFeed.feed_row['wdi_feed_counter'];
1314
+ var source = '<div class="wdi_feed_item ' + customClass + '" wdi_index=<%= wdi_index%> wdi_res_index=<%= wdi_res_index%> ' + pagination + ' wdi_type="image" id="wdi_' + wdi_feed_counter + '_<%=id%>">' +
1315
+ '<div class="wdi_photo_wrap">' +
1316
+ '<div class="wdi_photo_wrap_inner">' +
1317
+ '<div class="wdi_photo_img">' +
1318
+ '<img class="wdi_img" '+sourceAttr+'="<%=image_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);">' +
1319
+ '<div class="wdi_photo_overlay ' + overlayCustomClass + '" ' + onclick + '>' + showUsernameOnThumb +
1320
+ '<div class="wdi_thumb_icon" style="display:table;width:100%;height:100%;">' +
1321
+ '<div style="display:table-cell;vertical-align:middle;text-align:center;color:white;">' +
1322
+ '<i class="fa ' + thumbClass + '"></i>' +
1323
+ '</div>' +
1324
+ '</div>' +
1325
+ '</div>' +
1326
+ '</div>' +
1327
+ '</div>' +
1328
  '</div>';
1329
+ if (currentFeed['feed_row']['show_likes'] === '1' || currentFeed['feed_row']['show_comments'] === '1' || currentFeed['feed_row']['show_description'] === '1') {
1330
+ source += '<div class="wdi_photo_meta">';
1331
+ if (currentFeed['feed_row']['show_likes'] === '1') {
1332
+ source += '<div class="wdi_thumb_likes"><i class="fa fa-heart-o">&nbsp;<%= likes%></i></div>';
1333
  }
1334
+ if (currentFeed['feed_row']['show_comments'] === '1') {
1335
+ source += '<div class="wdi_thumb_comments"><i class="fa fa-comment-o">&nbsp;<%= comments%></i></div>';
1336
  }
1337
+ source += '<div class="clear"></div>';
1338
+ if (currentFeed['feed_row']['show_description'] === '1') {
1339
+ source += '<div class="wdi_photo_title" >' +
1340
+ '<%=caption%>' +
1341
+ '</div>';
1342
  }
1343
+ source += '</div>';
1344
  }
1345
+ source += '</div>';
1346
  var template = _.template(source);
1347
  return template;
1348
  }
1349
 
1350
+ wdi_front.bindEvents = function(currentFeed) {
1351
+ if (currentFeed.feed_row.feed_display_view == 'load_more_btn') {
1352
  //binding load more event
1353
+ jQuery('#wdi_feed_' + currentFeed.feed_row['wdi_feed_counter'] + ' .wdi_load_more_container').on(wdi_front.clickOrTouch, function() {
1354
  //do the actual load more operation
1355
  wdi_front.loadMore(jQuery(this).find('.wdi_load_more_wrap'));
1356
  });
1357
  }
1358
+
1359
+ if (currentFeed.feed_row.feed_display_view == 'pagination') {
1360
  //binding pagination events
1361
+ jQuery('#wdi_feed_' + currentFeed.feed_row['wdi_feed_counter'] + ' #wdi_next').on(wdi_front.clickOrTouch, function() {
1362
+ wdi_front.paginatorNext(jQuery(this), currentFeed);
1363
  });
1364
+ jQuery('#wdi_feed_' + currentFeed.feed_row['wdi_feed_counter'] + ' #wdi_prev').on(wdi_front.clickOrTouch, function() {
1365
+ wdi_front.paginatorPrev(jQuery(this), currentFeed);
1366
  });
1367
+ jQuery('#wdi_feed_' + currentFeed.feed_row['wdi_feed_counter'] + ' #wdi_last_page').on(wdi_front.clickOrTouch, function() {
1368
+ wdi_front.paginationLastPage(jQuery(this), currentFeed);
1369
  });
1370
+ jQuery('#wdi_feed_' + currentFeed.feed_row['wdi_feed_counter'] + ' #wdi_first_page').on(wdi_front.clickOrTouch, function() {
1371
+ wdi_front.paginationFirstPage(jQuery(this), currentFeed);
1372
  });
1373
  //setting pagiantion flags
1374
  currentFeed.paginatorNextFlag = false;
1375
  }
1376
+ if (currentFeed.feed_row.feed_display_view == 'infinite_scroll') {
1377
  //binding infinite scroll Events
1378
+ jQuery(window).on('scroll', function() {
1379
  wdi_front.infiniteScroll(currentFeed);
1380
  });
1381
  //infinite scroll flags
1382
  currentFeed.infiniteScrollFlag = false;
1383
  }
1384
 
 
 
 
1385
 
1386
+ }
1387
 
1388
+ wdi_front.infiniteScroll = function(currentFeed) {
1389
 
1390
+ if (jQuery(window).scrollTop() <= jQuery('#wdi_feed_' + currentFeed.feed_row['wdi_feed_counter'] + ' #wdi_infinite_scroll').offset().top) {
1391
+ if (currentFeed.infiniteScrollFlag === false && currentFeed.stopInfiniteScrollFlag == false) {
 
 
1392
  currentFeed.infiniteScrollFlag = true;
1393
+ wdi_front.loadMore(jQuery('#wdi_feed_' + currentFeed.feed_row['wdi_feed_counter'] + ' #wdi_infinite_scroll'), currentFeed);
1394
+ } else if (currentFeed.stopInfiniteScrollFlag) {
1395
+ wdi_front.allImagesLoaded(currentFeed);
1396
  }
1397
+
1398
  }
1399
  }
1400
 
1401
 
1402
 
1403
+ wdi_front.paginationFirstPage = function(btn, currentFeed) {
1404
+ if (currentFeed.paginator == 1 || currentFeed.currentPage == 1) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1405
  btn.addClass('wdi_disabled');
1406
  return;
1407
  }
1408
  var oldPage = currentFeed.currentPage;
1409
  currentFeed.currentPage = 1;
1410
+ wdi_front.updatePagination(currentFeed, 'custom', oldPage);
1411
 
1412
  //enable last page button
1413
  var last_page_btn = btn.parent().find('#wdi_last_page');
1417
  btn.addClass('wdi_disabled');
1418
 
1419
  }
1420
+
1421
+ wdi_front.paginationLastPage = function(btn, currentFeed) {
1422
+ if (currentFeed.paginator == 1 || currentFeed.currentPage == currentFeed.paginator) {
1423
  return;
1424
  }
1425
  var oldPage = currentFeed.currentPage;
1426
  currentFeed.currentPage = currentFeed.paginator;
1427
+ wdi_front.updatePagination(currentFeed, 'custom', oldPage);
1428
 
1429
  //disableing last page button
1430
  btn.addClass('wdi_disabled');
1433
  var first_page_btn = btn.parent().find('#wdi_first_page');
1434
  first_page_btn.removeClass('wdi_disabled');
1435
  }
1436
+
1437
+ wdi_front.paginatorNext = function(btn, currentFeed) {
1438
+
1439
  var last_page_btn = btn.parent().find('#wdi_last_page');
1440
  var first_page_btn = btn.parent().find('#wdi_first_page');
1441
  currentFeed.paginatorNextFlag = true;
1442
+ if (currentFeed.paginator == currentFeed.currentPage && !wdi_front.checkFeedFinished(currentFeed)) {
1443
  currentFeed.currentPage++;
1444
  var number_of_photos = currentFeed.feed_row.number_of_photos;
1445
+ wdi_front.loadMore(btn, currentFeed, number_of_photos);
1446
  //on the last page don't show got to last page button
1447
  last_page_btn.addClass('wdi_disabled');
1448
+ } else if (currentFeed.paginator > currentFeed.currentPage) {
1449
  currentFeed.currentPage++;
1450
+ wdi_front.updatePagination(currentFeed, 'next');
1451
  //check if new page isn't the last one then enable last page button
1452
+ if (currentFeed.paginator > currentFeed.currentPage) {
1453
  last_page_btn.removeClass('wdi_disabled');
1454
+ } else {
1455
  last_page_btn.addClass('wdi_disabled');
1456
  }
1457
  }
1458
 
1459
  //enable first page button
1460
  first_page_btn.removeClass('wdi_disabled');
1461
+
1462
+
1463
  }
1464
+
1465
+ wdi_front.paginatorPrev = function(btn, currentFeed) {
1466
  var last_page_btn = btn.parent().find('#wdi_last_page');
1467
  var first_page_btn = btn.parent().find('#wdi_first_page');
1468
+ if (currentFeed.currentPage == 1) {
1469
  first_page_btn.addClass('wdi_disabled');
1470
  return;
1471
  }
1472
+
1473
  currentFeed.currentPage--;
1474
+ wdi_front.updatePagination(currentFeed, 'prev');
1475
+
1476
  //enable last page button
1477
  last_page_btn.removeClass('wdi_disabled');
1478
 
1479
+ if (currentFeed.currentPage == 1) {
1480
  first_page_btn.addClass('wdi_disabled');
1481
  }
1482
 
1483
  }
1484
 
1485
  //displays proper images for specific page after pagination buttons click event
1486
+ wdi_front.updatePagination = function(currentFeed, dir, oldPage) {
1487
+ var currentFeedString = '#wdi_feed_' + currentFeed.feed_row['wdi_feed_counter'];
1488
+ jQuery(currentFeedString + ' [wdi_page="' + currentFeed.currentPage + '"]').each(function() {
1489
  jQuery(this).removeClass('wdi_hidden');
1490
  });
1491
+ switch (dir) {
1492
+ case 'next':
1493
+ {
1494
+ var oldPage = currentFeed.currentPage - 1;
1495
+ jQuery(currentFeedString + ' .wdi_feed_wrapper').height(jQuery('.wdi_feed_wrapper').height());
1496
+ jQuery(currentFeedString + ' [wdi_page="' + oldPage + '"]').each(function() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1497
  jQuery(this).addClass('wdi_hidden');
1498
  });
1499
+ break;
1500
+ }
1501
+ case 'prev':
1502
+ {
1503
+ var oldPage = currentFeed.currentPage + 1;
1504
+ jQuery(currentFeedString + ' .wdi_feed_wrapper').height(jQuery('.wdi_feed_wrapper').height());
1505
+ jQuery(currentFeedString + ' [wdi_page="' + oldPage + '"]').each(function() {
1506
+ jQuery(this).addClass('wdi_hidden');
1507
+ });
1508
+ break;
1509
+ }
1510
+ case 'custom':
1511
+ {
1512
+ var oldPage = oldPage;
1513
+ if (oldPage != currentFeed.currentPage) {
1514
+ jQuery(currentFeedString + ' .wdi_feed_wrapper').height(jQuery('.wdi_feed_wrapper').height());
1515
+ jQuery(currentFeedString + ' [wdi_page="' + oldPage + '"]').each(function() {
1516
+ jQuery(this).addClass('wdi_hidden');
1517
+ });
1518
+ }
1519
+
1520
+ break;
1521
  }
 
 
 
1522
  }
1523
  currentFeed.paginatorNextFlag = false;
1524
+
1525
+ jQuery(currentFeedString + ' .wdi_feed_wrapper').css('height', 'auto');
1526
+ jQuery(currentFeedString + ' #wdi_current_page').text(currentFeed.currentPage);
1527
  }
1528
 
1529
 
1530
+ wdi_front.loadMore = function(button, _currentFeed) {
1531
+
1532
 
1533
  var dataCounter = 0;
1534
+ if (button != '' && button != undefined && button != 'initial' && button != 'initial-keep') {
1535
  var currentFeed = window[button.parent().parent().parent().parent().attr('id')];
1536
  }
1537
+ if (_currentFeed != undefined) {
1538
  var currentFeed = _currentFeed;
1539
  }
1540
  //check if any filter is enabled and filter user images has finished
1541
  //then stop any load more action
1542
+ var activeFilter = 0,
1543
+ finishedFilter = 0;
1544
+ for (var i = 0; i < currentFeed.userSortFlags.length; i++) {
1545
+ if (currentFeed.userSortFlags[i].flag === true) {
1546
  activeFilter++;
1547
+ for (var j = 0; j < currentFeed.usersData.length; j++) {
1548
+ if (currentFeed.userSortFlags[i]['id'] === currentFeed.usersData[j]['user_id']) {
1549
+ if (currentFeed.usersData[j]['finished'] === 'finished') {
1550
  finishedFilter++;
1551
  }
1552
  }
1553
  }
1554
  }
1555
  }
1556
+ if (activeFilter === finishedFilter && activeFilter != 0) {
1557
  return;
1558
  }
1559
 
1560
 
1561
  //if button is not provided than it enables auto_tiggering and recursively loads images
1562
+ if (button === '') {
1563
  currentFeed['auto_trigger'] = true;
1564
+ } else {
1565
  currentFeed['auto_trigger'] = false;
1566
  }
1567
  //ading ajax loading
1568
  wdi_front.ajaxLoader(currentFeed);
 
1569
 
1570
+
1571
+
1572
  //check if masonry view is on and and feed display type is pagination then
1573
  //close all captions before loading more pages for porper pagination rendering
1574
+ if (currentFeed.feed_row.feed_type === 'masonry' && currentFeed.feed_row.feed_display_view == 'pagination') {
1575
+ jQuery('#wdi_feed_' + wdi_front.feed_counter + ' .wdi_full_caption').each(function() {
1576
  jQuery(this).find('.wdi_photo_title').trigger(wdi_front.clickOrTouch);
1577
  });
1578
  }
1580
 
1581
 
1582
  //check if all data loaded then remove ajaxLoader
1583
+ for (var i = 0; i < currentFeed.usersData.length; i++) {
1584
+ if (currentFeed.usersData[i]['finished'] === 'finished') {
1585
  dataCounter++;
1586
  }
1587
  }
1588
+ if (dataCounter === currentFeed.usersData.length) {
1589
  wdi_front.allImagesLoaded(currentFeed);
1590
+ jQuery('#wdi_feed_' + currentFeed['feed_row']['wdi_feed_counter'] + ' .wdi_load_more').remove();
1591
+
1592
  }
1593
 
1594
  var usersData = currentFeed['usersData'];
1595
  currentFeed.loadMoreDataCount = currentFeed.feed_users.length;
1596
+
1597
+ for (var i = 0; i < usersData.length; i++) {
1598
 
1599
  var pagination = usersData[i]['pagination'];
1600
  var user = {
1601
+ user_id: usersData[i]['user_id'],
1602
+ username: usersData[i]['username']
1603
+ }
1604
+ //checking if pagination url exists then load images, else skip
1605
+ if (pagination['next_url'] != '' && pagination['next_url'] != null && pagination['next_url'] != undefined) {
1606
  var next_url = pagination['next_url'];
1607
+ wdi_front.loadMoreRequest(user, next_url, currentFeed, button);
1608
+ } else {
1609
+
1610
+ if (button == 'initial-keep') {
1611
+
1612
+ currentFeed.temproraryUsersData[i] = currentFeed.usersData[i];
 
 
1613
  }
1614
  currentFeed.loadMoreDataCount--;
1615
  continue;
1622
  /*
1623
  * Requests images based on provided pagination url
1624
  */
1625
+ wdi_front.loadMoreRequest = function(user, next_url, currentFeed, button) {
1626
 
1627
  var usersData = currentFeed['usersData'];
1628
  var errorMessage = '';
1629
+
1630
+
1631
+ currentFeed.instagram.requestByUrl(next_url, {
1632
+ success: function(response) {
1633
+
1634
+ if (response === '' || response == undefined || response == null) {
1635
+ errorMessage = wdi_front_messages.network_error;
1636
+ currentFeed.loadMoreDataCount--;
1637
+ alert(errorMessage);
1638
+ return;
1639
+ }
1640
+ if (response['meta']['code'] != 200) {
1641
+ errorMessage = response['meta']['error_message'];
1642
+ currentFeed.loadMoreDataCount--;
1643
+ alert(errorMessage);
1644
+ return;
1645
+ }
1646
+
1647
+ response['user_id'] = user.user_id;
1648
+ response['username'] = user.username;
1649
+
1650
+ for (var i = 0; i < currentFeed['usersData'].length; i++) {
1651
+ if (response['user_id'] === currentFeed['usersData'][i]['user_id']) {
1652
+
1653
+ ///mmm!!!
1654
+ if (response['user_id'][0] === '#') {
1655
+ response['data'] = wdi_front.appendRequestHashtag(response['data'], response['user_id']);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1656
  }
1657
+ ////////////////
1658
+ /*if button is initial-keep then we will lose currentFeed['usersData'][i]
1659
+ for not loosing it we keep it in currentFeed.temproraryUsersData, which value will be
1660
+ used later in wdi_front.checkForLoadMoreDone(), in other cases when button is set to
1661
+ initial we already keep data in that variable, so we don't deed to keep it again, it will give us duplicate value
1662
+ */
1663
+ if (button == 'initial-keep') {
1664
+ currentFeed.temproraryUsersData[i] = currentFeed.usersData[i];
1665
+ }
1666
+ currentFeed['usersData'][i] = response;
1667
+
1668
+ currentFeed.loadMoreDataCount--;
1669
+ }
1670
+ }
1671
+ //checks if load more done then displays feed
1672
+ wdi_front.checkForLoadMoreDone(currentFeed, button);
1673
+ }
1674
+ })
1675
+
1676
  }
1677
+
1678
+ wdi_front.checkForLoadMoreDone = function(currentFeed, button) {
1679
  var load_more_number = currentFeed.feed_row['load_more_number'];
1680
  var number_of_photos = currentFeed.feed_row['number_of_photos'];
1681
 
1682
+ if (currentFeed.loadMoreDataCount == 0) {
1683
+
1684
+ currentFeed.temproraryUsersData = wdi_front.mergeData(currentFeed.temproraryUsersData, currentFeed.usersData);
1685
+ var gettedDataLength = wdi_front.getArrayContentLength(currentFeed.temproraryUsersData, 'data');
1686
  /*this will happen when we call loadMore first time
1687
  initial-keep is the same as initial except that if loadMore is called
1688
+ with initial-keep we store data on currentFeed.temproraryUsersData before checkLoadMoreDone()
1689
  function call*/
1690
+ if (button == 'initial-keep') {
1691
  button = 'initial';
1692
  }
1693
  //if button is set to inital load number_of_photos photos
1694
+ if (button == 'initial') {
1695
  /*if existing data length is smaller then load_more_number then get more objects until desired number is reached
1696
  also if it is not possible to reach the desired number (this will happen when all users has no more photos) then
1697
  displayFeed()*/
1698
+ if (gettedDataLength < number_of_photos && !wdi_front.userHasNoPhoto(currentFeed, currentFeed.temproraryUsersData) && currentFeed.instagramRequestCounter <= currentFeed.maxConditionalFiltersRequestCount) {
1699
+ //console.log('checkForLoadMoreDone recursion');
1700
+
1701
+ wdi_front.loadMore('initial', currentFeed);
1702
+ } else {
1703
 
1704
  currentFeed.usersData = currentFeed.temproraryUsersData;
1705
 
1711
  currentFeed.temproraryUsersData = [];
1712
  }
1713
 
1714
+ } else {
1715
  //else load load_more_number photos
1716
  //if existing data length is smaller then load_more_number then get more objects until desired number is reached
1717
+
1718
+ if (gettedDataLength < load_more_number && !wdi_front.userHasNoPhoto(currentFeed, currentFeed.temproraryUsersData) && currentFeed.instagramRequestCounter <= currentFeed.maxConditionalFiltersRequestCount) {
1719
+ //console.log('load more recursion');
1720
+ wdi_front.loadMore(undefined, currentFeed);
1721
+ } else {
1722
 
1723
  currentFeed.usersData = currentFeed.temproraryUsersData;
1724
 
1725
+ wdi_front.displayFeed(currentFeed, load_more_number);
1726
  //when all data us properly displayed check for any active filters and then apply them
1727
  wdi_front.applyFilters(currentFeed);
1728
 
1731
  }
1732
  }
1733
 
1734
+
 
1735
 
1736
  }
1737
  }
1738
 
1739
+ wdi_front.mergeData = function(array1, array2) {
1740
+
1741
+
1742
+ for (var i = 0; i < array2.length; i++) {
1743
+ if (array1[i] != undefined) {
1744
+ if (array2[i]['finished'] == 'finished') {
1745
  continue;
1746
  }
1747
  //if user data is finished then dont add duplicate data
1748
+ if (array1[i]['pagination']['next_max_id'] == undefined) {
1749
  continue;
1750
  }
1751
  //extend data
1754
  array1[i]['user_id'] = array2[i]['user_id'];
1755
  array1[i]['username'] = array2[i]['username'];
1756
  array1[i]['meta'] = array2[i]['meta'];
1757
+ } else {
1758
  array1.push(array2[i]);
1759
  }
1760
  }
1761
  return array1;
1762
  }
1763
 
 
 
1764
 
1765
 
1766
  //broken image handling
1767
+ wdi_front.brokenImageHandler = function(source) {
1768
+ source.src = wdi_url.plugin_url + "../images/missing.png";
1769
+ source.onerror = "";
1770
+ return true;
1771
 
1772
  }
1773
 
1774
 
1775
  //ajax loading
1776
+ wdi_front.ajaxLoader = function(currentFeed) {
1777
  var wdi_feed_counter = currentFeed.feed_row['wdi_feed_counter'];
1778
+
1779
+ var feed_container = jQuery('#wdi_feed_' + wdi_feed_counter);
1780
+ if (currentFeed.feed_row.feed_display_view == 'load_more_btn') {
1781
  feed_container.find('.wdi_load_more').addClass('wdi_hidden');
1782
  feed_container.find('.wdi_spinner').removeClass('wdi_hidden');
1783
  }
1784
+ /////////////////////////////////////////////////////
1785
+ if (currentFeed.feed_row.feed_display_view == 'infinite_scroll') {
1786
  var loadingDiv;
1787
+ if (feed_container.find('.wdi_ajax_loading').length == 0) {
1788
+ 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>');
1789
  feed_container.append(loadingDiv);
1790
+ } else {
1791
  loadingDiv = feed_container.find('.wdi_ajax_loading');
1792
  }
1793
  loadingDiv.removeClass('wdi_hidden');
1794
  }
1795
+
1796
+
1797
+
1798
+ ////////////////////////////////////////////////////
1799
+
1800
  }
1801
+
1802
  //if all images loaded then clicking load more causes it's removal
1803
+ wdi_front.allImagesLoaded = function(currentFeed) {
1804
+ ////////////////////////////////////////////////////////////////////
1805
+
1806
  //clearInterval(currentFeed.loadingInterval);
1807
  //jQuery('#wdi_feed_'+currentFeed.feed_row['wdi_feed_counter']+' .wdi_ajax_loading').remove();
1808
 
1809
+ ////////////////////////////////////////////////////
1810
+
1811
+
1812
  //if all images loaded then enable load more button and hide spinner
1813
  var wdi_feed_counter = currentFeed.feed_row['wdi_feed_counter'];
1814
+ var feed_container = jQuery('#wdi_feed_' + wdi_feed_counter);
1815
+
1816
+ if (currentFeed.feed_row.feed_display_view == 'load_more_btn') {
1817
  feed_container.find('.wdi_load_more').removeClass('wdi_hidden');
1818
  feed_container.find('.wdi_spinner').addClass('wdi_hidden');
1819
  }
1820
 
1821
+ if (currentFeed.feed_row.feed_display_view == 'infinite_scroll') {
1822
+ jQuery('#wdi_feed_' + currentFeed.feed_row['wdi_feed_counter'] + ' .wdi_ajax_loading').addClass('wdi_hidden');
1823
  }
1824
 
1825
+
1826
+
1827
+
1828
  //custom event fired for user based custom js
1829
  feed_container.trigger('wdi_feed_loaded');
1830
 
1831
+
1832
  }
1833
 
1834
 
1835
  //shows different parts of the feed based user choice
1836
+ wdi_front.show = function(name, currentFeed) {
1837
  var wdi_feed_counter = currentFeed.feed_row['wdi_feed_counter'];
1838
+ var feed_container = jQuery('#wdi_feed_' + wdi_feed_counter + ' .wdi_feed_container');
1839
+ var _this = this;
1840
+ switch (name) {
1841
+ case 'header':
1842
+ {
1843
+ show_header();
1844
+ break;
1845
+ }
1846
+ case 'users':
1847
+ {
1848
+ show_users(currentFeed);
1849
+ break;
1850
+ }
 
1851
 
1852
+ }
 
 
 
 
 
 
 
1853
 
1854
+ function show_header() {
1855
 
1856
+ var templateData = {
1857
+ 'feed_thumb': currentFeed['feed_row']['feed_thumb'],
1858
+ 'feed_name': currentFeed['feed_row']['feed_name'],
1859
+ };
1860
 
1861
+ var headerTemplate = wdi_front.getHeaderTemplate(),
1862
+ html = headerTemplate(templateData),
1863
+ containerHtml = feed_container.find('.wdi_feed_header').html();
1864
 
1865
+ feed_container.find('.wdi_feed_header').html(containerHtml + html);
1866
 
1867
 
1868
 
1869
  }
1870
+
1871
+ function show_users(currentFeed) {
1872
  feed_container.find('.wdi_feed_users').html('');
1873
  var users = currentFeed['feed_users'];
1874
  var access_token = currentFeed['feed_row']['access_token'];
 
1875
  var i = 0;
1876
  currentFeed.headerUserinfo = [];
1877
  getThumb();
1878
  //recursively calls itself until all user data is ready then displyes it with escapeRequest
1879
+ function getThumb() {
1880
+
1881
+ if (currentFeed.headerUserinfo.length == users.length) {
1882
+ escapeRequest(currentFeed.headerUserinfo, currentFeed);
1883
  return;
1884
  }
1885
+ var _user = users[currentFeed.headerUserinfo.length];
1886
+ switch (_this.getInputType(_user.username)) {
1887
+ case 'hashtag':
1888
+ {
1889
+ currentFeed.instagram.getTagRecentMedia(_this.stripHashtag(_user.username), {
1890
+ success: function(response) {
1891
+ response = _this.checkMediaResponse(response);
1892
+ if (response != false) {
1893
+
1894
+ if (response['data'].length == 0) {
1895
+ thumb_img = '';
1896
+ } else {
1897
+ thumb_img = response['data'][0]['images']['thumbnail']['url'];
1898
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1899
  var obj = {
1900
+ name: users[i]['username'],
 
1901
  url: thumb_img,
1902
  };
1903
+ i++;
1904
+ currentFeed.headerUserinfo.push(obj);
1905
+ getThumb();
1906
+ }
1907
+ },
1908
+ args :{
1909
+ ignoreFiltering : true,
1910
+ }
1911
+ });
1912
+ break;
1913
+ }
1914
+ case 'user':
1915
+ {
1916
+ currentFeed.instagram.getUserInfo(_user.id, {
1917
+ success: function(response) {
1918
+ response = _this.checkMediaResponse(response);
1919
+ if (response != false) {
1920
+ var obj = {
1921
+ id: response['data']['id'],
1922
+ name: response['data']['username'],
1923
+ url: response['data']['profile_picture'],
1924
+ bio: response['data']['bio'],
1925
+ counts: response['data']['counts'],
1926
+ website: response['data']['website'],
1927
+ full_name: response['data']['full_name']
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1928
  }
1929
+ currentFeed.headerUserinfo.push(obj);
1930
+ i++;
1931
+ getThumb();
1932
  }
1933
+ },
1934
+ args :{
1935
+ ignoreFiltering : true,
1936
+ }
1937
+ })
1938
+ break;
1939
+ }
1940
+ }
1941
  }
1942
  //when all user data is ready break recursion and create user elements
1943
+ function escapeRequest(info, currentFeed) {
 
1944
  feed_container.find('.wdi_feed_users').html('');
1945
+ for (var k = 0; k < info.length; k++) {
1946
  //setting all user filters to false
1947
 
1948
  var userFilter = {
1950
  'id': info[k]['id'],
1951
  'name': info[k]['name']
1952
  };
1953
+
1954
 
1955
  //user inforamtion
 
1956
  var hashtagClass = (info[k]['name'][0] == '#') ? 'wdi_header_hashtag' : '';
1957
 
1958
  var templateData = {
1959
+ 'user_index': k,
1960
  'user_img_url': info[k]['url'],
1961
  'counts': info[k]["counts"],
1962
+ 'feed_counter': currentFeed.feed_row.wdi_feed_counter,
1963
+ 'user_name': info[k]['name'],
1964
  'bio': info[k]['bio'],
1965
+ 'usersCount': currentFeed.feed_row.feed_users.length,
1966
+ 'hashtagClass': hashtagClass
1967
 
1968
  };
 
 
 
 
 
1969
 
1970
+ var userTemplate = wdi_front.getUserTemplate(currentFeed, info[k]['name']),
1971
+ html = userTemplate(templateData),
1972
+ containerHtml = feed_container.find('.wdi_feed_users').html();
1973
+
1974
+ feed_container.find('.wdi_feed_users').html(containerHtml + html);
1975
+
1976
+
1977
 
1978
  currentFeed.userSortFlags.push(userFilter);
1979
+
1980
  var clearFloat = jQuery('<div class="clear"></div>');
1981
 
1982
  }
1983
  feed_container.find('.wdi_feed_users').append(clearFloat);
1984
+ wdi_front.updateUsersImages(currentFeed);
1985
  };
1986
  }
1987
 
1988
  }
1989
 
1990
 
1991
+ wdi_front.getUserTemplate = function(currentFeed, username) {
1992
  var usersCount = currentFeed.feed_row.feed_users.split(',').length,
1993
+ instagramLink, instagramLinkOnClick, js;
1994
 
1995
+ switch (username[0]) {
1996
+ case '#':
1997
+ {
1998
+ instagramLink = '//instagram.com/explore/tags/' + username.substr(1, username.length);
1999
+ break;
2000
+ }
2001
+ default:
2002
+ {
2003
+ instagramLink = '//instagram.com/' + username;
2004
+ break;
2005
+ }
2006
  }
2007
+ js = 'window.open("' + instagramLink + '","_blank")';
2008
+ instagramLinkOnClick = "onclick='" + js + "'";
2009
 
2010
+ var source = '<div class="wdi_single_user" user_index="<%=user_index%>">' +
2011
+ '<div class="wdi_header_user_text <%=hashtagClass%>">' +
2012
 
2013
+ '<div class="wdi_user_img_wrap">' +
2014
+ '<img onerror="wdi_front.brokenImageHandler(this);" src="<%= user_img_url%>">';
2015
+ if (usersCount > 1) {
2016
+ source += '<div title="' + wdi_front_messages.filter_title + '" class="wdi_filter_overlay">' +
2017
+ '<div class="wdi_filter_icon">' +
2018
+ '<span onclick="wdi_front.addFilter(<%=user_index%>,<%=feed_counter%>);" class="fa fa-filter"></span>' +
2019
+ '</div>' +
2020
+ '</div>';
2021
+ }
2022
+ source += '</div>';
2023
+ source += '<h3 ' + instagramLinkOnClick + '><%= user_name%></h3>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2024
 
2025
+ if (username[0] !== '#') {
2026
+ if (currentFeed.feed_row.follow_on_instagram_btn == '1') {
2027
+ source += '<div class="wdi_user_controls">' +
2028
+ '<div class="wdi_follow_btn" onclick="window.open(\'//instagram.com/<%= user_name%>\',\'_blank\')"><span> Follow</span></div>' +
2029
  '</div>';
2030
+ }
2031
+ source += '<div class="wdi_media_info">' +
2032
+ '<p class="wdi_posts"><span class="fa fa-camera-retro"><%= counts.media%></span></p>' +
2033
+ '<p class="wdi_followers"><span class="fa fa-user"><%= counts.followed_by%></span></p>' +
2034
+ '</div>';
2035
+ } else {
2036
+ source += '<div class="wdi_user_controls">' +
2037
+ '</div>' +
2038
+ '<div class="wdi_media_info">' +
2039
+ '<p class="wdi_posts"><span></span></p>' +
2040
+ '<p class="wdi_followers"><span></span></p>' +
2041
+ '</div>';
2042
+ }
2043
+
2044
+ if (usersCount == 1 && username[0] !== '#' && currentFeed.feed_row.display_user_info == '1') {
2045
+ source += '<div class="wdi_bio"><%= bio%></div>';
2046
+ }
2047
+
2048
+
2049
+
2050
+ source += '</div>' +
2051
+ '</div>';
2052
  var template = _.template(source);
2053
  return template;
2054
  }
2055
 
2056
 
2057
 
2058
+ wdi_front.getHeaderTemplate = function() {
2059
+ var source = '<div class="wdi_header_wrapper">' +
2060
+ '<div class="wdi_header_img_wrap">' +
2061
+ '<img src="<%=feed_thumb%>">' +
2062
+ '</div>' +
2063
+ '<div class="wdi_header_text"><%=feed_name%></div>' +
2064
+ '<div class="clear">' +
2065
+ '</div>';
2066
  var template = _.template(source);
2067
  return template;
2068
  }
2069
 
2070
 
2071
  //sets user filter to true and applys filter to feed
2072
+ wdi_front.addFilter = function(index, feed_counter) {
2073
+ var currentFeed = window['wdi_feed_' + feed_counter];
2074
  var usersCount = currentFeed.feed_row.feed_users.split(',').length;
2075
+ if (usersCount < 2) {
2076
  return;
2077
  }
2078
 
2079
+ if (currentFeed.nowLoadingImages != false) {
2080
  return;
2081
+ } else {
2082
+
2083
+ var userDiv = jQuery('#wdi_feed_' + currentFeed.feed_row.wdi_feed_counter + '_users [user_index="' + index + '"]');
2084
+ userDiv.find('.wdi_filter_overlay').toggleClass('wdi_filter_active_bg');
2085
+ userDiv.find('.wdi_header_user_text h3').toggleClass('wdi_filter_active_col');
2086
+ userDiv.find('.wdi_media_info').toggleClass('wdi_filter_active_col');
2087
+ userDiv.find('.wdi_follow_btn').toggleClass('wdi_filter_active_col');
2088
+
2089
+ currentFeed.customFilterChanged = true;
2090
+ //setting filter flag to true
2091
+ if (currentFeed.userSortFlags[index]['flag'] == false) {
2092
+ currentFeed.userSortFlags[index]['flag'] = true;
2093
+ } else {
2094
+ currentFeed.userSortFlags[index]['flag'] = false;
2095
+ }
2096
+ //getting active filter count
2097
+ var activeFilterCount = 0;
2098
+ for (var j = 0; j < currentFeed.userSortFlags.length; j++) {
2099
+ if (currentFeed.userSortFlags[j]['flag'] == true) {
2100
+ activeFilterCount++;
2101
+ }
2102
+ }
2103
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2104
 
2105
 
2106
+ if (currentFeed.feed_row.feed_display_view == 'pagination') {
2107
+ //reset responsive indexes because number of feed images may change after using filter
2108
+ currentFeed.resIndex = 0;
2109
+ }
2110
 
 
 
 
 
2111
 
2112
+ //applying filters
2113
+ if (activeFilterCount != 0) {
2114
+ wdi_front.filterData(currentFeed);
2115
+ wdi_front.displayFeed(currentFeed);
2116
+ } else {
2117
+ currentFeed.customFilteredData = currentFeed.dataStorageList;
2118
+ wdi_front.displayFeed(currentFeed);
2119
+ }
2120
 
 
 
 
 
 
 
 
 
2121
 
2122
+ if (currentFeed.feed_row.feed_display_view == 'pagination') {
2123
+ //reset paginator because while filtering images become more or less so pages also become more or less
2124
+ currentFeed.paginator = Math.ceil((currentFeed.imageIndex) / parseInt(currentFeed.feed_row.pagination_per_page_number));
2125
+ //setting current page as the last loaded page when filter is active
2126
+ currentFeed.currentPage = currentFeed.paginator; //pagination page number
2127
+ //when feed is displayed we are by default in the first page
2128
+ //so we are navigating from page 1 to current page using custom navigation method
2129
+ wdi_front.updatePagination(currentFeed, 'custom', 1);
 
2130
 
2131
+ jQuery('#wdi_first_page').removeClass('wdi_disabled');
2132
+ jQuery('#wdi_last_page').addClass('wdi_disabled');
 
 
2133
  }
2134
+
2135
+ }
2136
  }
2137
+
2138
+ wdi_front.filterData = function(currentFeed) {
2139
+
2140
  var users = currentFeed.userSortFlags;
2141
  currentFeed.customFilteredData = [];
2142
+ for (var i = 0; i < currentFeed.dataStorageList.length; i++) {
2143
+ for (var j = 0; j < users.length; j++) {
2144
+ if ((currentFeed.dataStorageList[i]['user']['id'] == users[j]['id'] || currentFeed.dataStorageList[i]['wdi_hashtag'] == users[j]['name']) && users[j]['flag'] == true) {
2145
  currentFeed.customFilteredData.push(currentFeed.dataStorageList[i]);
2146
  }
2147
 
2148
  }
2149
  }
2150
+
2151
  }
2152
+
2153
+ wdi_front.applyFilters = function(currentFeed) {
2154
+ for (var i = 0; i < currentFeed.userSortFlags.length; i++) {
2155
+ if (currentFeed.userSortFlags[i]['flag'] == true) {
2156
+ var userDiv = jQuery('#wdi_feed_' + currentFeed.feed_row.wdi_feed_counter + '[user_index="' + i + '"]');
2157
+ wdi_front.addFilter(i, currentFeed.feed_row.wdi_feed_counter);
2158
+ wdi_front.addFilter(i, currentFeed.feed_row.wdi_feed_counter);
2159
  }
2160
  }
2161
 
2162
  }
2163
 
2164
  //gets data Count from global storage
2165
+ wdi_front.getImgCount = function(currentFeed) {
2166
  var dataStorage = currentFeed.dataStorage;
2167
  var count = 0;
2168
+ for (var i = 0; i < dataStorage.length; i++) {
2169
+ count += dataStorage[i].length;
2170
  }
2171
  return count;
2172
  }
2173
 
2174
  //parses image data for lightbox popup
2175
+ wdi_front.parseLighboxData = function(currentFeed, filterFlag) {
2176
+
2177
  var dataStorage = currentFeed.dataStorage;
2178
  var sortImagesBy = currentFeed.feed_row['sort_images_by'];
2179
  var sortOrder = currentFeed.feed_row['display_order'];
2180
+ var sortOperator = wdi_front.sortingOperator(sortImagesBy, sortOrder);
2181
  var data = [];
2182
 
2183
  var popupData = [];
2184
  var obj = {};
2185
+
2186
  //if filterFlag is true, it means that some filter for frontend content is enabled so give
2187
  //lightbox only those images which are visible at that moment else give all avialable
2188
+ if (filterFlag == true) {
2189
  data = currentFeed.customFilteredData;
2190
+ } else {
2191
+ for (var i = 0; i < dataStorage.length; i++) {
2192
+ for (var j = 0; j < dataStorage[i].length; j++) {
2193
  data.push(dataStorage[i][j]);
2194
  }
2195
  }
2196
  data.sort(sortOperator);
2197
  }
2198
+
2199
+
2200
+
2201
+ for (i = 0; i < data.length; i++) {
2202
  obj = {
2203
+ 'alt': '',
2204
+ 'avg_rating': '',
2205
+ 'comment_count': data[i]['comments']['count'],
2206
+ 'date': wdi_front.convertUnixDate(data[i]['created_time']),
2207
+ 'description': wdi_front.getDescription((data[i]['caption'] !== null) ? data[i]['caption']['text'] : ''),
2208
+ 'filename': wdi_front.getFileName(data[i]),
2209
+ 'filetype': wdi_front.getFileType(data[i]['type']),
2210
+ 'hit_count': '0',
2211
+ 'id': data[i]['id'],
2212
+ 'image_url': data[i]['link'],
2213
+ 'number': 0,
2214
+ 'rate': '',
2215
+ 'rate_count': '0',
2216
+ 'username': data[i]['user']['username'],
2217
+ 'profile_picture': data[i]['user']['profile_picture'],
2218
+ 'thumb_url': data[i]['link'] + 'media/?size=t',
2219
+ 'comments_data': data[i]['comments']['data']
2220
+ }
2221
+ popupData.push(obj);
2222
  }
2223
  return popupData;
2224
  }
2225
+
2226
+ wdi_front.convertUnixDate = function(date) {
2227
  var utcSeconds = parseInt(date);
2228
  var newDate = new Date(0);
2229
  newDate.setUTCSeconds(utcSeconds);
2230
+ var str = newDate.getFullYear() + '-' + newDate.getMonth() + '-' + newDate.getDate();
2231
+ str += ' ' + newDate.getHours() + ':' + newDate.getMinutes();
2232
  return str;
2233
  }
2234
+
2235
+ wdi_front.getDescription = function(desc) {
2236
+ desc = desc.replace(/\r?\n|\r/g, ' ');
2237
 
2238
 
2239
  return desc;
2240
  }
2241
+
2242
+ wdi_front.getFileName = function(data) {
2243
  var link = data['link'];
2244
  var type = data['type'];
2245
+ if (type === 'image') {
2246
+ var linkFragments = link.split('/');
2247
+ return linkFragments[linkFragments.length - 2];
2248
+ } else {
2249
+ return data['videos']['standard_resolution']['url'];
2250
+ }
2251
 
2252
  }
2253
+
2254
+ wdi_front.getFileType = function(type) {
2255
+ if (type === 'image') {
2256
+ return "EMBED_OEMBED_INSTAGRAM_IMAGE";
2257
+ }
2258
+ if (type === 'video') {
2259
+ return "EMBED_OEMBED_INSTAGRAM_VIDEO";
2260
+ }
2261
  }
2262
 
2263
 
2264
 
2265
+ wdi_front.array_max = function(array) {
2266
+ var max = array[0];
2267
+ var minIndex = 0;
2268
+ for (var i = 1; i < array.length; i++) {
2269
+ if (max < array[i]) {
2270
+ max = array[i];
2271
+ minIndex = i;
2272
+ }
2273
+ }
2274
+ return {
2275
+ 'value': max,
2276
+ 'index': minIndex
2277
+ };
2278
+ }
2279
+
2280
+ wdi_front.array_min = function(array) {
2281
+ var min = array[0];
2282
+ var minIndex = 0;
2283
+ for (var i = 1; i < array.length; i++) {
2284
+ if (min > array[i]) {
2285
+ min = array[i];
2286
+ minIndex = i;
2287
+ }
2288
+ }
2289
+ return {
2290
+ 'value': min,
2291
+ 'index': minIndex
2292
+ };
2293
+ }
2294
 
2295
  /*
2296
  * Returns users count whose feed is not finished
2297
  */
2298
+ wdi_front.activeUsersCount = function(currentFeed) {
2299
  var counter = 0;
2300
+ for (var i = 0; i < currentFeed.usersData.length; i++) {
2301
+ if (currentFeed.usersData[i].finished != 'finished') {
2302
  counter++;
2303
  }
2304
  }
2307
 
2308
 
2309
 
2310
+ /**
2311
+ * Return response if it is valid else returns boolean false
2312
+ * @param {Object} response [instagram API response]
2313
+ * @return {Object or Boolean} [false: if invalid response, object: if valid]
2314
+ */
2315
+ wdi_front.checkMediaResponse = function(response) {
2316
 
2317
+ if (response == '' || response == undefined || response == null) {
2318
+ errorMessage = wdi_front_messages.connection_error;
2319
+ alert(errorMessage);
2320
+ return false;
2321
+ }
2322
+ if (response['meta']['code'] != 200) {
2323
+ errorMessage = response['meta']['error_message'];
2324
+ alert(errorMessage);
2325
+ return false;
2326
+ }
2327
+ return response;
2328
+ }
2329
 
2330
 
2331
+ /**
2332
+ * Removes # from string if it is first char
2333
+ * @param {String} hashtag
2334
+ * @return {String}
2335
+ */
2336
+ wdi_front.stripHashtag = function(hashtag) {
2337
+ switch (hashtag[0]) {
2338
+ case '#':
2339
+ {
2340
+ return hashtag.substr(1, hashtag.length);
2341
+ break;
2342
+ }
2343
+ default:
2344
+ {
2345
+ return hashtag;
2346
+ break;
2347
+ }
2348
+ }
2349
+ }
2350
 
2351
+ /**
2352
+ * Returns type of given input
2353
+ * @param {String} input [this is username or hashtag]
2354
+ * @return {String} [input type]
2355
+ */
2356
+ wdi_front.getInputType = function(input) {
2357
+ switch (input[0]) {
2358
+ case '#':
2359
+ {
2360
+ return 'hashtag';
2361
+ break;
2362
+ }
2363
+ case '%':
2364
+ {
2365
+ return 'location';
2366
+ break;
2367
+ }
2368
+ default:
2369
+ {
2370
+ return 'user';
2371
+ break;
2372
+ }
2373
 
2374
+ }
2375
+ }
2376
 
2377
 
2378
+ /**
2379
+ * Makes a regex search of a given word returns true if symbol before and after word is space
2380
+ * or word is in the beggining or in the end of string
2381
+ * @param {String} captionText [String where search needs to be done]
2382
+ * @param {String} searchkey [word or phrazee to search]
2383
+ * @return {Boolean}
2384
+ */
2385
+ wdi_front.regexpTestCaption = function( captionText, searchkey ){
2386
+ var flag1 = false,
2387
+ flag2 = false,
2388
+ matchIndexes = [],
2389
+ escKey = searchkey.replace(/[-[\]{}()*+?.,\\^$|]/g, "\\$&"),
2390
+ regexp1 = new RegExp("(?:^|\\s)"+escKey+"(?:^|\\s)"),
2391
+ regexp2 = new RegExp("(?:^|\\s)"+escKey,'g');
2392
+ if( regexp1.exec(captionText) != null){
2393
+ flag1 = true;
2394
+ }
2395
+
2396
+ while ( ( match = regexp2.exec( captionText ) ) != null ) {
2397
+ if( match.index == captionText.length - searchkey.length - 1 ){
2398
+ flag2 = true;
2399
+ }
2400
+ }
2401
+
2402
+ if( flag1 == true || flag2 == true){
2403
+ return true;
2404
+ }else{
2405
+ return false;
2406
+ }
2407
+
2408
+ }
2409
+
2410
+
2411
+
2412
+ /**
2413
+ * replaces single new-lines with space
2414
+ * if multiple new lines are following each other then replaces all newlines with single space
2415
+ * @param {String} string [input string]
2416
+ * @return {String} [output string]
2417
+ */
2418
+ wdi_front.replaceNewLines = function( string ){
2419
+ var delimeter = "vUkCJvN2ps3t",
2420
+ matchIndexes = [],
2421
+ regexp;
2422
+ string = string.replace( /\r?\n|\r/g, delimeter );
2423
+
2424
+ regexp = new RegExp(delimeter,'g');
2425
+ while ( ( match = regexp.exec( string ) ) != null ) {
2426
+ matchIndexes.push( match.index );
2427
+ }
2428
+
2429
+ var pieces = string.split(delimeter);
2430
+ var foundFlag = 0;
2431
+
2432
+ for( var i = 0; i < pieces.length; i++ ){
2433
+
2434
+ if( pieces[i] == '' ){
2435
+ foundFlag++;
2436
+ }else{
2437
+ foundFlag = 0;
2438
+ }
2439
+
2440
+ if(foundFlag > 0){
2441
+ pieces.splice(i,1);
2442
+ foundFlag--;
2443
+ i--;
2444
+ }
2445
+
2446
+ }
2447
+ string = pieces.join(' ');
2448
+ return string;
2449
+ }
2450
 
2451
 
2452
 
2453
+ var WDIFeed = function(obj) {
2454
+ this['data'] = obj['data']
2455
+ this['dataCount'] = obj['dataCount']
2456
+ this['feed_row'] = obj['feed_row']
2457
+ this['usersData'] = obj['usersData']
2458
+ };
2459
+
2460
+ /**
2461
+ * Iterates through all filter objects and filters response accroding to them
2462
+ * @param {Object} response [instagram API response]
2463
+ * @param {Object} args [some custom arguments ]
2464
+ * @return {Object} [instagram API response]
2465
+ */
2466
+ WDIFeed.prototype.conditionalFilter = function(response, args) {
2467
+
2468
+ var currentFeed = this,
2469
+ conditional_filter_type = currentFeed.feed_row.conditional_filter_type,
2470
+ filters = currentFeed.feed_row.conditional_filters;
2471
+
2472
+
2473
+ if(args.ignoreFiltering == true){
2474
+
2475
+ }else{
2476
+
2477
+ /**
2478
+ * Get rid of duplicate media
2479
+ */
2480
+ response = this.avoidDuplicateMedia( response );
2481
+ }
2482
+
2483
+
2484
+ //if filters json is invalid then return response without filtering
2485
+ if (!wdi_front.isJsonString(filters)) {
2486
+ return response;
2487
+ } else {
2488
+ filters = JSON.parse(filters);
2489
+ if (filters.length == 0) {
2490
+ return response;
2491
+ }
2492
+ }
2493
+
2494
+
2495
+ if( currentFeed.feed_row.conditional_filter_enable == '0'){
2496
+ return response;
2497
+ }
2498
+
2499
+ //console.log('filtering');
2500
+ //increase counter for determing request count if this counter is more then
2501
+ //currentFeed.maxConditionalFiltersRequestCount then program will terminate recursion loop
2502
+ currentFeed.instagramRequestCounter++;
2503
+
2504
+ switch (conditional_filter_type) {
2505
+ case 'AND':
2506
+ {
2507
+ response = this.applyANDLogic(response, filters, currentFeed);
2508
+ break;
2509
+ }
2510
+ case 'OR':
2511
+ {
2512
+ response = this.applyORLogic(response, filters, currentFeed)
2513
+ break;
2514
+ }
2515
+ case 'NOR':
2516
+ {
2517
+ response = this.applyNORLogic(response, filters, currentFeed)
2518
+ break;
2519
+ }
2520
+ default:
2521
+ {
2522
+ break;
2523
+ }
2524
+ }
2525
+
2526
+
2527
+ return response;
2528
+ }
2529
+
2530
+
2531
+
2532
+ /**
2533
+ * Return those elements which meet filters conditions
2534
+ * @param {Object} response [instagram API response]
2535
+ * @param {Array} filters [Array of filter objects]
2536
+ * @return {Object} [filtered response]
2537
+ */
2538
+ WDIFeed.prototype.applyANDLogic = function(response, filters) {
2539
+ var currentFeed = this;
2540
+ for (var i = 0; i < filters.length; i++) {
2541
+ response = this.filterResponse(response, filters[i]);
2542
+ }
2543
+
2544
+ return response;
2545
+ }
2546
+
2547
+ /**
2548
+ * Return those elements which meet filters conditions
2549
+ * @param {Object} response [instagram API response]
2550
+ * @param {Array} filters [Array of filter objects]
2551
+ * @return {Object} [filtered response]
2552
+ */
2553
+ WDIFeed.prototype.applyORLogic = function(response, filters) {
2554
+ var currentFeed = this;
2555
+ var allData = [],
2556
+ res,
2557
+ mergedData = [],
2558
+ returnObject,
2559
+ media;
2560
+
2561
+ for (var i = 0; i < filters.length; i++) {
2562
+ res = this.filterResponse(response, filters[i]);
2563
+ allData = allData.concat(res['data']);
2564
+ res = {};
2565
+ }
2566
+
2567
+ for (i = 0; i < allData.length; i++) {
2568
+ media = allData[i];
2569
+ if (!this.mediaExists(media, mergedData) && !this.mediaExists(media, currentFeed.dataStorageList)) {
2570
+ mergedData.push(media);
2571
+ }
2572
+ }
2573
+
2574
+ returnObject = {
2575
+ data: mergedData,
2576
+ meta: response['meta'],
2577
+ pagination: response['pagination']
2578
+ }
2579
+ return returnObject;
2580
+ }
2581
+
2582
+
2583
+
2584
+ /**
2585
+ * Return those elements which meet filters conditions
2586
+ * @param {Object} response [instagram API response]
2587
+ * @param {Array} filters [Array of filter objects]
2588
+ * @return {Object} [filtered response]
2589
+ */
2590
+ WDIFeed.prototype.applyNORLogic = function(response, filters) {
2591
+
2592
+ var res = response,
2593
+ currentFeed = this,
2594
+ matchedData = this.applyORLogic(response, filters, currentFeed),
2595
+ mergedData = [],
2596
+ returnObject;
2597
+
2598
+ for (var i = 0; i < res['data'].length; i++) {
2599
+ if (!this.mediaExists(res['data'][i], matchedData['data'])) {
2600
+ mergedData.push(res['data'][i]);
2601
+ }
2602
+ }
2603
+
2604
+ returnObject = {
2605
+ data: mergedData,
2606
+ meta: res['meta'],
2607
+ pagination: res['pagination']
2608
+ }
2609
+ return returnObject;
2610
+ }
2611
+
2612
+
2613
+ WDIFeed.prototype.mediaExists = function(media, array) {
2614
+
2615
+ for (var i = 0; i < array.length; i++) {
2616
+ if (media['id'] == array[i]['id']) {
2617
+ return true;
2618
+ }
2619
+ }
2620
+ return false;
2621
+ }
2622
+
2623
+
2624
+ /**
2625
+ * checks filter type and calls corresponding function for filtering
2626
+ * @param {Object} response [instagram API response]
2627
+ * @param {Object} filter [filter object created in backend]
2628
+ * @return {Object} [filtered response]
2629
+ */
2630
+ WDIFeed.prototype.filterResponse = function(response, filter) {
2631
+
2632
+ switch (filter.filter_type) {
2633
+ case 'hashtag':
2634
+ {
2635
+ return this.filterByHashtag(response, filter);
2636
+ break;
2637
+ }
2638
+ case 'username':
2639
+ {
2640
+ return this.filterByUsername(response, filter);
2641
+ break;
2642
+ }
2643
+ case 'mention':
2644
+ {
2645
+ return this.filterByMention(response, filter);
2646
+ break;
2647
+ }
2648
+ case 'description':
2649
+ {
2650
+ return this.filterByDescription(response, filter);
2651
+ break;
2652
+ }
2653
+ case 'location':
2654
+ {
2655
+ return this.filterByLocation(response, filter);
2656
+ break;
2657
+ }
2658
+ case 'url':
2659
+ {
2660
+ return this.filterByUrl(response, filter);
2661
+ break;
2662
+ }
2663
+ }
2664
+ }
2665
+
2666
+
2667
+
2668
+ /**
2669
+ * filters data by given hastag filter and returns filtered response
2670
+ * @param {Object} response [instagram API response]
2671
+ * @param {Object} filter [hashtag filter object]
2672
+ * @return {Object} [filtered response]
2673
+ */
2674
+ WDIFeed.prototype.filterByHashtag = function(response, filter) {
2675
+ var filteredResponse = [],
2676
+ currentTag,
2677
+ media,
2678
+ returnObject;
2679
+
2680
+ for (var i = 0; i < response['data'].length; i++) {
2681
+ media = response['data'][i];
2682
+ for (var j = 0; j < media['tags'].length; j++) {
2683
+ tag = media['tags'][j];
2684
+ if (tag.toLowerCase() == filter.filter_by.toLowerCase()) {
2685
+
2686
+ filteredResponse.push(media);
2687
+ }
2688
+ }
2689
+ }
2690
+
2691
+
2692
+ returnObject = {
2693
+ data: filteredResponse,
2694
+ meta: response['meta'],
2695
+ pagination: response['pagination']
2696
+ }
2697
+ return returnObject;
2698
+ }
2699
+
2700
+ /**
2701
+ * filters data by given username filter and returns filtered response
2702
+ * @param {Object} response [instagram API response]
2703
+ * @param {Object} filter [hashtag filter object]
2704
+ * @return {Object} [filtered response]
2705
+ */
2706
+ WDIFeed.prototype.filterByUsername = function(response, filter) {
2707
+ var filteredResponse = [],
2708
+ media,
2709
+ returnObject;
2710
+
2711
+ for (var i = 0; i < response['data'].length; i++) {
2712
+ media = response['data'][i];
2713
+ if (media.user.username.toLowerCase() == filter.filter_by.toLowerCase()) {
2714
+ filteredResponse.push(media);
2715
+ }
2716
+ }
2717
+
2718
+
2719
+ returnObject = {
2720
+ data: filteredResponse,
2721
+ meta: response['meta'],
2722
+ pagination: response['pagination']
2723
+ }
2724
+ return returnObject;
2725
+ }
2726
+
2727
+
2728
+ /**
2729
+ * filters data by given mention filter and returns filtered response
2730
+ * @param {Object} response [instagram API response]
2731
+ * @param {Object} filter [hashtag filter object]
2732
+ * @return {Object} [filtered response]
2733
+ */
2734
+ WDIFeed.prototype.filterByMention = function(response, filter) {
2735
+ var filteredResponse = [],
2736
+ media, captionText, returnObject;
2737
+ for (var i = 0; i < response['data'].length; i++) {
2738
+ media = response['data'][i];
2739
+ if (media['caption'] !== null) {
2740
+ captionText = media['caption']['text'].toLowerCase();
2741
+ if (captionText.indexOf('@' + filter.filter_by.toLowerCase()) != -1) {
2742
+
2743
+ filteredResponse.push(media);
2744
+ }
2745
+ }
2746
+ }
2747
+
2748
+ returnObject = {
2749
+ data: filteredResponse,
2750
+ meta: response['meta'],
2751
+ pagination: response['pagination']
2752
+ }
2753
+ return returnObject;
2754
+ }
2755
+
2756
+
2757
+ /**
2758
+ * filters data by given description filter and returns filtered response
2759
+ * @param {Object} response [instagram API response]
2760
+ * @param {Object} filter [hashtag filter object]
2761
+ * @return {Object} [filtered response]
2762
+ */
2763
+ WDIFeed.prototype.filterByDescription = function(response, filter) {
2764
+ var filteredResponse = [],
2765
+ media, captionText, returnObject;
2766
+
2767
+ for (var i = 0; i < response['data'].length; i++) {
2768
+ media = response['data'][i];
2769
+ if (media['caption'] !== null) {
2770
+
2771
+ captionText = media['caption']['text'].toLowerCase();
2772
+ captionText = wdi_front.replaceNewLines( captionText );
2773
+ var searchkey = filter.filter_by.toLowerCase();
2774
+
2775
+ if( wdi_front.regexpTestCaption( captionText, searchkey) ) {
2776
+ filteredResponse.push(media);
2777
+ }
2778
+ }
2779
+ }
2780
+
2781
+ returnObject = {
2782
+ data: filteredResponse,
2783
+ meta: response['meta'],
2784
+ pagination: response['pagination']
2785
+ }
2786
+
2787
+ return returnObject;
2788
+ }
2789
+
2790
+
2791
+
2792
+ /**
2793
+ * filters data by given location filter and returns filtered response
2794
+ * @param {Object} response [instagram API response]
2795
+ * @param {Object} filter [hashtag filter object]
2796
+ * @return {Object} [filtered response]
2797
+ */
2798
+ WDIFeed.prototype.filterByLocation = function(response, filter) {
2799
+ var filteredResponse = [],
2800
+ media, locationId, returnObject;
2801
+ for (var i = 0; i < response['data'].length; i++) {
2802
+ media = response['data'][i];
2803
+
2804
+ if (media['location'] !== null) {
2805
+ locationId = media['location']['id'];
2806
+ if (locationId == filter.filter_by) {
2807
+ filteredResponse.push(media);
2808
+ }
2809
+ }
2810
+ }
2811
+
2812
+ returnObject = {
2813
+ data: filteredResponse,
2814
+ meta: response['meta'],
2815
+ pagination: response['pagination']
2816
+ }
2817
+ return returnObject;
2818
+ }
2819
+
2820
+
2821
+ /**
2822
+ * filters data by given url filter and returns filtered response
2823
+ * @param {Object} response [instagram API response]
2824
+ * @param {Object} filter [hashtag filter object]
2825
+ * @return {Object} [filtered response]
2826
+ */
2827
+
2828
+ WDIFeed.prototype.filterByUrl = function(response, filter) {
2829
+ var filteredResponse = [],
2830
+ media, id, returnObject, filter_by;
2831
+
2832
+ filter.filter_by = this.getIdFromUrl(filter.filter_by);
2833
+
2834
+ for (var i = 0; i < response['data'].length; i++) {
2835
+ media = response['data'][i];
2836
+
2837
+ if (media['link'] !== null) {
2838
+ id = this.getIdFromUrl(media['link']);
2839
+ if (id == filter.filter_by) {
2840
+ filteredResponse.push(media);
2841
+ }
2842
+ }
2843
+ }
2844
+
2845
+ returnObject = {
2846
+ data: filteredResponse,
2847
+ meta: response['meta'],
2848
+ pagination: response['pagination']
2849
+ }
2850
+ return returnObject;
2851
+ }
2852
+
2853
+ /**
2854
+ * gets id of media from url, this id is not the one which comes with api request
2855
+ * @param {String} url [media url]
2856
+ * @return {String}
2857
+ */
2858
+ WDIFeed.prototype.getIdFromUrl = function(url) {
2859
+ var url_parts = url.split('/'),
2860
+ id = false;
2861
+ for (var i = 0; i < url_parts.length; i++) {
2862
+ if (url_parts[i] == 'p') {
2863
+ if (typeof url_parts[i + 1] != 'undefined') {
2864
+ id = url_parts[i + 1];
2865
+ break;
2866
+ }
2867
+ }
2868
+ };
2869
+ return id;
2870
+ }
2871
+
2872
+
2873
+ /**
2874
+ * Iterates throught response data and remove duplicate media
2875
+ * @param {Object} response [Instagram API request]
2876
+ * @return {Object} [response]
2877
+ */
2878
+ WDIFeed.prototype.avoidDuplicateMedia = function ( response ){
2879
+ var data = response['data'],
2880
+ uniqueData = [],
2881
+ returnObject = {};
2882
+
2883
+ for( var i = 0; i < data.length; i++ ){
2884
+ if( !this.mediaExists( data[i], this.dataStorageList ) && !this.mediaExists( data[i], uniqueData ) && !this.mediaExists( data[i], this.conditionalFilterBuffer ) ){
2885
+ uniqueData.push( data[i] );
2886
+ }
2887
+ }
2888
+
2889
+ this.conditionalFilterBuffer = this.conditionalFilterBuffer.concat(uniqueData);
2890
+
2891
+ returnObject = {
2892
+ data: uniqueData,
2893
+ meta: response['meta'],
2894
+ pagination: response['pagination']
2895
+ }
2896
+
2897
+ return returnObject;
2898
+
2899
+ }
js/wdi_instagram.js ADDED
@@ -0,0 +1,1323 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WDIInstagram is jQuery based plugin which handles communication
3
+ * with instagram API endpoints
4
+ *
5
+ * Plugin Version: 1.0.0
6
+ * Author: Melik Karapetyan
7
+ * License: GPLv2 or later
8
+ *
9
+ *
10
+ *
11
+ *
12
+ *
13
+ * Methods:
14
+ * getSelfInfo = function( args ) : Get information about the owner of the access_token.
15
+ * searchForUsersByName = function( username, args ) : Get a list of users matching the query.
16
+ * searchForTagsByName = function(tagname, args) : Search for tags by name.
17
+ * getTagRecentMedia = function(tagname, args) : Gets recent media based on tagname
18
+ *
19
+ */
20
+
21
+
22
+
23
+ /**
24
+ * example of arg
25
+ * @type {Object}
26
+ */
27
+ // var args = {
28
+ // access_tokens: ['227416602.145c5c2.302096fa9b3b4a8bbe0cee9341a6d7f5'],
29
+ // filters: [{
30
+ // where: 'getTagRecentMedia',
31
+ // what: function(r) {
32
+ // return r;
33
+ // },
34
+ // }, {
35
+ // where: 'searchForUsersByName',
36
+ // what: 'bbb',
37
+ // }],
38
+ // }
39
+
40
+
41
+
42
+ /**
43
+ * WDIInstagram object constructor
44
+ * @param {Object} args
45
+ *
46
+ * @param {Array} [args.access_tokens] [array of lavid instagram access tokens]
47
+ * @param {Array} [args.filters] [array of object defining filters]
48
+ * @param {Object} [args.filters[i] ] [ filter object which contain 'where' : 'what' pair ]
49
+ * @param {String} [args.filters.filter[i].where] [name of function where filter must be applied]
50
+ * @param {String or Array} [args.filters.filter[i].what] [name of filtering function,
51
+ * if function is in global scope then it should be name of the funtion
52
+ * else if function in method of some object then it should be an array
53
+ * ['parent_object_name','filtering_function_name']]
54
+ */
55
+ function WDIInstagram(args) {
56
+
57
+ this.access_tokens = [];
58
+ this.filters = [];
59
+ if (typeof args != 'undefined') {
60
+ if (typeof args.access_tokens != 'undefined') {
61
+ this.access_tokens = args.access_tokens;
62
+ }
63
+ if (typeof args.filters != 'undefined') {
64
+ this.filters = args.filters;
65
+ }
66
+ }
67
+
68
+
69
+ var _this = this;
70
+
71
+ /**
72
+ * Default object for handling status codes
73
+ * @type {Object}
74
+ */
75
+ this.statusCode = {
76
+ 429 : function(){
77
+ console.log(' 429: Too many requests try after one hour' );
78
+ },
79
+ }
80
+
81
+ /**
82
+ * gets filter function defined for specific method
83
+ * this function is internal function and cannot be called outside of this object
84
+ *
85
+ * @param {String} methodName [name of WDIInstagram method]
86
+ * @return {Function} [filtering function for {methodName}]
87
+ */
88
+ this.getFilter = function(methodName) {
89
+ var filters = _this.filters;
90
+ if (typeof filters == "undefined") {
91
+ return false;
92
+ }
93
+
94
+ for (var i = 0; i < filters.length; i++) {
95
+ if (filters[i].where == methodName) {
96
+
97
+ if (typeof filters[i].what == 'object' && filters[i].what.length == 2) {
98
+ if (typeof window[filters[i].what[0]] != 'undefined') {
99
+ if (typeof window[filters[i].what[0]][filters[i].what[1]] == 'function') {
100
+ return window[filters[i].what[0]][filters[i].what[1]];
101
+ }
102
+ }
103
+ } else if (typeof filters[i].what == 'string') {
104
+ if (typeof window[filters[i].what] == 'function') {
105
+ return window[filters[i].what];
106
+ }
107
+ } else if (typeof filters[i].what == 'function') {
108
+ return filters[i].what;
109
+ } else {
110
+ return false;
111
+ }
112
+ }
113
+ }
114
+ return false;
115
+ }
116
+
117
+ function getAccessToken() {
118
+ var access_tokens = _this.access_tokens,
119
+ index = parseInt(Math.random(0, 1) * access_tokens.length);
120
+ return access_tokens[index];
121
+ }
122
+
123
+ /**
124
+ * Adds access token to this.access_tokens array
125
+ * non string values are not allowed
126
+ * @param {String} token [Instagram API access token]
127
+ */
128
+ this.addToken = function(token) {
129
+ if (typeof token == 'string') {
130
+ _this.access_tokens.push(token);
131
+ }
132
+ }
133
+
134
+ /**
135
+ * Gets recent media based on tagname
136
+ *
137
+ *
138
+ * @definition success_callback => which function to call in case of success
139
+ * @definition error_callback => which function to call in case of error
140
+ * @definition media_count => number of media to request
141
+ * @definition min_tag_id => Return media before this min_tag_id.
142
+ * @definition max_tag_id => Return media after this max_tag_id.
143
+ * @definition statusCode => StatusCode object.
144
+ *
145
+ * @param tagname => A valid tag name without a leading #. (eg. snowy, nofilter)
146
+ * @param args = {
147
+ * success : 'success_callback',
148
+ * error : 'error_callback',
149
+ * statusCode : statusCode
150
+ * count : 'media_count',
151
+ * min_tag_id : 'min_tag_id',
152
+ * max_tag_id : 'max_tag_id',
153
+ * args : arguments to be passed to filtering function
154
+ * }
155
+ *
156
+ *
157
+ * if callback function is property of any other object just give it as array [ 'parent_object', 'callback_function']
158
+ * or you can pass as callback function an anonymous function
159
+ *
160
+ *
161
+ * @return object of founded media
162
+ */
163
+ this.getTagRecentMedia = function(tagname, args) {
164
+ var instagram = this,
165
+ noArgument = false,
166
+ successFlag = false,
167
+ statusCode = this.statusCode;
168
+ errorFlag = false,
169
+ argFlag = false,
170
+ filter = this.getFilter('getTagRecentMedia');
171
+
172
+ baseUrl = 'https://api.instagram.com/v1/tags/' + tagname + '/media/recent?access_token=' + getAccessToken();
173
+
174
+
175
+ if (typeof args == 'undefined' || args.length === 0) {
176
+ noArgument = true;
177
+ } else {
178
+
179
+ if ('success' in args) {
180
+ successFlag = true;
181
+ }
182
+ if( 'statusCode' in args ){
183
+ statusCode = args['statusCode'];
184
+ }
185
+ if ('error' in args) {
186
+ errorFlag = true;
187
+ }
188
+ //
189
+ if ( 'args' in args ){
190
+ argFlag = true;
191
+ }else{
192
+ args.args = {};
193
+ }
194
+ //
195
+ if ('count' in args) {
196
+ args['count'] = parseInt(args['count']);
197
+ if (!Number.isInteger(args['count']) || args['count'] <= 0) {
198
+ args.count = 33;
199
+ }
200
+ } else {
201
+ args.count = 33;
202
+ }
203
+
204
+ baseUrl += '&count=' + args.count;
205
+
206
+ if ('min_tag_id' in args) {
207
+ baseUrl += '&min_tag_id=' + args.min_tag_id;
208
+ }
209
+
210
+ if ('max_tag_id' in args) {
211
+ baseUrl += '&max_tag_id=' + args.max_tag_id;
212
+ }
213
+ }
214
+
215
+ jQuery.ajax({
216
+ type: 'POST',
217
+ url: baseUrl,
218
+ dataType: 'jsonp',
219
+ success: function(response) {
220
+ if (successFlag) {
221
+ if (typeof args.success == 'object' && args.success.length == 2) {
222
+ if (typeof window[args.success[0]] != 'undefined') {
223
+ if (typeof window[args.success[0]][args.success[1]] == 'function') {
224
+ if (filter) {
225
+ response = filter(response,instagram.filterArguments, args.args);
226
+ }
227
+ window[args.success[0]][args.success[1]](response);
228
+ }
229
+ }
230
+
231
+ } else if (typeof args.success == 'string') {
232
+ if (typeof window[args.success] == 'function') {
233
+ if (filter) {
234
+ response = filter(response,instagram.filterArguments, args.args);
235
+ }
236
+ window[args.success](response);
237
+ }
238
+ } else if (typeof args.success == 'function') {
239
+ if (filter) {
240
+ response = filter(response,instagram.filterArguments, args.args);
241
+ }
242
+ args.success(response);
243
+ }
244
+ }
245
+ },
246
+ error: function(response) {
247
+ if (errorFlag) {
248
+ if (typeof args['error'] == 'object' && args['error'].length == 2) {
249
+ if (typeof window[args['error'][0]][args['error'][1]] == 'function') {
250
+ window[args['error'][0]][args['error'][1]](response);
251
+ }
252
+ } else if (typeof args['error'] == 'string') {
253
+ if (typeof window[args['error']] == 'function') {
254
+ window[args['error']](response);
255
+ }
256
+ } else if (typeof args['error'] == 'function') {
257
+ args['error'](response);
258
+ }
259
+ }
260
+ },
261
+ statusCode : statusCode
262
+ });
263
+
264
+ }
265
+
266
+
267
+ /**
268
+ * Search for tags by name.
269
+ *
270
+ *
271
+ * @definition success_callback => which function to call in case of success
272
+ * @definition error_callback => which function to call in case of error
273
+ * @definition statusCode => StatusCode object.
274
+ *
275
+ * @param tagname => A valid tag name without a leading #. (eg. snowy, nofilter)
276
+ * @param args = {
277
+ * success: 'success_callback',
278
+ * error: 'error_callback',
279
+ * statusCode : statusCode,
280
+ * }
281
+ *
282
+ *
283
+ * if callback function is property of any other object just give it as array [ 'parent_object', 'callback_function']
284
+ * or you can pass as callback function an anonymous function
285
+ *
286
+ *
287
+ * @return object of founded media
288
+ */
289
+
290
+ this.searchForTagsByName = function(tagname, args) {
291
+ var instagram = this,
292
+ noArgument = false,
293
+ successFlag = false,
294
+ statusCode = this.statusCode;
295
+ errorFlag = false;
296
+ filter = this.getFilter('searchForTagsByName');
297
+
298
+ if (typeof args == 'undefined' || args.length === 0) {
299
+ noArgument = true;
300
+ } else {
301
+ if ('success' in args) {
302
+ successFlag = true;
303
+ }
304
+ if ('error' in args) {
305
+ errorFlag = true;
306
+ }
307
+ if( 'statusCode' in args ){
308
+ statusCode = args['statusCode'];
309
+ }
310
+ }
311
+
312
+
313
+ jQuery.ajax({
314
+ type: 'POST',
315
+ url: 'https://api.instagram.com/v1/tags/search?q=' + tagname + '&access_token=' + getAccessToken(),
316
+ dataType: 'jsonp',
317
+ success: function(response) {
318
+ if (successFlag) {
319
+ if (typeof args.success == 'object' && args.success.length == 2) {
320
+ if (typeof window[args.success[0]] != 'undefined') {
321
+ if (typeof window[args.success[0]][args.success[1]] == 'function') {
322
+ if (filter) {
323
+ response = filter(response,instagram.filterArguments);
324
+ }
325
+ window[args.success[0]][args.success[1]](response);
326
+ }
327
+ }
328
+ } else if (typeof args.success == 'string') {
329
+ if (typeof window[args.success] == 'function') {
330
+ if (filter) {
331
+ response = filter(response,instagram.filterArguments);
332
+ }
333
+ window[args.success](response);
334
+ }
335
+ } else if (typeof args.success == 'function') {
336
+ if (filter) {
337
+ response = filter(response,instagram.filterArguments);
338
+ }
339
+ args.success(response);
340
+ }
341
+ }
342
+ },
343
+ error: function(response) {
344
+ if (errorFlag) {
345
+ if (typeof args['error'] == 'object' && args['error'].length == 2) {
346
+ if (typeof window[args['error'][0]][args['error'][1]] == 'function') {
347
+ window[args['error'][0]][args['error'][1]](response);
348
+ }
349
+ } else if (typeof args['error'] == 'string') {
350
+ if (typeof window[args['error']] == 'function') {
351
+ window[args['error']](response);
352
+ }
353
+ } else if (typeof args['error'] == 'function') {
354
+ args['error'](response);
355
+ }
356
+ }
357
+ },
358
+ statusCode: statusCode
359
+ });
360
+ }
361
+
362
+
363
+
364
+ /**
365
+ * Get a list of users matching the query.
366
+ *
367
+ *
368
+ * @definition success_callback => which function to call in case of success
369
+ * @definition error_callback => which function to call in case of error
370
+ * @definition statusCode => StatusCode object.
371
+ *
372
+ * @param username
373
+ * @param args = {
374
+ * success: 'success_callback',
375
+ * error: 'error_callback',
376
+ * statusCode : statusCode
377
+ * }
378
+ *
379
+ *
380
+ * if callback function is property of any other object just give it as array [ 'parent_object', 'callback_function']
381
+ * or you can pass as callback function an anonymous function
382
+ *
383
+ *
384
+ * @return object of founded users
385
+ */
386
+ this.searchForUsersByName = function(username, args) {
387
+ var instagram = this,
388
+ noArgument = false,
389
+ successFlag = false,
390
+ statusCode = this.statusCode,
391
+ errorFlag = false,
392
+ filter = this.getFilter('searchForUsersByName');
393
+
394
+ if (typeof args == 'undefined' || args.length === 0) {
395
+ noArgument = true;
396
+ } else {
397
+ if ('success' in args) {
398
+ successFlag = true;
399
+ }
400
+ if ('error' in args) {
401
+ errorFlag = true;
402
+ }
403
+ if( 'statusCode' in args ){
404
+ statusCode = args['statusCode'];
405
+ }
406
+ }
407
+
408
+
409
+ jQuery.ajax({
410
+ type: 'POST',
411
+ dataType: 'jsonp',
412
+ url: 'https://api.instagram.com/v1/users/search?q=' + username + '&access_token=' + getAccessToken(),
413
+ success: function(response) {
414
+ if (successFlag) {
415
+ if (typeof args.success == 'object' && args.success.length == 2) {
416
+ if (typeof window[args.success[0]] != 'undefined') {
417
+ if (typeof window[args.success[0]][args.success[1]] == 'function') {
418
+ if (filter) {
419
+ response = filter(response,instagram.filterArguments);
420
+ }
421
+ window[args.success[0]][args.success[1]](response);
422
+ }
423
+ }
424
+ } else if (typeof args.success == 'string') {
425
+ if (typeof window[args.success] == 'function') {
426
+ if (filter) {
427
+ response = filter(response,instagram.filterArguments);
428
+ }
429
+ window[args.success](response);
430
+ }
431
+ } else if (typeof args.success == 'function') {
432
+ if (filter) {
433
+ response = filter(response,instagram.filterArguments);
434
+ }
435
+ args.success(response);
436
+ }
437
+ }
438
+ },
439
+ error: function(response) {
440
+ if (errorFlag) {
441
+ if (typeof args['error'] == 'object' && args['error'].length == 2) {
442
+ if (typeof window[args['error'][0]][args['error'][1]] == 'function') {
443
+ window[args['error'][0]][args['error'][1]](response);
444
+ }
445
+ } else if (typeof args['error'] == 'string') {
446
+ if (typeof window[args['error']] == 'function') {
447
+ window[args['error']](response);
448
+ }
449
+ } else if (typeof args['error'] == 'function') {
450
+ args['error'](response);
451
+ }
452
+ }
453
+ },
454
+ statusCode : this.statusCode
455
+
456
+ });
457
+ }
458
+
459
+
460
+
461
+ /**
462
+ * Get the list of recent media liked by the owner of the access_token.
463
+ *
464
+ *
465
+ * @definition success_callback => which function to call in case of success
466
+ * @definition error_callback => which function to call in case of error
467
+ * @definition statusCode => StatusCode object.
468
+ * @param args = {
469
+ * success: 'success_callback',
470
+ * error: 'error_callback',
471
+ * statusCode : statusCode
472
+ * }
473
+ *
474
+ *
475
+ * if callback function is property of any other object just give it as array [ 'parent_object', 'callback_function']
476
+ * or you can pass as callback function an anonymous function
477
+ *
478
+ *
479
+ * @return object of founded media
480
+ */
481
+
482
+ this.getRecentLikedMedia = function(args) {
483
+ var instagram = this,
484
+ noArgument = false,
485
+ successFlag = false,
486
+ statusCode = this.statusCode,
487
+ errorFlag = false,
488
+ filter = this.getFilter('getRecentLikedMedia');
489
+
490
+ if (typeof args == 'undefined' || args.length === 0) {
491
+ noArgument = true;
492
+ } else {
493
+ if ('success' in args) {
494
+ successFlag = true;
495
+ }
496
+ if ('error' in args) {
497
+ errorFlag = true;
498
+ }
499
+ if( 'statusCode' in args ){
500
+ statusCode = args['statusCode'];
501
+ }
502
+ }
503
+
504
+
505
+ jQuery.ajax({
506
+ type: 'POST',
507
+ dataType: 'jsonp',
508
+ url: 'https://api.instagram.com/v1/users/self/media/liked?access_token=' + getAccessToken(),
509
+ success: function(response) {
510
+ if (successFlag) {
511
+ if (typeof args.success == 'object' && args.success.length == 2) {
512
+ if (typeof window[args.success[0]] != 'undefined') {
513
+ if (typeof window[args.success[0]][args.success[1]] == 'function') {
514
+ if (filter) {
515
+ response = filter(response,instagram.filterArguments);
516
+ }
517
+ window[args.success[0]][args.success[1]](response);
518
+ }
519
+ }
520
+ } else if (typeof args.success == 'string') {
521
+ if (typeof window[args.success] == 'function') {
522
+ if (filter) {
523
+ response = filter(response,instagram.filterArguments);
524
+ }
525
+ window[args.success](response);
526
+ }
527
+ } else if (typeof args.success == 'function') {
528
+ if (filter) {
529
+ response = filter(response,instagram.filterArguments);
530
+ }
531
+ args.success(response);
532
+ }
533
+ }
534
+ },
535
+ error: function(response) {
536
+ if (errorFlag) {
537
+ if (typeof args['error'] == 'object' && args['error'].length == 2) {
538
+ if (typeof window[args['error'][0]][args['error'][1]] == 'function') {
539
+ window[args['error'][0]][args['error'][1]](response);
540
+ }
541
+ } else if (typeof args['error'] == 'string') {
542
+ if (typeof window[args['error']] == 'function') {
543
+ window[args['error']](response);
544
+ }
545
+ } else if (typeof args['error'] == 'function') {
546
+ args['error'](response);
547
+ }
548
+ }
549
+ },
550
+ statusCode : statusCode
551
+
552
+ });
553
+ }
554
+
555
+
556
+
557
+ /**
558
+ * Get the most recent media published by a user.
559
+ * This endpoint requires the public_content scope if the user-id is not the owner of the access_token.
560
+ *
561
+ *
562
+ * @definition success_callback => which function to call in case of success
563
+ * @definition error_callback => which function to call in case of error
564
+ * @definition media_count => number of media to request
565
+ * @definition min_id => Return media before this min_id.
566
+ * @definition max_id => Return media after this max_id.
567
+ * @definition statusCode => StatusCode object.
568
+ *
569
+ * @param args = {
570
+ * success : 'success_callback',
571
+ * error : 'error_callback',
572
+ * statusCode : statusCode,
573
+ * count : 'media_count',
574
+ * min_id : 'min_id',
575
+ * max_id : 'max_id',
576
+ * args: arguments to be passed to filtering function
577
+ * }
578
+ *
579
+ *
580
+ * if callback function is property of any other object just give it as array [ 'parent_object', 'callback_function']
581
+ * or you can pass as callback function an anonymous function
582
+ *
583
+ *
584
+ * @return object of founded media
585
+ */
586
+ this.getUserRecentMedia = function(user_id, args) {
587
+ var instagram = this,
588
+ noArgument = false,
589
+ successFlag = false,
590
+ argFlag = false,
591
+ //internal default object for statusCode handling
592
+ statusCode = this.statusCode,
593
+ errorFlag = false,
594
+ filter = this.getFilter('getUserRecentMedia'),
595
+ baseUrl = 'https://api.instagram.com/v1/users/' + user_id + '/media/recent/?access_token=' + getAccessToken();
596
+ if (typeof args == 'undefined' || args.length === 0) {
597
+ noArgument = true;
598
+ } else {
599
+ if ('success' in args) {
600
+ successFlag = true;
601
+ }
602
+
603
+ if( 'statusCode' in args ){
604
+ statusCode = args['statusCode'];
605
+ }
606
+
607
+ if ( 'args' in args ){
608
+ argFlag = true;
609
+ }else{
610
+ args.args = {};
611
+ }
612
+
613
+ if ('error' in args) {
614
+ errorFlag = true;
615
+ }
616
+
617
+ if ('count' in args) {
618
+ args['count'] = parseInt(args['count']);
619
+ if (!Number.isInteger(args['count']) || args['count'] <= 0) {
620
+ args.count = 33;
621
+ }
622
+ } else {
623
+ args.count = 33;
624
+ }
625
+
626
+ baseUrl += '&count=' + args.count;
627
+
628
+ if ('min_id' in args) {
629
+ baseUrl += '&min_id=' + args.min_id;
630
+ }
631
+
632
+ if ('max_id' in args) {
633
+ baseUrl += '&max_id=' + args.max_id;
634
+ }
635
+ }
636
+
637
+
638
+ jQuery.ajax({
639
+ type: 'POST',
640
+ dataType: 'jsonp',
641
+ url: baseUrl,
642
+ success: function(response) {
643
+ if (successFlag) {
644
+ if (typeof args.success == 'object' && args.success.length == 2) {
645
+ if (typeof window[args.success[0]] != 'undefined') {
646
+ if (typeof window[args.success[0]][args.success[1]] == 'function') {
647
+ if (filter) {
648
+ response = filter(response,instagram.filterArguments, args.args);
649
+ }
650
+ window[args.success[0]][args.success[1]](response);
651
+ }
652
+ }
653
+ } else if (typeof args.success == 'string') {
654
+ if (typeof window[args.success] == 'function') {
655
+ if (filter) {
656
+ response = filter(response,instagram.filterArguments, args.args);
657
+ }
658
+ window[args.success](response);
659
+ }
660
+ } else if (typeof args.success == 'function') {
661
+ if (filter) {
662
+ response = filter(response,instagram.filterArguments, args.args);
663
+ }
664
+ args.success(response);
665
+ }
666
+ }
667
+ },
668
+ error: function(response) {
669
+ if (errorFlag) {
670
+ if (typeof args['error'] == 'object' && args['error'].length == 2) {
671
+ if (typeof window[args['error'][0]][args['error'][1]] == 'function') {
672
+ window[args['error'][0]][args['error'][1]](response);
673
+ }
674
+ } else if (typeof args['error'] == 'string') {
675
+ if (typeof window[args['error']] == 'function') {
676
+ window[args['error']](response);
677
+ }
678
+ } else if (typeof args['error'] == 'function') {
679
+ args['error'](response);
680
+ }
681
+ }
682
+ },
683
+ statusCode: statusCode
684
+
685
+ });
686
+
687
+ }
688
+
689
+
690
+
691
+ /**
692
+ * Get the most recent media published by the owner of the access_token.
693
+ *
694
+ *
695
+ * @definition success_callback => which function to call in case of success
696
+ * @definition error_callback => which function to call in case of error
697
+ * @definition media_count => number of media to request
698
+ * @definition min_id => Return media before this min_id.
699
+ * @definition max_id => Return media after this max_id.
700
+ * @definition statusCode => StatusCode object.
701
+ *
702
+ * @param args = {
703
+ * success : 'success_callback',
704
+ * error : 'error_callback',
705
+ * count : 'media_count',
706
+ * min_id : 'min_id'
707
+ * max_id : 'max_id'
708
+ * statusCode : statusCode
709
+ *
710
+ * }
711
+ *
712
+ *
713
+ * if callback function is property of any other object just give it as array [ 'parent_object', 'callback_function']
714
+ * or you can pass as callback function an anonymous function
715
+ *
716
+ *
717
+ * @return object of founded media
718
+ */
719
+ this.getSelfRecentMedia = function(args) {
720
+ var instagram = this,
721
+ noArgument = false,
722
+ successFlag = false,
723
+ statusCode = this.statusCode;
724
+ errorFlag = false,
725
+ filter = this.getFilter('getSelfRecentMedia'),
726
+ baseUrl = 'https://api.instagram.com/v1/users/self/media/recent/?access_token=' + getAccessToken();
727
+
728
+ if (typeof args == 'undefined' || args.length === 0) {
729
+ noArgument = true;
730
+ } else {
731
+ if ('success' in args) {
732
+ successFlag = true;
733
+ }
734
+
735
+ if ('error' in args) {
736
+ errorFlag = true;
737
+ }
738
+
739
+ if( 'statusCode' in args ){
740
+ statusCode = args['statusCode'];
741
+ }
742
+
743
+ if ('count' in args) {
744
+ args['count'] = parseInt(args['count']);
745
+ if (!Number.isInteger(args['count']) || args['count'] <= 0) {
746
+ args.count = 33;
747
+ }
748
+ } else {
749
+ args.count = 33;
750
+ }
751
+
752
+ baseUrl += '&count=' + args.count;
753
+
754
+ if ('min_id' in args) {
755
+ baseUrl += '&min_id=' + args.min_id;
756
+ }
757
+
758
+ if ('max_id' in args) {
759
+ baseUrl += '&max_id=' + args.max_id;
760
+ }
761
+ }
762
+
763
+ jQuery.ajax({
764
+ type: 'POST',
765
+ dataType: 'jsonp',
766
+ url: baseUrl,
767
+ success: function(response) {
768
+ if (successFlag) {
769
+ if (typeof args.success == 'object' && args.success.length == 2) {
770
+ if (typeof window[args.success[0]] != 'undefined') {
771
+ if (typeof window[args.success[0]][args.success[1]] == 'function') {
772
+ if (filter) {
773
+ response = filter(response,instagram.filterArguments);
774
+ }
775
+ window[args.success[0]][args.success[1]](response);
776
+ }
777
+ }
778
+ } else if (typeof args.success == 'string') {
779
+ if (typeof window[args.success] == 'function') {
780
+ if (filter) {
781
+ response = filter(response,instagram.filterArguments);
782
+ }
783
+ window[args.success](response);
784
+ }
785
+ } else if (typeof args.success == 'function') {
786
+ if (filter) {
787
+ response = filter(response,instagram.filterArguments);
788
+ }
789
+ args.success(response);
790
+ }
791
+ }
792
+ },
793
+ error: function(response) {
794
+ if (errorFlag) {
795
+ if (typeof args['error'] == 'object' && args['error'].length == 2) {
796
+ if (typeof window[args['error'][0]][args['error'][1]] == 'function') {
797
+ window[args['error'][0]][args['error'][1]](response);
798
+ }
799
+ } else if (typeof args['error'] == 'string') {
800
+ if (typeof window[args['error']] == 'function') {
801
+ window[args['error']](response);
802
+ }
803
+ } else if (typeof args['error'] == 'function') {
804
+ args['error'](response);
805
+ }
806
+ }
807
+ },
808
+ statusCode : statusCode
809
+
810
+ });
811
+ }
812
+
813
+
814
+
815
+ /**
816
+ * Get information about a user.
817
+ * This endpoint requires the public_content scope if the user-id is not the owner of the access_token.
818
+ *
819
+ *
820
+ * @definition success_callback => which function to call in case of success
821
+ * @definition error_callback => which function to call in case of error
822
+ * @definition statusCode => StatusCode object.
823
+ *
824
+ * @param args = {
825
+ * success : 'success_callback',
826
+ * error : 'error_callback'
827
+ * statusCode : statusCode
828
+ * }
829
+ *
830
+ *
831
+ * if callback function is property of any other object just give it as array [ 'parent_object', 'callback_function']
832
+ * or you can pass as callback function an anonymous function
833
+ *
834
+ *
835
+ * @return object of founded info
836
+ */
837
+ this.getUserInfo = function(user_id, args) {
838
+ var instagram = this,
839
+ noArgument = false,
840
+ successFlag = false,
841
+ statusCode = this.statusCode,
842
+ errorFlag = false,
843
+ filter = this.getFilter('getUserInfo');
844
+
845
+ if (typeof args == 'undefined' || args.length === 0) {
846
+ noArgument = true;
847
+ } else {
848
+ if ('success' in args) {
849
+ successFlag = true;
850
+ }
851
+
852
+ if ('error' in args) {
853
+ errorFlag = true;
854
+ }
855
+
856
+ if( 'statusCode' in args ){
857
+ statusCode = args['statusCode'];
858
+ }
859
+ }
860
+ jQuery.ajax({
861
+ type: 'POST',
862
+ dataType: 'jsonp',
863
+ url: 'https://api.instagram.com/v1/users/' + user_id + '/?access_token=' + getAccessToken(),
864
+ success: function(response) {
865
+ if (successFlag) {
866
+ if (typeof args.success == 'object' && args.success.length == 2) {
867
+ if (typeof window[args.success[0]] != 'undefined') {
868
+ if (typeof window[args.success[0]][args.success[1]] == 'function') {
869
+ if (filter) {
870
+ response = filter(response,instagram.filterArguments);
871
+ }
872
+ window[args.success[0]][args.success[1]](response);
873
+ }
874
+ }
875
+ } else if (typeof args.success == 'string') {
876
+ if (typeof window[args.success] == 'function') {
877
+ if (filter) {
878
+ response = filter(response,instagram.filterArguments);
879
+ }
880
+ window[args.success](response);
881
+ }
882
+ } else if (typeof args.success == 'function') {
883
+ if (filter) {
884
+ response = filter(response,instagram.filterArguments);
885
+ }
886
+ args.success(response);
887
+ }
888
+ }
889
+ },
890
+ error: function(response) {
891
+ if (errorFlag) {
892
+ if (typeof args['error'] == 'object' && args['error'].length == 2) {
893
+ if (typeof window[args['error'][0]][args['error'][1]] == 'function') {
894
+ window[args['error'][0]][args['error'][1]](response);
895
+ }
896
+ } else if (typeof args['error'] == 'string') {
897
+ if (typeof window[args['error']] == 'function') {
898
+ window[args['error']](response);
899
+ }
900
+ } else if (typeof args['error'] == 'function') {
901
+ args['error'](response);
902
+ }
903
+ }
904
+ },
905
+ statusCode : statusCode
906
+
907
+ });
908
+ }
909
+
910
+
911
+
912
+ /**
913
+ * Get information about the owner of the access_token.
914
+ *
915
+ *
916
+ * @definition success_callback => which function to call in case of success
917
+ * @definition error_callback => which function to call in case of error
918
+ * @definition statusCode => StatusCode object.
919
+ *
920
+ * @param args = {
921
+ * success : 'success_callback',
922
+ * error : 'error_callback'
923
+ * statusCode : statusCode
924
+ * }
925
+ *
926
+ *
927
+ * if callback function is property of any other object just give it as array [ 'parent_object', 'callback_function']
928
+ * or you can pass as callback function an anonymous function
929
+ *
930
+ *
931
+ * @return object of founded info
932
+ */
933
+ this.getSelfInfo = function(args) {
934
+ var instagram = this,
935
+ noArgument = false,
936
+ successFlag = false,
937
+ statusCode = this.statusCode,
938
+ errorFlag = false,
939
+ filter = this.getFilter('getSelfInfo');
940
+ if (typeof args == 'undefined' || args.length === 0) {
941
+ noArgument = true;
942
+ } else {
943
+ if ('success' in args) {
944
+ successFlag = true;
945
+ }
946
+
947
+ if ('error' in args) {
948
+ errorFlag = true;
949
+ }
950
+
951
+ if( 'statusCode' in args ){
952
+ statusCode = args['statusCode'];
953
+ }
954
+ }
955
+ jQuery.ajax({
956
+ type: 'POST',
957
+ dataType: 'jsonp',
958
+ url: 'https://api.instagram.com/v1/users/self/?access_token=' + getAccessToken(),
959
+ success: function(response) {
960
+ if (successFlag) {
961
+ if (typeof args.success == 'object' && args.success.length == 2) {
962
+ if (typeof window[args.success[0]] != 'undefined') {
963
+ if (typeof window[args.success[0]][args.success[1]] == 'function') {
964
+ if (filter) {
965
+ response = filter(response,instagram.filterArguments);
966
+ }
967
+ window[args.success[0]][args.success[1]](response);
968
+ }
969
+ }
970
+ } else if (typeof args.success == 'string') {
971
+ if (typeof window[args.success] == 'function') {
972
+ if (filter) {
973
+ response = filter(response,instagram.filterArguments);
974
+ }
975
+ window[args.success](response);
976
+ }
977
+ } else if (typeof args.success == 'function') {
978
+ if (filter) {
979
+ response = filter(response,instagram.filterArguments);
980
+ }
981
+ args.success(response);
982
+ }
983
+ }
984
+ },
985
+ error: function(response) {
986
+ if (errorFlag) {
987
+ if (typeof args['error'] == 'object' && args['error'].length == 2) {
988
+ if (typeof window[args['error'][0]][args['error'][1]] == 'function') {
989
+ window[args['error'][0]][args['error'][1]](response);
990
+ }
991
+ } else if (typeof args['error'] == 'string') {
992
+ if (typeof window[args['error']] == 'function') {
993
+ window[args['error']](response);
994
+ }
995
+ } else if (typeof args['error'] == 'function') {
996
+ args['error'](response);
997
+ }
998
+ }
999
+ },
1000
+ statusCode : statusCode
1001
+
1002
+ });
1003
+ }
1004
+
1005
+
1006
+
1007
+ /**
1008
+ * Get a list of recent comments on a media object.
1009
+ * The public_content permission scope is required to get comments for a media
1010
+ * that does not belong to the owner of the access_token.
1011
+ *
1012
+ * @media_id => id of the media which comments must be getted
1013
+ * @definition success_callback => which function to call in case of success
1014
+ * @definition error_callback => which function to call in case of error
1015
+ * @definition statusCode => StatusCode object.
1016
+ *
1017
+ * @param args = {
1018
+ * success : 'success_callback',
1019
+ * error : 'error_callback'
1020
+ * statusCode : statusCode
1021
+ * }
1022
+ *
1023
+ *
1024
+ * if callback function is property of any other object just give it as array [ 'parent_object', 'callback_function']
1025
+ * or you can pass as callback function an anonymous function
1026
+ *
1027
+ *
1028
+ * @return object of founded comments
1029
+ */
1030
+ this.getRecentMediaComments = function(media_id, args) {
1031
+ var instagram = this,
1032
+ noArgument = false,
1033
+ successFlag = false,
1034
+ statusCode = this.statusCode,
1035
+ errorFlag = false,
1036
+ filter = this.getFilter('getRecentMediaComments');
1037
+ if (typeof args == 'undefined' || args.length === 0) {
1038
+ noArgument = true;
1039
+ } else {
1040
+ if ('success' in args) {
1041
+ successFlag = true;
1042
+ }
1043
+
1044
+ if ('error' in args) {
1045
+ errorFlag = true;
1046
+ }
1047
+
1048
+ if( 'statusCode' in args ){
1049
+ statusCode = args['statusCode'];
1050
+ }
1051
+ }
1052
+ jQuery.ajax({
1053
+ type: 'POST',
1054
+ dataType: 'jsonp',
1055
+ url: 'https://api.instagram.com/v1/media/' + media_id + '/comments?access_token=' + getAccessToken(),
1056
+ success: function(response) {
1057
+ if (successFlag) {
1058
+ if (typeof args.success == 'object' && args.success.length == 2) {
1059
+ if (typeof window[args.success[0]] != 'undefined') {
1060
+ if (typeof window[args.success[0]][args.success[1]] == 'function') {
1061
+ if (filter) {
1062
+ response = filter(response,instagram.filterArguments);
1063
+ }
1064
+ window[args.success[0]][args.success[1]](response);
1065
+ }
1066
+ }
1067
+ } else if (typeof args.success == 'string') {
1068
+ if (typeof window[args.success] == 'function') {
1069
+ if (filter) {
1070
+ response = filter(response,instagram.filterArguments);
1071
+ }
1072
+ window[args.success](response);
1073
+ }
1074
+ } else if (typeof args.success == 'function') {
1075
+ if (filter) {
1076
+ response = filter(response,instagram.filterArguments);
1077
+ }
1078
+ args.success(response);
1079
+ }
1080
+ }
1081
+ },
1082
+ error: function(response) {
1083
+ if (errorFlag) {
1084
+ if (typeof args['error'] == 'object' && args['error'].length == 2) {
1085
+ if (typeof window[args['error'][0]][args['error'][1]] == 'function') {
1086
+ window[args['error'][0]][args['error'][1]](response);
1087
+ }
1088
+ } else if (typeof args['error'] == 'string') {
1089
+ if (typeof window[args['error']] == 'function') {
1090
+ window[args['error']](response);
1091
+ }
1092
+ } else if (typeof args['error'] == 'function') {
1093
+ args['error'](response);
1094
+ }
1095
+ }
1096
+ },
1097
+ statusCode : statusCode
1098
+
1099
+ });
1100
+ }
1101
+
1102
+
1103
+
1104
+ /**
1105
+ * Get a list of users who have liked this media.
1106
+ *
1107
+ * @media_id => id of the media which comments must be getted
1108
+ * @definition success_callback => which function to call in case of success
1109
+ * @definition error_callback => which function to call in case of error
1110
+ * @definition statusCode => StatusCode object.
1111
+ *
1112
+ * @param args = {
1113
+ * success : 'success_callback',
1114
+ * error : 'error_callback'
1115
+ * statusCode : statusCode
1116
+ * }
1117
+ *
1118
+ *
1119
+ * if callback function is property of any other object just give it as array [ 'parent_object', 'callback_function']
1120
+ * or you can pass as callback function an anonymous function
1121
+ *
1122
+ *
1123
+ * @return object of founded comments
1124
+ */
1125
+ this.getRecentMediaLikes = function(media_id, args) {
1126
+ var instagram = this,
1127
+ noArgument = false,
1128
+ successFlag = false,
1129
+ statusCode = this.statusCode,
1130
+ errorFlag = false,
1131
+ filter = this.getFilter('getRecentMediaLikes');
1132
+
1133
+ if (typeof args == 'undefined' || args.length === 0) {
1134
+ noArgument = true;
1135
+ } else {
1136
+ if ('success' in args) {
1137
+ successFlag = true;
1138
+ }
1139
+
1140
+ if ('error' in args) {
1141
+ errorFlag = true;
1142
+ }
1143
+
1144
+ if( 'statusCode' in args ){
1145
+ statusCode = args['statusCode'];
1146
+ }
1147
+ }
1148
+ jQuery.ajax({
1149
+ type: 'POST',
1150
+ dataType: 'jsonp',
1151
+ url: 'https://api.instagram.com/v1/media/' + media_id + '/likes?access_token=' + getAccessToken(),
1152
+ success: function(response) {
1153
+ if (successFlag) {
1154
+ if (typeof args.success == 'object' && args.success.length == 2) {
1155
+ if (typeof window[args.success[0]] != 'undefined') {
1156
+ if (typeof window[args.success[0]][args.success[1]] == 'function') {
1157
+ if (filter) {
1158
+ response = filter(response,instagram.filterArguments);
1159
+ }
1160
+ window[args.success[0]][args.success[1]](response);
1161
+ }
1162
+ }
1163
+ } else if (typeof args.success == 'string') {
1164
+ if (typeof window[args.success] == 'function') {
1165
+ if (filter) {
1166
+ response = filter(response,instagram.filterArguments);
1167
+ }
1168
+ window[args.success](response);
1169
+ }
1170
+ } else if (typeof args.success == 'function') {
1171
+ if (filter) {
1172
+ response = filter(response,instagram.filterArguments);
1173
+ }
1174
+ args.success(response);
1175
+ }
1176
+ }
1177
+ },
1178
+ error: function(response) {
1179
+ if (errorFlag) {
1180
+ if (typeof args['error'] == 'object' && args['error'].length == 2) {
1181
+ if (typeof window[args['error'][0]][args['error'][1]] == 'function') {
1182
+ window[args['error'][0]][args['error'][1]](response);
1183
+ }
1184
+ } else if (typeof args['error'] == 'string') {
1185
+ if (typeof window[args['error']] == 'function') {
1186
+ window[args['error']](response);
1187
+ }
1188
+ } else if (typeof args['error'] == 'function') {
1189
+ args['error'](response);
1190
+ }
1191
+ }
1192
+ },
1193
+ statusCode : statusCode
1194
+
1195
+ });
1196
+ }
1197
+
1198
+
1199
+ /**
1200
+ * make an ajax request based on url
1201
+ *
1202
+ *
1203
+ * @definition success_callback => which function to call in case of success
1204
+ * @definition error_callback => which function to call in case of error
1205
+ * @definition statusCode => StatusCode object.
1206
+ *
1207
+ * @param args = {
1208
+ * success : 'success_callback',
1209
+ * error : 'error_callback',
1210
+ * statusCode : statusCode,
1211
+ * args.args : arguments to be passed to filter function
1212
+ * }
1213
+ *
1214
+ *
1215
+ * if callback function is property of any other object just give it as array [ 'parent_object', 'callback_function']
1216
+ * or you can pass as callback function an anonymous function
1217
+ *
1218
+ *
1219
+ * @return object of founded media
1220
+ */
1221
+ this.requestByUrl = function(requestUrl, args) {
1222
+ var instagram = this,
1223
+ noArgument = false,
1224
+ successFlag = false,
1225
+ errorFlag = false,
1226
+ argFlag = false,
1227
+ statusCode = this.statusCode,
1228
+ filter = this.getFilter('requestByUrl'),
1229
+ urlParts,
1230
+ urlPart;
1231
+
1232
+ //changing access token to random one
1233
+ urlParts = requestUrl.split('?')[1].split('&');
1234
+ for (var i = 0; i < urlParts.length; i++) {
1235
+ urlParts[i] = urlParts[i].split('=');
1236
+ if (urlParts[i][0] == 'access_token') {
1237
+ urlParts[i][1] = getAccessToken();
1238
+ }
1239
+ urlParts[i] = urlParts[i].join('=');
1240
+ }
1241
+ urlParts = urlParts.join('&');
1242
+ requestUrl = requestUrl.split('?')[0] + '?' + urlParts;
1243
+
1244
+
1245
+ if (typeof args == 'undefined' || args.length === 0) {
1246
+ noArgument = true;
1247
+ } else {
1248
+ if ('success' in args) {
1249
+ successFlag = true;
1250
+ }
1251
+
1252
+ if ( 'args' in args ){
1253
+ argFlag = true;
1254
+ }else{
1255
+ args.args = {};
1256
+ }
1257
+
1258
+
1259
+ if ('error' in args) {
1260
+ errorFlag = true;
1261
+ }
1262
+
1263
+ if( 'statusCode' in args ){
1264
+ statusCode = args['statusCode'];
1265
+ }
1266
+ }
1267
+
1268
+
1269
+ jQuery.ajax({
1270
+ type: 'POST',
1271
+ dataType: 'jsonp',
1272
+ url: requestUrl,
1273
+ success: function(response) {
1274
+ if (successFlag) {
1275
+ if (typeof args.success == 'object' && args.success.length == 2) {
1276
+ if (typeof window[args.success[0]] != 'undefined') {
1277
+ if (typeof window[args.success[0]][args.success[1]] == 'function') {
1278
+ if (filter) {
1279
+ response = filter(response,instagram.filterArguments, args.args);
1280
+ }
1281
+ window[args.success[0]][args.success[1]](response);
1282
+ }
1283
+ }
1284
+ } else if (typeof args.success == 'string') {
1285
+ if (typeof window[args.success] == 'function') {
1286
+ if (filter) {
1287
+ response = filter(response,instagram.filterArguments, args.args);
1288
+ }
1289
+ window[args.success](response);
1290
+ }
1291
+ } else if (typeof args.success == 'function') {
1292
+ if (filter) {
1293
+ response = filter(response,instagram.filterArguments, args.args);
1294
+ }
1295
+ args.success(response);
1296
+ }
1297
+ }
1298
+ },
1299
+ error: function(response) {
1300
+ if (errorFlag) {
1301
+ if (typeof args['error'] == 'object' && args['error'].length == 2) {
1302
+ if (typeof window[args['error'][0]][args['error'][1]] == 'function') {
1303
+ window[args['error'][0]][args['error'][1]](response);
1304
+ }
1305
+ } else if (typeof args['error'] == 'string') {
1306
+ if (typeof window[args['error']] == 'function') {
1307
+ window[args['error']](response);
1308
+ }
1309
+ } else if (typeof args['error'] == 'function') {
1310
+ args['error'](response);
1311
+ }
1312
+ }
1313
+ },
1314
+ statusCode : statusCode
1315
+
1316
+ });
1317
+
1318
+ }
1319
+ }
1320
+
1321
+
1322
+
1323
+
languages/wdi-ru_RU.mo CHANGED
Binary file
languages/wdi-ru_RU.po CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: \n"
4
- "POT-Creation-Date: 2015-09-28 11:18+0400\n"
5
- "PO-Revision-Date: 2015-09-28 11:18+0400\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "Language: ru\n"
@@ -16,1584 +16,1913 @@ msgstr ""
16
  "X-Poedit-KeywordsList: _e;__\n"
17
  "X-Poedit-SearchPath-0: .\n"
18
 
19
- #: admin-functions.php:80
20
  msgid "Succesfully Uninstalled!"
21
- msgstr ""
22
 
23
- #: admin-functions.php:86
24
  msgid "Already Unistalled"
25
- msgstr ""
26
 
27
- #: admin-functions.php:435
28
- msgid "Click here to get your access token and user ID"
 
 
29
  msgstr ""
30
 
31
- #: admin-functions.php:484
32
  msgid "Access Token"
33
- msgstr ""
34
 
35
- #: admin-functions.php:485
36
  msgid "Username"
 
 
 
 
 
 
 
 
37
  msgstr ""
38
 
39
- #: admin-functions.php:548
40
  msgid "Database error, please uninstall the plugin and install again"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  msgstr ""
42
 
43
- #: admin/controllers/WDIControllerFeeds_wdi.php:241
44
- msgid "Item Succesfully Duplicated."
45
  msgstr ""
46
 
47
- #: admin/controllers/WDIControllerFeeds_wdi.php:311
48
- #: admin/controllers/WDIControllerThemes_wdi.php:632
49
- msgid "Item Succesfully Deleted."
50
  msgstr ""
51
 
52
- #: admin/controllers/WDIControllerFeeds_wdi.php:314
53
- #: admin/controllers/WDIControllerFeeds_wdi.php:346
54
- #: admin/controllers/WDIControllerFeeds_wdi.php:383
55
- #: admin/controllers/WDIControllerThemes_wdi.php:635
 
 
 
 
 
 
 
 
 
56
  msgid "Error. Please install plugin again."
57
- msgstr ""
58
 
59
- #: admin/controllers/WDIControllerFeeds_wdi.php:331
60
- #: admin/controllers/WDIControllerThemes_wdi.php:664
61
  msgid "Items Succesfully Deleted."
62
- msgstr ""
63
 
64
- #: admin/controllers/WDIControllerFeeds_wdi.php:334
65
- #: admin/controllers/WDIControllerFeeds_wdi.php:371
66
- #: admin/controllers/WDIControllerFeeds_wdi.php:408
67
- #: admin/controllers/WDIControllerThemes_wdi.php:668
68
  msgid "You must select at least one item."
69
- msgstr ""
70
 
71
- #: admin/controllers/WDIControllerFeeds_wdi.php:343
72
  msgid "Item Succesfully Published."
73
- msgstr ""
74
 
75
- #: admin/controllers/WDIControllerFeeds_wdi.php:368
76
  msgid "Items Succesfully Published."
77
- msgstr ""
78
 
79
- #: admin/controllers/WDIControllerFeeds_wdi.php:380
80
  msgid "Item Succesfully Unpublished."
81
- msgstr ""
82
 
83
- #: admin/controllers/WDIControllerFeeds_wdi.php:405
84
  msgid "Items Succesfully Unpublished."
85
- msgstr ""
86
-
87
- #: admin/controllers/WDIControllerThemes_wdi.php:300
88
- #: admin/controllers/WDIControllerThemes_wdi.php:327
89
- #: admin/controllers/WDIControllerThemes_wdi.php:358
90
- #: admin/controllers/WDIControllerThemes_wdi.php:403
91
- msgid "Cannot Write on database"
92
- msgstr ""
93
 
94
- #: admin/controllers/WDIControllerThemes_wdi.php:306
95
- #: admin/controllers/WDIControllerThemes_wdi.php:336
96
- #: admin/controllers/WDIControllerThemes_wdi.php:366
97
- msgid "You have not made new changes"
98
- msgstr ""
99
-
100
- #: admin/controllers/WDIControllerThemes_wdi.php:400
101
  msgid "Please select at least one item"
102
- msgstr ""
103
 
104
- #: admin/controllers/WDIControllerThemes_wdi.php:405
105
  msgid "Items Succesfully Duplicated."
106
- msgstr ""
107
 
108
- #: admin/controllers/WDIControllerThemes_wdi.php:638
109
- #: admin/controllers/WDIControllerThemes_wdi.php:659
110
  msgid "You cannot delete default theme."
111
- msgstr ""
112
 
113
  #: admin/controllers/WDIControllerWidget.php:22
114
  msgid "Show your instagram feeds in your widget area"
115
- msgstr ""
116
 
117
  #: admin/controllers/WDIControllerWidget.php:27
118
  msgid "Instagram WD Widget"
119
- msgstr ""
120
 
121
  #: admin/views/WDIViewEditorShortcode.php:100
122
  msgid "Select Feed:"
123
- msgstr ""
124
 
125
- #: admin/views/WDIViewFeeds_wdi.php:38 admin/views/WDIViewFeeds_wdi.php:307
126
- msgid "This section allows you to create, edit and delete Feeds."
127
  msgstr ""
128
 
129
- #: admin/views/WDIViewFeeds_wdi.php:39 admin/views/WDIViewFeeds_wdi.php:308
 
130
  msgid "Read More in User Manual"
131
- msgstr ""
132
 
133
- #: admin/views/WDIViewFeeds_wdi.php:52 instagram-wd.php:155
134
  msgid "Feeds"
135
- msgstr ""
136
 
137
- #: admin/views/WDIViewFeeds_wdi.php:56 admin/views/WDIViewThemes_wdi.php:56
138
  msgid "Add new"
139
- msgstr ""
140
 
141
- #: admin/views/WDIViewFeeds_wdi.php:61 admin/views/WDIViewThemes_wdi.php:61
142
  msgid "Select All"
143
- msgstr ""
144
 
145
- #: admin/views/WDIViewFeeds_wdi.php:75 admin/views/WDIViewFeeds_wdi.php:96
146
- #: admin/views/WDIViewThemes_wdi.php:73 admin/views/WDIViewThemes_wdi.php:93
147
- #: frontend/views/WDIViewGalleryBox.php:1238
148
- #: frontend/views/WDIViewGalleryBox.php:1266
149
- #: frontend/views/WDIViewGalleryBox.php:1273
150
  msgid "Name"
151
- msgstr ""
152
 
153
- #: admin/views/WDIViewFeeds_wdi.php:90
154
  msgid "Feed"
155
- msgstr ""
156
 
157
- #: admin/views/WDIViewFeeds_wdi.php:99
158
  msgid "Shortcode"
159
- msgstr ""
160
 
161
- #: admin/views/WDIViewFeeds_wdi.php:100
162
  msgid "PHP function"
163
- msgstr ""
164
 
165
- #: admin/views/WDIViewFeeds_wdi.php:106
166
  msgid "Published"
167
- msgstr ""
168
 
169
- #: admin/views/WDIViewFeeds_wdi.php:109 admin/views/WDIViewThemes_wdi.php:104
170
  msgid "Edit"
171
- msgstr ""
172
 
173
- #: admin/views/WDIViewFeeds_wdi.php:110 admin/views/WDIViewThemes_wdi.php:105
174
  msgid "Delete"
175
- msgstr ""
176
 
177
- #: admin/views/WDIViewFeeds_wdi.php:205
178
  msgid "Feed Name"
179
- msgstr ""
180
 
181
- #: admin/views/WDIViewFeeds_wdi.php:205
182
  msgid "The name of your feed which can be displayed in feed's header section"
 
 
 
 
183
  msgstr ""
184
 
185
- #: admin/views/WDIViewFeeds_wdi.php:206
186
  msgid "Theme"
187
- msgstr ""
188
 
189
- #: admin/views/WDIViewFeeds_wdi.php:206
190
  msgid "The theme of your feed, you can create themes in themes menu"
191
- msgstr ""
192
 
193
- #: admin/views/WDIViewFeeds_wdi.php:207
194
  msgid "Feed Usernames and Hashtags"
195
- msgstr ""
196
 
197
- #: admin/views/WDIViewFeeds_wdi.php:207
198
  msgid ""
199
  "Enter usernames or hashtags to your feed, hashtags must start with #, "
200
  "username's shouldn't start with @"
201
  msgstr ""
 
 
202
 
203
- #: admin/views/WDIViewFeeds_wdi.php:208
204
- msgid "Feed Display Type"
205
  msgstr ""
206
 
207
- #: admin/views/WDIViewFeeds_wdi.php:208
208
- msgid "Pagination"
209
  msgstr ""
210
 
211
- #: admin/views/WDIViewFeeds_wdi.php:208
 
 
 
 
 
 
 
 
212
  msgid "Load More Button"
213
- msgstr ""
214
 
215
- #: admin/views/WDIViewFeeds_wdi.php:208
216
  msgid "Infinite Scroll"
 
 
 
 
217
  msgstr ""
218
 
219
- #: admin/views/WDIViewFeeds_wdi.php:208
220
  msgid "How to load and display new images"
221
- msgstr ""
222
 
223
- #: admin/views/WDIViewFeeds_wdi.php:209
224
  msgid "Sort Images By"
225
- msgstr ""
226
 
227
- #: admin/views/WDIViewFeeds_wdi.php:209
228
  msgid "Date"
229
- msgstr ""
230
 
231
- #: admin/views/WDIViewFeeds_wdi.php:209
232
  msgid "Likes"
233
- msgstr ""
234
 
235
- #: admin/views/WDIViewFeeds_wdi.php:209
236
  msgid "Comments"
237
- msgstr ""
238
 
239
- #: admin/views/WDIViewFeeds_wdi.php:209 framework/WDILibrary.php:767
240
  msgid "Random"
241
- msgstr ""
242
 
243
- #: admin/views/WDIViewFeeds_wdi.php:209
244
  msgid "How to sort images"
245
- msgstr ""
246
 
247
- #: admin/views/WDIViewFeeds_wdi.php:210
248
  msgid "Order By"
249
- msgstr ""
250
 
251
- #: admin/views/WDIViewFeeds_wdi.php:210
252
  msgid "Sorting order either Ascending or Descending"
253
- msgstr ""
254
 
255
- #: admin/views/WDIViewFeeds_wdi.php:211
256
- msgid "Follow on Instagram button"
257
  msgstr ""
258
 
259
- #: admin/views/WDIViewFeeds_wdi.php:212
260
  msgid "Display Header"
261
- msgstr ""
262
 
263
- #: admin/views/WDIViewFeeds_wdi.php:212
264
  msgid "Displays feed's header, header includes feed name and feed users"
265
  msgstr ""
 
266
 
267
- #: admin/views/WDIViewFeeds_wdi.php:213
268
  msgid "Number of Photos to Display"
269
- msgstr ""
270
 
271
- #: admin/views/WDIViewFeeds_wdi.php:213
272
  msgid "Number of images to load when page loads first time"
273
- msgstr ""
274
 
275
- #: admin/views/WDIViewFeeds_wdi.php:214
276
  msgid "Number of Photos to Load"
277
- msgstr ""
278
 
279
- #: admin/views/WDIViewFeeds_wdi.php:214
280
  msgid ""
281
  "Number of images to load when clicking load more button or triggering "
282
  "infinite scroll"
283
  msgstr ""
284
-
285
- #: admin/views/WDIViewFeeds_wdi.php:215
286
- msgid "Number of Columns"
287
- msgstr ""
288
-
289
- #: admin/views/WDIViewFeeds_wdi.php:215
290
- msgid "Feed item's column count"
291
- msgstr ""
292
-
293
- #: admin/views/WDIViewFeeds_wdi.php:216
294
- msgid "Resort After Loading New Images"
295
- msgstr ""
296
-
297
- #: admin/views/WDIViewFeeds_wdi.php:216
298
- msgid "Sort both newly loaded and existing images alltogether"
299
- msgstr ""
300
-
301
- #: admin/views/WDIViewFeeds_wdi.php:217
302
- msgid "Show Likes"
303
- msgstr ""
304
-
305
- #: admin/views/WDIViewFeeds_wdi.php:218
306
- msgid "Show Description"
307
- msgstr ""
308
-
309
- #: admin/views/WDIViewFeeds_wdi.php:219
310
- #: frontend/views/WDIViewGalleryBox.php:2166
311
- msgid "Show Comments"
312
- msgstr ""
313
 
314
  #: admin/views/WDIViewFeeds_wdi.php:220
315
- msgid "Show Usernames"
316
  msgstr ""
317
 
318
- #: admin/views/WDIViewFeeds_wdi.php:221
319
- msgid "Disable Mobile Layout"
320
  msgstr ""
321
 
322
  #: admin/views/WDIViewFeeds_wdi.php:221
323
- msgid "Column number stays the same in all screens"
324
  msgstr ""
325
 
326
- #: admin/views/WDIViewFeeds_wdi.php:222
327
- msgid "Image Onclick"
328
  msgstr ""
329
 
330
  #: admin/views/WDIViewFeeds_wdi.php:222
331
- msgid "Open Lightbox"
332
  msgstr ""
333
 
334
- #: admin/views/WDIViewFeeds_wdi.php:222
335
- msgid "Redirect To Instagram"
336
  msgstr ""
337
 
338
- #: admin/views/WDIViewFeeds_wdi.php:222
339
- msgid "Do Nothing"
340
  msgstr ""
341
 
342
  #: admin/views/WDIViewFeeds_wdi.php:224
343
- msgid "Full width lightbox"
344
- msgstr ""
345
 
346
- #: admin/views/WDIViewFeeds_wdi.php:224 admin/views/WDIViewFeeds_wdi.php:228
347
- #: admin/views/WDIViewFeeds_wdi.php:230 admin/views/WDIViewFeeds_wdi.php:233
348
- #: admin/views/WDIViewFeeds_wdi.php:234 admin/views/WDIViewFeeds_wdi.php:236
349
- #: admin/views/WDIViewFeeds_wdi.php:237 admin/views/WDIViewFeeds_wdi.php:238
350
- #: admin/views/WDIViewFeeds_wdi.php:239 admin/views/WDIViewFeeds_wdi.php:240
351
- #: admin/views/WDIViewFeeds_wdi.php:241 admin/views/WDIViewFeeds_wdi.php:242
352
- #: admin/views/WDIViewFeeds_wdi.php:243 admin/views/WDIViewFeeds_wdi.php:244
353
- #: admin/views/WDIViewFeeds_wdi.php:245 admin/views/WDIViewFeeds_wdi.php:246
354
- #: admin/views/WDIViewFeeds_wdi.php:247
355
- msgid "Yes"
356
- msgstr ""
357
 
358
- #: admin/views/WDIViewFeeds_wdi.php:224 admin/views/WDIViewFeeds_wdi.php:228
359
- #: admin/views/WDIViewFeeds_wdi.php:230 admin/views/WDIViewFeeds_wdi.php:233
360
- #: admin/views/WDIViewFeeds_wdi.php:234 admin/views/WDIViewFeeds_wdi.php:236
361
- #: admin/views/WDIViewFeeds_wdi.php:237 admin/views/WDIViewFeeds_wdi.php:238
362
- #: admin/views/WDIViewFeeds_wdi.php:239 admin/views/WDIViewFeeds_wdi.php:240
363
- #: admin/views/WDIViewFeeds_wdi.php:241 admin/views/WDIViewFeeds_wdi.php:242
364
- #: admin/views/WDIViewFeeds_wdi.php:243 admin/views/WDIViewFeeds_wdi.php:244
365
- #: admin/views/WDIViewFeeds_wdi.php:245 admin/views/WDIViewFeeds_wdi.php:246
366
- #: admin/views/WDIViewFeeds_wdi.php:247
367
- msgid "No"
368
  msgstr ""
369
 
370
  #: admin/views/WDIViewFeeds_wdi.php:225
371
- msgid "Lightbox Width"
372
- msgstr ""
373
 
374
  #: admin/views/WDIViewFeeds_wdi.php:226
375
- msgid "Lightbox Height"
 
 
 
 
 
 
 
 
 
376
  msgstr ""
377
 
378
  #: admin/views/WDIViewFeeds_wdi.php:227
379
- msgid "Lightbox Effect"
380
- msgstr ""
381
 
382
  #: admin/views/WDIViewFeeds_wdi.php:228
383
- msgid "Lightbox autoplay"
384
- msgstr ""
 
385
 
386
  #: admin/views/WDIViewFeeds_wdi.php:229
387
- msgid "Time Interval"
388
  msgstr ""
389
 
390
  #: admin/views/WDIViewFeeds_wdi.php:230
391
- msgid "Enable filmstrip in lightbox"
392
  msgstr ""
393
 
394
  #: admin/views/WDIViewFeeds_wdi.php:231
395
- msgid "Filmstrip size"
396
  msgstr ""
397
 
398
- #: admin/views/WDIViewFeeds_wdi.php:232
399
- msgid "Show Next / Previous Buttons"
400
  msgstr ""
401
 
402
  #: admin/views/WDIViewFeeds_wdi.php:232
403
- msgid "On Hover"
404
  msgstr ""
405
 
406
- #: admin/views/WDIViewFeeds_wdi.php:232
407
- msgid "Always"
408
  msgstr ""
409
 
410
  #: admin/views/WDIViewFeeds_wdi.php:233
411
- msgid "Enable control buttons"
412
  msgstr ""
413
 
414
  #: admin/views/WDIViewFeeds_wdi.php:234
415
- msgid "Enable fullscreen"
416
- msgstr ""
 
 
 
 
417
 
418
  #: admin/views/WDIViewFeeds_wdi.php:235
419
- msgid "Enable info"
420
- msgstr ""
421
 
422
- #: admin/views/WDIViewFeeds_wdi.php:236
423
- msgid "Display info by default"
424
- msgstr ""
 
 
 
 
 
 
 
 
425
 
426
  #: admin/views/WDIViewFeeds_wdi.php:237
427
- msgid "Full width info"
428
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
429
 
430
  #: admin/views/WDIViewFeeds_wdi.php:238
431
- msgid "Enable comments"
432
- msgstr ""
433
 
434
  #: admin/views/WDIViewFeeds_wdi.php:239
435
- msgid "Enable Original Image Display Button"
436
- msgstr ""
437
 
438
  #: admin/views/WDIViewFeeds_wdi.php:240
439
- msgid "Enable Download Button"
440
- msgstr ""
441
 
442
  #: admin/views/WDIViewFeeds_wdi.php:241
443
- msgid "Enable Facebook button"
444
- msgstr ""
445
 
446
  #: admin/views/WDIViewFeeds_wdi.php:242
447
- msgid "Enable Twitter button"
448
- msgstr ""
449
 
450
  #: admin/views/WDIViewFeeds_wdi.php:243
451
- msgid "Enable Google+ button"
452
- msgstr ""
453
 
454
  #: admin/views/WDIViewFeeds_wdi.php:244
455
- msgid "Enable Pinterest button"
456
- msgstr ""
457
 
458
  #: admin/views/WDIViewFeeds_wdi.php:245
459
- msgid "Enable Tumblr button"
460
- msgstr ""
 
 
 
 
 
 
 
 
461
 
462
  #: admin/views/WDIViewFeeds_wdi.php:246
463
- msgid "Show Images Count"
464
- msgstr ""
465
 
466
  #: admin/views/WDIViewFeeds_wdi.php:247
 
 
 
 
467
  msgid "Enable Loop"
468
- msgstr ""
469
 
470
- #: admin/views/WDIViewFeeds_wdi.php:283
471
- msgid "Feed Settings"
472
  msgstr ""
473
 
474
- #: admin/views/WDIViewFeeds_wdi.php:284
475
- msgid "Lightbox Settings"
476
- msgstr ""
477
 
478
- #: admin/views/WDIViewFeeds_wdi.php:317
479
- msgid "Edit feed"
480
- msgstr ""
481
 
482
- #: admin/views/WDIViewFeeds_wdi.php:320
483
- msgid "Add new Feed"
484
- msgstr ""
485
 
486
- #: admin/views/WDIViewFeeds_wdi.php:351
487
- msgid "Add"
488
- msgstr ""
489
 
490
- #: admin/views/WDIViewFeeds_wdi.php:365 admin/views/WDIViewThemes_wdi.php:524
491
- msgid "Save"
492
  msgstr ""
493
 
494
- #: admin/views/WDIViewFeeds_wdi.php:367 admin/views/WDIViewThemes_wdi.php:526
495
- msgid "Apply"
496
- msgstr ""
497
 
498
- #: admin/views/WDIViewFeeds_wdi.php:368 admin/views/WDIViewThemes_wdi.php:527
499
- #: framework/WDILibrary.php:189 framework/WDILibrary.php:717
500
- msgid "Reset"
501
  msgstr ""
502
 
503
- #: admin/views/WDIViewSettings_wdi.php:24
504
- msgid "Instagram WD Settings"
505
- msgstr ""
506
 
507
- #: admin/views/WDIViewSettings_wdi.php:32
508
- msgid "Delete all plugin related data from database"
509
- msgstr ""
510
 
511
- #: admin/views/WDIViewSettings_wdi.php:33
512
- msgid "Uninstall"
513
- msgstr ""
514
 
515
- #: admin/views/WDIViewThemes_wdi.php:38
516
- msgid "This section allows you to create, edit and delete Themes."
517
- msgstr ""
518
 
519
- #: admin/views/WDIViewThemes_wdi.php:39
520
- msgid "Read More in User Manual."
521
- msgstr ""
522
 
523
- #: admin/views/WDIViewThemes_wdi.php:52 instagram-wd.php:156
524
- msgid "Themes"
525
- msgstr ""
526
 
527
- #: admin/views/WDIViewThemes_wdi.php:101 framework/WDILibrary.php:764
528
- msgid "Default"
529
  msgstr ""
530
 
531
- #: admin/views/WDIViewThemes_wdi.php:178
532
- msgid "Theme Name"
533
  msgstr ""
534
 
535
- #: admin/views/WDIViewThemes_wdi.php:180
536
- msgid "Feed Container Width"
537
  msgstr ""
538
 
539
- #: admin/views/WDIViewThemes_wdi.php:180
540
- msgid "Includes all feed elements"
541
- msgstr ""
542
 
543
- #: admin/views/WDIViewThemes_wdi.php:181
544
- msgid "Feed Container Background Color"
545
- msgstr ""
546
 
547
- #: admin/views/WDIViewThemes_wdi.php:182
548
- msgid "Feed Wrapper Width"
549
  msgstr ""
550
 
551
- #: admin/views/WDIViewThemes_wdi.php:182
552
- msgid "Includes only feed images, does not include feed header"
553
  msgstr ""
554
 
555
- #: admin/views/WDIViewThemes_wdi.php:183
556
- msgid "Feed Wrapper Background Color"
557
- msgstr ""
558
 
559
- #: admin/views/WDIViewThemes_wdi.php:184
560
- msgid "Header Margin"
561
- msgstr ""
562
 
563
- #: admin/views/WDIViewThemes_wdi.php:185
564
- msgid "Header Padding"
565
  msgstr ""
566
 
567
- #: admin/views/WDIViewThemes_wdi.php:186
568
- msgid "Header Border Size"
 
 
 
 
569
  msgstr ""
570
 
571
- #: admin/views/WDIViewThemes_wdi.php:187
572
- msgid "Header Border Color"
573
- msgstr ""
574
 
575
- #: admin/views/WDIViewThemes_wdi.php:188
576
- msgid "Header Position"
577
  msgstr ""
578
 
579
- #: admin/views/WDIViewThemes_wdi.php:188 admin/views/WDIViewThemes_wdi.php:208
580
- #: admin/views/WDIViewThemes_wdi.php:223 admin/views/WDIViewThemes_wdi.php:237
581
- #: admin/views/WDIViewThemes_wdi.php:273 admin/views/WDIViewThemes_wdi.php:287
582
- #: admin/views/WDIViewThemes_wdi.php:308
583
- msgid "Left"
584
  msgstr ""
585
 
586
- #: admin/views/WDIViewThemes_wdi.php:188 admin/views/WDIViewThemes_wdi.php:208
587
- #: admin/views/WDIViewThemes_wdi.php:223 admin/views/WDIViewThemes_wdi.php:237
588
- #: admin/views/WDIViewThemes_wdi.php:287
589
- msgid "Center"
590
  msgstr ""
591
 
592
- #: admin/views/WDIViewThemes_wdi.php:188 admin/views/WDIViewThemes_wdi.php:208
593
- #: admin/views/WDIViewThemes_wdi.php:223 admin/views/WDIViewThemes_wdi.php:237
594
- #: admin/views/WDIViewThemes_wdi.php:273 admin/views/WDIViewThemes_wdi.php:287
595
- #: admin/views/WDIViewThemes_wdi.php:308
596
- msgid "Right"
597
  msgstr ""
598
 
599
- #: admin/views/WDIViewThemes_wdi.php:189
600
- msgid "Header Image Width"
601
  msgstr ""
602
 
603
- #: admin/views/WDIViewThemes_wdi.php:190
604
- msgid "Header Border Radius"
605
  msgstr ""
606
 
607
- #: admin/views/WDIViewThemes_wdi.php:191
608
- msgid "Header Text Padding"
609
  msgstr ""
610
 
611
- #: admin/views/WDIViewThemes_wdi.php:192
612
- msgid "Header Text Color"
613
  msgstr ""
614
 
615
- #: admin/views/WDIViewThemes_wdi.php:193
616
- msgid "Header Font Weight"
 
 
 
617
  msgstr ""
618
 
619
- #: admin/views/WDIViewThemes_wdi.php:193
620
- msgid "400 (Normal)"
621
  msgstr ""
622
 
623
- #: admin/views/WDIViewThemes_wdi.php:194
624
- msgid "Header Text Font Size"
625
  msgstr ""
626
 
627
- #: admin/views/WDIViewThemes_wdi.php:195
628
- msgid "Header Text Font Style"
629
- msgstr ""
630
 
631
- #: admin/views/WDIViewThemes_wdi.php:196
632
- msgid "Min Image Width"
633
- msgstr ""
634
 
635
- #: admin/views/WDIViewThemes_wdi.php:197
636
- msgid "Max Image Width"
637
- msgstr ""
 
638
 
639
- #: admin/views/WDIViewThemes_wdi.php:198
640
- msgid "User Horizontal Margin"
641
  msgstr ""
642
 
643
- #: admin/views/WDIViewThemes_wdi.php:199
644
- msgid "User Padding"
645
  msgstr ""
646
 
647
- #: admin/views/WDIViewThemes_wdi.php:200 admin/views/WDIViewThemes_wdi.php:204
648
- msgid "User Border Size"
649
  msgstr ""
650
 
651
- #: admin/views/WDIViewThemes_wdi.php:201
652
- msgid "User Border Color"
653
  msgstr ""
654
 
655
- #: admin/views/WDIViewThemes_wdi.php:202
656
- msgid "User Border Radius"
657
  msgstr ""
658
 
659
- #: admin/views/WDIViewThemes_wdi.php:203
660
- msgid "User Background Color"
661
  msgstr ""
662
 
663
- #: admin/views/WDIViewThemes_wdi.php:205
664
- msgid "Users Border Color"
665
  msgstr ""
666
 
667
- #: admin/views/WDIViewThemes_wdi.php:206
668
- msgid "Users Background Color"
669
  msgstr ""
670
 
671
- #: admin/views/WDIViewThemes_wdi.php:208
672
- msgid "Load More Button Position"
673
  msgstr ""
674
 
675
- #: admin/views/WDIViewThemes_wdi.php:209
676
- msgid "Load More Button Padding"
677
  msgstr ""
678
 
679
- #: admin/views/WDIViewThemes_wdi.php:210
680
- msgid "Load More Background Color"
681
  msgstr ""
682
 
683
- #: admin/views/WDIViewThemes_wdi.php:211
684
- msgid "Load More Button Border Radius"
685
  msgstr ""
686
 
687
- #: admin/views/WDIViewThemes_wdi.php:212
688
- msgid "Load More Button Height"
689
  msgstr ""
690
 
691
- #: admin/views/WDIViewThemes_wdi.php:213
692
- msgid "Load More Button Width"
693
  msgstr ""
694
 
695
- #: admin/views/WDIViewThemes_wdi.php:214
696
- msgid "Load More Button Border Size"
697
  msgstr ""
698
 
699
- #: admin/views/WDIViewThemes_wdi.php:215
700
- msgid "Load More Button Border Color"
701
  msgstr ""
702
 
703
- #: admin/views/WDIViewThemes_wdi.php:216
704
- msgid "Load More Button Text Color"
705
  msgstr ""
706
 
707
- #: admin/views/WDIViewThemes_wdi.php:217
708
- msgid "Load More Button Text Font Size"
709
  msgstr ""
710
 
711
- #: admin/views/WDIViewThemes_wdi.php:218
712
- msgid "Load More Button Hover Color"
713
  msgstr ""
714
 
715
- #: admin/views/WDIViewThemes_wdi.php:219
716
- msgid "Pagination Color"
717
  msgstr ""
718
 
719
- #: admin/views/WDIViewThemes_wdi.php:220
720
- msgid "Pagination Height"
721
  msgstr ""
722
 
723
- #: admin/views/WDIViewThemes_wdi.php:221
724
- msgid "Pagination Button Margins"
725
  msgstr ""
726
 
727
- #: admin/views/WDIViewThemes_wdi.php:222
728
- msgid "Pagination Hover Color"
729
  msgstr ""
730
 
731
- #: admin/views/WDIViewThemes_wdi.php:223
732
- msgid "Pagination Buttons Alignment"
733
  msgstr ""
734
 
735
- #: admin/views/WDIViewThemes_wdi.php:224
736
- msgid "Pagination Buttons Position"
737
  msgstr ""
738
 
739
- #: admin/views/WDIViewThemes_wdi.php:224 admin/views/WDIViewThemes_wdi.php:233
740
- #: admin/views/WDIViewThemes_wdi.php:273 admin/views/WDIViewThemes_wdi.php:286
741
- msgid "Top"
742
  msgstr ""
743
 
744
- #: admin/views/WDIViewThemes_wdi.php:224 admin/views/WDIViewThemes_wdi.php:233
745
- #: admin/views/WDIViewThemes_wdi.php:273 admin/views/WDIViewThemes_wdi.php:286
746
- msgid "Bottom"
747
  msgstr ""
748
 
749
- #: admin/views/WDIViewThemes_wdi.php:227
750
- msgid "Overlay Background Color"
751
  msgstr ""
752
 
753
- #: admin/views/WDIViewThemes_wdi.php:228
754
- msgid "Overlay background transparency"
755
  msgstr ""
756
 
757
- #: admin/views/WDIViewThemes_wdi.php:229
758
- msgid "Lightbox Background Color"
759
  msgstr ""
760
 
761
- #: admin/views/WDIViewThemes_wdi.php:230
762
- msgid "Control Buttons Height"
763
  msgstr ""
764
 
765
- #: admin/views/WDIViewThemes_wdi.php:231
766
- msgid "Control Buttons Margin (top)"
767
- msgstr ""
768
 
769
- #: admin/views/WDIViewThemes_wdi.php:232
770
- msgid "Control Buttons Margin (left)"
771
  msgstr ""
772
 
773
- #: admin/views/WDIViewThemes_wdi.php:233
774
- msgid "Control Buttons Position"
 
 
775
  msgstr ""
776
 
777
- #: admin/views/WDIViewThemes_wdi.php:234
778
- msgid "Control Buttons Background Color"
779
  msgstr ""
780
 
781
- #: admin/views/WDIViewThemes_wdi.php:235
782
- msgid "Control Buttons Container Border Radius"
 
783
  msgstr ""
784
 
785
- #: admin/views/WDIViewThemes_wdi.php:236 admin/views/WDIViewThemes_wdi.php:239
786
- msgid "Control Buttons Transparency"
 
 
787
  msgstr ""
788
 
789
- #: admin/views/WDIViewThemes_wdi.php:237
790
- msgid "Control Buttons Alignment"
 
 
791
  msgstr ""
792
 
793
- #: admin/views/WDIViewThemes_wdi.php:238
794
- msgid "Control Buttons Color"
 
 
795
  msgstr ""
796
 
797
- #: admin/views/WDIViewThemes_wdi.php:241
798
- msgid "Toggle Button Height"
799
  msgstr ""
800
 
801
- #: admin/views/WDIViewThemes_wdi.php:242
802
- msgid "Toggle Button Width"
 
803
  msgstr ""
804
 
805
- #: admin/views/WDIViewThemes_wdi.php:243
806
- msgid "Close Button Border Radius"
807
  msgstr ""
808
 
809
- #: admin/views/WDIViewThemes_wdi.php:244
810
- msgid "Close Button Border Width"
 
811
  msgstr ""
812
 
813
- #: admin/views/WDIViewThemes_wdi.php:245
814
- msgid "Close Button Border Style"
 
815
  msgstr ""
816
 
817
- #: admin/views/WDIViewThemes_wdi.php:246
818
- msgid "Close Button Border Color"
819
  msgstr ""
820
 
821
- #: admin/views/WDIViewThemes_wdi.php:247
822
- msgid "Close Button Box Shadow"
823
  msgstr ""
824
 
825
- #: admin/views/WDIViewThemes_wdi.php:248
826
- msgid "Close Button Background Color"
827
- msgstr ""
828
 
829
- #: admin/views/WDIViewThemes_wdi.php:249
830
- msgid "Close Button Transparency"
831
- msgstr ""
832
 
833
- #: admin/views/WDIViewThemes_wdi.php:250
834
- msgid "Close Button Width"
835
- msgstr ""
836
 
837
- #: admin/views/WDIViewThemes_wdi.php:251
838
- msgid "Close Button Height"
839
- msgstr ""
840
 
841
- #: admin/views/WDIViewThemes_wdi.php:252
842
- msgid "Close Button Top"
843
- msgstr ""
844
 
845
- #: admin/views/WDIViewThemes_wdi.php:253
846
- msgid "Close Button Right"
847
- msgstr ""
848
 
849
- #: admin/views/WDIViewThemes_wdi.php:254
850
- msgid "Close Button Size"
851
- msgstr ""
852
 
853
- #: admin/views/WDIViewThemes_wdi.php:255
854
- msgid "Close Button Color"
855
- msgstr ""
856
 
857
- #: admin/views/WDIViewThemes_wdi.php:256
858
- msgid "Fullscreen Close Button Color"
859
- msgstr ""
860
 
861
- #: admin/views/WDIViewThemes_wdi.php:257
862
- msgid "Share Buttons Color"
863
- msgstr ""
864
 
865
- #: admin/views/WDIViewThemes_wdi.php:259
866
- msgid "Right, Left Buttons Style"
867
- msgstr ""
868
 
869
- #: admin/views/WDIViewThemes_wdi.php:260
870
- msgid "Right, Left Buttons Background Color"
871
- msgstr ""
872
 
873
- #: admin/views/WDIViewThemes_wdi.php:261
874
- msgid "Right, Left Buttons Transparency"
875
- msgstr ""
876
 
877
- #: admin/views/WDIViewThemes_wdi.php:262
878
- msgid "Right, Left Buttons Box Shadow: "
879
- msgstr ""
880
 
881
- #: admin/views/WDIViewThemes_wdi.php:263
882
- msgid "Right, Left Buttons Height"
883
- msgstr ""
884
 
885
- #: admin/views/WDIViewThemes_wdi.php:264
886
- msgid "Right, Left Buttons Width"
887
- msgstr ""
888
 
889
- #: admin/views/WDIViewThemes_wdi.php:265
890
- msgid "Right, Left Buttons Size"
891
- msgstr ""
892
 
893
- #: admin/views/WDIViewThemes_wdi.php:266
894
- msgid "Right, Left, Close Buttons Hover Color"
895
- msgstr ""
896
 
897
- #: admin/views/WDIViewThemes_wdi.php:267
898
- msgid "Right, Left Buttons Color"
899
  msgstr ""
900
 
901
- #: admin/views/WDIViewThemes_wdi.php:268
902
- msgid "Right, Left Buttons Border Radius"
903
  msgstr ""
904
 
905
- #: admin/views/WDIViewThemes_wdi.php:269
906
- msgid "Right, Left Buttons Border Width"
907
  msgstr ""
908
 
909
- #: admin/views/WDIViewThemes_wdi.php:270
910
- msgid "Right, Left Buttons Border Style"
911
- msgstr ""
912
 
913
- #: admin/views/WDIViewThemes_wdi.php:271
914
- msgid "Right, Left Buttons Border Color"
915
  msgstr ""
916
 
917
- #: admin/views/WDIViewThemes_wdi.php:273
918
- msgid "Filmstrip Position"
919
  msgstr ""
920
 
921
- #: admin/views/WDIViewThemes_wdi.php:274
922
- msgid "Filmstrip Thumbnail Margin"
923
  msgstr ""
924
 
925
- #: admin/views/WDIViewThemes_wdi.php:275
926
- msgid "Filmstrip Thumbnail Border Width"
927
  msgstr ""
928
 
929
- #: admin/views/WDIViewThemes_wdi.php:276
930
- msgid "Filmstrip Thumbnail Border Style"
931
  msgstr ""
932
 
933
- #: admin/views/WDIViewThemes_wdi.php:277
934
- msgid "Filmstrip Thumbnail Border Color"
935
- msgstr ""
936
 
937
- #: admin/views/WDIViewThemes_wdi.php:278
938
- msgid "Filmstrip Thumbnail Border Radius"
939
- msgstr ""
940
 
941
- #: admin/views/WDIViewThemes_wdi.php:279
942
- msgid "Filmstrip Thumbnail Active Border Width"
943
- msgstr ""
944
 
945
- #: admin/views/WDIViewThemes_wdi.php:280
946
- msgid "Filmstrip Thumbnail Active Border Color"
947
- msgstr ""
948
 
949
- #: admin/views/WDIViewThemes_wdi.php:281
950
- msgid "Filmstrip Thumbnail Deactive Transparency"
951
- msgstr ""
 
952
 
953
- #: admin/views/WDIViewThemes_wdi.php:282
954
- msgid "Filmstrip Right, Left Buttons Size"
955
- msgstr ""
 
 
 
956
 
957
- #: admin/views/WDIViewThemes_wdi.php:283
958
- msgid "Filmstrip Right, Left Buttons Color"
959
- msgstr ""
 
 
960
 
961
- #: admin/views/WDIViewThemes_wdi.php:284
962
- msgid "Filmstrip Right, Left Button Background Color"
963
- msgstr ""
 
964
 
965
- #: admin/views/WDIViewThemes_wdi.php:286
966
- msgid "Info Position"
967
- msgstr ""
968
 
969
- #: admin/views/WDIViewThemes_wdi.php:287
970
- msgid "Info Alignment"
971
- msgstr ""
 
972
 
973
- #: admin/views/WDIViewThemes_wdi.php:288
974
- msgid "Info Background Color"
975
- msgstr ""
 
976
 
977
- #: admin/views/WDIViewThemes_wdi.php:289
978
- msgid "Info Background Transparency"
979
- msgstr ""
 
980
 
981
- #: admin/views/WDIViewThemes_wdi.php:290
982
- msgid "Info border width"
983
- msgstr ""
 
984
 
985
- #: admin/views/WDIViewThemes_wdi.php:291
986
- msgid "Info Border Style"
987
- msgstr ""
 
988
 
989
- #: admin/views/WDIViewThemes_wdi.php:292
990
- msgid "Info Border Color"
991
- msgstr ""
 
992
 
993
- #: admin/views/WDIViewThemes_wdi.php:293
994
- msgid "Info Border Radius"
995
  msgstr ""
996
 
997
- #: admin/views/WDIViewThemes_wdi.php:294
998
- msgid "Info Padding"
999
- msgstr ""
1000
 
1001
- #: admin/views/WDIViewThemes_wdi.php:295
1002
- msgid "Info Margin"
1003
- msgstr ""
1004
 
1005
- #: admin/views/WDIViewThemes_wdi.php:297
1006
- msgid "Title Font Color"
1007
- msgstr ""
1008
 
1009
- #: admin/views/WDIViewThemes_wdi.php:298
1010
- msgid "Title Font Family"
1011
- msgstr ""
 
1012
 
1013
- #: admin/views/WDIViewThemes_wdi.php:299
1014
- msgid "Title Font Weight"
1015
- msgstr ""
 
 
1016
 
1017
- #: admin/views/WDIViewThemes_wdi.php:300
1018
- msgid "Title Font Size"
1019
- msgstr ""
 
 
1020
 
1021
- #: admin/views/WDIViewThemes_wdi.php:302
1022
- msgid "Description Font Color"
1023
- msgstr ""
1024
 
1025
- #: admin/views/WDIViewThemes_wdi.php:303
1026
- msgid "Description Font Family"
1027
- msgstr ""
1028
 
1029
- #: admin/views/WDIViewThemes_wdi.php:304
1030
- msgid "Description Font Weight"
1031
- msgstr ""
1032
 
1033
- #: admin/views/WDIViewThemes_wdi.php:305
1034
- msgid "Description Font Size"
 
 
1035
  msgstr ""
1036
 
1037
- #: admin/views/WDIViewThemes_wdi.php:307
1038
- msgid "Comments Width"
1039
- msgstr ""
1040
 
1041
- #: admin/views/WDIViewThemes_wdi.php:308
1042
- msgid "Comments Position"
1043
- msgstr ""
1044
 
1045
- #: admin/views/WDIViewThemes_wdi.php:309
1046
- msgid "Comments Background Color"
1047
- msgstr ""
 
1048
 
1049
- #: admin/views/WDIViewThemes_wdi.php:310
1050
- msgid "Comments Font Size"
1051
- msgstr ""
1052
 
1053
- #: admin/views/WDIViewThemes_wdi.php:311
1054
- msgid "Comments Font Color"
1055
- msgstr ""
 
1056
 
1057
- #: admin/views/WDIViewThemes_wdi.php:312
1058
- msgid "Comments Font Family"
1059
- msgstr ""
 
 
 
1060
 
1061
- #: admin/views/WDIViewThemes_wdi.php:313
1062
- msgid "Comments Author Font Size"
1063
- msgstr ""
 
 
 
1064
 
1065
- #: admin/views/WDIViewThemes_wdi.php:314
1066
- msgid "Users and Hashtag Color"
1067
- msgstr ""
 
 
 
1068
 
1069
- #: admin/views/WDIViewThemes_wdi.php:315
1070
- msgid "Users and Hashtag Hover Color"
1071
- msgstr ""
 
 
 
1072
 
1073
- #: admin/views/WDIViewThemes_wdi.php:316
1074
- msgid "Comments Date Font Size"
 
1075
  msgstr ""
1076
 
1077
- #: admin/views/WDIViewThemes_wdi.php:317
1078
- msgid "Comments Body Font Size"
1079
- msgstr ""
1080
 
1081
- #: admin/views/WDIViewThemes_wdi.php:318
1082
- msgid "Comment Input Border Width"
 
 
 
1083
  msgstr ""
 
 
1084
 
1085
- #: admin/views/WDIViewThemes_wdi.php:319
1086
- msgid "Comment Input Border Style"
1087
- msgstr ""
1088
 
1089
- #: admin/views/WDIViewThemes_wdi.php:320
1090
- msgid "Comment Input Border Color"
1091
- msgstr ""
1092
 
1093
- #: admin/views/WDIViewThemes_wdi.php:321
1094
- msgid "Comment Input Border Radius"
1095
- msgstr ""
1096
 
1097
- #: admin/views/WDIViewThemes_wdi.php:322
1098
- msgid "Comment Input Padding"
1099
- msgstr ""
 
1100
 
1101
- #: admin/views/WDIViewThemes_wdi.php:323
1102
- msgid "Comment Input Background Color"
1103
- msgstr ""
1104
 
1105
- #: admin/views/WDIViewThemes_wdi.php:324
1106
- msgid "Comment Button Background Color"
 
 
 
1107
  msgstr ""
 
 
1108
 
1109
- #: admin/views/WDIViewThemes_wdi.php:325
1110
- msgid "Comment Button Padding"
1111
- msgstr ""
1112
 
1113
- #: admin/views/WDIViewThemes_wdi.php:326
1114
- msgid "Comment Button Border Width"
1115
- msgstr ""
1116
 
1117
- #: admin/views/WDIViewThemes_wdi.php:327
1118
- msgid "Comment Button Border Style"
1119
  msgstr ""
1120
 
1121
- #: admin/views/WDIViewThemes_wdi.php:328
1122
- msgid "Comment Button Border Color"
 
1123
  msgstr ""
1124
 
1125
- #: admin/views/WDIViewThemes_wdi.php:329
1126
- msgid "Comment Button Border Radius"
1127
- msgstr ""
1128
 
1129
- #: admin/views/WDIViewThemes_wdi.php:330
1130
- msgid "Comment Separator Width"
1131
  msgstr ""
1132
 
1133
- #: admin/views/WDIViewThemes_wdi.php:331
1134
- msgid "Comment Separator Style"
1135
  msgstr ""
1136
 
1137
- #: admin/views/WDIViewThemes_wdi.php:332
1138
- msgid "Comment Separator Color"
1139
- msgstr ""
1140
 
1141
- #: admin/views/WDIViewThemes_wdi.php:335 admin/views/WDIViewThemes_wdi.php:351
1142
- #: admin/views/WDIViewThemes_wdi.php:367
1143
- msgid "Photo Wrapper Padding"
1144
- msgstr ""
1145
 
1146
- #: admin/views/WDIViewThemes_wdi.php:336 admin/views/WDIViewThemes_wdi.php:352
1147
- #: admin/views/WDIViewThemes_wdi.php:368
1148
- msgid "Photo Wrapper Border Size"
1149
  msgstr ""
1150
 
1151
- #: admin/views/WDIViewThemes_wdi.php:337 admin/views/WDIViewThemes_wdi.php:353
1152
- #: admin/views/WDIViewThemes_wdi.php:369
1153
- msgid "Photo Wrapper Border Color"
1154
- msgstr ""
1155
 
1156
- #: admin/views/WDIViewThemes_wdi.php:338 admin/views/WDIViewThemes_wdi.php:354
1157
- #: admin/views/WDIViewThemes_wdi.php:370
1158
- msgid "Photo border Radius"
1159
- msgstr ""
1160
 
1161
- #: admin/views/WDIViewThemes_wdi.php:339 admin/views/WDIViewThemes_wdi.php:355
1162
- #: admin/views/WDIViewThemes_wdi.php:371
1163
- msgid "Photo Wrapper Background Color"
1164
- msgstr ""
1165
 
1166
- #: admin/views/WDIViewThemes_wdi.php:340 admin/views/WDIViewThemes_wdi.php:356
1167
- #: admin/views/WDIViewThemes_wdi.php:372
1168
- msgid "Photo Meta Background Color"
1169
- msgstr ""
1170
 
1171
- #: admin/views/WDIViewThemes_wdi.php:341 admin/views/WDIViewThemes_wdi.php:357
1172
- #: admin/views/WDIViewThemes_wdi.php:373
1173
- msgid "Same Line For Likes and Comments"
1174
  msgstr ""
1175
 
1176
- #: admin/views/WDIViewThemes_wdi.php:342 admin/views/WDIViewThemes_wdi.php:358
1177
- #: admin/views/WDIViewThemes_wdi.php:374
1178
- msgid "\"Likes\" Text Color"
1179
- msgstr ""
1180
 
1181
- #: admin/views/WDIViewThemes_wdi.php:343 admin/views/WDIViewThemes_wdi.php:359
1182
- #: admin/views/WDIViewThemes_wdi.php:375
1183
- msgid "\"Comments\" Text Color"
1184
- msgstr ""
1185
 
1186
- #: admin/views/WDIViewThemes_wdi.php:344 admin/views/WDIViewThemes_wdi.php:360
1187
- #: admin/views/WDIViewThemes_wdi.php:376
1188
- msgid "Photo Caption Font Size"
1189
- msgstr ""
1190
 
1191
- #: admin/views/WDIViewThemes_wdi.php:345 admin/views/WDIViewThemes_wdi.php:361
1192
- #: admin/views/WDIViewThemes_wdi.php:377
1193
- msgid "Photo Caption Color"
1194
  msgstr ""
1195
 
1196
- #: admin/views/WDIViewThemes_wdi.php:346 admin/views/WDIViewThemes_wdi.php:362
1197
- #: admin/views/WDIViewThemes_wdi.php:378
1198
- msgid "Photo Margin"
1199
  msgstr ""
1200
 
1201
- #: admin/views/WDIViewThemes_wdi.php:347 admin/views/WDIViewThemes_wdi.php:363
1202
- #: admin/views/WDIViewThemes_wdi.php:379
1203
- msgid "Photo Caption Hover Color"
1204
  msgstr ""
1205
 
1206
- #: admin/views/WDIViewThemes_wdi.php:348 admin/views/WDIViewThemes_wdi.php:364
1207
- #: admin/views/WDIViewThemes_wdi.php:380
1208
- msgid "\"Likes\" and \"Comments\" Font Size"
1209
  msgstr ""
1210
 
1211
- #: framework/WDILibrary.php:188 framework/WDILibrary.php:720
1212
- msgid "Search"
1213
  msgstr ""
1214
 
1215
- #: framework/WDILibrary.php:511
1216
- msgid " item(s)"
1217
  msgstr ""
1218
 
1219
- #: framework/WDILibrary.php:516
1220
- msgid "First"
1221
  msgstr ""
1222
 
1223
- #: framework/WDILibrary.php:517
1224
- msgid "Previous"
1225
  msgstr ""
1226
 
1227
- #: framework/WDILibrary.php:518
1228
- msgid "Next"
1229
  msgstr ""
1230
 
1231
- #: framework/WDILibrary.php:519
1232
- msgid "Last"
1233
  msgstr ""
1234
 
1235
- #: framework/WDILibrary.php:537
1236
- msgid "Go to the first page"
1237
  msgstr ""
1238
 
1239
- #: framework/WDILibrary.php:538
1240
- msgid "Go to the previous page"
1241
  msgstr ""
1242
 
1243
- #: framework/WDILibrary.php:540
1244
- msgid "of"
1245
  msgstr ""
1246
 
1247
- #: framework/WDILibrary.php:544
1248
- msgid "Go to the next page"
1249
  msgstr ""
1250
 
1251
- #: framework/WDILibrary.php:545
1252
- msgid "Go to the last page"
1253
  msgstr ""
1254
 
1255
- #: framework/WDILibrary.php:557 frontend/views/WDIViewBlogStyle_view.php:47
1256
- #: frontend/views/WDIViewMasonry_view.php:52
1257
- #: frontend/views/WDIViewThumbnails_view.php:50
1258
- msgid "Load More..."
1259
  msgstr ""
1260
 
1261
- #: framework/WDILibrary.php:762
1262
- msgid "Order by: "
1263
- msgstr ""
1264
 
1265
- #: framework/WDILibrary.php:765
1266
- msgid "Filename"
1267
- msgstr ""
1268
 
1269
- #: framework/WDILibrary.php:766
1270
- msgid "Size"
1271
- msgstr ""
1272
 
1273
- #: framework/WDI_admin_view.php:711
1274
- msgid "Preview"
1275
- msgstr ""
1276
 
1277
- #: frontend/shortcode.php:28
1278
- msgid "Invalid shortcode"
1279
- msgstr ""
1280
 
1281
- #: frontend/shortcode.php:43
1282
- msgid "Access Token is invalid, please get it again"
1283
- msgstr ""
1284
 
1285
- #: frontend/shortcode.php:47
1286
- msgid "Feed Doesn't exists"
1287
- msgstr ""
1288
 
1289
- #: frontend/shortcode.php:67
1290
- msgid "Unable to display unpublished feed"
1291
- msgstr ""
1292
 
1293
- #: frontend/shortcode.php:97
1294
- msgid "Invalid feed type"
1295
- msgstr ""
1296
 
1297
- #: frontend/shortcode.php:144
1298
- msgid "Field is required."
1299
- msgstr ""
1300
 
1301
- #: frontend/shortcode.php:145 frontend/views/WDIViewGalleryBox.php:1225
1302
- msgid "This is not a valid email address."
1303
- msgstr ""
1304
 
1305
- #: frontend/shortcode.php:146
1306
- msgid "There are no images matching your search."
1307
- msgstr ""
1308
 
1309
- #: frontend/views/WDIViewBlogStyle_view.php:39
1310
- #: frontend/views/WDIViewBlogStyle_view.php:52
1311
- #: frontend/views/WDIViewMasonry_view.php:39
1312
- #: frontend/views/WDIViewMasonry_view.php:57
1313
- #: frontend/views/WDIViewThumbnails_view.php:42
1314
- #: frontend/views/WDIViewThumbnails_view.php:55
1315
- msgid "First Page"
1316
- msgstr ""
1317
 
1318
- #: frontend/views/WDIViewBlogStyle_view.php:39
1319
- #: frontend/views/WDIViewBlogStyle_view.php:52
1320
- #: frontend/views/WDIViewMasonry_view.php:39
1321
- #: frontend/views/WDIViewMasonry_view.php:57
1322
- #: frontend/views/WDIViewThumbnails_view.php:42
1323
- #: frontend/views/WDIViewThumbnails_view.php:55
1324
- msgid "Previous Page"
1325
- msgstr ""
1326
 
1327
- #: frontend/views/WDIViewBlogStyle_view.php:39
1328
- #: frontend/views/WDIViewBlogStyle_view.php:52
1329
- #: frontend/views/WDIViewMasonry_view.php:39
1330
- #: frontend/views/WDIViewMasonry_view.php:57
1331
- #: frontend/views/WDIViewThumbnails_view.php:42
1332
- #: frontend/views/WDIViewThumbnails_view.php:55
1333
- msgid "Next Page"
1334
- msgstr ""
1335
 
1336
- #: frontend/views/WDIViewBlogStyle_view.php:39
1337
- #: frontend/views/WDIViewBlogStyle_view.php:52
1338
- #: frontend/views/WDIViewMasonry_view.php:39
1339
- #: frontend/views/WDIViewMasonry_view.php:57
1340
- #: frontend/views/WDIViewThumbnails_view.php:42
1341
- #: frontend/views/WDIViewThumbnails_view.php:55
1342
- msgid "Last Page"
1343
- msgstr ""
1344
 
1345
- #: frontend/views/WDIViewGalleryBox.php:921
1346
- msgid "The image has been deleted."
1347
- msgstr ""
1348
 
1349
- #: frontend/views/WDIViewGalleryBox.php:942
1350
- #: frontend/views/WDIViewGalleryBox.php:2692
1351
- msgid "Play"
1352
- msgstr ""
1353
 
1354
- #: frontend/views/WDIViewGalleryBox.php:946
1355
- #: frontend/views/WDIViewGalleryBox.php:2000
1356
- #: frontend/views/WDIViewGalleryBox.php:2520
1357
- #: frontend/views/WDIViewGalleryBox.php:2616
1358
- msgid "Maximize"
1359
- msgstr ""
1360
 
1361
- #: frontend/views/WDIViewGalleryBox.php:950
1362
- #: frontend/views/WDIViewGalleryBox.php:2002
1363
- #: frontend/views/WDIViewGalleryBox.php:2618
1364
- msgid "Fullscreen"
1365
- msgstr ""
1366
 
1367
- #: frontend/views/WDIViewGalleryBox.php:952
1368
- #: frontend/views/WDIViewGalleryBox.php:2392
1369
- msgid "Show info"
1370
- msgstr ""
1371
 
1372
- #: frontend/views/WDIViewGalleryBox.php:954
1373
- msgid "Show comments"
1374
- msgstr ""
1375
 
1376
- #: frontend/views/WDIViewGalleryBox.php:956
1377
- #: frontend/views/WDIViewGalleryBox.php:2403
1378
- msgid "Show rating"
1379
- msgstr ""
1380
 
1381
- #: frontend/views/WDIViewGalleryBox.php:962
1382
- #: frontend/views/WDIViewGalleryBox.php:963
1383
- msgid "Share on Facebook"
1384
- msgstr ""
1385
 
1386
- #: frontend/views/WDIViewGalleryBox.php:969
1387
- #: frontend/views/WDIViewGalleryBox.php:970
1388
- msgid "Share on Twitter"
1389
- msgstr ""
1390
 
1391
- #: frontend/views/WDIViewGalleryBox.php:976
1392
- #: frontend/views/WDIViewGalleryBox.php:977
1393
- msgid "Share on Google+"
1394
- msgstr ""
1395
 
1396
- #: frontend/views/WDIViewGalleryBox.php:983
1397
- #: frontend/views/WDIViewGalleryBox.php:984
1398
- msgid "Share on Pinterest"
1399
- msgstr ""
1400
 
1401
- #: frontend/views/WDIViewGalleryBox.php:990
1402
- #: frontend/views/WDIViewGalleryBox.php:991
1403
- msgid "Share on Tumblr"
1404
- msgstr ""
1405
 
1406
- #: frontend/views/WDIViewGalleryBox.php:998
1407
- msgid "Open image in Instagram."
1408
- msgstr ""
1409
 
1410
- #: frontend/views/WDIViewGalleryBox.php:1026
1411
- msgid "Download original image"
1412
- msgstr ""
1413
 
1414
- #: frontend/views/WDIViewGalleryBox.php:1218
1415
- msgid "Error. Incorrect Verification Code."
1416
- msgstr ""
1417
 
1418
- #: frontend/views/WDIViewGalleryBox.php:1233
1419
- #: frontend/views/WDIViewGalleryBox.php:2214
1420
- msgid "Hide Comments"
1421
- msgstr ""
1422
 
1423
- #: frontend/views/WDIViewGalleryBox.php:1244
1424
- #: frontend/views/WDIViewGalleryBox.php:1266
1425
- #: frontend/views/WDIViewGalleryBox.php:1273
1426
- msgid "Email"
1427
- msgstr ""
1428
 
1429
- #: frontend/views/WDIViewGalleryBox.php:1251
1430
- #: frontend/views/WDIViewGalleryBox.php:1266
1431
- #: frontend/views/WDIViewGalleryBox.php:1273
1432
- msgid "Comment"
1433
- msgstr ""
1434
 
1435
- #: frontend/views/WDIViewGalleryBox.php:1256
1436
- msgid "Verification Code"
1437
- msgstr ""
1438
 
1439
- #: frontend/views/WDIViewGalleryBox.php:1279
1440
- msgid "Submit"
1441
- msgstr ""
1442
 
1443
- #: frontend/views/WDIViewGalleryBox.php:1280
1444
- msgid "Your comment is awaiting moderation"
1445
- msgstr ""
1446
 
1447
- #: frontend/views/WDIViewGalleryBox.php:2388
1448
- msgid "Hide info"
1449
- msgstr ""
1450
 
1451
- #: frontend/views/WDIViewGalleryBox.php:2399
1452
- msgid "Hide rating"
1453
- msgstr ""
1454
 
1455
- #: frontend/views/WDIViewGalleryBox.php:2557
1456
- #: frontend/views/WDIViewGalleryBox.php:2765
1457
- msgid "Restore"
1458
- msgstr ""
1459
 
1460
- #: frontend/views/WDIViewGalleryBox.php:2671
1461
- msgid "Exit Fullscreen"
1462
- msgstr ""
1463
 
1464
- #: frontend/views/WDIViewGalleryBox.php:2686
1465
- #: frontend/views/WDIViewGalleryBox.php:2703
1466
- msgid "Pause"
1467
- msgstr ""
1468
 
1469
- #: instagram-wd.php:126
1470
- msgid "Configure"
1471
- msgstr ""
1472
 
1473
- #: instagram-wd.php:154
1474
- msgid "Instagram WDI"
1475
- msgstr ""
1476
 
1477
- #: instagram-wd.php:157
1478
- msgid "Settings"
1479
- msgstr ""
1480
 
1481
- #: instagram-wd.php:216
1482
- msgid "All the data will be removed from the database. Continue?"
1483
- msgstr ""
1484
 
1485
- #: instagram-wd.php:217
1486
- msgid "Some error with instagram servers, try agian later :("
1487
- msgstr ""
1488
 
1489
- #: instagram-wd.php:218
1490
- msgid "Invalid user:"
1491
- msgstr ""
1492
 
1493
- #: instagram-wd.php:219
1494
- msgid "Already added!"
1495
- msgstr ""
1496
 
1497
- #: instagram-wd.php:220
1498
- msgid "User does not exist."
1499
- msgstr ""
1500
 
1501
- #: instagram-wd.php:221
1502
- msgid "Network Error, please try again later. :("
1503
- msgstr ""
1504
 
1505
- #: instagram-wd.php:222
1506
- msgid "Invalid hashtag"
1507
- msgstr ""
1508
 
1509
- #: instagram-wdi-notices.php:200
1510
- msgid "Leave A Review?"
1511
- msgstr ""
1512
 
1513
- #: instagram-wdi-notices.php:201
1514
- #, php-format
1515
- msgid ""
1516
- "We hope you've enjoyed using WordPress %s! Would you consider leaving us a "
1517
- "review on WordPress.org?"
1518
- msgstr ""
1519
 
1520
- #: instagram-wdi-notices.php:202
1521
- msgid "Sure! I'd love to!"
1522
- msgstr ""
1523
 
1524
- #: instagram-wdi-notices.php:203
1525
- msgid "I've already left a review"
1526
- msgstr ""
1527
 
1528
- #: instagram-wdi-notices.php:204
1529
- msgid "Maybe Later"
1530
- msgstr ""
1531
 
1532
- #: instagram-wdi-notices.php:205 instagram-wdi-notices.php:215
1533
- msgid "Never show again"
1534
- msgstr ""
1535
 
1536
- #: instagram-wdi-notices.php:211
1537
- msgid "Hey! How's It Going?"
1538
- msgstr ""
1539
 
1540
- #: instagram-wdi-notices.php:212
1541
- #, php-format
1542
- msgid ""
1543
- "Thank you for using WordPress %s! We hope that you've found everything you "
1544
- "need, but if you have any questions:"
1545
- msgstr ""
1546
 
1547
- #: instagram-wdi-notices.php:213
1548
- msgid "Check out User Guide"
1549
- msgstr ""
1550
 
1551
- #: instagram-wdi-notices.php:214
1552
- msgid "Get Some Help"
1553
- msgstr ""
1554
 
1555
- #: update/update.php:22
1556
- msgid "Instagram WD description."
1557
- msgstr ""
1558
 
1559
- #: update/update.php:78
1560
- msgid "Updates"
1561
- msgstr ""
1562
 
1563
- #: update/update.php:116
1564
- #, php-format
1565
- msgid ""
1566
- "You can download the latest version of your plugins from your %s account.\n"
1567
- " After deactivate and delete the current version.\n"
1568
- " Install the downloaded latest version of the plugin."
1569
- msgstr ""
1570
 
1571
- #: update/update.php:152
1572
- #, php-format
1573
- msgid "Current version %s"
1574
- msgstr ""
1575
 
1576
- #: update/update.php:158 update/update.php:230
1577
- #, php-format
1578
- msgid "There is a new %s version"
1579
- msgstr ""
1580
 
1581
- #: update/update.php:160 update/update.php:212
1582
- msgid "What's new:"
1583
- msgstr ""
1584
 
1585
- #: update/update.php:177 update/update.php:253
1586
- msgid "More updates"
1587
- msgstr ""
1588
 
1589
- #: update/update.php:182 update/update.php:217
1590
- #, php-format
1591
- msgid "%s is up to date."
1592
- msgstr ""
1593
 
1594
- #: update/update.php:250
1595
- msgid "Show less"
1596
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1597
 
1598
  #~ msgid "Close Button: "
1599
  #~ msgstr "Кнопка Закрыть"
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: \n"
4
+ "POT-Creation-Date: 2016-01-18 12:02+0400\n"
5
+ "PO-Revision-Date: 2016-01-18 12:03+0400\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "Language: ru\n"
16
  "X-Poedit-KeywordsList: _e;__\n"
17
  "X-Poedit-SearchPath-0: .\n"
18
 
19
+ #: admin-functions.php:30
20
  msgid "Succesfully Uninstalled!"
21
+ msgstr "Установка успешна!"
22
 
23
+ #: admin-functions.php:36
24
  msgid "Already Unistalled"
25
+ msgstr "Уже удалено"
26
 
27
+ #: admin-functions.php:453
28
+ msgid ""
29
+ "You need Access Token for using plugin, click sign in with Instagram button "
30
+ "above to get yours"
31
  msgstr ""
32
 
33
+ #: admin-functions.php:529
34
  msgid "Access Token"
35
+ msgstr "Токен доступа"
36
 
37
+ #: admin-functions.php:530 admin/views/WDIViewFeeds_wdi.php:413
38
  msgid "Username"
39
+ msgstr "Имя пользователя"
40
+
41
+ #: admin-functions.php:532
42
+ msgid "Custom CSS"
43
+ msgstr ""
44
+
45
+ #: admin-functions.php:533
46
+ msgid "Custom JavaScript"
47
  msgstr ""
48
 
49
+ #: admin-functions.php:588
50
  msgid "Database error, please uninstall the plugin and install again"
51
+ msgstr "Ошибка базы данных, пожалуйста, удалите плагин и установите его заново"
52
+
53
+ #: admin/controllers/WDIControllerFeeds_wdi.php:167
54
+ #: admin/controllers/WDIControllerFeeds_wdi.php:197
55
+ #: admin/controllers/WDIControllerFeeds_wdi.php:232
56
+ #: admin/controllers/WDIControllerThemes_wdi.php:341
57
+ msgid "Cannot Write on database"
58
+ msgstr "Невозможно записать в базу данных"
59
+
60
+ #: admin/controllers/WDIControllerFeeds_wdi.php:172
61
+ #: admin/controllers/WDIControllerFeeds_wdi.php:205
62
+ #: admin/controllers/WDIControllerFeeds_wdi.php:240
63
+ msgid "You have not made new changes"
64
+ msgstr "Вы не внесли никаких изменений"
65
+
66
+ #: admin/controllers/WDIControllerFeeds_wdi.php:174
67
+ msgid "Successfully saved"
68
  msgstr ""
69
 
70
+ #: admin/controllers/WDIControllerFeeds_wdi.php:208
71
+ msgid "Changes have been successfully applied"
72
  msgstr ""
73
 
74
+ #: admin/controllers/WDIControllerFeeds_wdi.php:243
75
+ msgid "Feed successfully reseted"
 
76
  msgstr ""
77
 
78
+ #: admin/controllers/WDIControllerFeeds_wdi.php:258
79
+ msgid "Item Succesfully Duplicated."
80
+ msgstr "Элемент успешно дублирован"
81
+
82
+ #: admin/controllers/WDIControllerFeeds_wdi.php:281
83
+ #: admin/controllers/WDIControllerThemes_wdi.php:375
84
+ msgid "Item Succesfully Deleted."
85
+ msgstr "Элемент успешно удален."
86
+
87
+ #: admin/controllers/WDIControllerFeeds_wdi.php:284
88
+ #: admin/controllers/WDIControllerFeeds_wdi.php:316
89
+ #: admin/controllers/WDIControllerFeeds_wdi.php:353
90
+ #: admin/controllers/WDIControllerThemes_wdi.php:378
91
  msgid "Error. Please install plugin again."
92
+ msgstr "Ошибка. Пожалуйста, переустановите плагин."
93
 
94
+ #: admin/controllers/WDIControllerFeeds_wdi.php:301
95
+ #: admin/controllers/WDIControllerThemes_wdi.php:407
96
  msgid "Items Succesfully Deleted."
97
+ msgstr "Элемент успешно удален."
98
 
99
+ #: admin/controllers/WDIControllerFeeds_wdi.php:304
100
+ #: admin/controllers/WDIControllerFeeds_wdi.php:341
101
+ #: admin/controllers/WDIControllerFeeds_wdi.php:378
102
+ #: admin/controllers/WDIControllerThemes_wdi.php:411
103
  msgid "You must select at least one item."
104
+ msgstr "Вы должны выбрать хотя бы один элемент."
105
 
106
+ #: admin/controllers/WDIControllerFeeds_wdi.php:313
107
  msgid "Item Succesfully Published."
108
+ msgstr "Элемент успешно опубликован."
109
 
110
+ #: admin/controllers/WDIControllerFeeds_wdi.php:338
111
  msgid "Items Succesfully Published."
112
+ msgstr "Элементы успешно опубликованы."
113
 
114
+ #: admin/controllers/WDIControllerFeeds_wdi.php:350
115
  msgid "Item Succesfully Unpublished."
116
+ msgstr "Публикация элемента успешно отменена."
117
 
118
+ #: admin/controllers/WDIControllerFeeds_wdi.php:375
119
  msgid "Items Succesfully Unpublished."
120
+ msgstr "Публикация элементов успешно отменена."
 
 
 
 
 
 
 
121
 
122
+ #: admin/controllers/WDIControllerThemes_wdi.php:338
 
 
 
 
 
 
123
  msgid "Please select at least one item"
124
+ msgstr "Пожалуйста, выберите хотя бы один элемент."
125
 
126
+ #: admin/controllers/WDIControllerThemes_wdi.php:343
127
  msgid "Items Succesfully Duplicated."
128
+ msgstr "Элементы успешно дублированы."
129
 
130
+ #: admin/controllers/WDIControllerThemes_wdi.php:381
131
+ #: admin/controllers/WDIControllerThemes_wdi.php:402
132
  msgid "You cannot delete default theme."
133
+ msgstr "Вы не можете удалить стандартную тему"
134
 
135
  #: admin/controllers/WDIControllerWidget.php:22
136
  msgid "Show your instagram feeds in your widget area"
137
+ msgstr "Показ Ваших фидов Инстаграм в области виджетов"
138
 
139
  #: admin/controllers/WDIControllerWidget.php:27
140
  msgid "Instagram WD Widget"
141
+ msgstr "Instagram WD Widget"
142
 
143
  #: admin/views/WDIViewEditorShortcode.php:100
144
  msgid "Select Feed:"
145
+ msgstr "Выбрать фид:"
146
 
147
+ #: admin/views/WDIViewFeeds_wdi.php:39
148
+ msgid "This Section Allows You to Add/Edit Feeds"
149
  msgstr ""
150
 
151
+ #: admin/views/WDIViewFeeds_wdi.php:40 admin/views/WDIViewFeeds_wdi.php:330
152
+ #: admin/views/WDIViewSettings_wdi.php:40 admin/views/WDIViewThemes_wdi.php:31
153
  msgid "Read More in User Manual"
154
+ msgstr "Подробнее в руководстве пользователя"
155
 
156
+ #: admin/views/WDIViewFeeds_wdi.php:54 wd-instagram-feed.php:153
157
  msgid "Feeds"
158
+ msgstr "Фиды"
159
 
160
+ #: admin/views/WDIViewFeeds_wdi.php:58
161
  msgid "Add new"
162
+ msgstr "Добавить"
163
 
164
+ #: admin/views/WDIViewFeeds_wdi.php:63
165
  msgid "Select All"
166
+ msgstr "Выбрать все"
167
 
168
+ #: admin/views/WDIViewFeeds_wdi.php:77 admin/views/WDIViewFeeds_wdi.php:98
169
+ #: frontend/views/WDIViewGalleryBox.php:1348
170
+ #: frontend/views/WDIViewGalleryBox.php:1376
171
+ #: frontend/views/WDIViewGalleryBox.php:1383
 
172
  msgid "Name"
173
+ msgstr "Название"
174
 
175
+ #: admin/views/WDIViewFeeds_wdi.php:92
176
  msgid "Feed"
177
+ msgstr "Фид"
178
 
179
+ #: admin/views/WDIViewFeeds_wdi.php:101
180
  msgid "Shortcode"
181
+ msgstr "Шорткод"
182
 
183
+ #: admin/views/WDIViewFeeds_wdi.php:102
184
  msgid "PHP function"
185
+ msgstr "Функция PHP"
186
 
187
+ #: admin/views/WDIViewFeeds_wdi.php:108
188
  msgid "Published"
189
+ msgstr "Опубликовано"
190
 
191
+ #: admin/views/WDIViewFeeds_wdi.php:111
192
  msgid "Edit"
193
+ msgstr "Редактировать"
194
 
195
+ #: admin/views/WDIViewFeeds_wdi.php:112
196
  msgid "Delete"
197
+ msgstr "Удалить"
198
 
199
+ #: admin/views/WDIViewFeeds_wdi.php:209
200
  msgid "Feed Name"
201
+ msgstr "Название фида"
202
 
203
+ #: admin/views/WDIViewFeeds_wdi.php:209
204
  msgid "The name of your feed which can be displayed in feed's header section"
205
+ msgstr "Название Вашего фида, которое будет отображаться в секции заголовка"
206
+
207
+ #: admin/views/WDIViewFeeds_wdi.php:210
208
+ msgid "Changing Theme is Available Only in PRO version"
209
  msgstr ""
210
 
211
+ #: admin/views/WDIViewFeeds_wdi.php:210
212
  msgid "Theme"
213
+ msgstr "Тема"
214
 
215
+ #: admin/views/WDIViewFeeds_wdi.php:210
216
  msgid "The theme of your feed, you can create themes in themes menu"
217
+ msgstr "Тема Вашего фида (Вы можете создавать темы в меню тем)"
218
 
219
+ #: admin/views/WDIViewFeeds_wdi.php:211
220
  msgid "Feed Usernames and Hashtags"
221
+ msgstr "Имена пользователей и хештеги"
222
 
223
+ #: admin/views/WDIViewFeeds_wdi.php:211
224
  msgid ""
225
  "Enter usernames or hashtags to your feed, hashtags must start with #, "
226
  "username's shouldn't start with @"
227
  msgstr ""
228
+ "Введите имя пользователя или хештег Вашего фида (хештег должен начинаться с "
229
+ "символа #, а имя пользователя - @)"
230
 
231
+ #: admin/views/WDIViewFeeds_wdi.php:212
232
+ msgid "Featured Image"
233
  msgstr ""
234
 
235
+ #: admin/views/WDIViewFeeds_wdi.php:212
236
+ msgid "Select Featured Image For Header Section"
237
  msgstr ""
238
 
239
+ #: admin/views/WDIViewFeeds_wdi.php:213
240
+ msgid "Feed Display Type"
241
+ msgstr "Тип отображения фида"
242
+
243
+ #: admin/views/WDIViewFeeds_wdi.php:213
244
+ msgid "Pagination"
245
+ msgstr "Нумерация страниц"
246
+
247
+ #: admin/views/WDIViewFeeds_wdi.php:213
248
  msgid "Load More Button"
249
+ msgstr "Кнопка \"Загрузить еще\""
250
 
251
+ #: admin/views/WDIViewFeeds_wdi.php:213
252
  msgid "Infinite Scroll"
253
+ msgstr "Бесконечная прокрутка"
254
+
255
+ #: admin/views/WDIViewFeeds_wdi.php:213
256
+ msgid "This Feature is Available in PRO version"
257
  msgstr ""
258
 
259
+ #: admin/views/WDIViewFeeds_wdi.php:213
260
  msgid "How to load and display new images"
261
+ msgstr "Как загрузить и отобразить новые картинки"
262
 
263
+ #: admin/views/WDIViewFeeds_wdi.php:214
264
  msgid "Sort Images By"
265
+ msgstr "Сортировать картинки по"
266
 
267
+ #: admin/views/WDIViewFeeds_wdi.php:214
268
  msgid "Date"
269
+ msgstr "Дате"
270
 
271
+ #: admin/views/WDIViewFeeds_wdi.php:214
272
  msgid "Likes"
273
+ msgstr "Лайкам"
274
 
275
+ #: admin/views/WDIViewFeeds_wdi.php:214
276
  msgid "Comments"
277
+ msgstr "Комментариям"
278
 
279
+ #: admin/views/WDIViewFeeds_wdi.php:214 framework/WDILibrary.php:767
280
  msgid "Random"
281
+ msgstr "Случайно"
282
 
283
+ #: admin/views/WDIViewFeeds_wdi.php:214
284
  msgid "How to sort images"
285
+ msgstr "Как сортировать картинки"
286
 
287
+ #: admin/views/WDIViewFeeds_wdi.php:215
288
  msgid "Order By"
289
+ msgstr "Сортировать по"
290
 
291
+ #: admin/views/WDIViewFeeds_wdi.php:215
292
  msgid "Sorting order either Ascending or Descending"
293
+ msgstr "Восходящая или нисходящая сортировка"
294
 
295
+ #: admin/views/WDIViewFeeds_wdi.php:216
296
+ msgid "Follow on Instagram Button"
297
  msgstr ""
298
 
299
+ #: admin/views/WDIViewFeeds_wdi.php:217
300
  msgid "Display Header"
301
+ msgstr "Заголовок"
302
 
303
+ #: admin/views/WDIViewFeeds_wdi.php:217
304
  msgid "Displays feed's header, header includes feed name and feed users"
305
  msgstr ""
306
+ "Отображает заголовок фида, который содержит название фида и имя пользователя"
307
 
308
+ #: admin/views/WDIViewFeeds_wdi.php:218
309
  msgid "Number of Photos to Display"
310
+ msgstr "Количество отображаемых фото"
311
 
312
+ #: admin/views/WDIViewFeeds_wdi.php:218
313
  msgid "Number of images to load when page loads first time"
314
+ msgstr "Количество загружаемых изображений при загрузке страницы"
315
 
316
+ #: admin/views/WDIViewFeeds_wdi.php:219
317
  msgid "Number of Photos to Load"
318
+ msgstr "Количество загружаемых фото"
319
 
320
+ #: admin/views/WDIViewFeeds_wdi.php:219
321
  msgid ""
322
  "Number of images to load when clicking load more button or triggering "
323
  "infinite scroll"
324
  msgstr ""
325
+ "Количество загружаемых изображений по нажатию кнопки \"Загрузить еще\" или "
326
+ "при бесконечной прокрутке"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
327
 
328
  #: admin/views/WDIViewFeeds_wdi.php:220
329
+ msgid "Number of Images Per Page"
330
  msgstr ""
331
 
332
+ #: admin/views/WDIViewFeeds_wdi.php:220
333
+ msgid "Number Of Images To Show On Each Pagination Page"
334
  msgstr ""
335
 
336
  #: admin/views/WDIViewFeeds_wdi.php:221
337
+ msgid "Number of Pages To Preload"
338
  msgstr ""
339
 
340
+ #: admin/views/WDIViewFeeds_wdi.php:221 admin/views/WDIViewFeeds_wdi.php:222
341
+ msgid "This Will Preload Images For Pagination"
342
  msgstr ""
343
 
344
  #: admin/views/WDIViewFeeds_wdi.php:222
345
+ msgid "Number of Images To Preload"
346
  msgstr ""
347
 
348
+ #: admin/views/WDIViewFeeds_wdi.php:223
349
+ msgid "Number of Images To Load Each Time"
350
  msgstr ""
351
 
352
+ #: admin/views/WDIViewFeeds_wdi.php:223
353
+ msgid "Number Of Photos To Load on Each Load"
354
  msgstr ""
355
 
356
  #: admin/views/WDIViewFeeds_wdi.php:224
357
+ msgid "Number of Columns"
358
+ msgstr "Количество колонок"
359
 
360
+ #: admin/views/WDIViewFeeds_wdi.php:224
361
+ msgid "Feed item's column count"
362
+ msgstr "Счетчик колонок элементов фида"
 
 
 
 
 
 
 
 
363
 
364
+ #: admin/views/WDIViewFeeds_wdi.php:225
365
+ msgid "Sort Again Whole Feed After Loading New Images"
 
 
 
 
 
 
 
 
366
  msgstr ""
367
 
368
  #: admin/views/WDIViewFeeds_wdi.php:225
369
+ msgid "Sort both newly loaded and existing images alltogether"
370
+ msgstr "Сортировать и новые, и уже загруженные картинки вместе"
371
 
372
  #: admin/views/WDIViewFeeds_wdi.php:226
373
+ msgid "Show Likes"
374
+ msgstr "Показать лайки"
375
+
376
+ #: admin/views/WDIViewFeeds_wdi.php:226 admin/views/WDIViewFeeds_wdi.php:227
377
+ #: admin/views/WDIViewFeeds_wdi.php:228 admin/views/WDIViewFeeds_wdi.php:229
378
+ #: admin/views/WDIViewFeeds_wdi.php:243 admin/views/WDIViewFeeds_wdi.php:244
379
+ #: admin/views/WDIViewFeeds_wdi.php:246 admin/views/WDIViewFeeds_wdi.php:247
380
+ #: admin/views/WDIViewFeeds_wdi.php:251 admin/views/WDIViewFeeds_wdi.php:253
381
+ #: admin/views/WDIViewFeeds_wdi.php:256
382
+ msgid "This Feature is Available Only in PRO version"
383
  msgstr ""
384
 
385
  #: admin/views/WDIViewFeeds_wdi.php:227
386
+ msgid "Show Description"
387
+ msgstr "Показать описание"
388
 
389
  #: admin/views/WDIViewFeeds_wdi.php:228
390
+ #: frontend/views/WDIViewGalleryBox.php:2333
391
+ msgid "Show Comments"
392
+ msgstr "Показать комментарии"
393
 
394
  #: admin/views/WDIViewFeeds_wdi.php:229
395
+ msgid "Show Username On Image Thumb"
396
  msgstr ""
397
 
398
  #: admin/views/WDIViewFeeds_wdi.php:230
399
+ msgid "Show User Data"
400
  msgstr ""
401
 
402
  #: admin/views/WDIViewFeeds_wdi.php:231
403
+ msgid "Display User Bio"
404
  msgstr ""
405
 
406
+ #: admin/views/WDIViewFeeds_wdi.php:231
407
+ msgid "User bio will be displayed if feed has only one user"
408
  msgstr ""
409
 
410
  #: admin/views/WDIViewFeeds_wdi.php:232
411
+ msgid "Display User Posts and Followers count"
412
  msgstr ""
413
 
414
+ #: admin/views/WDIViewFeeds_wdi.php:233
415
+ msgid "Show Full Description"
416
  msgstr ""
417
 
418
  #: admin/views/WDIViewFeeds_wdi.php:233
419
+ msgid "Discription will be shown no matter how long it is"
420
  msgstr ""
421
 
422
  #: admin/views/WDIViewFeeds_wdi.php:234
423
+ msgid "Disable Mobile Layout"
424
+ msgstr "Отключить мобильную раскладку"
425
+
426
+ #: admin/views/WDIViewFeeds_wdi.php:234
427
+ msgid "Column number stays the same in all screens"
428
+ msgstr "Количество колонок остается одинаковым на всех экранах"
429
 
430
  #: admin/views/WDIViewFeeds_wdi.php:235
431
+ msgid "Image Onclick"
432
+ msgstr "Действие по клику на картинке"
433
 
434
+ #: admin/views/WDIViewFeeds_wdi.php:235
435
+ msgid "Open Lightbox"
436
+ msgstr "Открыть лайтбокс"
437
+
438
+ #: admin/views/WDIViewFeeds_wdi.php:235
439
+ msgid "Redirect To Instagram"
440
+ msgstr "Перейти в Инстаграм"
441
+
442
+ #: admin/views/WDIViewFeeds_wdi.php:235
443
+ msgid "Do Nothing"
444
+ msgstr "Ничего не делать"
445
 
446
  #: admin/views/WDIViewFeeds_wdi.php:237
447
+ msgid "Full width lightbox"
448
+ msgstr "Полная ширина лайтбокса"
449
+
450
+ #: admin/views/WDIViewFeeds_wdi.php:237 admin/views/WDIViewFeeds_wdi.php:241
451
+ #: admin/views/WDIViewFeeds_wdi.php:243 admin/views/WDIViewFeeds_wdi.php:246
452
+ #: admin/views/WDIViewFeeds_wdi.php:247 admin/views/WDIViewFeeds_wdi.php:248
453
+ #: admin/views/WDIViewFeeds_wdi.php:249 admin/views/WDIViewFeeds_wdi.php:250
454
+ #: admin/views/WDIViewFeeds_wdi.php:252 admin/views/WDIViewFeeds_wdi.php:253
455
+ #: admin/views/WDIViewFeeds_wdi.php:254 admin/views/WDIViewFeeds_wdi.php:255
456
+ #: admin/views/WDIViewFeeds_wdi.php:256 admin/views/WDIViewFeeds_wdi.php:257
457
+ #: admin/views/WDIViewFeeds_wdi.php:258 admin/views/WDIViewFeeds_wdi.php:259
458
+ #: admin/views/WDIViewFeeds_wdi.php:260 admin/views/WDIViewFeeds_wdi.php:261
459
+ #: admin/views/WDIViewFeeds_wdi.php:262 admin/views/WDIViewFeeds_wdi.php:265
460
+ msgid "Yes"
461
+ msgstr "Да"
462
+
463
+ #: admin/views/WDIViewFeeds_wdi.php:237 admin/views/WDIViewFeeds_wdi.php:241
464
+ #: admin/views/WDIViewFeeds_wdi.php:243 admin/views/WDIViewFeeds_wdi.php:246
465
+ #: admin/views/WDIViewFeeds_wdi.php:247 admin/views/WDIViewFeeds_wdi.php:248
466
+ #: admin/views/WDIViewFeeds_wdi.php:249 admin/views/WDIViewFeeds_wdi.php:250
467
+ #: admin/views/WDIViewFeeds_wdi.php:252 admin/views/WDIViewFeeds_wdi.php:253
468
+ #: admin/views/WDIViewFeeds_wdi.php:254 admin/views/WDIViewFeeds_wdi.php:255
469
+ #: admin/views/WDIViewFeeds_wdi.php:256 admin/views/WDIViewFeeds_wdi.php:257
470
+ #: admin/views/WDIViewFeeds_wdi.php:258 admin/views/WDIViewFeeds_wdi.php:259
471
+ #: admin/views/WDIViewFeeds_wdi.php:260 admin/views/WDIViewFeeds_wdi.php:261
472
+ #: admin/views/WDIViewFeeds_wdi.php:262 admin/views/WDIViewFeeds_wdi.php:265
473
+ msgid "No"
474
+ msgstr "Нет"
475
 
476
  #: admin/views/WDIViewFeeds_wdi.php:238
477
+ msgid "Lightbox Width"
478
+ msgstr "Ширина лайтбокса"
479
 
480
  #: admin/views/WDIViewFeeds_wdi.php:239
481
+ msgid "Lightbox Height"
482
+ msgstr "Высота лайтбокса"
483
 
484
  #: admin/views/WDIViewFeeds_wdi.php:240
485
+ msgid "Lightbox Effect"
486
+ msgstr "Эффект лайтбокса"
487
 
488
  #: admin/views/WDIViewFeeds_wdi.php:241
489
+ msgid "Lightbox autoplay"
490
+ msgstr "Автозапуск лайтбокса"
491
 
492
  #: admin/views/WDIViewFeeds_wdi.php:242
493
+ msgid "Time Interval"
494
+ msgstr "Врем. интервал"
495
 
496
  #: admin/views/WDIViewFeeds_wdi.php:243
497
+ msgid "Enable filmstrip in lightbox"
498
+ msgstr "Вкл. диафильм в лайтбоксе"
499
 
500
  #: admin/views/WDIViewFeeds_wdi.php:244
501
+ msgid "Filmstrip size"
502
+ msgstr "Размеры диафильма"
503
 
504
  #: admin/views/WDIViewFeeds_wdi.php:245
505
+ msgid "Show Next / Previous Buttons"
506
+ msgstr "Показать кнопки Следующий / Предыдущий:"
507
+
508
+ #: admin/views/WDIViewFeeds_wdi.php:245
509
+ msgid "On Hover"
510
+ msgstr "При наведении курсора"
511
+
512
+ #: admin/views/WDIViewFeeds_wdi.php:245
513
+ msgid "Always"
514
+ msgstr "Всегда"
515
 
516
  #: admin/views/WDIViewFeeds_wdi.php:246
517
+ msgid "Display info by default"
518
+ msgstr "Отображать данные по умолчанию"
519
 
520
  #: admin/views/WDIViewFeeds_wdi.php:247
521
+ msgid "Full width info"
522
+ msgstr "Данные во всю ширину"
523
+
524
+ #: admin/views/WDIViewFeeds_wdi.php:248
525
  msgid "Enable Loop"
526
+ msgstr "Вкл. цикл"
527
 
528
+ #: admin/views/WDIViewFeeds_wdi.php:249
529
+ msgid "Enable Right Click Protection"
530
  msgstr ""
531
 
532
+ #: admin/views/WDIViewFeeds_wdi.php:250
533
+ msgid "Enable control buttons"
534
+ msgstr "Вкл. кнопки управления"
535
 
536
+ #: admin/views/WDIViewFeeds_wdi.php:251
537
+ msgid "Enable info"
538
+ msgstr "Вкл. данные"
539
 
540
+ #: admin/views/WDIViewFeeds_wdi.php:252
541
+ msgid "Enable fullscreen"
542
+ msgstr "Вкл. на весь экран"
543
 
544
+ #: admin/views/WDIViewFeeds_wdi.php:253
545
+ msgid "Enable comments"
546
+ msgstr "Вкл. комментарии"
547
 
548
+ #: admin/views/WDIViewFeeds_wdi.php:254
549
+ msgid "Link To Instagram Button"
550
  msgstr ""
551
 
552
+ #: admin/views/WDIViewFeeds_wdi.php:255
553
+ msgid "Enable Download Button"
554
+ msgstr "Вкл. кнопку \"Скачать\""
555
 
556
+ #: admin/views/WDIViewFeeds_wdi.php:256
557
+ msgid "Enable Share Buttons"
 
558
  msgstr ""
559
 
560
+ #: admin/views/WDIViewFeeds_wdi.php:257
561
+ msgid "Enable Facebook button"
562
+ msgstr "Вкл. кнопку Facebook"
563
 
564
+ #: admin/views/WDIViewFeeds_wdi.php:258
565
+ msgid "Enable Twitter button"
566
+ msgstr "Вкл. кнопку Twitter"
567
 
568
+ #: admin/views/WDIViewFeeds_wdi.php:259
569
+ msgid "Enable Google+ button"
570
+ msgstr "Вкл. кнопку Google+"
571
 
572
+ #: admin/views/WDIViewFeeds_wdi.php:260
573
+ msgid "Enable Pinterest button"
574
+ msgstr "Вкл. кнопку Pinterest"
575
 
576
+ #: admin/views/WDIViewFeeds_wdi.php:261
577
+ msgid "Enable Tumblr button"
578
+ msgstr "Вкл. кнопку Tumblr"
579
 
580
+ #: admin/views/WDIViewFeeds_wdi.php:262
581
+ msgid "Show Images Count"
582
+ msgstr "Показать счетчик фото"
583
 
584
+ #: admin/views/WDIViewFeeds_wdi.php:265
585
+ msgid "Enable Conditional Filters"
586
  msgstr ""
587
 
588
+ #: admin/views/WDIViewFeeds_wdi.php:266
589
+ msgid "Filter Logic"
590
  msgstr ""
591
 
592
+ #: admin/views/WDIViewFeeds_wdi.php:283 admin/views/WDIViewFeeds_wdi.php:288
593
+ msgid "Available In Pro Version"
594
  msgstr ""
595
 
596
+ #: admin/views/WDIViewFeeds_wdi.php:304
597
+ msgid "Feed Settings"
598
+ msgstr "Настройки фида"
599
 
600
+ #: admin/views/WDIViewFeeds_wdi.php:305
601
+ msgid "Lightbox Settings"
602
+ msgstr "Настройки лайтбокса"
603
 
604
+ #: admin/views/WDIViewFeeds_wdi.php:306
605
+ msgid "Conditional Filters"
606
  msgstr ""
607
 
608
+ #: admin/views/WDIViewFeeds_wdi.php:329
609
+ msgid "Here You Can Change Feed Parameters"
610
  msgstr ""
611
 
612
+ #: admin/views/WDIViewFeeds_wdi.php:341
613
+ msgid "Edit feed"
614
+ msgstr "Редактировать фид"
615
 
616
+ #: admin/views/WDIViewFeeds_wdi.php:344
617
+ msgid "Add new Feed"
618
+ msgstr "Добавить фид"
619
 
620
+ #: admin/views/WDIViewFeeds_wdi.php:378
621
+ msgid "Source of filtering"
622
  msgstr ""
623
 
624
+ #: admin/views/WDIViewFeeds_wdi.php:381
625
+ msgid ""
626
+ "Please note that filters are being applied to maximum 330 image per load. "
627
+ "This means that even if you have 25 images per load but only 20 images "
628
+ "correspond to your filter then those 20 images will be displayed during the "
629
+ "load."
630
  msgstr ""
631
 
632
+ #: admin/views/WDIViewFeeds_wdi.php:394
633
+ msgid "Add"
634
+ msgstr "Добавить"
635
 
636
+ #: admin/views/WDIViewFeeds_wdi.php:403
637
+ msgid "Add Condition"
638
  msgstr ""
639
 
640
+ #: admin/views/WDIViewFeeds_wdi.php:409
641
+ msgid "Enter Your Codition Here..."
 
 
 
642
  msgstr ""
643
 
644
+ #: admin/views/WDIViewFeeds_wdi.php:412
645
+ msgid "Condition Type"
 
 
646
  msgstr ""
647
 
648
+ #: admin/views/WDIViewFeeds_wdi.php:414
649
+ msgid "Hashtag"
 
 
 
650
  msgstr ""
651
 
652
+ #: admin/views/WDIViewFeeds_wdi.php:415
653
+ msgid "Mention"
654
  msgstr ""
655
 
656
+ #: admin/views/WDIViewFeeds_wdi.php:416
657
+ msgid "Description"
658
  msgstr ""
659
 
660
+ #: admin/views/WDIViewFeeds_wdi.php:418
661
+ msgid "Instagram Media Link"
662
  msgstr ""
663
 
664
+ #: admin/views/WDIViewFeeds_wdi.php:420
665
+ msgid "Add New Condition"
666
  msgstr ""
667
 
668
+ #: admin/views/WDIViewFeeds_wdi.php:421
669
+ msgid ""
670
+ "Write your condition, select condition type and click on Add New Condition. "
671
+ "You can add as many conditions as you want. You can add different condition "
672
+ "types mixed together as well."
673
  msgstr ""
674
 
675
+ #: admin/views/WDIViewFeeds_wdi.php:427
676
+ msgid "Result"
677
  msgstr ""
678
 
679
+ #: admin/views/WDIViewFeeds_wdi.php:429
680
+ msgid "Posts Which Meet Following Condition Would Be Shown"
681
  msgstr ""
682
 
683
+ #: admin/views/WDIViewFeeds_wdi.php:444
684
+ msgid "Save"
685
+ msgstr "Сохранить"
686
 
687
+ #: admin/views/WDIViewFeeds_wdi.php:446
688
+ msgid "Apply"
689
+ msgstr "Применить"
690
 
691
+ #: admin/views/WDIViewFeeds_wdi.php:447 framework/WDILibrary.php:189
692
+ #: framework/WDILibrary.php:717
693
+ msgid "Reset"
694
+ msgstr "Сброс"
695
 
696
+ #: admin/views/WDIViewFeeds_wdi.php:448
697
+ msgid "Cancel"
698
  msgstr ""
699
 
700
+ #: admin/views/WDIViewLicensing_wdi.php:29
701
+ msgid "ready"
702
  msgstr ""
703
 
704
+ #: admin/views/WDIViewLicensing_wdi.php:31
705
+ msgid "Responsive Design and Layout"
706
  msgstr ""
707
 
708
+ #: admin/views/WDIViewLicensing_wdi.php:32
709
+ msgid "SEO Friendly"
710
  msgstr ""
711
 
712
+ #: admin/views/WDIViewLicensing_wdi.php:33
713
+ msgid "Thumbnails layout"
714
  msgstr ""
715
 
716
+ #: admin/views/WDIViewLicensing_wdi.php:34
717
+ msgid "Image Browser layout"
718
  msgstr ""
719
 
720
+ #: admin/views/WDIViewLicensing_wdi.php:35
721
+ msgid "Lightbox"
722
  msgstr ""
723
 
724
+ #: admin/views/WDIViewLicensing_wdi.php:36
725
+ msgid "Load More Button / Classic Pagination"
726
  msgstr ""
727
 
728
+ #: admin/views/WDIViewLicensing_wdi.php:37
729
+ msgid "Image Sorting"
730
  msgstr ""
731
 
732
+ #: admin/views/WDIViewLicensing_wdi.php:38
733
+ msgid "Widget"
734
  msgstr ""
735
 
736
+ #: admin/views/WDIViewLicensing_wdi.php:39
737
+ msgid "Slideshow/Lightbox Effects"
738
  msgstr ""
739
 
740
+ #: admin/views/WDIViewLicensing_wdi.php:42
741
+ msgid "Infinite Scroll Load More"
742
  msgstr ""
743
 
744
+ #: admin/views/WDIViewLicensing_wdi.php:43
745
+ msgid "Full Style Customization With Themes"
746
  msgstr ""
747
 
748
+ #: admin/views/WDIViewLicensing_wdi.php:44
749
+ msgid "Filmstrip"
750
  msgstr ""
751
 
752
+ #: admin/views/WDIViewLicensing_wdi.php:45
753
+ msgid "Instagram Comments in Lightbox"
754
  msgstr ""
755
 
756
+ #: admin/views/WDIViewLicensing_wdi.php:46
757
+ msgid "Blog Style layout"
758
  msgstr ""
759
 
760
+ #: admin/views/WDIViewLicensing_wdi.php:47
761
+ msgid "Masonry layout"
762
  msgstr ""
763
 
764
+ #: admin/views/WDIViewLicensing_wdi.php:48
765
+ msgid "Videos in BlogStyle, ImageBrowser and Lightbox"
766
  msgstr ""
767
 
768
+ #: admin/views/WDIViewLicensing_wdi.php:49
769
+ msgid "Social Share Buttons"
770
  msgstr ""
771
 
772
+ #: admin/views/WDIViewLicensing_wdi.php:50
773
+ msgid "Multiple User/Hashtag Feeds"
774
  msgstr ""
775
 
776
+ #: admin/views/WDIViewLicensing_wdi.php:51
777
+ msgid "Filtering Images Based on Users/Hashtags"
778
  msgstr ""
779
 
780
+ #: admin/views/WDIViewLicensing_wdi.php:52
781
+ msgid "Support / Updates"
782
  msgstr ""
783
 
784
+ #: admin/views/WDIViewLicensing_wdi.php:55
785
+ msgid "Free"
786
  msgstr ""
787
 
788
+ #: admin/views/WDIViewLicensing_wdi.php:77
789
+ msgid "Only Bug Fixes"
790
  msgstr ""
791
 
792
+ #: admin/views/WDIViewLicensing_wdi.php:80
793
+ msgid "Pro Version"
794
  msgstr ""
795
 
796
+ #: admin/views/WDIViewLicensing_wdi.php:102
797
+ msgid "Full Support"
 
798
  msgstr ""
799
 
800
+ #: admin/views/WDIViewLicensing_wdi.php:114
801
+ msgid "After purchasing the commercial version follow these steps:"
 
802
  msgstr ""
803
 
804
+ #: admin/views/WDIViewLicensing_wdi.php:116
805
+ msgid "Deactivate Instagram Feed WD plugin."
806
  msgstr ""
807
 
808
+ #: admin/views/WDIViewLicensing_wdi.php:117
809
+ msgid "Delete Instagram Feed WD plugin."
810
  msgstr ""
811
 
812
+ #: admin/views/WDIViewLicensing_wdi.php:118
813
+ msgid "Install the downloaded commercial version of the plugin."
814
  msgstr ""
815
 
816
+ #: admin/views/WDIViewSettings_wdi.php:39
817
+ msgid "This Section Allows You To Set API Parameters"
818
  msgstr ""
819
 
820
+ #: admin/views/WDIViewSettings_wdi.php:50
821
+ msgid "Instagram WD Settings"
822
+ msgstr "Instagram WD Widget"
823
 
824
+ #: admin/views/WDIViewSettings_wdi.php:55
825
+ msgid "Reset Access Token and Username"
826
  msgstr ""
827
 
828
+ #: admin/views/WDIViewSettings_wdi.php:70
829
+ msgid ""
830
+ "Are you sure that you want to reset access token and username, after "
831
+ "resetting it you will need to log in with Instagram again for using plugin"
832
  msgstr ""
833
 
834
+ #: admin/views/WDIViewThemes_wdi.php:30
835
+ msgid "Here You Can Customize Your Themes"
836
  msgstr ""
837
 
838
+ #: admin/views/WDIViewThemes_wdi.php:40
839
+ msgid ""
840
+ "This is FREE version, Customizing themes is available only in PRO version"
841
  msgstr ""
842
 
843
+ #: admin/views/WDIViewUninstall_wdi.php:22
844
+ #: admin/views/WDIViewUninstall_wdi.php:68
845
+ #: admin/views/WDIViewUninstall_wdi.php:80
846
+ msgid "Uninstalling Instagram Feed WD"
847
  msgstr ""
848
 
849
+ #: admin/views/WDIViewUninstall_wdi.php:24
850
+ msgid ""
851
+ "Deactivating Instagram Feed WD plugin does not remove any data that may have "
852
+ "been created. To completely remove this plugin, you can uninstall it here."
853
  msgstr ""
854
 
855
+ #: admin/views/WDIViewUninstall_wdi.php:25
856
+ msgid ""
857
+ "WARNING: Once uninstalled, this can't be undone. You should use a Database "
858
+ "Backup plugin of WordPress to back up all the data first."
859
  msgstr ""
860
 
861
+ #: admin/views/WDIViewUninstall_wdi.php:26
862
+ msgid "The following Database Tables will be deleted:"
863
  msgstr ""
864
 
865
+ #: admin/views/WDIViewUninstall_wdi.php:42
866
+ #: admin/views/WDIViewUninstall_wdi.php:55
867
+ msgid "Are you sure you want to uninstall plugin?"
868
  msgstr ""
869
 
870
+ #: admin/views/WDIViewUninstall_wdi.php:70
871
+ msgid "Instagram Feed WD is uninstalled"
872
  msgstr ""
873
 
874
+ #: admin/views/WDIViewUninstall_wdi.php:70
875
+ #: admin/views/WDIViewUninstall_wdi.php:93
876
+ msgid "Click Here"
877
  msgstr ""
878
 
879
+ #: admin/views/WDIViewUninstall_wdi.php:70
880
+ #: admin/views/WDIViewUninstall_wdi.php:93
881
+ msgid "to deactivate it"
882
  msgstr ""
883
 
884
+ #: admin/views/WDIViewUninstall_wdi.php:82
885
+ msgid "The following Database Tables has been successfully deleted:"
886
  msgstr ""
887
 
888
+ #: admin/views/WDIViewUninstall_wdi.php:93
889
+ msgid "Instagram Feed WD is successfully uninstalled"
890
  msgstr ""
891
 
892
+ #: framework/WDILibrary.php:188 framework/WDILibrary.php:720
893
+ msgid "Search"
894
+ msgstr "Поиск"
895
 
896
+ #: framework/WDILibrary.php:511
897
+ msgid " item(s)"
898
+ msgstr "элемент(ы)"
899
 
900
+ #: framework/WDILibrary.php:516
901
+ msgid "First"
902
+ msgstr "Первый"
903
 
904
+ #: framework/WDILibrary.php:517
905
+ msgid "Previous"
906
+ msgstr "Предыдущий"
907
 
908
+ #: framework/WDILibrary.php:518
909
+ msgid "Next"
910
+ msgstr "Следующий"
911
 
912
+ #: framework/WDILibrary.php:519
913
+ msgid "Last"
914
+ msgstr "Последний"
915
 
916
+ #: framework/WDILibrary.php:537
917
+ msgid "Go to the first page"
918
+ msgstr "Перейти к первой странице"
919
 
920
+ #: framework/WDILibrary.php:538
921
+ msgid "Go to the previous page"
922
+ msgstr "Перейти к предыдущей странице"
923
 
924
+ #: framework/WDILibrary.php:540
925
+ msgid "of"
926
+ msgstr "из"
927
 
928
+ #: framework/WDILibrary.php:544
929
+ msgid "Go to the next page"
930
+ msgstr "Перейти к следующей странице"
931
 
932
+ #: framework/WDILibrary.php:545
933
+ msgid "Go to the last page"
934
+ msgstr "Перейти к последней странице"
935
 
936
+ #: framework/WDILibrary.php:557
937
+ msgid "Load More..."
938
+ msgstr "Загрузить еще..."
939
 
940
+ #: framework/WDILibrary.php:762
941
+ msgid "Order by: "
942
+ msgstr "Сортировать по:"
943
 
944
+ #: framework/WDILibrary.php:764
945
+ msgid "Default"
946
+ msgstr "По умолчанию"
947
 
948
+ #: framework/WDILibrary.php:765
949
+ msgid "Filename"
950
+ msgstr "Имени файла"
951
 
952
+ #: framework/WDILibrary.php:766
953
+ msgid "Size"
954
+ msgstr "Размеру"
955
 
956
+ #: framework/WDI_admin_view.php:717
957
+ msgid "Preview"
958
+ msgstr "Превью"
959
 
960
+ #: frontend/shortcode.php:28
961
+ msgid "Invalid shortcode"
962
+ msgstr "Неверный шорткод"
963
 
964
+ #: frontend/shortcode.php:43
965
+ msgid "Access Token is invalid, please get it again "
966
  msgstr ""
967
 
968
+ #: frontend/shortcode.php:48
969
+ msgid "Feed Doesn't exists "
970
  msgstr ""
971
 
972
+ #: frontend/shortcode.php:69
973
+ msgid "Unable to display unpublished feed "
974
  msgstr ""
975
 
976
+ #: frontend/shortcode.php:92
977
+ msgid "Invalid feed type"
978
+ msgstr "Неверный тип фида"
979
 
980
+ #: frontend/shortcode.php:128
981
+ msgid "Connection Error, try again later :("
982
  msgstr ""
983
 
984
+ #: frontend/shortcode.php:129
985
+ msgid "Username not found"
986
  msgstr ""
987
 
988
+ #: frontend/shortcode.php:130
989
+ msgid "Network error, please try again later :("
990
  msgstr ""
991
 
992
+ #: frontend/shortcode.php:131
993
+ msgid "There is no data for that hashtag"
994
  msgstr ""
995
 
996
+ #: frontend/shortcode.php:132
997
+ msgid "Click to filter images by this user"
998
  msgstr ""
999
 
1000
+ #: frontend/shortcode.php:168
1001
+ msgid "Field is required."
1002
+ msgstr "Поле обязательно для заполнения."
1003
 
1004
+ #: frontend/shortcode.php:169 frontend/views/WDIViewGalleryBox.php:1335
1005
+ msgid "This is not a valid email address."
1006
+ msgstr "Это неправильный адрес электронной почты."
1007
 
1008
+ #: frontend/shortcode.php:170
1009
+ msgid "There are no images matching your search."
1010
+ msgstr "По вашему поиску изображений не найдено"
1011
 
1012
+ #: frontend/views/WDIViewGalleryBox.php:1006
1013
+ msgid "The image has been deleted."
1014
+ msgstr "Изображение было удалено."
1015
 
1016
+ #: frontend/views/WDIViewGalleryBox.php:1027
1017
+ #: frontend/views/WDIViewGalleryBox.php:2890
1018
+ msgid "Play"
1019
+ msgstr "Старт"
1020
 
1021
+ #: frontend/views/WDIViewGalleryBox.php:1031
1022
+ #: frontend/views/WDIViewGalleryBox.php:2161
1023
+ #: frontend/views/WDIViewGalleryBox.php:2717
1024
+ #: frontend/views/WDIViewGalleryBox.php:2814
1025
+ msgid "Maximize"
1026
+ msgstr "Увеличить"
1027
 
1028
+ #: frontend/views/WDIViewGalleryBox.php:1035
1029
+ #: frontend/views/WDIViewGalleryBox.php:2163
1030
+ #: frontend/views/WDIViewGalleryBox.php:2816
1031
+ msgid "Fullscreen"
1032
+ msgstr "Во весь экран"
1033
 
1034
+ #: frontend/views/WDIViewGalleryBox.php:1037
1035
+ #: frontend/views/WDIViewGalleryBox.php:2581
1036
+ msgid "Show info"
1037
+ msgstr "Показать информацию"
1038
 
1039
+ #: frontend/views/WDIViewGalleryBox.php:1039
1040
+ msgid "Show comments"
1041
+ msgstr "Показать комментарии"
1042
 
1043
+ #: frontend/views/WDIViewGalleryBox.php:1041
1044
+ #: frontend/views/WDIViewGalleryBox.php:2594
1045
+ msgid "Show rating"
1046
+ msgstr "Показать рейтинг"
1047
 
1048
+ #: frontend/views/WDIViewGalleryBox.php:1047
1049
+ #: frontend/views/WDIViewGalleryBox.php:1048
1050
+ msgid "Share on Facebook"
1051
+ msgstr "Поделиться на Facebook"
1052
 
1053
+ #: frontend/views/WDIViewGalleryBox.php:1054
1054
+ #: frontend/views/WDIViewGalleryBox.php:1055
1055
+ msgid "Share on Twitter"
1056
+ msgstr "Поделиться в Twitter"
1057
 
1058
+ #: frontend/views/WDIViewGalleryBox.php:1061
1059
+ #: frontend/views/WDIViewGalleryBox.php:1062
1060
+ msgid "Share on Google+"
1061
+ msgstr "Поделиться на Google+"
1062
 
1063
+ #: frontend/views/WDIViewGalleryBox.php:1068
1064
+ #: frontend/views/WDIViewGalleryBox.php:1069
1065
+ msgid "Share on Pinterest"
1066
+ msgstr "Поделиться на Pinterest"
1067
 
1068
+ #: frontend/views/WDIViewGalleryBox.php:1075
1069
+ #: frontend/views/WDIViewGalleryBox.php:1076
1070
+ msgid "Share on Tumblr"
1071
+ msgstr "Поделиться на Tumblr"
1072
 
1073
+ #: frontend/views/WDIViewGalleryBox.php:1084
1074
+ msgid "Share"
1075
  msgstr ""
1076
 
1077
+ #: frontend/views/WDIViewGalleryBox.php:1103
1078
+ msgid "Open image in Instagram."
1079
+ msgstr "Открыть изображение в Инстаграме."
1080
 
1081
+ #: frontend/views/WDIViewGalleryBox.php:1131
1082
+ msgid "Download original image"
1083
+ msgstr "Скачать оригинальное изображение"
1084
 
1085
+ #: frontend/views/WDIViewGalleryBox.php:1328
1086
+ msgid "Error. Incorrect Verification Code."
1087
+ msgstr "Ошибка. Неправильный код подтверждения."
1088
 
1089
+ #: frontend/views/WDIViewGalleryBox.php:1343
1090
+ #: frontend/views/WDIViewGalleryBox.php:2381
1091
+ msgid "Hide Comments"
1092
+ msgstr "Скрыть комментарии"
1093
 
1094
+ #: frontend/views/WDIViewGalleryBox.php:1354
1095
+ #: frontend/views/WDIViewGalleryBox.php:1376
1096
+ #: frontend/views/WDIViewGalleryBox.php:1383
1097
+ msgid "Email"
1098
+ msgstr "Email"
1099
 
1100
+ #: frontend/views/WDIViewGalleryBox.php:1361
1101
+ #: frontend/views/WDIViewGalleryBox.php:1376
1102
+ #: frontend/views/WDIViewGalleryBox.php:1383
1103
+ msgid "Comment"
1104
+ msgstr "Комментарий"
1105
 
1106
+ #: frontend/views/WDIViewGalleryBox.php:1366
1107
+ msgid "Verification Code"
1108
+ msgstr "Код подтверждения"
1109
 
1110
+ #: frontend/views/WDIViewGalleryBox.php:1389
1111
+ msgid "Submit"
1112
+ msgstr "Отправить"
1113
 
1114
+ #: frontend/views/WDIViewGalleryBox.php:1390
1115
+ msgid "Your comment is awaiting moderation"
1116
+ msgstr "Ваш комментарий на модерации"
1117
 
1118
+ #: frontend/views/WDIViewGalleryBox.php:1397
1119
+ #: frontend/views/WDIViewGalleryBox.php:2066
1120
+ #: frontend/views/WDIViewGalleryBox.php:2391
1121
+ msgid "There are no comments to show"
1122
  msgstr ""
1123
 
1124
+ #: frontend/views/WDIViewGalleryBox.php:2567
1125
+ msgid "Hide info"
1126
+ msgstr "Скрыть информацию"
1127
 
1128
+ #: frontend/views/WDIViewGalleryBox.php:2590
1129
+ msgid "Hide rating"
1130
+ msgstr "Скрыть рейтинг"
1131
 
1132
+ #: frontend/views/WDIViewGalleryBox.php:2754
1133
+ #: frontend/views/WDIViewGalleryBox.php:2974
1134
+ msgid "Restore"
1135
+ msgstr "Восстановить"
1136
 
1137
+ #: frontend/views/WDIViewGalleryBox.php:2869
1138
+ msgid "Exit Fullscreen"
1139
+ msgstr "Выход из полноэкранного вида"
1140
 
1141
+ #: frontend/views/WDIViewGalleryBox.php:2884
1142
+ #: frontend/views/WDIViewGalleryBox.php:2901
1143
+ msgid "Pause"
1144
+ msgstr "Пауза"
1145
 
1146
+ #: frontend/views/WDIViewImageBrowser_view.php:39
1147
+ #: frontend/views/WDIViewImageBrowser_view.php:51
1148
+ #: frontend/views/WDIViewThumbnails_view.php:42
1149
+ #: frontend/views/WDIViewThumbnails_view.php:59
1150
+ msgid "First Page"
1151
+ msgstr "Первая страница"
1152
 
1153
+ #: frontend/views/WDIViewImageBrowser_view.php:39
1154
+ #: frontend/views/WDIViewImageBrowser_view.php:51
1155
+ #: frontend/views/WDIViewThumbnails_view.php:42
1156
+ #: frontend/views/WDIViewThumbnails_view.php:59
1157
+ msgid "Previous Page"
1158
+ msgstr "Предыдущая страница"
1159
 
1160
+ #: frontend/views/WDIViewImageBrowser_view.php:39
1161
+ #: frontend/views/WDIViewImageBrowser_view.php:51
1162
+ #: frontend/views/WDIViewThumbnails_view.php:42
1163
+ #: frontend/views/WDIViewThumbnails_view.php:59
1164
+ msgid "Next Page"
1165
+ msgstr "Следующая страница"
1166
 
1167
+ #: frontend/views/WDIViewImageBrowser_view.php:39
1168
+ #: frontend/views/WDIViewImageBrowser_view.php:51
1169
+ #: frontend/views/WDIViewThumbnails_view.php:42
1170
+ #: frontend/views/WDIViewThumbnails_view.php:59
1171
+ msgid "Last Page"
1172
+ msgstr "Последняя страница"
1173
 
1174
+ #: frontend/views/WDIViewImageBrowser_view.php:46
1175
+ #: frontend/views/WDIViewThumbnails_view.php:52
1176
+ msgid "Load More"
1177
  msgstr ""
1178
 
1179
+ #: instagram-wdi-notices.php:217
1180
+ msgid "Leave A Review?"
1181
+ msgstr "Оставить отзыв?"
1182
 
1183
+ #: instagram-wdi-notices.php:218
1184
+ #, php-format
1185
+ msgid ""
1186
+ "We hope you've enjoyed using WordPress %s! Would you consider leaving us a "
1187
+ "review on WordPress.org?"
1188
  msgstr ""
1189
+ "Мы надеемся, что вам понравилось, использовать WordPress %s! Оставьте нам "
1190
+ "свой отзыв на WordPress.org."
1191
 
1192
+ #: instagram-wdi-notices.php:219
1193
+ msgid "Sure! I'd love to!"
1194
+ msgstr "Конечно! С удовольствием!"
1195
 
1196
+ #: instagram-wdi-notices.php:220
1197
+ msgid "I've already left a review"
1198
+ msgstr "Я уже оставил отзыв"
1199
 
1200
+ #: instagram-wdi-notices.php:221
1201
+ msgid "Maybe Later"
1202
+ msgstr "Может быть позже"
1203
 
1204
+ #: instagram-wdi-notices.php:222 instagram-wdi-notices.php:232
1205
+ #: instagram-wdi-notices.php:238
1206
+ msgid "Never show again"
1207
+ msgstr "Никогда больше не показывать"
1208
 
1209
+ #: instagram-wdi-notices.php:228 instagram-wdi-notices.php:236
1210
+ msgid "Hey! How's It Going?"
1211
+ msgstr "Привет! Как дела?"
1212
 
1213
+ #: instagram-wdi-notices.php:229
1214
+ #, php-format
1215
+ msgid ""
1216
+ "Thank you for using WordPress %s! We hope that you've found everything you "
1217
+ "need, but if you have any questions:"
1218
  msgstr ""
1219
+ "Благодарим Вас за использование WordPress %s! Мы надеемся, что Вы нашли все, "
1220
+ "что нужно, но если у вас есть какие-либо вопросы:"
1221
 
1222
+ #: instagram-wdi-notices.php:230
1223
+ msgid "Check out User Guide"
1224
+ msgstr "Ознакомьтесь с Руководством пользователя"
1225
 
1226
+ #: instagram-wdi-notices.php:231
1227
+ msgid "Get Some Help"
1228
+ msgstr "Получить помощь"
1229
 
1230
+ #: templates/plugin-uninstalled.php:28
1231
+ msgid "you have uninstalled"
1232
  msgstr ""
1233
 
1234
+ #: templates/plugin-uninstalled.php:28
1235
+ msgid ""
1236
+ "plugin,if you want to use it again simply deactivate and activate it again"
1237
  msgstr ""
1238
 
1239
+ #: wd-instagram-feed.php:121
1240
+ msgid "Configure"
1241
+ msgstr "Настройка"
1242
 
1243
+ #: wd-instagram-feed.php:124
1244
+ msgid "Customize"
1245
  msgstr ""
1246
 
1247
+ #: wd-instagram-feed.php:152
1248
+ msgid "Instagram Feed WD"
1249
  msgstr ""
1250
 
1251
+ #: wd-instagram-feed.php:154
1252
+ msgid "Themes"
1253
+ msgstr "Темы"
1254
 
1255
+ #: wd-instagram-feed.php:155
1256
+ msgid "Settings"
1257
+ msgstr "Настройки"
 
1258
 
1259
+ #: wd-instagram-feed.php:156
1260
+ msgid "Buy Pro"
 
1261
  msgstr ""
1262
 
1263
+ #: wd-instagram-feed.php:162
1264
+ msgid "Uninstall"
1265
+ msgstr "Удалить"
 
1266
 
1267
+ #: wd-instagram-feed.php:236
1268
+ msgid "All the data will be removed from the database. Continue?"
1269
+ msgstr "Все данные будут удалены из базы данных. Продолжить?"
 
1270
 
1271
+ #: wd-instagram-feed.php:237
1272
+ msgid "Some error with instagram servers, try agian later :("
1273
+ msgstr "Ошибка сервера Инстаграма. Пожалуйста, попробуйте позже :("
 
1274
 
1275
+ #: wd-instagram-feed.php:238
1276
+ msgid "Invalid user:"
1277
+ msgstr "Неверное имя пользователя"
 
1278
 
1279
+ #: wd-instagram-feed.php:239
1280
+ msgid "already added!"
 
1281
  msgstr ""
1282
 
1283
+ #: wd-instagram-feed.php:240
1284
+ msgid "User does not exist."
1285
+ msgstr "Пользователь не существует."
 
1286
 
1287
+ #: wd-instagram-feed.php:241
1288
+ msgid "Network Error, please try again later. :("
1289
+ msgstr "Ошибка сети. Пожалуйста, попробуйте позже :("
 
1290
 
1291
+ #: wd-instagram-feed.php:242
1292
+ msgid "Invalid hashtag"
1293
+ msgstr "Неверный хештег"
 
1294
 
1295
+ #: wd-instagram-feed.php:243
1296
+ msgid "This hashtag currently has no posts. Are you sure you want to add it?"
 
1297
  msgstr ""
1298
 
1299
+ #: wd-instagram-feed.php:244
1300
+ msgid "You can add only one username or hashtag in FREE Version"
 
1301
  msgstr ""
1302
 
1303
+ #: wd-instagram-feed.php:245
1304
+ msgid "Available in PRO"
 
1305
  msgstr ""
1306
 
1307
+ #: wd-instagram-feed.php:246
1308
+ msgid "Combined Usernames/Hashtags are available only in PRO version"
 
1309
  msgstr ""
1310
 
1311
+ #: wd-instagram-feed.php:247
1312
+ msgid "Customizing Themes is available only in PRO version"
1313
  msgstr ""
1314
 
1315
+ #: wd-instagram-feed.php:248
1316
+ msgid "URL is not valid"
1317
  msgstr ""
1318
 
1319
+ #: wd-instagram-feed.php:249
1320
+ msgid "Please Select Condition Type"
1321
  msgstr ""
1322
 
1323
+ #: wd-instagram-feed.php:250
1324
+ msgid "Show Posts Which Have All Of The Conditions"
1325
  msgstr ""
1326
 
1327
+ #: wd-instagram-feed.php:251
1328
+ msgid "Show Posts Which Have At Least One Of The Conditions"
1329
  msgstr ""
1330
 
1331
+ #: wd-instagram-feed.php:252
1332
+ msgid "Hide Posts Which Have At Least One Of The Conditions"
1333
  msgstr ""
1334
 
1335
+ #: wd-instagram-feed.php:253
1336
+ msgid "EITHER"
1337
  msgstr ""
1338
 
1339
+ #: wd-instagram-feed.php:254
1340
+ msgid "NEITHER"
1341
  msgstr ""
1342
 
1343
+ #: wd-instagram-feed.php:255
1344
+ msgid "EXCEPT"
1345
  msgstr ""
1346
 
1347
+ #: wd-instagram-feed.php:256
1348
+ msgid "AND"
1349
  msgstr ""
1350
 
1351
+ #: wd-instagram-feed.php:257
1352
+ msgid "OR"
1353
  msgstr ""
1354
 
1355
+ #: wd-instagram-feed.php:258
1356
+ msgid "NOR"
 
 
1357
  msgstr ""
1358
 
1359
+ #~ msgid "Click here to get your access token and user ID"
1360
+ #~ msgstr "Нажмите здесь, чтобы получить свой токен и ID"
 
1361
 
1362
+ #~ msgid "This section allows you to create, edit and delete Feeds."
1363
+ #~ msgstr "Этот раздел позволяет вам создавать, редактировать и удалять фиды."
 
1364
 
1365
+ #~ msgid "Follow on Instagram button"
1366
+ #~ msgstr "Кнопка \"Следовать в Инстаграме\""
 
1367
 
1368
+ #~ msgid "Resort After Loading New Images"
1369
+ #~ msgstr "Пересортировка после загрузки новых изображений"
 
1370
 
1371
+ #~ msgid "Show Usernames"
1372
+ #~ msgstr "Показать имена пользователей"
 
1373
 
1374
+ #~ msgid "Enable Original Image Display Button"
1375
+ #~ msgstr "Вкл. кнопку Отобр. оригин. изобр."
 
1376
 
1377
+ #~ msgid "Delete all plugin related data from database"
1378
+ #~ msgstr "Удалить из базы данных все данные, касающиеся плагина"
 
1379
 
1380
+ #~ msgid "This section allows you to create, edit and delete Themes."
1381
+ #~ msgstr "Этот раздел позволяет вам создавать, редактировать и удалять темы."
 
1382
 
1383
+ #~ msgid "Read More in User Manual."
1384
+ #~ msgstr "Подробнее в руководстве пользователя"
 
1385
 
1386
+ #~ msgid "Theme Name"
1387
+ #~ msgstr "Название темы"
 
1388
 
1389
+ #~ msgid "Feed Container Width"
1390
+ #~ msgstr "Ширина контейнера фида"
 
1391
 
1392
+ #~ msgid "Includes all feed elements"
1393
+ #~ msgstr "Включает все элементы фида"
 
1394
 
1395
+ #~ msgid "Feed Container Background Color"
1396
+ #~ msgstr "Фоновый цвет контейнера фида"
 
 
 
 
 
 
1397
 
1398
+ #~ msgid "Feed Wrapper Width"
1399
+ #~ msgstr "Ширина враппера фида"
 
 
 
 
 
 
1400
 
1401
+ #~ msgid "Includes only feed images, does not include feed header"
1402
+ #~ msgstr "Включает только картинки фида, но не заголовок"
 
 
 
 
 
 
1403
 
1404
+ #~ msgid "Feed Wrapper Background Color"
1405
+ #~ msgstr "Фоновый цвет враппера фида"
 
 
 
 
 
 
1406
 
1407
+ #~ msgid "Header Margin"
1408
+ #~ msgstr "Отступ заголовка"
 
1409
 
1410
+ #~ msgid "Header Padding"
1411
+ #~ msgstr "Внутренний отступ заголовка"
 
 
1412
 
1413
+ #~ msgid "Header Border Size"
1414
+ #~ msgstr "Размер рамки заголовка"
 
 
 
 
1415
 
1416
+ #~ msgid "Header Border Color"
1417
+ #~ msgstr "Цвет рамки заголовка"
 
 
 
1418
 
1419
+ #~ msgid "Header Position"
1420
+ #~ msgstr "Позиция заголовка"
 
 
1421
 
1422
+ #~ msgid "Left"
1423
+ #~ msgstr "Слева"
 
1424
 
1425
+ #~ msgid "Center"
1426
+ #~ msgstr "По центру"
 
 
1427
 
1428
+ #~ msgid "Right"
1429
+ #~ msgstr "Справа"
 
 
1430
 
1431
+ #~ msgid "Header Image Width"
1432
+ #~ msgstr "Ширина названия картинки"
 
 
1433
 
1434
+ #~ msgid "Header Border Radius"
1435
+ #~ msgstr "Радиус рамки заголовка"
 
 
1436
 
1437
+ #~ msgid "Header Text Padding"
1438
+ #~ msgstr "Внутренний отступ текста заголовка"
 
 
1439
 
1440
+ #~ msgid "Header Text Color"
1441
+ #~ msgstr "Цвет текста заголовка"
 
 
1442
 
1443
+ #~ msgid "Header Font Weight"
1444
+ #~ msgstr "Толщина шрифта заголовка"
 
1445
 
1446
+ #~ msgid "400 (Normal)"
1447
+ #~ msgstr "400 (нормальный)"
 
1448
 
1449
+ #~ msgid "Header Text Font Size"
1450
+ #~ msgstr "Размер шрифта текста заголовка"
 
1451
 
1452
+ #~ msgid "Header Text Font Style"
1453
+ #~ msgstr "Стиль шрифта текста заголовка"
 
 
1454
 
1455
+ #~ msgid "Min Image Width"
1456
+ #~ msgstr "Минимальная ширина изображения"
 
 
 
1457
 
1458
+ #~ msgid "Max Image Width"
1459
+ #~ msgstr "Максимальная ширина изображения"
 
 
 
1460
 
1461
+ #~ msgid "User Horizontal Margin"
1462
+ #~ msgstr "Горизонтальный отступ имени пользователя"
 
1463
 
1464
+ #~ msgid "User Padding"
1465
+ #~ msgstr "Внутренний отступ имени пользователя"
 
1466
 
1467
+ #~ msgid "User Border Size"
1468
+ #~ msgstr "Размер рамки имени пользователя"
 
1469
 
1470
+ #~ msgid "User Border Color"
1471
+ #~ msgstr "Цвет рамки имени пользователя"
 
1472
 
1473
+ #~ msgid "User Border Radius"
1474
+ #~ msgstr "Радиус рамки имени пользователя"
 
1475
 
1476
+ #~ msgid "User Background Color"
1477
+ #~ msgstr "Фоновый цвет имени пользователя"
 
 
1478
 
1479
+ #~ msgid "Users Border Color"
1480
+ #~ msgstr "Цвет рамки имен пользователей"
 
1481
 
1482
+ #~ msgid "Users Background Color"
1483
+ #~ msgstr "Фоновый цвет ‪имен пользователей"
 
 
1484
 
1485
+ #~ msgid "Load More Button Position"
1486
+ #~ msgstr "Позиция кнопки \"Загрузить еще\""
 
1487
 
1488
+ #~ msgid "Load More Button Padding"
1489
+ #~ msgstr "Внутренний отступ кнопки \"Загрузить еще\""
 
1490
 
1491
+ #~ msgid "Load More Background Color"
1492
+ #~ msgstr "Фоновый цвет кнопки \"Загрузить еще\""
 
1493
 
1494
+ #~ msgid "Load More Button Border Radius"
1495
+ #~ msgstr "Радиус рамки кнопки \"Загрузить еще\""
 
1496
 
1497
+ #~ msgid "Load More Button Height"
1498
+ #~ msgstr "Высота кнопки \"Загрузить еще\""
 
1499
 
1500
+ #~ msgid "Load More Button Width"
1501
+ #~ msgstr "Ширина кнопки \"Загрузить еще\""
 
1502
 
1503
+ #~ msgid "Load More Button Border Size"
1504
+ #~ msgstr "Ширина рамки кнопки \"Загрузить еще\""
 
1505
 
1506
+ #~ msgid "Load More Button Border Color"
1507
+ #~ msgstr "Цвет рамки кнопки \"Загрузить еще\""
 
1508
 
1509
+ #~ msgid "Load More Button Text Color"
1510
+ #~ msgstr "Цвет текста кнопки \"Загрузить еще\""
 
1511
 
1512
+ #~ msgid "Load More Button Text Font Size"
1513
+ #~ msgstr "Размер шрифта кнопки \"Загрузить еще\""
 
1514
 
1515
+ #~ msgid "Load More Button Hover Color"
1516
+ #~ msgstr "Цвет при наведении на кнопку \"Загрузить еще\""
 
1517
 
1518
+ #~ msgid "Pagination Color"
1519
+ #~ msgstr "Цвет нумерации страниц"
 
 
 
 
1520
 
1521
+ #~ msgid "Pagination Height"
1522
+ #~ msgstr "Высота нумерации страниц"
 
1523
 
1524
+ #~ msgid "Pagination Button Margins"
1525
+ #~ msgstr "Отступы кнопки нумерации страниц"
 
1526
 
1527
+ #~ msgid "Pagination Hover Color"
1528
+ #~ msgstr "Цвет при наведении на нумерацию страниц"
 
1529
 
1530
+ #~ msgid "Pagination Buttons Alignment"
1531
+ #~ msgstr "Выравнивание кнопок нумерации страниц"
 
1532
 
1533
+ #~ msgid "Pagination Buttons Position"
1534
+ #~ msgstr "Позиция кнопок нумерации страниц"
 
1535
 
1536
+ #~ msgid "Top"
1537
+ #~ msgstr "Верх"
 
 
 
 
1538
 
1539
+ #~ msgid "Bottom"
1540
+ #~ msgstr "Низ"
 
1541
 
1542
+ #~ msgid "Overlay Background Color"
1543
+ #~ msgstr "Цвет фона наложения"
 
1544
 
1545
+ #~ msgid "Overlay background transparency"
1546
+ #~ msgstr "Прозрачность фона наложения"
 
1547
 
1548
+ #~ msgid "Lightbox Background Color"
1549
+ #~ msgstr "Цвет фона лайтбокса"
 
1550
 
1551
+ #~ msgid "Control Buttons Height"
1552
+ #~ msgstr "Высота кнопок управления"
 
 
 
 
 
1553
 
1554
+ #~ msgid "Control Buttons Margin (top)"
1555
+ #~ msgstr "Отступ кнопок управления (сверху)"
 
 
1556
 
1557
+ #~ msgid "Control Buttons Margin (left)"
1558
+ #~ msgstr "Отступ кнопок управления (слева)"
 
 
1559
 
1560
+ #~ msgid "Control Buttons Position"
1561
+ #~ msgstr "Положение кнопок управления"
 
1562
 
1563
+ #~ msgid "Control Buttons Background Color"
1564
+ #~ msgstr "Цвет фона кнопок управления"
 
1565
 
1566
+ #~ msgid "Control Buttons Container Border Radius"
1567
+ #~ msgstr "Радиус рамки контейнера кнопок управления"
 
 
1568
 
1569
+ #~ msgid "Control Buttons Transparency"
1570
+ #~ msgstr "Прозрачность кнопок управления"
1571
+
1572
+ #~ msgid "Control Buttons Alignment"
1573
+ #~ msgstr "Выравнивание кнопок управления"
1574
+
1575
+ #~ msgid "Control Buttons Color"
1576
+ #~ msgstr "Цвет кнопок управления"
1577
+
1578
+ #~ msgid "Toggle Button Height"
1579
+ #~ msgstr "Высота переключателя"
1580
+
1581
+ #~ msgid "Toggle Button Width"
1582
+ #~ msgstr "Ширина переключателя"
1583
+
1584
+ #~ msgid "Close Button Border Radius"
1585
+ #~ msgstr "Радиус рамки кнопки \"Закрыть\""
1586
+
1587
+ #~ msgid "Close Button Border Width"
1588
+ #~ msgstr "Ширина рамки кнопки \"Закрыть\""
1589
+
1590
+ #~ msgid "Close Button Border Style"
1591
+ #~ msgstr "Стиль рамки кнопки \"Закрыть\""
1592
+
1593
+ #~ msgid "Close Button Border Color"
1594
+ #~ msgstr "Цвет рамки кнопки \"Закрыть\""
1595
+
1596
+ #~ msgid "Close Button Box Shadow"
1597
+ #~ msgstr "Тень блока кнопки \"Закрыть\""
1598
+
1599
+ #~ msgid "Close Button Background Color"
1600
+ #~ msgstr "Цвет фона кнопки \"Закрыть\""
1601
+
1602
+ #~ msgid "Close Button Transparency"
1603
+ #~ msgstr "Прозрачность кнопки \"Закрыть\""
1604
+
1605
+ #~ msgid "Close Button Width"
1606
+ #~ msgstr "Ширина кнопки \"Закрыть\""
1607
+
1608
+ #~ msgid "Close Button Height"
1609
+ #~ msgstr "Высота кнопки \"Закрыть\""
1610
+
1611
+ #~ msgid "Close Button Top"
1612
+ #~ msgstr "Верхний отступ кнопки \"Закрыть\""
1613
+
1614
+ #~ msgid "Close Button Right"
1615
+ #~ msgstr "Правый отступ кнопки \"Закрыть\""
1616
+
1617
+ #~ msgid "Close Button Size"
1618
+ #~ msgstr "Размер кнопки \"Закрыть\""
1619
+
1620
+ #~ msgid "Close Button Color"
1621
+ #~ msgstr "Цвет кнопки \"Закрыть\""
1622
+
1623
+ #~ msgid "Fullscreen Close Button Color"
1624
+ #~ msgstr "Полноэкранный цвет кнопки \"Закрыть\""
1625
+
1626
+ #~ msgid "Share Buttons Color"
1627
+ #~ msgstr "Цвет кнопок \"Поделиться\""
1628
+
1629
+ #~ msgid "Right, Left Buttons Style"
1630
+ #~ msgstr "Стиль кнопок вправо / влево"
1631
+
1632
+ #~ msgid "Right, Left Buttons Background Color"
1633
+ #~ msgstr "Фоновой цвет кнопок вправо / влево"
1634
+
1635
+ #~ msgid "Right, Left Buttons Transparency"
1636
+ #~ msgstr "Прозрачность кнопок влево / вправо"
1637
+
1638
+ #~ msgid "Right, Left Buttons Box Shadow: "
1639
+ #~ msgstr "Тень блока кнопок вправо / влево"
1640
+
1641
+ #~ msgid "Right, Left Buttons Height"
1642
+ #~ msgstr "Высота кнопок вправо / влево"
1643
+
1644
+ #~ msgid "Right, Left Buttons Width"
1645
+ #~ msgstr "Ширина кнопок вправо / влево"
1646
+
1647
+ #~ msgid "Right, Left Buttons Size"
1648
+ #~ msgstr "Размеры кнопок вправо / влево "
1649
+
1650
+ #~ msgid "Right, Left, Close Buttons Hover Color"
1651
+ #~ msgstr "Цвет при наведении на кнопки Вправо, Влево, Закрыть"
1652
+
1653
+ #~ msgid "Right, Left Buttons Color"
1654
+ #~ msgstr "Цвет кнопок влево / вправо"
1655
+
1656
+ #~ msgid "Right, Left Buttons Border Radius"
1657
+ #~ msgstr "Радиус рамки кнопок вправо / влево"
1658
+
1659
+ #~ msgid "Right, Left Buttons Border Width"
1660
+ #~ msgstr "Ширина рамки кнопок враво / влево"
1661
+
1662
+ #~ msgid "Right, Left Buttons Border Style"
1663
+ #~ msgstr "Стиль рамки кнопок вправо / влево"
1664
+
1665
+ #~ msgid "Right, Left Buttons Border Color"
1666
+ #~ msgstr "Цвет рамки кнопок вправо / влево"
1667
+
1668
+ #~ msgid "Filmstrip Position"
1669
+ #~ msgstr "Позиция диафильма"
1670
+
1671
+ #~ msgid "Filmstrip Thumbnail Margin"
1672
+ #~ msgstr "Отступ между миниатюрами диафильма"
1673
+
1674
+ #~ msgid "Filmstrip Thumbnail Border Width"
1675
+ #~ msgstr "Ширина рамок миниатюр диафильма"
1676
+
1677
+ #~ msgid "Filmstrip Thumbnail Border Style"
1678
+ #~ msgstr "Стиль рамок миниатюр диафильма"
1679
+
1680
+ #~ msgid "Filmstrip Thumbnail Border Color"
1681
+ #~ msgstr "Цвет рамок миниатюр диафильма"
1682
+
1683
+ #~ msgid "Filmstrip Thumbnail Border Radius"
1684
+ #~ msgstr "Радиус рамок миниатюр диафильма"
1685
+
1686
+ #~ msgid "Filmstrip Thumbnail Active Border Width"
1687
+ #~ msgstr "Ширина рамок активной миниатюры диафильма"
1688
+
1689
+ #~ msgid "Filmstrip Thumbnail Active Border Color"
1690
+ #~ msgstr "Цвет рамки активной миниатюры диафильма"
1691
+
1692
+ #~ msgid "Filmstrip Thumbnail Deactive Transparency"
1693
+ #~ msgstr "Прозрачность неактивных миниатюр диафильма"
1694
+
1695
+ #~ msgid "Filmstrip Right, Left Buttons Size"
1696
+ #~ msgstr "Размер кнопок вправо / влево на диафильме"
1697
+
1698
+ #~ msgid "Filmstrip Right, Left Buttons Color"
1699
+ #~ msgstr "Цвет кнопок влево / вправо в диафильме"
1700
+
1701
+ #~ msgid "Filmstrip Right, Left Button Background Color"
1702
+ #~ msgstr "Цвет фона кнопок влево / вправо в диафильме"
1703
+
1704
+ #~ msgid "Info Position"
1705
+ #~ msgstr "Позиция информации"
1706
+
1707
+ #~ msgid "Info Alignment"
1708
+ #~ msgstr "Выравнивание информации"
1709
+
1710
+ #~ msgid "Info Background Color"
1711
+ #~ msgstr "Цвет фона информации"
1712
+
1713
+ #~ msgid "Info Background Transparency"
1714
+ #~ msgstr "Прозрачность фона информации"
1715
+
1716
+ #~ msgid "Info border width"
1717
+ #~ msgstr "Ширина рамки информации"
1718
+
1719
+ #~ msgid "Info Border Style"
1720
+ #~ msgstr "Стиль рамки информации"
1721
+
1722
+ #~ msgid "Info Border Color"
1723
+ #~ msgstr "Цвет рамки информации"
1724
+
1725
+ #~ msgid "Info Border Radius"
1726
+ #~ msgstr "Радиус рамки информации"
1727
+
1728
+ #~ msgid "Info Padding"
1729
+ #~ msgstr "Внутренний отступ информации"
1730
+
1731
+ #~ msgid "Info Margin"
1732
+ #~ msgstr "Отступ информации"
1733
+
1734
+ #~ msgid "Title Font Color"
1735
+ #~ msgstr "Цвет шрифта названия"
1736
+
1737
+ #~ msgid "Title Font Family"
1738
+ #~ msgstr "Семейство шрифтов названия"
1739
+
1740
+ #~ msgid "Title Font Weight"
1741
+ #~ msgstr "Толщина шрифта названия"
1742
+
1743
+ #~ msgid "Title Font Size"
1744
+ #~ msgstr "Размер шрифта названия"
1745
+
1746
+ #~ msgid "Description Font Color"
1747
+ #~ msgstr "Цвет шрифта описания"
1748
+
1749
+ #~ msgid "Description Font Family"
1750
+ #~ msgstr "Семейство шрифтов описания"
1751
+
1752
+ #~ msgid "Description Font Weight"
1753
+ #~ msgstr "Толщина шрифта описания"
1754
+
1755
+ #~ msgid "Description Font Size"
1756
+ #~ msgstr "Размер шрифта описания"
1757
+
1758
+ #~ msgid "Comments Width"
1759
+ #~ msgstr "Ширина комментариев"
1760
+
1761
+ #~ msgid "Comments Position"
1762
+ #~ msgstr "Положение комментариев"
1763
+
1764
+ #~ msgid "Comments Background Color"
1765
+ #~ msgstr "Цвет фона комментариев"
1766
+
1767
+ #~ msgid "Comments Font Size"
1768
+ #~ msgstr "Размер шрифта комментариев"
1769
+
1770
+ #~ msgid "Comments Font Color"
1771
+ #~ msgstr "Цвет шрифта комментариев"
1772
+
1773
+ #~ msgid "Comments Font Family"
1774
+ #~ msgstr "Семейство шрифтов комментариев"
1775
+
1776
+ #~ msgid "Comments Author Font Size"
1777
+ #~ msgstr "Размер шрифта автора комментариев"
1778
+
1779
+ #~ msgid "Users and Hashtag Color"
1780
+ #~ msgstr "Цвет ‪имен пользователей и хештегов"
1781
+
1782
+ #~ msgid "Users and Hashtag Hover Color"
1783
+ #~ msgstr "Цвет ‪имен пользователей и хештегов при наведении"
1784
+
1785
+ #~ msgid "Comments Date Font Size"
1786
+ #~ msgstr "Размер шрифта даты комментариев"
1787
+
1788
+ #~ msgid "Comments Body Font Size"
1789
+ #~ msgstr "Размер шрифта тела комментариев"
1790
+
1791
+ #~ msgid "Comment Input Border Width"
1792
+ #~ msgstr "Ширина рамки поля ввода комментариев"
1793
+
1794
+ #~ msgid "Comment Input Border Style"
1795
+ #~ msgstr "Стиль рамки поля ввода комментариев"
1796
+
1797
+ #~ msgid "Comment Input Border Color"
1798
+ #~ msgstr "Цвет рамки поля ввода комментариев"
1799
+
1800
+ #~ msgid "Comment Input Border Radius"
1801
+ #~ msgstr "Радиус рамки поля ввода комментариев"
1802
+
1803
+ #~ msgid "Comment Input Padding"
1804
+ #~ msgstr "Внутренний отступ поля ввода комментариев"
1805
+
1806
+ #~ msgid "Comment Input Background Color"
1807
+ #~ msgstr "Цвет фона поля ввода комментариев"
1808
+
1809
+ #~ msgid "Comment Button Background Color"
1810
+ #~ msgstr "Цвет фона кнопки комментирования"
1811
+
1812
+ #~ msgid "Comment Button Padding"
1813
+ #~ msgstr "Внутренний отступ кнопки комментирования"
1814
+
1815
+ #~ msgid "Comment Button Border Width"
1816
+ #~ msgstr "Ширина рамки кнопки комментирования"
1817
+
1818
+ #~ msgid "Comment Button Border Style"
1819
+ #~ msgstr "Стиль рамки кнопки комментирования"
1820
+
1821
+ #~ msgid "Comment Button Border Color"
1822
+ #~ msgstr "Цвет рамки кнопки комментирования"
1823
+
1824
+ #~ msgid "Comment Button Border Radius"
1825
+ #~ msgstr "Радиус рамки кнопки комментирования"
1826
+
1827
+ #~ msgid "Comment Separator Width"
1828
+ #~ msgstr "Ширина разделителя комментариев"
1829
+
1830
+ #~ msgid "Comment Separator Style"
1831
+ #~ msgstr "Стиль разделителя комментариев"
1832
+
1833
+ #~ msgid "Comment Separator Color"
1834
+ #~ msgstr "Цвет разделителя комментариев"
1835
+
1836
+ #~ msgid "Photo Wrapper Padding"
1837
+ #~ msgstr "Внутренний отступ враппера изображений"
1838
+
1839
+ #~ msgid "Photo Wrapper Border Size"
1840
+ #~ msgstr "Ширина рамки враппера изображений"
1841
+
1842
+ #~ msgid "Photo Wrapper Border Color"
1843
+ #~ msgstr "Цвет рамки враппера изображений"
1844
+
1845
+ #~ msgid "Photo border Radius"
1846
+ #~ msgstr "Радиус рамки изображения"
1847
+
1848
+ #~ msgid "Photo Wrapper Background Color"
1849
+ #~ msgstr "Фоновый цвет враппера изображения"
1850
+
1851
+ #~ msgid "Photo Meta Background Color"
1852
+ #~ msgstr "Фоновый цвет МЕТА-информации изображения"
1853
+
1854
+ #~ msgid "Same Line For Likes and Comments"
1855
+ #~ msgstr "Одна линия для лайков и комментариев"
1856
+
1857
+ #~ msgid "\"Likes\" Text Color"
1858
+ #~ msgstr "Цвет текста лайков"
1859
+
1860
+ #~ msgid "\"Comments\" Text Color"
1861
+ #~ msgstr "Цвет текста комментариев"
1862
+
1863
+ #~ msgid "Photo Caption Font Size"
1864
+ #~ msgstr "Размер шрифта подписи фото"
1865
+
1866
+ #~ msgid "Photo Caption Color"
1867
+ #~ msgstr "Цвет подписи фото"
1868
+
1869
+ #~ msgid "Photo Margin"
1870
+ #~ msgstr "Отступ подписи фото"
1871
+
1872
+ #~ msgid "Photo Caption Hover Color"
1873
+ #~ msgstr "Цвет при наведении на подпись фото"
1874
+
1875
+ #~ msgid "\"Likes\" and \"Comments\" Font Size"
1876
+ #~ msgstr "Размер шрифта лайков и комментариев"
1877
+
1878
+ #~ msgid "Access Token is invalid, please get it again"
1879
+ #~ msgstr "Токен доступа неверный, пожалуйста, получите его заново"
1880
+
1881
+ #~ msgid "Feed Doesn't exists"
1882
+ #~ msgstr "Фид не существует"
1883
+
1884
+ #~ msgid "Unable to display unpublished feed"
1885
+ #~ msgstr "Невозможно отобразить неопубликованный фид"
1886
+
1887
+ #~ msgid "Instagram WDI"
1888
+ #~ msgstr "Instagram WDI"
1889
+
1890
+ #~ msgid "Already added!"
1891
+ #~ msgstr "Уже добавлено!"
1892
+
1893
+ #~ msgid "Instagram WD description."
1894
+ #~ msgstr "Описание Instagram WD"
1895
+
1896
+ #~ msgid "Updates"
1897
+ #~ msgstr "Обновления"
1898
+
1899
+ #~ msgid ""
1900
+ #~ "You can download the latest version of your plugins from your %s "
1901
+ #~ "account.\n"
1902
+ #~ " After deactivate and delete the current version.\n"
1903
+ #~ " Install the downloaded latest version of the plugin."
1904
+ #~ msgstr ""
1905
+ #~ "Вы можете загрузить последнюю версию плагинов из своего %s аккаунта.\n"
1906
+ #~ " После деактивации удалите текущую версию.\n"
1907
+ #~ " Установите загруженную последнюю плагина."
1908
+
1909
+ #~ msgid "Current version %s"
1910
+ #~ msgstr "Текущая версия %s"
1911
+
1912
+ #~ msgid "There is a new %s version"
1913
+ #~ msgstr "Есть новая %s версия"
1914
+
1915
+ #~ msgid "What's new:"
1916
+ #~ msgstr "Что нового:"
1917
+
1918
+ #~ msgid "More updates"
1919
+ #~ msgstr "Больше обновлений"
1920
+
1921
+ #~ msgid "%s is up to date."
1922
+ #~ msgstr "%s обновлен."
1923
+
1924
+ #~ msgid "Show less"
1925
+ #~ msgstr "Показать меньше информации"
1926
 
1927
  #~ msgid "Close Button: "
1928
  #~ msgstr "Кнопка Закрыть"
license.txt ADDED
@@ -0,0 +1,233 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Preamble
5
+
6
+ The GNU General Public License is a free, copyleft license for software and other kinds of works.
7
+
8
+ The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
9
+
10
+ When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
11
+
12
+ To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
13
+
14
+ For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
15
+
16
+ Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
17
+
18
+ For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
19
+
20
+ Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
21
+
22
+ Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
23
+
24
+ The precise terms and conditions for copying, distribution and modification follow.
25
+
26
+ TERMS AND CONDITIONS
27
+
28
+ 0. Definitions.
29
+ “This License” refers to version 3 of the GNU General Public License.
30
+
31
+ “Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
32
+
33
+ “The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
34
+
35
+ To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
36
+
37
+ A “covered work” means either the unmodified Program or a work based on the Program.
38
+
39
+ To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
40
+
41
+ To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
42
+
43
+ An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
44
+
45
+ 1. Source Code.
46
+ The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
47
+
48
+ A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
49
+
50
+ The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
51
+
52
+ The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
53
+
54
+ The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
55
+
56
+ The Corresponding Source for a work in source code form is that same work.
57
+
58
+ 2. Basic Permissions.
59
+ All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
60
+
61
+ You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
62
+
63
+ Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
64
+
65
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
66
+ No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
67
+
68
+ When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
69
+
70
+ 4. Conveying Verbatim Copies.
71
+ You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
72
+
73
+ You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
74
+
75
+ 5. Conveying Modified Source Versions.
76
+ You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
77
+
78
+ a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
79
+ b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
80
+ c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
81
+ d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
82
+ A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
83
+
84
+ 6. Conveying Non-Source Forms.
85
+ You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
86
+
87
+ a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
88
+ b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
89
+ c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
90
+ d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
91
+ e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
92
+ A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
93
+
94
+ A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
95
+
96
+ “Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
97
+
98
+ If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
99
+
100
+ The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
101
+
102
+ Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
103
+
104
+ 7. Additional Terms.
105
+ “Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
106
+
107
+ When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
108
+
109
+ Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
110
+
111
+ a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
112
+ b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
113
+ c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
114
+ d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
115
+ e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
116
+ f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
117
+ All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
118
+
119
+ If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
120
+
121
+ Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
122
+
123
+ 8. Termination.
124
+ You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
125
+
126
+ However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
127
+
128
+ Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
129
+
130
+ Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
131
+
132
+ 9. Acceptance Not Required for Having Copies.
133
+ You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
134
+
135
+ 10. Automatic Licensing of Downstream Recipients.
136
+ Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
137
+
138
+ An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
139
+
140
+ You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
141
+
142
+ 11. Patents.
143
+ A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.
144
+
145
+ A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
146
+
147
+ Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
148
+
149
+ In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
150
+
151
+ If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
152
+
153
+ If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
154
+
155
+ A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
156
+
157
+ Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
158
+
159
+ 12. No Surrender of Others' Freedom.
160
+ If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
161
+
162
+ 13. Use with the GNU Affero General Public License.
163
+ Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
164
+
165
+ 14. Revised Versions of this License.
166
+ The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
167
+
168
+ Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
169
+
170
+ If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
171
+
172
+ Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
173
+
174
+ 15. Disclaimer of Warranty.
175
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
176
+
177
+ 16. Limitation of Liability.
178
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
179
+
180
+ 17. Interpretation of Sections 15 and 16.
181
+ If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
182
+
183
+ END OF TERMS AND CONDITIONS
184
+
185
+ Copyright 2013 jQuery Foundation and other contributors,
186
+ http://jqueryui.com/
187
+
188
+ This software consists of voluntary contributions made by many
189
+ individuals (AUTHORS.txt, http://jqueryui.com/about) For exact
190
+ contribution history, see the revision history and logs, available
191
+ at http://jquery-ui.googlecode.com/svn/
192
+
193
+ Permission is hereby granted, free of charge, to any person obtaining
194
+ a copy of this software and associated documentation files (the
195
+ "Software"), to deal in the Software without restriction, including
196
+ without limitation the rights to use, copy, modify, merge, publish,
197
+ distribute, sublicense, and/or sell copies of the Software, and to
198
+ permit persons to whom the Software is furnished to do so, subject to
199
+ the following conditions:
200
+
201
+ The above copyright notice and this permission notice shall be
202
+ included in all copies or substantial portions of the Software.
203
+
204
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
205
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
206
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
207
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
208
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
209
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
210
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
211
+
212
+ Copyright (c) 2013 ZURB, inc.
213
+
214
+ MIT License
215
+
216
+ Permission is hereby granted, free of charge, to any person obtaining
217
+ a copy of this software and associated documentation files (the
218
+ "Software"), to deal in the Software without restriction, including
219
+ without limitation the rights to use, copy, modify, merge, publish,
220
+ distribute, sublicense, and/or sell copies of the Software, and to
221
+ permit persons to whom the Software is furnished to do so, subject to
222
+ the following conditions:
223
+
224
+ The above copyright notice and this permission notice shall be
225
+ included in all copies or substantial portions of the Software.
226
+
227
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
228
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
229
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
230
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
231
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
232
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
233
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://web-dorado.com/products/wordpress-instagram-feed-wd.html
4
  Tags: : custom instagram Feed, instagram, instagram account, instagram feed, instagram photos, instagram plugin, instagram posts, instagram stream, instagram wall, mobile instagram, responsive instagram, gallery, hashtag, images, photos, shortcode, widget ,Grid instagram view, instagram gallery, instagram images, instagram page, instagram plugin, instagram responsive, instagram touch, Instagram widgets, lightbox instagram, lightbox, feed
5
  Requires at least: 3.9
6
  Tested up to: 4.4
7
- Stable tag: 1.0.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -102,6 +102,12 @@ After downloading the ZIP file of the Instagram Feed WD plugin,
102
 
103
  == Changelog ==
104
 
 
 
 
 
 
 
105
  =1.0.5=
106
  New: New year promo
107
 
4
  Tags: : custom instagram Feed, instagram, instagram account, instagram feed, instagram photos, instagram plugin, instagram posts, instagram stream, instagram wall, mobile instagram, responsive instagram, gallery, hashtag, images, photos, shortcode, widget ,Grid instagram view, instagram gallery, instagram images, instagram page, instagram plugin, instagram responsive, instagram touch, Instagram widgets, lightbox instagram, lightbox, feed
5
  Requires at least: 3.9
6
  Tested up to: 4.4
7
+ Stable tag: 1.0.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
102
 
103
  == Changelog ==
104
 
105
+ =1.0.6=
106
+ New: Conditional Filters (Pro)
107
+ New: Option for displaying username in masonry/thumbnails view (Pro)
108
+ Fixed: Minor bugs
109
+ New: Russian translation (Thanks to Ruslan Tertyshny).
110
+
111
  =1.0.5=
112
  New: New year promo
113
 
templates/plugin-uninstalled.php CHANGED
@@ -1,4 +1,4 @@
1
- <?php $deactivate_url = wp_nonce_url('plugins.php?action=deactivate&amp;plugin=wd-instagram-feed/instagram-wd.php', 'deactivate-plugin_wd-instagram-feed/instagram-wd.php'); ?>
2
  <div id="wdi_plugin_uninstalled">
3
  <div class="wdi_plugin_uninstalled_container">
4
  <style>
1
+ <?php $deactivate_url = wp_nonce_url('plugins.php?action=deactivate&amp;plugin=wd-instagram-feed/wd-instagram-feed.php', 'deactivate-plugin_wd-instagram-feed/wd-instagram-feed.php'); ?>
2
  <div id="wdi_plugin_uninstalled">
3
  <div class="wdi_plugin_uninstalled_container">
4
  <style>
update/wdi_update.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @param version without first '1' or '2'
4
+ *
5
+ */
6
+
7
+ function wdi_update_diff($new_v, $old_v = 0.0){
8
+ global $wpdb;
9
+ @ini_set('max_execution_time', 60);
10
+
11
+ if(version_compare($old_v, "0.6", '<')){
12
+
13
+ $wpdb->query("ALTER TABLE " . $wpdb->prefix . WDI_FEED_TABLE . " ADD `conditional_filters` varchar(10000) NOT NULL DEFAULT ''");
14
+ $wpdb->query("ALTER TABLE " . $wpdb->prefix . WDI_FEED_TABLE . " ADD `conditional_filter_type` varchar(32) NOT NULL DEFAULT 'none'");
15
+ $wpdb->query("ALTER TABLE " . $wpdb->prefix . WDI_FEED_TABLE . " ADD `show_username_on_thumb` varchar(32) NOT NULL DEFAULT '0'");
16
+ $wpdb->query("ALTER TABLE " . $wpdb->prefix . WDI_FEED_TABLE . " ADD `conditional_filter_enable` varchar(32) NOT NULL DEFAULT '0'");
17
+
18
+ $wpdb->query("ALTER TABLE " . $wpdb->prefix . WDI_THEME_TABLE . " ADD `th_thumb_user_bg_color` varchar(32) NOT NULL DEFAULT '#429FFF'");
19
+ $wpdb->query("ALTER TABLE " . $wpdb->prefix . WDI_THEME_TABLE . " ADD `th_thumb_user_color` varchar(32) NOT NULL DEFAULT '#FFFFFF'");
20
+ $wpdb->query("ALTER TABLE " . $wpdb->prefix . WDI_THEME_TABLE . " ADD `mas_thumb_user_bg_color` varchar(32) NOT NULL DEFAULT '#429FFF'");
21
+ $wpdb->query("ALTER TABLE " . $wpdb->prefix . WDI_THEME_TABLE . " ADD `mas_thumb_user_color` varchar(32) NOT NULL DEFAULT '#FFFFFF'");
22
+
23
+ require_once(WDI_DIR . '/framework/WDILibraryEmbed.php');
24
+
25
+ /*set master user id*/
26
+ $wdi_options = get_option(WDI_OPT);
27
+ $master_username = isset($wdi_options['wdi_user_name']) ? $wdi_options['wdi_user_name'] : false;
28
+ if($master_username){
29
+ $master_user_id = WDILibraryEmbed::get_instagram_id_by_username($master_username);
30
+ }
31
+ $wdi_options["wdi_user_id"] = $master_user_id ? $master_user_id : '';
32
+ update_option(WDI_OPT, $wdi_options);
33
+
34
+ /*set ids in feeds*/
35
+ $feeds = $wpdb->get_results( 'SELECT * FROM '.$wpdb->prefix . WDI_FEED_TABLE, ARRAY_A );
36
+ foreach ($feeds as $feed) {
37
+ $users_new = array();
38
+ $users = trim($feed['feed_users']);
39
+ $usersArr = explode(',',$users);
40
+ foreach ($usersArr as $username) {
41
+ if(substr($username, 0, 1) == "#"){
42
+ $current_user_id = $username;
43
+ }
44
+ else{
45
+ $current_user_id = WDILibraryEmbed::get_instagram_id_by_username($username);
46
+ }
47
+
48
+ $current_user = new stdClass();
49
+ $current_user->username = $username;
50
+ $current_user->id = $current_user_id;
51
+ array_push($users_new, $current_user);
52
+ }
53
+ $users_new_json = json_encode($users_new);
54
+ /*save current feed data into WPDB*/
55
+ $wpdb->update(
56
+ $wpdb->prefix . WDI_FEED_TABLE,
57
+ array(
58
+ 'feed_users' => $users_new_json,
59
+ ),
60
+ array( 'id' => $feed['id'] )
61
+ );
62
+ }
63
+ }
64
+
65
+ }
66
+
instagram-wd.php → wd-instagram-feed.php RENAMED
@@ -3,7 +3,7 @@
3
  Plugin Name: Instagram Feed WD
4
  Plugin URI: https://web-dorado.com/products/wordpress-instagram-feed-wd.html
5
  Description: WD Instagram 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.0.5
7
  Author: WebDorado
8
  Author URI: https://web-dorado.com
9
  License: GPLv2 or later
@@ -20,16 +20,10 @@ define("WDI_META", "_".WDI_VAR."_meta");
20
  //define("wdi",'wdi');
21
  define('WDI_FEED_TABLE','wdi_feeds');
22
  define('WDI_THEME_TABLE','wdi_themes');
23
- define('WDI_VERSION','1.0.5');
24
  define('WDI_IS_PRO','false');
25
 
26
 
27
-
28
-
29
-
30
-
31
-
32
-
33
  function wdi_use_home_url() {
34
  $home_url = str_replace("http://", "", home_url());
35
  $home_url = str_replace("https://", "", $home_url);
@@ -219,15 +213,19 @@ add_action('admin_enqueue_scripts','wdi_load_scripts');
219
 
220
  function wdi_load_scripts(){
221
  require_once(WDI_DIR . '/framework/WDILibrary.php');
 
222
  $page = WDILibrary::get('page');
223
  if($page === 'wdi_themes' || $page === 'wdi_feeds' || $page === 'wdi_settings' || $page==='wdi_uninstall'){
224
  wp_enqueue_script('jquery-color');
225
  wp_enqueue_script('wp-color-picker');
226
  wp_enqueue_style('wp-color-picker');
227
- wp_enqueue_script('wdi_admin',plugins_url('js/wdi_admin.js', __FILE__),array("jquery"), WDI_VERSION );
228
 
229
  $uninstall_url = wp_nonce_url( admin_url( 'admin-ajax.php' ), 'wdiUninstallPlugin', 'uninstall_nonce' );
230
 
 
 
 
231
  wp_localize_script("wdi_admin", 'wdi_ajax',array( 'ajax_url' => admin_url( 'admin-ajax.php' ),
232
  'uninstall_url' => $uninstall_url,
233
  'is_pro' => WDI_IS_PRO
@@ -238,18 +236,31 @@ function wdi_load_scripts(){
238
  'uninstall_confirm' => __( "All the data will be removed from the database. Continue?", "wdi" ),
239
  'instagram_server_error' => __('Some error with instagram servers, try agian later :(', "wdi" ),
240
  'invalid_user' => __('Invalid user:', "wdi" ),
241
- 'already_added' => __('Already added!', "wdi"),
242
  'user_not_exist' => __('User does not exist.', "wdi"),
243
  'network_error' => __("Network Error, please try again later. :(", "wdi"),
244
  'invalid_hashtag' => __('Invalid hashtag', "wdi"),
 
245
  'only_one_user_or_hashtag'=> __('You can add only one username or hashtag in FREE Version', "wdi"),
246
- 'available_in_pro' => __('Available in PRO Version','wdi'),
247
  'username_hashtag_multiple' => __('Combined Usernames/Hashtags are available only in PRO version'),
248
- 'theme_save_message_free' => __('Customizing Themes is available only in PRO version','wdi'),));
 
 
 
 
 
 
 
 
 
 
 
 
249
  wp_localize_script("wdi_admin", 'wdi_url',array('plugin_url'=>plugin_dir_url(__FILE__)));
250
  wp_localize_script("wdi_admin", 'wdi_admin',array('admin_url' =>get_admin_url()));
251
  }
252
-
253
 
254
  }
255
 
3
  Plugin Name: Instagram Feed WD
4
  Plugin URI: https://web-dorado.com/products/wordpress-instagram-feed-wd.html
5
  Description: WD Instagram 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.0.6
7
  Author: WebDorado
8
  Author URI: https://web-dorado.com
9
  License: GPLv2 or later
20
  //define("wdi",'wdi');
21
  define('WDI_FEED_TABLE','wdi_feeds');
22
  define('WDI_THEME_TABLE','wdi_themes');
23
+ define('WDI_VERSION','1.0.6');
24
  define('WDI_IS_PRO','false');
25
 
26
 
 
 
 
 
 
 
27
  function wdi_use_home_url() {
28
  $home_url = str_replace("http://", "", home_url());
29
  $home_url = str_replace("https://", "", $home_url);
213
 
214
  function wdi_load_scripts(){
215
  require_once(WDI_DIR . '/framework/WDILibrary.php');
216
+ global $wdi_options;
217
  $page = WDILibrary::get('page');
218
  if($page === 'wdi_themes' || $page === 'wdi_feeds' || $page === 'wdi_settings' || $page==='wdi_uninstall'){
219
  wp_enqueue_script('jquery-color');
220
  wp_enqueue_script('wp-color-picker');
221
  wp_enqueue_style('wp-color-picker');
222
+ wp_enqueue_script('wdi_admin',plugins_url('js/wdi_admin.js', __FILE__),array("jquery",'wdi_instagram'), WDI_VERSION );
223
 
224
  $uninstall_url = wp_nonce_url( admin_url( 'admin-ajax.php' ), 'wdiUninstallPlugin', 'uninstall_nonce' );
225
 
226
+ wp_enqueue_script('wdi_instagram',plugins_url('js/wdi_instagram.js', __FILE__),array("jquery"), WDI_VERSION );
227
+
228
+
229
  wp_localize_script("wdi_admin", 'wdi_ajax',array( 'ajax_url' => admin_url( 'admin-ajax.php' ),
230
  'uninstall_url' => $uninstall_url,
231
  'is_pro' => WDI_IS_PRO
236
  'uninstall_confirm' => __( "All the data will be removed from the database. Continue?", "wdi" ),
237
  'instagram_server_error' => __('Some error with instagram servers, try agian later :(', "wdi" ),
238
  'invalid_user' => __('Invalid user:', "wdi" ),
239
+ 'already_added' => __('already added!', "wdi"),
240
  'user_not_exist' => __('User does not exist.', "wdi"),
241
  'network_error' => __("Network Error, please try again later. :(", "wdi"),
242
  'invalid_hashtag' => __('Invalid hashtag', "wdi"),
243
+ 'hashtag_no_data' => __('This hashtag currently has no posts. Are you sure you want to add it?','wdi'),
244
  'only_one_user_or_hashtag'=> __('You can add only one username or hashtag in FREE Version', "wdi"),
245
+ 'available_in_pro' => __('Available in PRO','wdi'),
246
  'username_hashtag_multiple' => __('Combined Usernames/Hashtags are available only in PRO version'),
247
+ 'theme_save_message_free' => __('Customizing Themes is available only in PRO version','wdi'),
248
+ 'invalid_url' => __('URL is not valid','wdi'),
249
+ 'selectConditionType' => __('Please Select Condition Type','wdi'),
250
+ 'and_descr' => __('Show Posts Which Have All Of The Conditions','wdi'),
251
+ 'or_descr' => __('Show Posts Which Have At Least One Of The Conditions','wdi'),
252
+ 'nor_descr' => __('Hide Posts Which Have At Least One Of The Conditions','wdi'),
253
+ 'either' => __('EITHER','wdi'),
254
+ 'neither' => __('NEITHER','wdi'),
255
+ 'not' => __('EXCEPT','wdi'),
256
+ 'and' => __('AND','wdi'),
257
+ 'or' => __('OR','wdi'),
258
+ 'nor' => __('NOR','wdi')
259
+ ));
260
  wp_localize_script("wdi_admin", 'wdi_url',array('plugin_url'=>plugin_dir_url(__FILE__)));
261
  wp_localize_script("wdi_admin", 'wdi_admin',array('admin_url' =>get_admin_url()));
262
  }
263
+
264
 
265
  }
266