WD Instagram Feed – Instagram Gallery - Version 1.4.6

Version Description

Improved: Separate options for personal and business accounts. Improved: Increased loading time of feed. Fixed: Multiple accounts functionality.

Download this release

Release Info

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

Code changes from version 1.4.5 to 1.4.6

Files changed (72) hide show
  1. admin-functions.php +382 -216
  2. admin/controllers/WDIControllerFeeds_wdi.php +0 -568
  3. admin/controllers/WDIControllerSettings_wdi.php +0 -56
  4. admin/controllers/WDIControllerThemes_wdi.php +15 -639
  5. admin/controllers/WDIControllerUninstall_wdi.php +13 -22
  6. admin/controllers/WDIControllerWidget.php +6 -2
  7. admin/controllers/feeds.php +552 -0
  8. admin/controllers/settings.php +223 -0
  9. admin/models/WDIModelSettings_wdi.php +0 -10
  10. admin/models/WDIModelThemes_wdi.php +25 -18
  11. admin/models/{WDIModelFeeds_wdi.php → feeds.php} +51 -83
  12. admin/models/settings.php +12 -0
  13. admin/views/WDIViewFeeds_wdi.php +0 -668
  14. admin/views/WDIViewSettings_wdi.php +0 -132
  15. admin/views/WDIViewThemes_wdi.php +7 -7
  16. admin/views/WDIViewWidget.php +9 -0
  17. admin/views/feeds.php +1039 -0
  18. admin/views/settings.php +230 -0
  19. css/default_theme.css +0 -1079
  20. css/instagram.svg +1 -0
  21. css/wdi_backend.css +1243 -774
  22. css/wdi_backend.min.css +1 -1
  23. css/wdi_frontend.css +418 -21
  24. css/wdi_frontend.min.css +1 -1
  25. elementor/elementor.php +0 -1
  26. elementor/widget.php +8 -5
  27. framework/IsFree.php +4 -0
  28. framework/WDICache.php +84 -0
  29. framework/WDIInstagram.php +473 -0
  30. framework/WDILibrary.php +221 -115
  31. framework/WDILibraryEmbed.php +13 -25
  32. framework/WDI_admin_view.php +18 -24
  33. framework/WDI_form_builder.php +188 -68
  34. framework/WDI_generate_styles.php +1421 -0
  35. frontend/controllers/WDIControllerGalleryBox.php +1 -1
  36. frontend/controllers/imagebrowser.php +14 -19
  37. frontend/models/WDIModelGalleryBox.php +30 -64
  38. frontend/models/imagebrowser.php +2 -2
  39. frontend/models/thumbnails.php +3 -4
  40. frontend/shortcode.php +108 -73
  41. frontend/views/WDIViewGalleryBox.php +344 -459
  42. frontend/views/imagebrowser.php +209 -151
  43. frontend/views/thumbnails.php +67 -49
  44. images/arrow3.png +0 -0
  45. images/close.svg +1 -0
  46. images/feed_views/control_buttons.png +0 -0
  47. images/hny.jpg +0 -0
  48. images/i_support.png +0 -0
  49. images/instagram-connect-320.png +0 -0
  50. images/instagram-connect.png +0 -0
  51. images/instagram.svg +1 -0
  52. images/instagram_logo.png +0 -0
  53. images/menu_icon2.png +0 -0
  54. images/minus.png +0 -0
  55. images/notice.png +0 -0
  56. images/plus.png +0 -0
  57. images/publish.png +0 -0
  58. images/seo_logo.png +0 -0
  59. images/spinner.gif +0 -0
  60. images/unpublish.png +0 -0
  61. images/watermark.png +0 -0
  62. images/wd-logo.png +0 -0
  63. images/wd_slider.png +0 -0
  64. js/gallerybox/wdi_gallery_box.js +14 -358
  65. js/gallerybox/wdi_gallery_box.min.js +1 -1
  66. js/jquery.lazyload.min.js +2 -0
  67. js/wd_bp_install.min.js +0 -1
  68. js/wdi_admin.js +356 -461
  69. js/wdi_admin.min.js +1 -1
  70. js/wdi_frontend.js +58 -244
  71. js/wdi_frontend.min.js +1 -1
  72. js/wdi_instagram.js +352 -674
admin-functions.php CHANGED
@@ -1,39 +1,77 @@
1
  <?php
2
  /**
3
- * Checks if username and access_token exist, if not redirects to settings page
4
- */
5
-
6
- function wdi_check_necessary_params(){
7
  global $wdi_options;
8
- $instagram = (!isset($wdi_options['wdi_access_token']) || !isset($wdi_options['wdi_user_name']) || $wdi_options['wdi_access_token']=='' || $wdi_options['wdi_user_name'] =='');
9
- $fb = (empty($wdi_options['fb_token']) && empty($wdi_options['business_account_id']));
10
-
11
- if($instagram && $fb){
12
- ?>
13
- <script>
14
- window.location = "<?php echo admin_url('admin.php?page=wdi_settings');?>";
15
- </script>
16
- <?php
17
  }
18
  }
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  /**
22
  * checks if argument is 1 it displays success message on settings page after uninstalling plugin
23
  * else it displays error message already uninstalled
24
  */
25
-
26
- function wdi_uninstall_notice($arg){
27
- if ($arg == 1) {
28
  ?>
29
  <div class="updated">
30
- <p><?php _e('Succesfully Uninstalled!', "wd-instagram-feed"); ?></p>
31
  </div>
32
  <?php
33
- } else {
 
34
  ?>
35
  <div class="error">
36
- <p><?php _e('Already Unistalled', "wd-instagram-feed"); ?></p>
37
  </div>
38
  <?php
39
  }
@@ -42,9 +80,9 @@ function wdi_uninstall_notice($arg){
42
  /**
43
  * checks if plugin is uninstalled it displays to all users uninstalled screen
44
  */
45
- function wdi_check_uninstalled(){
46
  global $wdi_options;
47
- if (isset($wdi_options['wdi_plugin_uninstalled']) && $wdi_options['wdi_plugin_uninstalled'] == 'true') {
48
  require_once(WDI_DIR . '/templates/plugin-uninstalled.php');
49
  die();
50
  };
@@ -52,51 +90,43 @@ function wdi_check_uninstalled(){
52
 
53
  /**
54
  * triggered on plugin activation
55
- *
56
  * adds some plugin related options like plugin version and database version
57
  * also adds uninstalled option
58
  * after adding this basic options,creates tables for plugin in wordpress database
59
  */
60
-
61
- function wdi_install(){
62
  wdi_get_options();
63
  global $wdi_options;
64
- wp_schedule_event(time(), 'wdi_autoupdate_interval', 'wdi_schedule_event_hook');
65
-
66
- //delete wdi_admin_check transient recheck for updates on plugin activation
67
- delete_transient('wdi_update_check');
68
  $current_version = WDI_VERSION;
69
  $saved_version = get_option('wdi_version');
70
- if ($saved_version) {
71
-
72
- if (substr($saved_version, 0, 1) == '2' && substr($current_version, 0, 1) == '1') {
73
  wdi_set_options_defaults();
 
74
  return;
75
  }
76
-
77
  $old_version = substr($saved_version, 2);
78
  $new_version = substr(WDI_VERSION, 2);
79
-
80
  $newer = version_compare($new_version, $old_version, '>');
81
- if ($newer) {
82
  require_once WDI_DIR . '/update/wdi_update.php';
 
83
  /*adds new params for new versions*/
84
  wdi_update_diff($new_version, $old_version);
85
-
86
- if (!update_option('wdi_version', WDI_VERSION)) {
87
  add_option('wdi_version', WDI_VERSION);
88
  }
 
 
 
89
 
90
- }
91
- wdi_set_options_defaults();
92
-
93
- return;
94
-
95
  }
96
-
97
  wdi_set_options_defaults();
98
- //add_option( WDI_VAR.'_version',$version, '', 'yes' );
99
- // update_option( WDI_VAR.'_version',$version, '', 'yes' );
100
 
101
  global $wpdb;
102
  $table_name = $wpdb->prefix . WDI_FEED_TABLE;
@@ -168,19 +198,17 @@ function wdi_install(){
168
  conditional_filter_enable varchar(1) NOT NULL,
169
  liked_feed varchar(30) NOT NULL,
170
  mobile_breakpoint varchar(10) NOT NULL,
171
- redirect_url varchar(255) NOT NULL,
172
- feed_resolution varchar(255) NOT NULL,
173
- hashtag_top_recent varchar(10) NOT NULL,
174
-
175
 
176
  UNIQUE KEY id (id)
177
  ) $charset_collate;";
178
-
179
- if ($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) {
180
  //table is not created. you may create the table here.
181
  $wpdb->query($sql);
182
  }
183
-
184
  //dbDelta( $sql );
185
  $charset_collate2 = 'COLLATE latin1_general_ci';
186
  $table_name = $wpdb->prefix . WDI_THEME_TABLE;
@@ -435,135 +463,79 @@ function wdi_install(){
435
 
436
  UNIQUE KEY id (id)
437
  ) $charset_collate2;";
438
- // dbDelta( $sql );
439
- if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) {
440
  //table is not created. you may create the table here.
441
- $wpdb->query($sql);
442
- wdi_install_default_themes();
443
  }
444
-
445
- if(!update_option('wdi_version',WDI_VERSION )){
446
  add_option('wdi_version', WDI_VERSION);
447
  }
448
-
449
  /**
450
- * add api update notice
451
- * @since 1.1.0
452
- */
453
-
454
  $admin_notices_option = get_option('wdi_admin_notice', array());
455
  $admin_notices_option['api_update_token_reset'] = array(
456
- 'start' => current_time("n/j/Y"),
457
- 'int' => 0,
458
- 'dismissed' => 1, // dismissed on activate
459
- );
460
  update_option('wdi_admin_notice', $admin_notices_option);
461
-
 
 
 
 
462
  }
463
 
464
  function wdi_deactivate() {
465
- wp_clear_scheduled_hook( 'wdi_schedule_event_hook' );
466
  // Using this insted of flush_rewrite_rule() for better performance with multisite.
467
  global $wp_rewrite;
468
  $wp_rewrite->init();
469
  $wp_rewrite->flush_rules();
470
  }
471
 
472
- //Callback function for Settings Configure Section
473
- function wdi_configure_section_callback(){
474
- $new_url = urlencode(admin_url('admin.php?page=wdi_settings')) . '&response_type=token';
475
- $wdi_sample_feed_post_url = get_option('wdi_sample_feed_post_url');
476
- $default_feed_permalink = null;
477
- $options = get_option(WDI_OPT);
478
-
479
- if ($wdi_sample_feed_post_url == '1') {
480
- $wdi_sample_feed_post_id = get_option('wdi_sample_feed_post_id');
481
- $wdi_sample_feed_id = get_option('wdi_sample_feed_id');
482
- require_once(WDI_DIR . '/admin/models/WDIModelFeeds_wdi.php');
483
- $feed_model = new WDIModelFeeds_wdi();
484
- //getting all feed information from db
485
- $feed_row = WDILibrary::objectToArray($feed_model->get_feed_row($wdi_sample_feed_id));
486
- $demo_page_status = get_post_status($wdi_sample_feed_post_id);
487
-
488
-
489
- if ($wdi_sample_feed_post_id !== false && $demo_page_status != false && $demo_page_status != 'trash') {
490
- $default_feed_permalink = get_post_permalink($wdi_sample_feed_post_id);
491
- if (!is_string($default_feed_permalink)) {
492
- $default_feed_permalink = null;
493
- }
494
- }
495
- }
496
-
497
- ?>
498
- <div id="login_with_instagram">
499
- <?php if (!isset($options['wdi_access_token']) || $options['wdi_access_token'] == '') {
500
- WDILibrary::add_auth_button();
501
- }
502
- if (isset($options['wdi_access_token']) && $options['wdi_access_token'] != '' && $default_feed_permalink !== null) { ?>
503
- <a target="_blank" href="<?php echo $default_feed_permalink; ?>" class="wdi_default_feed_button"></a>
504
- <?php }
505
-
506
- if(isset($options['wdi_access_token']) && $options['wdi_access_token'] != '' && isset($feed_row)){
507
- ?>
508
- <a target="_blank" href="<?php echo esc_url(add_query_arg(array('page'=>'wdi_feeds',
509
- 'task'=>'edit',
510
- 'current_id' => $wdi_sample_feed_id,
511
- 'nonce_wd' => wp_create_nonce('nonce_wd')
512
- ), admin_url('admin.php'))); ?>" class="wdi_edit_default_feed_button"></a>
513
- <?php } ?>
514
- </div>
515
-
516
- <div class="wdi_access_token_missing">
517
- <?php
518
-
519
- if (!isset($options['wdi_access_token']) || $options['wdi_access_token'] == '' || !isset($options['wdi_user_name']) || $options['wdi_user_name'] == '')
520
- _e('You need Access Token for using Instagram API. Click sign in with Instagram button above to get yours. This will not show your Instagram media. After that you may create your feed.', "wd-instagram-feed");
521
- ?>
522
- </div>
523
- <?php
524
- }
525
-
526
- //Callback function for Settings Customize Section
527
- function wdi_customize_section_callback(){
528
-
529
- }
530
-
531
- //Callback function for Multiple accounts Section
532
- function wdi_multiple_accounts_section_callback(){
533
-
534
- }
535
-
536
- //Settings field callback:
537
  //receives settings element as parameter and checks it's type and displays proper form element
538
- function wdi_field_callback($element){
539
  $setting = $element[0];
540
  $wdi_formBuilder = new WDI_admin_view();
541
- switch($setting['type']) {
542
- case 'input':{
 
543
  $wdi_formBuilder->input($setting);
544
  break;
545
  }
546
- case 'checkbox':{
 
547
  $wdi_formBuilder->checkbox($setting);
548
  break;
549
  }
550
- case 'color':{
 
551
  $wdi_formBuilder->color($setting);
552
  break;
553
  }
554
- case 'textarea':{
 
555
  $wdi_formBuilder->textarea($setting);
556
  break;
557
  }
558
- case 'select':{
 
559
  $wdi_formBuilder->select($setting);
560
  break;
561
  }
562
- case 'link_button':{
 
563
  $wdi_formBuilder->link_button($setting);
564
  break;
565
  }
566
- case 'users_list':{
 
567
  $wdi_formBuilder->users_list($setting);
568
  break;
569
  }
@@ -571,15 +543,15 @@ function wdi_field_callback($element){
571
  }
572
 
573
  //Validatates input form submit forms
574
- function wdi_validate_options($input){
575
  global $wdi_options;
576
- foreach( $input as $key => $value ) {
577
- if( isset( $input[$key] ) ) {
578
- $wdi_options[$key] = strip_tags( stripslashes( $input[ $key ] ) );
579
- }
580
  }
 
581
 
582
- return apply_filters( 'wdi_validate_options', $wdi_options, $input );
583
  }
584
 
585
  function wdi_sanitize_options( $input ) {
@@ -604,8 +576,23 @@ function wdi_sanitize_options( $input ) {
604
  {
605
  global $wdi_options;
606
  $users_list = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
607
  $option = $input['wdi_authenticated_users_list'];
608
  //$saved_user_list = json_decode($wdi_options['wdi_authenticated_users_list'], true);
 
609
  if ( !empty($option['access_token']) ) {
610
 
611
  $user_count = count($option['access_token']);
@@ -618,9 +605,9 @@ function wdi_sanitize_options( $input ) {
618
  continue;
619
  }
620
  $users_list[$user_name] = array(
621
- 'access_token' => $option['access_token'][$i],
622
- 'user_name' => $user_name,
623
  'user_id' => $option['user_id'][$i],
 
 
624
  );
625
  }
626
  }
@@ -649,78 +636,177 @@ function wdi_sanitize_options( $input ) {
649
 
650
  return apply_filters('wdi_sanitize_options', $output, $input);
651
  }
652
- //Sets all settings for admin pages and returns associative array of settings
653
- function wdi_get_settings(){
654
- $opt = wdi_get_options();
655
-
656
- if(empty($opt['fb_token']) || empty($opt['business_account_id'])) {
657
- $fb_button_text = "Log In with Facebook";
658
- } else {
659
- $fb_button_text = "Reconnect";
660
- }
661
 
662
  $settings = array(
663
- 'wdi_access_token' => array('name' => 'wdi_access_token','sanitize_type'=>'text','input_size'=>'53','type'=>'input','default'=>'','field_or_not'=>'field','section'=>'wdi_configure_section','title'=>__('Primary Access Token',"wd-instagram-feed")),
664
- 'wdi_user_name' => array('name' => 'wdi_user_name','sanitize_type'=>'text', 'type'=>'input','input_size'=>'53','section'=>'wdi_configure_section','field_or_not'=>'field','default'=>'','title'=>__('Primary Username',"wd-instagram-feed")),
665
- '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'),
666
- 'wdi_fb_auth' => array('name'=>'wdi_fb_auth','sanitize_type'=>'','field_or_not'=>'','type'=>'link_button', 'section'=>'wdi_configure_section', 'href'=>wdi_get_graph_auth_url(), 'title'=>__('Log in for hashtag feed',"wd-instagram-feed"),'default'=>'', 'value'=>$fb_button_text, 'description' => 'Connect to Facebook Graph API to get hashtag feeds. See more in <a href="https://help.10web.io/hc/en-us/articles/360021344111?utm_source=instagram_feed&utm_medium=free_plugin" target="_blank">documentation</a>.'),
667
- 'wdi_transient_time' => array('name'=>'wdi_transient_time','sanitize_type'=>'number','field_or_not'=>'','type'=>'input', 'input_type'=>'number', 'section'=>'wdi_customize_section', 'title'=>__('Check for new posts every (min)',"wd-instagram-feed"),'default'=>'' ,'value'=>60),
668
- 'wdi_reset_cache' => array('name'=>'wdi_reset_cache','sanitize_type'=>'','field_or_not'=>'','type'=>'link_button', 'section'=>'wdi_customize_section', 'href'=>admin_url( 'admin.php?page=wdi_settings' ), 'title'=>__('Reset cache with Instagram data',"wd-instagram-feed"),'default'=>'', 'value'=>'Reset cache'),
669
- /* @TODO temporarily closed for update․
670
- 'wdi_authenticated_users_list' => array('name' => 'wdi_authenticated_users_list','sanitize_type'=>'users_list','input_size'=>'53','type'=>'users_list','default'=>'[]','field_or_not'=>'field','section'=>'wdi_customize_section','title'=>__('Multiple Instagram accounts ?',"wd-instagram-feed")),*/
671
- 'wdi_feeds_min_capability' => array('name'=>'wdi_feeds_min_capability',"sanitize_type"=> "text",'title'=>__('Minimal role to add and manage Feeds or Themes',"wd-instagram-feed"),'type'=>'select','field_or_not'=>'field',"default"=>"manage_options",'section'=>'wdi_customize_section','valid_options'=>array('manage_options'=>__('Administrator', 'wd-instagram-feed'),'publish_posts'=>__('Author', 'wd-instagram-feed'), 'contributor'=>__('Contributor', 'wd-instagram-feed'))),
672
- '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',"wd-instagram-feed")),
673
- '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',"wd-instagram-feed")),
674
- //'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',"wd-instagram-feed")),
675
- 'wdi_plugin_uninstalled' => array('name'=>'wdi_plugin_uninstalled','sanitize_type'=>'bool','field_or_not'=>'field','type'=>'input','input_type'=>'hidden','section'=>'wdi_customize_section','title'=>'','default'=>'false','value'=>'false'),
676
- 'fb_token' => array('name'=>'fb_token','sanitize_type'=>'','field_or_not'=>'field','type'=>'input','input_type'=>'hidden','section'=>'wdi_customize_section','title'=>'','default'=>''),
677
- 'business_account_id' => array('name'=>'business_account_id','sanitize_type'=>'','field_or_not'=>'field','type'=>'input','input_type'=>'hidden','section'=>'wdi_customize_section','title'=>'','default'=>''),
678
- 'wdi_uninstall' => array('name'=>'wdi_uninstall','sanitize_type'=>'','field_or_not'=>'','type'=>'link_button', 'section'=>'wdi_customize_section', 'href'=>admin_url( 'admin.php?page=wdi_uninstall' ), 'title'=>__('Uninstall',"wd-instagram-feed"),'default'=>''),
679
- //'wdi_version' => array('name'=>'wdi_version','field_or_not'=>'no_field','default'=>WDI_VERSION),
680
- //'wdi_first_time'=>array('name'=>'wdi_first_time','field_or_not'=>'no_field','default'=>'1')
681
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
682
  return $settings;
683
  }
684
 
685
  //Sets plugin default settings
686
- function wdi_set_options_defaults(){
687
  $db_options = array();
688
  $options = get_option(WDI_OPT);
689
-
690
  $settings = wdi_get_settings();
691
- foreach ($settings as $setting) {
692
- $settingDefault = isset($setting['default'])? $setting['default'] : '';
693
- $db_options[$setting['name']]=$settingDefault;
694
  }
695
-
696
- $options = wp_parse_args( $options, $db_options );
697
- if(isset($options['wdi_plugin_uninstalled']) && $options['wdi_plugin_uninstalled'] == 'true'){
698
  $options['wdi_plugin_uninstalled'] = 'false';
699
  }
700
-
701
- if(empty($options['wdi_authenticated_users_list'])){
702
  $options['wdi_authenticated_users_list'] = '[]';
703
  }
704
-
705
- add_option(WDI_OPT,$options,'','yes');
706
- update_option(WDI_OPT,$options,'yes');
707
- wdi_get_options();
708
  }
709
 
710
  function wdi_get_options() {
711
  global $wdi_options;
712
  $wdi_options = get_option(WDI_OPT);
 
713
  return apply_filters('wdi_get_options', $wdi_options);
714
  }
715
 
716
- function wdi_install_default_themes(){
717
  global $wdi_options;
718
  global $wpdb;
719
  require_once WDI_DIR . "/templates/default-themes.php";
720
  $default_themes = wdi_get_default_themes();
721
- foreach ($default_themes as $theme) {
722
  $table_name = $wpdb->prefix . WDI_THEME_TABLE;
723
- if ($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) {
724
  require_once(WDI_DIR . '/framework/WDILibrary.php');
725
  echo WDILibrary::message(__('Database error, please uninstall the plugin and install again', "wd-instagram-feed"), 'error');
726
  }
@@ -730,35 +816,115 @@ function wdi_install_default_themes(){
730
  }
731
  }
732
 
733
- function wdi_get_create_feeds_cap(){
734
  global $wdi_options;
735
  $min_feeds_capability = isset($wdi_options['wdi_feeds_min_capability']) ? $wdi_options['wdi_feeds_min_capability'] : "manage_options";
736
- if($min_feeds_capability == 'publish_posts') {
737
  $min_feeds_capability = 'publish_posts';
738
- } else if($min_feeds_capability == 'contributor') {
739
- $min_feeds_capability = 'contributor';
740
- } else {
741
- $min_feeds_capability = 'manage_options';
742
  }
 
 
 
 
 
 
 
 
 
743
  return $min_feeds_capability;
744
  }
745
 
746
- function wdi_get_graph_auth_url(){
747
- $app_id = '356432828483035';
748
- $redirect_uri = 'https://api.web-dorado.com/wdi/';
749
-
750
- $admin_url = admin_url('admin.php?page=wdi_settings');
 
 
 
 
 
 
 
 
 
 
 
751
 
 
 
 
 
 
 
 
752
  $state = array(
753
- 'wp_site_url' => $admin_url
754
  );
755
-
756
- $fb_url = add_query_arg(array(
757
- 'client_id' => $app_id,
758
- 'redirect_uri' => $redirect_uri,
759
- 'scope' => 'manage_pages,instagram_basic',
760
- ), "https://www.facebook.com/dialog/oauth");
761
-
762
- $fb_url .= '&state=' . base64_encode(json_encode($state));
763
- return $fb_url;
 
 
 
764
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
  /**
3
+ * Checks if username and access_token exist, if not redirects to settings page
4
+ */
5
+ function wdi_check_necessary_params() {
 
6
  global $wdi_options;
7
+ if ( empty($wdi_options['wdi_authenticated_users_list']) ) {
8
+ WDILibrary::redirect(add_query_arg(array(
9
+ 'page' => 'wdi_settings',
10
+ ), admin_url('admin.php')));
 
 
 
 
 
11
  }
12
  }
13
 
14
+ /**
15
+ * uninstall action callback
16
+ * this functions finds and deletes all plugin related tables from wordpress database
17
+ * also it deletes from options table plugin options sets uninstalled option as true
18
+ */
19
+ // add_action('wp_ajax_wdiUninstallPlugin','wdi_uninstall_ajax');
20
+ // function wdi_uninstall_ajax(){
21
+ // $nonce = isset($_REQUEST['uninstall_nonce']) ? $_REQUEST['uninstall_nonce'] : "";
22
+ // if(!wp_verify_nonce( $nonce, 'wdiUninstallPlugin' )){
23
+ // wp_die();
24
+ // }
25
+ // else{
26
+ // global $wpdb;
27
+ // $removed = false;
28
+ // $table_name = $wpdb->prefix.WDI_FEED_TABLE;
29
+ // $checktable = $wpdb->query("SHOW TABLES LIKE '$table_name'");
30
+ // $table_exists = $checktable > 0;
31
+ // if($table_exists){
32
+ // $sql = "DROP TABLE ". $table_name;
33
+ // $wpdb->query($sql);
34
+ // $removed = true;
35
+ // }
36
+ // $table_name = $wpdb->prefix.WDI_THEME_TABLE;
37
+ // $checktable = $wpdb->query("SHOW TABLES LIKE '$table_name'");
38
+ // $table_exists = $checktable > 0;
39
+ // if($table_exists){
40
+ // $sql = "DROP TABLE ". $table_name;
41
+ // $wpdb->query($sql);
42
+ // $removed = true;
43
+ // }
44
+ // if($removed == true) {
45
+ // wdi_uninstall_notice(1);
46
+ // }
47
+ // else{
48
+ // wdi_uninstall_notice(2);
49
+ // };
50
+ // delete_option(WDI_OPT);
51
+ // $default_option=array();
52
+ // $default_option['wdi_plugin_uninstalled'] = 'true';
53
+ // add_option(WDI_OPT,$default_option);
54
+ // delete_option('wdi_version');
55
+ // }
56
+ // wp_die();
57
+ // }
58
 
59
  /**
60
  * checks if argument is 1 it displays success message on settings page after uninstalling plugin
61
  * else it displays error message already uninstalled
62
  */
63
+ function wdi_uninstall_notice( $arg ) {
64
+ if ( $arg == 1 ) {
 
65
  ?>
66
  <div class="updated">
67
+ <p><?php _e('Succesfully Uninstalled!', 'wd-instagram-feed'); ?></p>
68
  </div>
69
  <?php
70
+ }
71
+ else {
72
  ?>
73
  <div class="error">
74
+ <p><?php _e('Already Unistalled', 'wd-instagram-feed'); ?></p>
75
  </div>
76
  <?php
77
  }
80
  /**
81
  * checks if plugin is uninstalled it displays to all users uninstalled screen
82
  */
83
+ function wdi_check_uninstalled() {
84
  global $wdi_options;
85
+ if ( isset($wdi_options['wdi_plugin_uninstalled']) && $wdi_options['wdi_plugin_uninstalled'] == 'true' ) {
86
  require_once(WDI_DIR . '/templates/plugin-uninstalled.php');
87
  die();
88
  };
90
 
91
  /**
92
  * triggered on plugin activation
 
93
  * adds some plugin related options like plugin version and database version
94
  * also adds uninstalled option
95
  * after adding this basic options,creates tables for plugin in wordpress database
96
  */
97
+ function wdi_install() {
 
98
  wdi_get_options();
99
  global $wdi_options;
100
+ wp_schedule_event(time(), 'wdi_autoupdate_interval', 'wdi_schedule_event_hook');
101
+ //delete wdi_admin_check transient recheck for updates on plugin activation
102
+ delete_transient('wdi_update_check');
 
103
  $current_version = WDI_VERSION;
104
  $saved_version = get_option('wdi_version');
105
+ wdi_parse_old_options($current_version, $saved_version);
106
+ if ( $saved_version ) {
107
+ if ( substr($saved_version, 0, 1) == '2' && substr($current_version, 0, 1) == '1' ) {
108
  wdi_set_options_defaults();
109
+
110
  return;
111
  }
 
112
  $old_version = substr($saved_version, 2);
113
  $new_version = substr(WDI_VERSION, 2);
 
114
  $newer = version_compare($new_version, $old_version, '>');
115
+ if ( $newer ) {
116
  require_once WDI_DIR . '/update/wdi_update.php';
117
+
118
  /*adds new params for new versions*/
119
  wdi_update_diff($new_version, $old_version);
120
+ if ( !update_option('wdi_version', WDI_VERSION) ) {
 
121
  add_option('wdi_version', WDI_VERSION);
122
  }
123
+ }
124
+ wdi_set_options_defaults();
125
+ wdi_generate_themes_files();
126
 
127
+ return;
 
 
 
 
128
  }
 
129
  wdi_set_options_defaults();
 
 
130
 
131
  global $wpdb;
132
  $table_name = $wpdb->prefix . WDI_FEED_TABLE;
198
  conditional_filter_enable varchar(1) NOT NULL,
199
  liked_feed varchar(30) NOT NULL,
200
  mobile_breakpoint varchar(10) NOT NULL,
201
+ redirect_url varchar(255) NOT NULL,
202
+ feed_resolution varchar(255) NOT NULL,
203
+ hashtag_top_recent varchar(10) NOT NULL,
204
+
205
 
206
  UNIQUE KEY id (id)
207
  ) $charset_collate;";
208
+ if ( $wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name ) {
 
209
  //table is not created. you may create the table here.
210
  $wpdb->query($sql);
211
  }
 
212
  //dbDelta( $sql );
213
  $charset_collate2 = 'COLLATE latin1_general_ci';
214
  $table_name = $wpdb->prefix . WDI_THEME_TABLE;
463
 
464
  UNIQUE KEY id (id)
465
  ) $charset_collate2;";
466
+ // dbDelta( $sql );
467
+ if ( $wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name ) {
468
  //table is not created. you may create the table here.
469
+ $wpdb->query($sql);
470
+ wdi_install_default_themes();
471
  }
472
+ if ( !update_option('wdi_version', WDI_VERSION) ) {
 
473
  add_option('wdi_version', WDI_VERSION);
474
  }
 
475
  /**
476
+ * add api update notice
477
+ *
478
+ * @since 1.1.0
479
+ */
480
  $admin_notices_option = get_option('wdi_admin_notice', array());
481
  $admin_notices_option['api_update_token_reset'] = array(
482
+ 'start' => current_time("n/j/Y"),
483
+ 'int' => 0,
484
+ 'dismissed' => 1, // dismissed on activate
485
+ );
486
  update_option('wdi_admin_notice', $admin_notices_option);
487
+ wdi_generate_themes_files();
488
+ // Using this insted of flush_rewrite_rule() for better performance with multisite.
489
+ global $wp_rewrite;
490
+ $wp_rewrite->init();
491
+ $wp_rewrite->flush_rules();
492
  }
493
 
494
  function wdi_deactivate() {
495
+ wp_clear_scheduled_hook('wdi_schedule_event_hook');
496
  // Using this insted of flush_rewrite_rule() for better performance with multisite.
497
  global $wp_rewrite;
498
  $wp_rewrite->init();
499
  $wp_rewrite->flush_rules();
500
  }
501
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
502
  //receives settings element as parameter and checks it's type and displays proper form element
503
+ function wdi_field_callback( $element ) {
504
  $setting = $element[0];
505
  $wdi_formBuilder = new WDI_admin_view();
506
+ switch ( $setting['type'] ) {
507
+ case 'input':
508
+ {
509
  $wdi_formBuilder->input($setting);
510
  break;
511
  }
512
+ case 'checkbox':
513
+ {
514
  $wdi_formBuilder->checkbox($setting);
515
  break;
516
  }
517
+ case 'color':
518
+ {
519
  $wdi_formBuilder->color($setting);
520
  break;
521
  }
522
+ case 'textarea':
523
+ {
524
  $wdi_formBuilder->textarea($setting);
525
  break;
526
  }
527
+ case 'select':
528
+ {
529
  $wdi_formBuilder->select($setting);
530
  break;
531
  }
532
+ case 'link_button':
533
+ {
534
  $wdi_formBuilder->link_button($setting);
535
  break;
536
  }
537
+ case 'users_list':
538
+ {
539
  $wdi_formBuilder->users_list($setting);
540
  break;
541
  }
543
  }
544
 
545
  //Validatates input form submit forms
546
+ function wdi_validate_options( $input ) {
547
  global $wdi_options;
548
+ foreach ( $input as $key => $value ) {
549
+ if ( isset($input[$key]) ) {
550
+ $wdi_options[$key] = strip_tags(stripslashes($input[$key]));
 
551
  }
552
+ }
553
 
554
+ return apply_filters('wdi_validate_options', $wdi_options, $input);
555
  }
556
 
557
  function wdi_sanitize_options( $input ) {
576
  {
577
  global $wdi_options;
578
  $users_list = array();
579
+ $authenticated_users_list = $input['wdi_authenticated_users_list'];
580
+ if ( !empty($authenticated_users_list) ) {
581
+ foreach ( $authenticated_users_list as $ukey => $uval ) {
582
+ if ( $wdi_options['wdi_user_name'] === $ukey ) {
583
+ continue;
584
+ }
585
+ $users_list[$user_name] = array(
586
+ 'user_id' => $uval['user_id'],
587
+ 'user_name' => $uval['user_name'],
588
+ 'access_token' => $uval['access_token'],
589
+ );
590
+ }
591
+ }
592
+
593
  $option = $input['wdi_authenticated_users_list'];
594
  //$saved_user_list = json_decode($wdi_options['wdi_authenticated_users_list'], true);
595
+
596
  if ( !empty($option['access_token']) ) {
597
 
598
  $user_count = count($option['access_token']);
605
  continue;
606
  }
607
  $users_list[$user_name] = array(
 
 
608
  'user_id' => $option['user_id'][$i],
609
+ 'user_name' => $user_name,
610
+ 'access_token' => $option['access_token'][$i],
611
  );
612
  }
613
  }
636
 
637
  return apply_filters('wdi_sanitize_options', $output, $input);
638
  }
639
+
640
+ // Sets all settings for admin pages and returns associative array of settings
641
+ function wdi_get_settings() {
642
+ $opt = wdi_get_options();
 
 
 
 
 
643
 
644
  $settings = array(
645
+ 'wdi_access_token' => array(
646
+ 'name' => 'wdi_access_token',
647
+ 'sanitize_type' => 'text',
648
+ 'input_size' => '53',
649
+ 'type' => 'input',
650
+ 'default' => '',
651
+ 'field_or_not' => 'field',
652
+ 'section' => 'wdi_configure_section',
653
+ 'title' => __('Primary Access Token', "wd-instagram-feed"),
654
+ ),
655
+ 'wdi_user_name' => array(
656
+ 'name' => 'wdi_user_name',
657
+ 'sanitize_type' => 'text',
658
+ 'type' => 'input',
659
+ 'input_size' => '53',
660
+ 'section' => 'wdi_configure_section',
661
+ 'field_or_not' => 'field',
662
+ 'default' => '',
663
+ 'title' => __('Primary Username', "wd-instagram-feed"),
664
+ ),
665
+ 'wdi_user_id' => array(
666
+ 'name' => 'wdi_user_id',
667
+ 'sanitize_type' => 'text',
668
+ 'type' => 'input',
669
+ 'section' => 'wdi_configure_section',
670
+ 'readonly' => 'readonly',
671
+ 'default' => '',
672
+ 'field_or_not' => 'no_field',
673
+ ),
674
+ 'wdi_start_in' => array(
675
+ 'name' => 'wdi_start_in',
676
+ 'sanitize_type' => 'text',
677
+ 'type' => 'input',
678
+ 'section' => 'wdi_configure_section',
679
+ 'readonly' => 'readonly',
680
+ 'default' => '',
681
+ 'field_or_not' => 'no_field',
682
+ ),
683
+ 'wdi_expires_in' => array(
684
+ 'name' => 'wdi_expires_in',
685
+ 'sanitize_type' => 'text',
686
+ 'type' => 'input',
687
+ 'section' => 'wdi_configure_section',
688
+ 'readonly' => 'readonly',
689
+ 'default' => '',
690
+ 'field_or_not' => 'no_field',
691
+ ),
692
+ 'wdi_transient_time' => array(
693
+ 'name' => 'wdi_transient_time',
694
+ 'sanitize_type' => 'number',
695
+ 'field_or_not' => '',
696
+ 'type' => 'input',
697
+ 'input_type' => 'number',
698
+ 'section' => 'wdi_customize_section',
699
+ 'title' => __('Check for new posts every (min)', "wd-instagram-feed"),
700
+ 'default' => '60',
701
+ 'value' => '',
702
+ ),
703
+ 'wdi_authenticated_users_list' => array(
704
+ 'name' => 'wdi_authenticated_users_list',
705
+ 'sanitize_type' => '', // users_list
706
+ 'input_size' => '53',
707
+ 'type' => 'users_list',
708
+ 'default' => '[]',
709
+ 'field_or_not' => 'field',
710
+ 'section' => 'wdi_customize_section',
711
+ 'title' => __('Multiple Instagram accounts ?', "wd-instagram-feed"),
712
+ ),
713
+ 'wdi_feeds_min_capability' => array(
714
+ 'name' => 'wdi_feeds_min_capability',
715
+ "sanitize_type" => "text",
716
+ 'title' => __('Minimal role to add and manage Feeds or Themes', "wd-instagram-feed"),
717
+ 'type' => 'select',
718
+ 'field_or_not' => 'field',
719
+ "default" => "manage_options",
720
+ 'section' => 'wdi_customize_section',
721
+ 'valid_options' => array(
722
+ 'manage_options' => __('Administrator', 'wd-instagram-feed'),
723
+ 'publish_posts' => __('Author', 'wd-instagram-feed'),
724
+ 'contributor' => __('Contributor', 'wd-instagram-feed'),
725
+ ),
726
+ ),
727
+ 'wdi_custom_css' => array(
728
+ 'name' => 'wdi_custom_css',
729
+ 'sanitize_type' => 'css',
730
+ 'type' => 'textarea',
731
+ 'section' => 'wdi_customize_section',
732
+ 'field_or_not' => 'field',
733
+ 'default' => '',
734
+ 'title' => __('Custom CSS', "wd-instagram-feed"),
735
+ ),
736
+ 'wdi_custom_js' => array(
737
+ 'name' => 'wdi_custom_js',
738
+ 'sanitize_type' => 'css',
739
+ 'type' => 'textarea',
740
+ 'section' => 'wdi_customize_section',
741
+ 'field_or_not' => 'field',
742
+ 'default' => '',
743
+ 'title' => __('Custom JavaScript', "wd-instagram-feed"),
744
+ ),
745
+ //'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',"wd-instagram-feed")),
746
+ 'wdi_plugin_uninstalled' => array(
747
+ 'name' => 'wdi_plugin_uninstalled',
748
+ 'sanitize_type' => 'bool',
749
+ 'field_or_not' => 'field',
750
+ 'type' => 'input',
751
+ 'input_type' => 'hidden',
752
+ 'section' => 'wdi_customize_section',
753
+ 'title' => '',
754
+ 'default' => 'false',
755
+ 'value' => 'false',
756
+ ),
757
+ 'wdi_uninstall' => array(
758
+ 'name' => 'wdi_uninstall',
759
+ 'sanitize_type' => '',
760
+ 'field_or_not' => '',
761
+ 'type' => 'link_button',
762
+ 'section' => 'wdi_customize_section',
763
+ 'href' => admin_url('admin.php?page=wdi_uninstall'),
764
+ 'title' => __('Uninstall', "wd-instagram-feed"),
765
+ 'default' => '',
766
+ ),
767
+ //'wdi_version' => array('name'=>'wdi_version','field_or_not'=>'no_field','default'=>WDI_VERSION),
768
+ //'wdi_first_time'=>array('name'=>'wdi_first_time','field_or_not'=>'no_field','default'=>'1')
769
+ );
770
+
771
  return $settings;
772
  }
773
 
774
  //Sets plugin default settings
775
+ function wdi_set_options_defaults() {
776
  $db_options = array();
777
  $options = get_option(WDI_OPT);
 
778
  $settings = wdi_get_settings();
779
+ foreach ( $settings as $setting ) {
780
+ $settingDefault = isset($setting['default']) ? $setting['default'] : '';
781
+ $db_options[$setting['name']] = $settingDefault;
782
  }
783
+ $options = wp_parse_args($options, $db_options);
784
+ if ( isset($options['wdi_plugin_uninstalled']) && $options['wdi_plugin_uninstalled'] == 'true' ) {
 
785
  $options['wdi_plugin_uninstalled'] = 'false';
786
  }
787
+ if ( empty($options['wdi_authenticated_users_list']) ) {
 
788
  $options['wdi_authenticated_users_list'] = '[]';
789
  }
790
+ add_option(WDI_OPT, $options, '', 'yes');
791
+ update_option(WDI_OPT, $options, 'yes');
792
+ wdi_get_options();
 
793
  }
794
 
795
  function wdi_get_options() {
796
  global $wdi_options;
797
  $wdi_options = get_option(WDI_OPT);
798
+
799
  return apply_filters('wdi_get_options', $wdi_options);
800
  }
801
 
802
+ function wdi_install_default_themes() {
803
  global $wdi_options;
804
  global $wpdb;
805
  require_once WDI_DIR . "/templates/default-themes.php";
806
  $default_themes = wdi_get_default_themes();
807
+ foreach ( $default_themes as $theme ) {
808
  $table_name = $wpdb->prefix . WDI_THEME_TABLE;
809
+ if ( $wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name ) {
810
  require_once(WDI_DIR . '/framework/WDILibrary.php');
811
  echo WDILibrary::message(__('Database error, please uninstall the plugin and install again', "wd-instagram-feed"), 'error');
812
  }
816
  }
817
  }
818
 
819
+ function wdi_get_create_feeds_cap() {
820
  global $wdi_options;
821
  $min_feeds_capability = isset($wdi_options['wdi_feeds_min_capability']) ? $wdi_options['wdi_feeds_min_capability'] : "manage_options";
822
+ if ( $min_feeds_capability == 'publish_posts' ) {
823
  $min_feeds_capability = 'publish_posts';
 
 
 
 
824
  }
825
+ else {
826
+ if ( $min_feeds_capability == 'contributor' ) {
827
+ $min_feeds_capability = 'contributor';
828
+ }
829
+ else {
830
+ $min_feeds_capability = 'manage_options';
831
+ }
832
+ }
833
+
834
  return $min_feeds_capability;
835
  }
836
 
837
+ function wdi_generate_themes_files() {
838
+ require_once WDI_DIR . '/admin/models/WDIModelThemes_wdi.php';
839
+ require_once WDI_DIR . '/framework/WDILibrary.php';
840
+ $themes = WDIModelThemes_wdi::get_themes();
841
+ if ( !is_array($themes) || empty($themes) ) {
842
+ return;
843
+ }
844
+ require_once WDI_DIR . '/admin/controllers/WDIControllerThemes_wdi.php';
845
+ WDIControllerThemes_wdi::remove_all_themes_files();
846
+ require_once WDI_DIR . '/framework/WDI_generate_styles.php';
847
+ foreach ( $themes as $id => $theme_title ) {
848
+ $theme_row = WDIModelThemes_wdi::get_theme_row($id);
849
+ $generator = new WDI_generate_styles($id, (array) $theme_row);
850
+ $generator->all_views_styles();
851
+ }
852
+ }
853
 
854
+ /**
855
+ * Get authorize urls.
856
+ * @return array
857
+ */
858
+ function wdi_get_auth_urls() {
859
+ require_once WDI_DIR . '/framework/WDILibrary.php';
860
+ $config = WDILibrary::instagram_app_config();
861
  $state = array(
862
+ 'wp_site_url' => admin_url('admin.php?page=wdi_settings'),
863
  );
864
+ $urls = array();
865
+ $urls['personal'] = add_query_arg(array(
866
+ 'app_id' => $config['basic_app_id'],
867
+ 'redirect_uri' => $config['basic_redirect_uri'],
868
+ 'scope' => $config['basic_scope'],
869
+ 'response_type' => $config['basic_response_type'],
870
+ 'state' => admin_url('admin.php?wdi_settings')
871
+ ), $config['basic_authorize_url']);
872
+
873
+ $urls['business'] = "";
874
+
875
+ return $urls;
876
  }
877
+
878
+ function wdi_parse_old_options( $new_version, $old_version ) {
879
+ if ( !empty($old_version) && version_compare($new_version, $old_version, '>') ) {
880
+ $options = wdi_get_options();
881
+ if ( !empty($options) ) {
882
+ $users = array();
883
+ $users[$options['wdi_user_name']] = array(
884
+ 'type' => 'personal',
885
+ 'user_id' => $options['wdi_user_id'],
886
+ 'user_name' => $options['wdi_user_name'],
887
+ 'access_token' => $options['wdi_access_token'],
888
+ 'start_in' => $options['wdi_start_in'],
889
+ 'expires_in' => $options['wdi_expires_in'],
890
+ );
891
+ if ( !empty($options['wdi_business_ig_user']) ) {
892
+ $business_users = json_decode($options['wdi_business_ig_user'], TRUE);
893
+ if ( !empty($business_users) ) {
894
+ $users[$business_users['username']] = array(
895
+ 'type' => 'business',
896
+ 'user_id' => $business_users['id'],
897
+ 'user_name' => $business_users['username'],
898
+ 'biography' => $business_users['biography'],
899
+ 'profile_picture_url' => $business_users['profile_picture_url'],
900
+ 'followers_count' => $business_users['followers_count'],
901
+ 'follows_count' => $business_users['follows_count'],
902
+ 'media_count' => $business_users['media_count'],
903
+ 'website' => $business_users['website'],
904
+ 'access_token' => $options['fb_token'],
905
+ 'start_in' => $options['wdi_start_in'],
906
+ 'expires_in' => $options['wdi_expires_in'],
907
+ );
908
+ }
909
+ }
910
+ if ( !empty($users) ) {
911
+ // old options removed.
912
+ $unset_options = array(
913
+ 'fb_token',
914
+ 'wdi_fb_auth',
915
+ 'business_account_id',
916
+ 'wdi_business_ig_user',
917
+ 'wdi_business_fb_page',
918
+ );
919
+ // 'wdi_access_token', 'wdi_user_name', 'wdi_user_id', 'wdi_start_in', 'wdi_expires_in',
920
+ foreach ( $unset_options as $key => $val ) {
921
+ if ( isset($options[$val]) ) {
922
+ unset($options[$val]);
923
+ }
924
+ }
925
+ $options['wdi_authenticated_users_list'] = json_encode($users);
926
+ update_option(WDI_OPT, $options, 'yes');
927
+ }
928
+ }
929
+ }
930
+ }
admin/controllers/WDIControllerFeeds_wdi.php DELETED
@@ -1,568 +0,0 @@
1
- <?php
2
- class WDIControllerFeeds_wdi {
3
-
4
- private $dataFormat;
5
-
6
- public function __construct() {
7
- $this->setDataFormat();
8
- }
9
-
10
- public function execute() {
11
- $task = WDILibrary::get('task');
12
- $id = WDILibrary::get('current_id', 0);
13
- $message = WDILibrary::get('message');
14
- echo WDILibrary::message_id($message);
15
- $get_method_tasks = array(
16
- "add",
17
- "edit",
18
- "display"
19
- );
20
- if ( method_exists($this, $task) ) {
21
- if( !in_array($task , $get_method_tasks) ) {
22
- check_admin_referer('nonce_wd', 'nonce_wd');
23
- }
24
- $this->$task($id);
25
- }
26
- else {
27
- $search_value = WDILibrary::get('search_value', '');
28
- if( !empty($search_value) ) {
29
- WDILibrary::wdi_spider_redirect(add_query_arg(array(
30
- 'page' => WDILibrary::get('page'),
31
- 'task' => 'display',
32
- 'search' => $search_value,
33
- ), admin_url('admin.php')));
34
- }else{
35
- $this->display();
36
- }
37
- }
38
- }
39
-
40
- public function create_feed($settings = array()) {
41
- require_once WDI_DIR . "/admin/models/WDIModelFeeds_wdi.php";
42
- $model = new WDIModelFeeds_wdi();
43
-
44
- $defaults = $model->wdi_get_feed_defaults();
45
-
46
- if (!empty($settings)) {
47
- $settings = $this->sanitize_input($settings, $defaults);
48
- $settings = wp_parse_args($settings, $defaults);
49
- } else {
50
- $settings = $defaults;
51
- }
52
-
53
- global $wpdb;
54
-
55
- $wpdb->insert($wpdb->prefix . WDI_FEED_TABLE, $settings, $this->dataFormat);
56
- return $wpdb->insert_id;
57
- }
58
-
59
- private function setDataFormat(){
60
- $this->dataFormat = array(
61
- '%s',/*feed_name*/
62
- '%s',/*feed_thumb*/
63
- '%s',/*thumb_user*/
64
- '%d',/*published*/
65
- '%d',/*theme_id*/
66
-
67
- '%s',/*feed_users*/
68
- '%s',/*feed_display_view*/
69
- '%s',/*sort_images_by*/
70
- '%s',/*display_order*/
71
- '%d',/*follow_on_instagram_btn*/
72
-
73
- '%d',/*display_header*/
74
- '%d',/*number_of_photos*/
75
- '%d',/*load_more_number*/
76
- '%d',/*'pagination_per_page_number'*/
77
- '%d',/*'pagination_preload_number'*/
78
-
79
- '%d',/*image_browser_preload_number*/
80
- '%d',/*image_browser_load_number*/
81
- '%d',/*number_of_columns*/
82
- '%d',/*resort_after_load_more*/
83
- '%d',/*show_likes*/
84
-
85
- '%d',/*show_description*/
86
- '%d',/*show_comments*/
87
- '%d',/*show_usernames*/
88
- '%d',/*display_user_info*/
89
- '%d',//'display_user_post_follow_number'
90
-
91
- '%d',/*show_full_description*/
92
- '%d',/*disable_mobile_layout*/
93
- '%s',/*feed_type*/
94
- '%s',/*feed_item_onclick*/
95
-
96
- '%d',//'popup_fullscreen'=>'bool',
97
-
98
- '%d',//'popup_width'=>'number',
99
- '%d',//'popup_height'=>'number',
100
- '%s',//'popup_type'=>'string',
101
- '%d',//'popup_autoplay'=>'bool',
102
- '%d',//'popup_interval'=>'number',
103
-
104
- '%d',//'popup_enable_filmstrip'=>'bool',
105
- '%d',//'popup_filmstrip_height'=>'number',
106
- '%d',//'autohide_lightbox_navigation'=>'bool',
107
- '%d',//'popup_enable_ctrl_btn'=>'bool',
108
- '%d',//'popup_enable_fullscreen'=>'bool',
109
-
110
- '%d',//'popup_enable_info'=>'bool',
111
- '%d',//'popup_info_always_show'=>'bool',
112
- '%d',//'popup_info_full_width'=>'bool',
113
- '%d',//'popup_enable_comment'=>'bool',
114
- '%d',//'popup_enable_fullsize_image'=>'bool',
115
-
116
- '%d',//'popup_enable_download'=>'bool',
117
- '%d',//popup_enable_share_buttons=>'bool',
118
- '%d',//'popup_enable_facebook'=>'bool',
119
- '%d',//'popup_enable_twitter'=>'bool',
120
- '%d',//'popup_enable_google'=>'bool',
121
-
122
- '%d',//'popup_enable_pinterest'=>'bool',
123
- '%d',//'popup_enable_tumblr'=>'bool',
124
- '%d',//'show_image_counts'=>'bool',
125
- '%d',//'enable_loop'=>'bool'
126
- '%d',//popup_image_right_click=>'bool'
127
-
128
- '%s',//'conditional_filters' => 'string',
129
- '%s',//'conditional_filter_type' => 'string'
130
- '%d',/*show_username_on_thumb*/
131
- '%d',//'conditional_filter_enable'=>'0',
132
- '%s',//'liked_feed' => 'string'
133
- '%d',//'mobile_breakpoint'=>'640',
134
- '%s',//'redirect_url',
135
- '%s',//'feed_resolution',
136
-
137
- );
138
- }
139
- private function display() {
140
- require_once (WDI_DIR . "/admin/models/WDIModelFeeds_wdi.php");
141
- $model = new WDIModelFeeds_wdi();
142
-
143
- require_once (WDI_DIR . "/admin/views/WDIViewFeeds_wdi.php");
144
- $view = new WDIViewFeeds_wdi($model);
145
- $view->display();
146
- }
147
-
148
- private function add() {
149
- require_once WDI_DIR . "/admin/models/WDIModelFeeds_wdi.php";
150
- $model = new WDIModelFeeds_wdi();
151
-
152
- require_once WDI_DIR . "/admin/views/WDIViewFeeds_wdi.php";
153
- $view = new WDIViewFeeds_wdi($model);
154
- $view->edit(0);
155
- }
156
-
157
-
158
- private function edit($customId = '') {
159
-
160
- require_once WDI_DIR . "/admin/models/WDIModelFeeds_wdi.php";
161
- $model = new WDIModelFeeds_wdi();
162
-
163
- require_once WDI_DIR . "/admin/views/WDIViewFeeds_wdi.php";
164
- $view = new WDIViewFeeds_wdi($model);
165
- if($customId != ''){
166
- $id = $customId;
167
- }else{
168
- $id = (int) WDILibrary::get('current_id', 0);
169
- }
170
- $view->edit($id);
171
- }
172
-
173
- private function apply() {
174
- $this->save_slider_db();
175
- $this->save_slide_db();
176
- $this->edit();
177
- }
178
-
179
- private function save_feed(){
180
- require_once WDI_DIR . "/admin/models/WDIModelFeeds_wdi.php";
181
- $model = new WDIModelFeeds_wdi();
182
-
183
- $settings = isset($_POST[WDI_FSN]) ? (array) $_POST[WDI_FSN]: array();
184
- $defaults = $model->wdi_get_feed_defaults();
185
- $settings = $this->sanitize_input($settings,$defaults);
186
- $settings = wp_parse_args( $settings, $defaults );
187
- $settings = $this->check_settings($settings);
188
-
189
- global $wpdb;
190
- $action = WDILibrary::get('add_or_edit', '');
191
- if( $action=='' ){
192
- $wpdb->insert($wpdb->prefix. WDI_FEED_TABLE, $settings,$this->dataFormat);
193
- if($wpdb->insert_id == false){
194
- $this->message(__('Cannot Write on database. Check database permissions.',"wd-instagram-feed"),'error');
195
- }
196
- }else{
197
- $msg = $wpdb->update($wpdb->prefix. WDI_FEED_TABLE, $settings, array('id'=>$action), $this->dataFormat,array('%d'));
198
- if($msg == false){
199
- $this->message(__("You have not made new changes","wd-instagram-feed"),'notice');
200
- }else{
201
- $this->message(__("Successfully saved","wd-instagram-feed"),"updated");
202
- }
203
- }
204
- $this->display();
205
- }
206
-
207
- private function apply_changes(){
208
- require_once WDI_DIR . "/admin/models/WDIModelFeeds_wdi.php";
209
- global $wpdb;
210
- $model = new WDIModelFeeds_wdi();
211
- $settings = isset($_POST[WDI_FSN]) ? (array) $_POST[WDI_FSN] : array();
212
- $defaults = $model->wdi_get_feed_defaults();
213
- $settings = $this->sanitize_input($settings,$defaults);
214
- $settings = wp_parse_args( $settings, $defaults );
215
- $settings = $this->check_settings($settings);
216
- $action = WDILibrary::get('add_or_edit', '');
217
- if($action==''){
218
- $wpdb->insert($wpdb->prefix. WDI_FEED_TABLE, $settings,$this->dataFormat);
219
- if($wpdb->insert_id == false){
220
- $message = 24;
221
- }else{
222
- $message = 23;
223
- }
224
- }else{
225
- $msg = $wpdb->update($wpdb->prefix. WDI_FEED_TABLE, $settings, array('id'=>$action), $this->dataFormat,array('%d'));
226
- if($msg == false){
227
- $message = 24;
228
- }else{
229
- $message = 23;
230
- }
231
- }
232
- $wdi_current_task = 'edit';
233
- if(!empty($action)){
234
- $wdi_current_id = $action;
235
- }elseif ($wpdb->insert_id != false){
236
- $wdi_current_id = $wpdb->insert_id;
237
- }else{
238
- $wdi_current_task = "display";
239
- $wdi_current_id = 0;
240
- }
241
-
242
- WDILibrary::wdi_spider_redirect(add_query_arg(array(
243
- 'page' => WDILibrary::get('page'),
244
- 'task' => $wdi_current_task,
245
- 'current_id' => $wdi_current_id,
246
- 'message' =>$message,
247
- ), admin_url('admin.php')));
248
-
249
-
250
- }
251
-
252
- private function cancel(){
253
- $this->display();
254
- }
255
-
256
- private function duplicate($id) {
257
- $message = 20;
258
- $duplicated = $this->duplicate_tabels($id);
259
- if($duplicated){
260
- $message = 18;
261
- }
262
- WDILibrary::wdi_spider_redirect(add_query_arg(array(
263
- 'page' => WDILibrary::get('page'),
264
- 'task' => 'display',
265
- 'message' => $message,
266
- ), admin_url('admin.php')));
267
- }
268
- private function duplicate_all($id) {
269
- global $wpdb;
270
- $message = 19;
271
- $flag = false;
272
- $feed_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . WDI_FEED_TABLE);
273
- foreach ($feed_ids_col as $slider_id) {
274
- $check_id = WDILibrary::get('check_' . $slider_id, '');
275
- if ( !empty($check_id) ) {
276
- if(!$flag){
277
- $flag = true;
278
- }
279
- $this->duplicate_tabels($slider_id);
280
- }
281
- }
282
-
283
- if(!$flag){
284
- $message = 6;
285
- }
286
-
287
- WDILibrary::wdi_spider_redirect(add_query_arg(array(
288
- 'page' => WDILibrary::get('page'),
289
- 'task' => 'display',
290
- 'message' => $message,
291
- ), admin_url('admin.php')));
292
- }
293
-
294
- private function duplicate_tabels($feed_id) {
295
- global $wpdb;
296
- if ($feed_id) {
297
- $feed_row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . WDI_FEED_TABLE.' where id="%d"', $feed_id));
298
- }
299
-
300
- if ($feed_row) {
301
- $duplicate_values = WDILibrary::objectToArray($feed_row);
302
- unset($duplicate_values['id']);
303
- $save = $wpdb->insert($wpdb->prefix . WDI_FEED_TABLE,$duplicate_values, $this->dataFormat);
304
- $new_slider_id = $wpdb->get_var('SELECT MAX(id) FROM ' . $wpdb->prefix . WDI_FEED_TABLE);
305
- }
306
- return $new_slider_id;
307
- }
308
-
309
- private function delete($id) {
310
- global $wpdb;
311
- $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . WDI_FEED_TABLE. ' WHERE id="%d"', $id);
312
- if ($wpdb->query($query)) {
313
- echo WDILibrary::message(__('Item Succesfully Deleted.',"wd-instagram-feed"), 'updated');
314
- }
315
- else {
316
- echo WDILibrary::message(__('Error. Please install plugin again.', "wd-instagram-feed"), 'error');
317
- }
318
- $this->display();
319
- }
320
-
321
- private function delete_all() {
322
- global $wpdb;
323
- $flag = FALSE;
324
- $feed_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . WDI_FEED_TABLE);
325
- foreach ($feed_ids_col as $slider_id) {
326
- $check_id = WDILibrary::get('check_' . $slider_id, '');
327
- $check_all_items = WDILibrary::get('check_all_items', '');
328
- if ( !empty($check_id) || !empty($check_all_items) ) {
329
- $flag = TRUE;
330
- $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . WDI_FEED_TABLE.' WHERE id="%d"', $slider_id);
331
- $wpdb->query($query);
332
- }
333
- }
334
- if ($flag) {
335
- $message = 5;
336
- }
337
- else {
338
- $message = 6;
339
- }
340
- WDILibrary::wdi_spider_redirect(add_query_arg(array(
341
- 'page' => WDILibrary::get('page'),
342
- 'task' => 'display',
343
- 'message' => $message,
344
- ), admin_url('admin.php')));
345
- }
346
-
347
- private function publish($id) {
348
- global $wpdb;
349
- $message = 20;
350
- $save = $wpdb->update($wpdb->prefix . WDI_FEED_TABLE, array('published' => 1), array('id' => $id));
351
- if($save !== FALSE){
352
- $message = 9;
353
- }
354
- WDILibrary::wdi_spider_redirect(add_query_arg(array(
355
- 'page' => WDILibrary::get('page'),
356
- 'task' => 'display',
357
- 'message' => $message,
358
- ), admin_url('admin.php')));
359
-
360
- }
361
-
362
- private function publish_all() {
363
- global $wpdb;
364
- $flag = FALSE;
365
- $check_all_items = WDILibrary::get('check_all_items', '');
366
- if ( isset($check_all_items) ) {
367
- $wpdb->query('UPDATE ' . $wpdb->prefix . WDI_FEED_TABLE .' SET published=1');
368
- $flag = TRUE;
369
- }
370
- else {
371
- $feed_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . WDI_FEED_TABLE);
372
- foreach ($feed_ids_col as $slider_id) {
373
- $check_id = WDILibrary::get('check_' . $slider_id, '');
374
- if ( !empty($check_id) ) {
375
- $flag = TRUE;
376
- $wpdb->update($wpdb->prefix . WDI_FEED_TABLE, array('published' => 1), array('id' => $slider_id));
377
- }
378
- }
379
- }
380
- if ($flag) {
381
- $message = 10;
382
- }
383
- else {
384
- $message = 6;
385
- }
386
- WDILibrary::wdi_spider_redirect(add_query_arg(array(
387
- 'page' => WDILibrary::get('page'),
388
- 'task' => 'display',
389
- 'message' => $message,
390
- ), admin_url('admin.php')));
391
- }
392
-
393
- private function unpublish($id) {
394
- global $wpdb;
395
- $message = 20;
396
- $save = $wpdb->update($wpdb->prefix . WDI_FEED_TABLE, array('published' => 0), array('id' => $id));
397
- if($save !== FALSE){
398
- $message = 11;
399
- }
400
- WDILibrary::wdi_spider_redirect(add_query_arg(array(
401
- 'page' => WDILibrary::get('page'),
402
- 'task' => 'display',
403
- 'message' => $message,
404
- ), admin_url('admin.php')));
405
- }
406
-
407
- private function unpublish_all() {
408
- global $wpdb;
409
- $flag = FALSE;
410
- $check_all_items = WDILibrary::get('check_all_items', '');
411
- if ( isset($check_all_items) ) {
412
- $wpdb->query('UPDATE ' . $wpdb->prefix . WDI_FEED_TABLE.' SET published=0');
413
- $flag = TRUE;
414
- }
415
- else {
416
- $feed_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . WDI_FEED_TABLE);
417
- foreach ($feed_ids_col as $slider_id) {
418
- $check_id = WDILibrary::get('check_' . $slider_id, '');
419
- if ( !empty($check_id) ) {
420
- $flag = TRUE;
421
- $wpdb->update($wpdb->prefix . WDI_FEED_TABLE, array('published' => 0), array('id' => $slider_id));
422
- }
423
- }
424
- }
425
- if ($flag) {
426
- $message = 12;
427
- }
428
- else {
429
- $message = 6;
430
- }
431
- WDILibrary::wdi_spider_redirect(add_query_arg(array(
432
- 'page' => WDILibrary::get('page'),
433
- 'task' => 'display',
434
- 'message' => $message,
435
- ), admin_url('admin.php')));
436
- }
437
-
438
- private function check_settings($settings){
439
- if($settings['feed_users']){
440
- $settings['feed_users'] = json_decode($settings['feed_users']);
441
- $settings['feed_users'] = json_encode(array($settings['feed_users'][0]));
442
- };
443
- if(intval($settings['theme_id']) > 1){
444
- $settings['theme_id'] = '1';
445
- };
446
- if($settings['feed_display_view'] === 'infinite_scroll'){
447
- $settings['feed_display_view'] = 'load_more_btn';
448
- }
449
- if($settings['feed_type'] === 'masonry' || $settings['feed_type'] === 'blog_style'){
450
- $settings['feed_type'] = 'thumbnails';
451
- }
452
- if($settings['popup_enable_filmstrip'] == '1'){
453
- $settings['popup_enable_filmstrip'] = '0';
454
- }
455
- if($settings['popup_filmstrip_height'] != '70'){
456
- $settings['popup_filmstrip_height'] = '70';
457
- }
458
- if($settings['popup_enable_comment'] == '1'){
459
- $settings['popup_enable_comment'] = '0';
460
- }
461
- if($settings['popup_enable_share_buttons'] == '1'){
462
- $settings['popup_enable_share_buttons'] = '0';
463
- }
464
-
465
- if($settings['popup_info_always_show'] == '1'){
466
- $settings['popup_info_always_show'] = '0';
467
- }
468
-
469
- if($settings['popup_info_full_width'] == '1'){
470
- $settings['popup_info_full_width'] = '0';
471
- }
472
-
473
- if($settings['popup_enable_info'] == '1'){
474
- $settings['popup_enable_info'] = '0';
475
- }
476
- if($settings['show_likes'] == '1'){
477
- $settings['show_likes'] = '0';
478
- }
479
-
480
- if($settings['show_description'] == '1'){
481
- $settings['show_description'] = '0';
482
- }
483
-
484
- if($settings['show_comments'] == '1'){
485
- $settings['show_comments'] = '0';
486
- }
487
-
488
- if($settings['show_username_on_thumb'] == '1'){
489
- $settings['show_username_on_thumb'] = '0';
490
- }
491
-
492
- if($settings['conditional_filter_enable'] == '1'){
493
- $settings['conditional_filter_enable'] = '0';
494
- }
495
- if($settings['liked_feed'] == 'liked'){
496
- $settings['liked_feed'] = 'userhash';
497
- }
498
- return $settings;
499
- }
500
-
501
- private function sanitize_input($settings,$defaults){
502
- require_once WDI_DIR . "/admin/models/WDIModelFeeds_wdi.php";
503
- $model = new WDIModelFeeds_wdi();
504
- $sanitize_types=$model->get_sanitize_types();
505
- $sanitized_output = array();
506
- foreach ($settings as $setting_name => $value) {
507
- switch($sanitize_types[$setting_name]){
508
- case 'string':{
509
- $sanitized_val=$this->sanitize_string($value,$defaults[$setting_name]);
510
- $sanitized_output[$setting_name] = $sanitized_val;
511
- break;
512
- }
513
- case 'number':{
514
- $sanitized_val=$this->sanitize_number($value,$defaults[$setting_name]);
515
- $sanitized_output[$setting_name] = $sanitized_val;
516
- break;
517
- }
518
- case 'bool':{
519
- $sanitized_val=$this->sanitize_bool($value,$defaults[$setting_name]);
520
- $sanitized_output[$setting_name] = $sanitized_val;
521
- break;
522
- }
523
- case 'url':{
524
- $sanitized_val=$this->sanitize_url($value,$defaults[$setting_name]);
525
- $sanitized_output[$setting_name] = $sanitized_val;
526
- break;
527
- }
528
- }
529
- }
530
- return $sanitized_output;
531
- }
532
-
533
- private function sanitize_bool($value,$default){
534
- if($value == 1 || $value == 0){
535
- return $value;
536
- }
537
- else{
538
- return $default;
539
- }
540
- }
541
- private function sanitize_string($value,$default){
542
- $sanitized_val = strip_tags(stripslashes($value));
543
- if($sanitized_val == ''){
544
- return $default;
545
- }else{
546
- return $sanitized_val;
547
- }
548
- }
549
- private function sanitize_number($value,$default){
550
- if(is_numeric($value) && $value>0){
551
- return $value;
552
- }else{
553
- return $default;
554
- }
555
- }
556
- private function sanitize_url($value,$default){
557
- if (function_exists('filter_var') && !filter_var($value, FILTER_VALIDATE_URL) === false) {
558
- return $value;
559
- } else {
560
- return $default;
561
- }
562
- }
563
-
564
- private function message($text,$type){
565
- require_once(WDI_DIR . '/framework/WDILibrary.php');
566
- echo WDILibrary::message($text, $type);
567
- }
568
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/controllers/WDIControllerSettings_wdi.php DELETED
@@ -1,56 +0,0 @@
1
- <?php
2
-
3
- class WDIControllerSettings_wdi {
4
-
5
- function __construct() {
6
-
7
- }
8
-
9
- public function execute() {
10
- $this->display();
11
- }
12
-
13
- public function display() {
14
- $this->reset_access_token();
15
- $this->basic_instagram_api_connect();
16
-
17
- require_once(WDI_DIR . '/admin/models/WDIModelSettings_wdi.php');
18
- $model = new WDIModelSettings_wdi();
19
- require_once(WDI_DIR . '/admin/views/WDIViewSettings_wdi.php');
20
- $view = new WDIViewSettings_wdi($model);
21
-
22
- $message = WDILibrary::get('message', '');
23
- if ( !empty($message) ) {
24
- echo WDILibrary::message($message, 'error');
25
- }
26
- $view->display();
27
- }
28
-
29
- private function reset_access_token() {
30
- $reset_access_token = WDILibrary::get('wdi_reset_access_token_input', '');
31
- if ( !empty($reset_access_token) && $reset_access_token == '1' ) {
32
- global $wpdb;
33
- $wpdb->query('DELETE FROM ' . $wpdb->prefix . 'options WHERE option_name = "wdi_instagram_options"');
34
- $wpdb->query('DELETE FROM ' . $wpdb->prefix . 'options WHERE option_name = "wdi_first_user_username"');
35
- WDILibrary::redirect(add_query_arg(array( 'page' => 'wdi_settings' ), admin_url('admin.php')));
36
- }
37
- }
38
-
39
- private function basic_instagram_api_connect() {
40
- if ( !empty($_REQUEST['wdi_access_token']) && !empty($_REQUEST['user_id']) ) {
41
- $wdi_options = wdi_get_options();
42
- $user_id = WDILibrary::get('user_id', '');
43
- $user_name = WDILibrary::get('username', '');
44
- $expires_in = WDILibrary::get('expires_in', '');
45
- $access_token = WDILibrary::get('wdi_access_token', '');
46
- $wdi_options['wdi_start_in'] = time();
47
- $wdi_options['wdi_user_id'] = $user_id;
48
- $wdi_options['wdi_user_name'] = $user_name;
49
- $wdi_options['wdi_expires_in'] = $expires_in;
50
- $wdi_options['wdi_access_token'] = $access_token;
51
- update_option(WDI_OPT, $wdi_options);
52
- // @TODO add success message.
53
- WDILibrary::redirect(add_query_arg(array( 'page' => 'wdi_settings' ), admin_url('admin.php')));
54
- }
55
- }
56
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/controllers/WDIControllerThemes_wdi.php CHANGED
@@ -5,7 +5,6 @@ class WDIControllerThemes_wdi {
5
  private $view,$model;
6
 
7
  public function __construct() {
8
- $this->setDataFormat();
9
  require_once (WDI_DIR . "/admin/models/WDIModelThemes_wdi.php");
10
  $this->model = new WDIModelThemes_wdi();
11
 
@@ -14,17 +13,7 @@ class WDIControllerThemes_wdi {
14
  }
15
 
16
  public function execute() {
17
- $task = WDILibrary::get('task');
18
- $id = WDILibrary::get('current_id', 0);
19
- $message = WDILibrary::get('message');
20
- echo WDILibrary::message_id($message);
21
- if (method_exists($this, $task)) {
22
- check_admin_referer('nonce_wd', 'nonce_wd');
23
- $this->$task($id);
24
- }
25
- else {
26
- $this->display();
27
- }
28
  }
29
 
30
  public function display() {
@@ -37,644 +26,31 @@ class WDIControllerThemes_wdi {
37
  }
38
 
39
 
40
- private function setDataFormat(){
41
- $this->data_format = array(
42
- '%s',/*theme_name*/
43
- '%s',/*default_theme*/
44
- '%s',/*feed_container_bg_color*/
45
- '%s',/*feed_wrapper_width*/
46
- '%s',/*feed_container_width*/
47
- '%s',/*feed_wrapper_bg_color*/
48
- '%s',/*active_filter_bg_color*/
49
- '%s',/*header_margin*/
50
- '%s',/*header_padding*/
51
- '%s',/*header_border_size*/
52
- '%s',/*header_border_color*/
53
- '%s',/*header_position*/
54
- '%s',/*header_img_width*/
55
- '%s',/*header_border_radius*/
56
- '%s',/*header_text_padding*/
57
- '%s',/*header_text_color*/
58
- '%d',/*header_font_weight*/
59
- '%s',/*header_text_font_size*/
60
- '%s',/*header_text_font_style*/
61
- '%s',/*'follow_btn_border_radius'=>'number'*/
62
- '%s',/*'follow_btn_padding'=>'number'*/
63
- '%d',/*'follow_btn_margin'=>'number'*/
64
- '%s',//'follow_btn_bg_color'=>'color',
65
- '%s',//'follow_btn_border_color'=>'color',
66
- '%s',//'follow_btn_text_color'=>'color',
67
- '%d',//'follow_btn_font_size'=>'number',
68
- '%s',//'follow_btn_border_hover_color'=>'color',
69
- '%s',//'follow_btn_text_hover_color'=>'color',
70
- '%s',//'follow_btn_background_hover_color'=>'color',
71
-
72
- '%s',/*user_horizontal_margin*/
73
- '%s',/*user_padding*/
74
- '%s',/*user_border_size*/
75
- '%s',/*user_border_color*/
76
- '%d',//'user_img_width'
77
- '%d',/*user_border_radius*/
78
- '%s',/*user_background_color*/
79
- '%s',/*users_border_size*/
80
- '%s',/*users_border_color*/
81
- '%s',/*users_background_color*/
82
- '%s',//users_text_color
83
- '%d',//users_font_weight
84
- '%s',//users_text_font_size
85
- '%s',//users_text_font_style
86
- '%s',//user_description_font_size
87
- '%s',//'lightbox_overlay_bg_color'=>'color',
88
- '%d',//'lightbox_overlay_bg_transparent'=>'number_max_100',
89
- '%s',//'lightbox_bg_color'=>'color',
90
- '%d',//'lightbox_ctrl_btn_height'=>'number',
91
- '%d',//'lightbox_ctrl_btn_margin_top'=>'number',
92
- '%d',//'lightbox_ctrl_btn_margin_left'=>'number',
93
- '%s',//'lightbox_ctrl_btn_pos'=>'string',
94
- '%s',//'lightbox_ctrl_cont_bg_color'=>'color',
95
- '%d',//'lightbox_ctrl_cont_border_radius'=>'number',
96
- '%d',//'lightbox_ctrl_cont_transparent'=>'number_max_100',
97
- '%s',//'lightbox_ctrl_btn_align'=>'position',
98
- '%s',//'lightbox_ctrl_btn_color'=>'color',
99
- '%d',//'lightbox_ctrl_btn_transparent'=>'number_max_100',
100
- '%d',//'lightbox_toggle_btn_height'=>'number',
101
- '%d',//'lightbox_toggle_btn_width'=>'number',
102
- '%d',//'lightbox_close_btn_border_radius'=>'number',
103
- '%d',//'lightbox_close_btn_border_width'=>'number',
104
- '%s',//'lightbox_close_btn_border_style'=>'string',
105
- '%s',//'lightbox_close_btn_border_color'=>'color',
106
- '%s',//'lightbox_close_btn_box_shadow'=>'css_box_shadow',
107
- '%s',//'lightbox_close_btn_bg_color'=>'color',
108
- '%d',//'lightbox_close_btn_transparent'=>'number_max_100',
109
- '%d',//'lightbox_close_btn_width'=>'number',
110
- '%d',//'lightbox_close_btn_height'=>'number',
111
- '%d',//'lightbox_close_btn_top'=>'number_neg',
112
- '%d',//'lightbox_close_btn_right'=>'number_neg',
113
- '%d',//'lightbox_close_btn_size'=>'number',
114
- '%s',//'lightbox_close_btn_color'=>'color',
115
- '%s',//'lightbox_close_btn_full_color'=>'color',
116
- '%s',//'lightbox_close_btn_hover_color'=>'color'
117
- '%s',//'lightbox_comment_share_button_color'=>'color',
118
- '%s',//'lightbox_rl_btn_style'=>'string',
119
- '%s',//'lightbox_rl_btn_bg_color'=>'color',
120
- '%d',//'lightbox_rl_btn_transparent'=>'number_max_100',
121
- '%s',//'lightbox_rl_btn_box_shadow'=>'css_box_shadow',
122
- '%d',//'lightbox_rl_btn_height'=>'number',
123
- '%d',//'lightbox_rl_btn_width'=>'number',
124
- '%d',//'lightbox_rl_btn_size'=>'number',
125
- '%s',//'lightbox_close_rl_btn_hover_color'=>'color',
126
- '%s',//'lightbox_rl_btn_color'=>'color',
127
- '%d',//'lightbox_rl_btn_border_radius'=>'number',
128
- '%d',//'lightbox_rl_btn_border_width'=>'number',
129
- '%s',//'lightbox_rl_btn_border_style'=>'string',
130
- '%s',//'lightbox_rl_btn_border_color'=>'color',
131
- '%s',//'lightbox_filmstrip_pos'=>'position',
132
- '%s',//'lightbox_filmstrip_thumb_margin'=>'length_multi',
133
- '%d',//'lightbox_filmstrip_thumb_border_width'=>'number',
134
- '%s',//'lightbox_filmstrip_thumb_border_style'=>'string',
135
- '%s',//'lightbox_filmstrip_thumb_border_color'=>'color',
136
- '%d',//'lightbox_filmstrip_thumb_border_radius'=>'number',
137
- '%d',//'lightbox_filmstrip_thumb_active_border_width'=>'number',
138
- '%s',//'lightbox_filmstrip_thumb_active_border_color'=>'color',
139
- '%s',//'lightbox_filmstrip_thumb_deactive_transparent'=>'number_max_100',
140
- '%d',//'lightbox_filmstrip_rl_btn_size'=>'number',
141
- '%s',//'lightbox_filmstrip_rl_btn_color'=>'color',
142
- '%s',//'lightbox_filmstrip_rl_bg_color'=>'color',
143
- '%s',//'lightbox_info_pos'=>'position',
144
- '%s',//'lightbox_info_align'=>'string',
145
- '%s',//'lightbox_info_bg_color'=>'color',
146
- '%d',//'lightbox_info_bg_transparent'=>'number_max_100',
147
- '%d',//'lightbox_info_border_width'=>'number',
148
- '%s',//'lightbox_info_border_style'=>'string',
149
- '%s',//'lightbox_info_border_color'=>'color',
150
- '%d',//'lightbox_info_border_radius'=>'number',
151
- '%s',//'lightbox_info_padding'=>'length_multi',
152
- '%s',//'lightbox_info_margin'=>'length_multi',
153
- '%s',//'lightbox_title_color'=>'color',
154
- '%s',//'lightbox_title_font_style'=>'string',
155
- '%s',//'lightbox_title_font_weight'=>'string',
156
- '%d',//'lightbox_title_font_size'=>'number',
157
- '%s',//'lightbox_description_color'=>'color',
158
- '%s',//'lightbox_description_font_style'=>'string',
159
- '%s',//'lightbox_description_font_weight'=>'string',
160
- '%d',//'lightbox_description_font_size'=>'number',
161
- '%d',//'lightbox_info_height'=>'number_max_100'
162
- '%d',//'lightbox_comment_width'=>'number',
163
- '%s',//'lightbox_comment_pos'=>'string',
164
- '%s',//'lightbox_comment_bg_color'=>'color',
165
- '%d',//'lightbox_comment_font_size'=>'number',
166
- '%s',//'lightbox_comment_font_color'=>'color',
167
- '%s',//'lightbox_comment_font_style'=>'string',
168
- '%d',//'lightbox_comment_author_font_size'=>'number',
169
- '%s',//'lightbox_comment_author_font_color'=>'color',
170
- '%s',//'lightbox_comment_author_font_color_hover'=>'color'
171
- '%d',//'lightbox_comment_date_font_size'=>'number',
172
- '%d',//'lightbox_comment_body_font_size'=>'number',
173
- '%d',//'lightbox_comment_input_border_width'=>'number',
174
- '%s',//'lightbox_comment_input_border_style'=>'string',
175
- '%s',//'lightbox_comment_input_border_color'=>'color',
176
- '%d',//'lightbox_comment_input_border_radius'=>'number',
177
- '%s',//'lightbox_comment_input_padding'=>'length_multi',
178
- '%s',//'lightbox_comment_input_bg_color'=>'color',
179
- '%s',//'lightbox_comment_button_bg_color'=>'color',
180
- '%s',//'lightbox_comment_button_padding'=>'length_multi',
181
- '%d',//'lightbox_comment_button_border_width'=>'number',
182
- '%s',//'lightbox_comment_button_border_style'=>'string',
183
- '%s',//'lightbox_comment_button_border_color'=>'color',
184
- '%d',//'lightbox_comment_button_border_radius'=>'number',
185
- '%d',//'lightbox_comment_separator_width'=>'number',
186
- '%s',//'lightbox_comment_separator_style'=>'string',
187
- '%s',//'lightbox_comment_separator_color'=>'color',
188
- '%s',//'lightbox_comment_load_more_color' =>'color',
189
- '%s',//'lightbox_comment_load_more_color_hover' =>'color',
190
-
191
- '%s',/*th_photo_wrap_padding*/
192
- '%s',/*th_photo_wrap_border_size*/
193
- '%s',/*th_photo_wrap_border_color*/
194
- '%s',/*th_photo_img_border_radius*/
195
- '%s',/*th_photo_wrap_bg_color*/
196
- '%s',/*th_photo_meta_bg_color*/
197
- '%s',/*th_photo_meta_one_line*/
198
- '%s',/*th_like_text_color*/
199
- '%s',/*th_comment_text_color*/
200
- '%s',/*th_photo_caption_font_size*/
201
- '%s',/*th_photo_caption_color*/
202
- '%s',/*th_feed_item_margin*/
203
- '%s',/*th_photo_caption_hover_color*/
204
- '%s',/*th_like_comm_font_size*/
205
- '%s',//'th_overlay_hover_color'=>'color',
206
- '%d',//'th_overlay_hover_transparent'=>'number',
207
- '%s',//'th_overlay_hover_icon_color'=>'color',
208
- '%s',//'th_overlay_hover_icon_font_size'=>'length',
209
-
210
- '%s',//th_photo_img_hover_effect
211
 
212
- '%s',/*mas_photo_wrap_padding*/
213
- '%s',/*mas_photo_wrap_border_size*/
214
- '%s',/*mas_photo_wrap_border_color*/
215
- '%s',/*mas_photo_img_border_radius*/
216
- '%s',/*mas_photo_wrap_bg_color*/
217
- '%s',/*mas_photo_meta_bg_color*/
218
- '%s',/*mas_photo_meta_one_line*/
219
- '%s',/*mas_like_text_color*/
220
- '%s',/*mas_comment_text_color*/
221
- '%s',/*mas_photo_caption_font_size*/
222
- '%s',/*mas_photo_caption_color*/
223
- '%s',/*mas_feed_item_margin*/
224
- '%s',/*mas_photo_caption_hover_color*/
225
- '%s',/*mas_like_comm_font_size*/
226
- '%s',//'mas_overlay_hover_color'=>'color',
227
- '%d',//'mas_overlay_hover_transparent'=>'number',
228
- '%s',//'mas_overlay_hover_icon_color'=>'color',
229
- '%s',//'mas_overlay_hover_icon_font_size'=>'length',
230
- '%s',//mas_photo_img_hover_effect
231
-
232
- '%s',/*blog_style_photo_wrap_padding*/
233
- '%s',/*blog_style_photo_wrap_border_size*/
234
- '%s',/*blog_style_photo_wrap_border_color*/
235
- '%s',/*blog_style_photo_img_border_radius*/
236
- '%s',/*blog_style_photo_wrap_bg_color*/
237
- '%s',/*blog_style_photo_meta_bg_color*/
238
- '%s',/*blog_style_photo_meta_one_line*/
239
- '%s',/*blog_style_like_text_color*/
240
- '%s',/*blog_style_comment_text_color*/
241
- '%s',/*blog_style_photo_caption_font_size*/
242
- '%s',/*blog_style_photo_caption_color*/
243
- '%s',/*blog_style_feed_item_margin*/
244
- '%s',/*blog_style_photo_caption_hover_color*/
245
- '%s',/*blog_style_like_comm_font_size*/
246
 
247
- '%s',/*image_browser_photo_wrap_padding*/
248
- '%s',/*image_browser_photo_wrap_border_size*/
249
- '%s',/*image_browser_photo_wrap_border_color*/
250
- '%s',/*image_browser_photo_img_border_radius*/
251
- '%s',/*image_browser_photo_wrap_bg_color*/
252
- '%s',/*image_browser_photo_meta_bg_color*/
253
- '%s',/*image_browser_photo_meta_one_line*/
254
- '%s',/*image_browser_like_text_color*/
255
- '%s',/*image_browser_comment_text_color*/
256
- '%s',/*image_browser_photo_caption_font_size*/
257
- '%s',/*image_browser_photo_caption_color*/
258
- '%s',/*image_browser_feed_item_margin*/
259
- '%s',/*image_browser_photo_caption_hover_color*/
260
- '%s',/*image_browser_like_comm_font_size*/
261
 
262
- '%s',/*load_more_position*/
263
- '%s',/*load_more_padding*/
264
- '%s',/*load_more_bg_color*/
265
- '%s',/*load_more_border_radius*/
266
- '%s',/*load_more_height*/
267
- '%s',/*load_more_width*/
268
- '%s',/*load_more_border_size*/
269
- '%s',/*load_more_border_color*/
270
- '%s',/*load_more_text_color*/
271
- '%s',/*load_more_text_font_size*/
272
- '%s',/*load_more_wrap_hover_color*/
273
- '%s',// 'pagination_ctrl_color' => 'color',
274
- '%s',// 'pagination_size' => 'length',
275
- '%s',// 'pagination_ctrl_margin' => 'length_multi',
276
- '%s',// 'pagination_ctrl_hover_color' => 'color'
277
- '%s',//'pagination_position'=>'position'
278
- '%s',//'pagination_position_vert'=>'position'
279
 
280
- /* since v1.0.6. keep order, defaults*/
281
-
282
- '%s',//'th_thumb_user_bg_color'=>'color',
283
- '%s',//'th_thumb_user_color'=>'color'
284
- '%s',//'mas_thumb_user_bg_color'=>'color',
285
- '%s',//'mas_thumb_user_color'=>'color'
286
- );
287
- }
288
-
289
- private function add() {
290
- require_once WDI_DIR . "/admin/models/WDIModelThemes_wdi.php";
291
- $model = new WDIModelThemes_wdi();
292
-
293
- require_once WDI_DIR . "/admin/views/WDIViewThemes_wdi.php";
294
- $view = new WDIViewThemes_wdi($model);
295
- $view->edit(0);
296
- }
297
 
298
 
299
- private function edit($customId = '') {
300
-
301
- require_once WDI_DIR . "/admin/models/WDIModelThemes_wdi.php";
302
- $model = new WDIModelThemes_wdi();
303
-
304
- require_once WDI_DIR . "/admin/views/WDIViewThemes_wdi.php";
305
- $view = new WDIViewThemes_wdi($model);
306
- if($customId != ''){
307
- $id = $customId;
308
- }else{
309
- $id = (int) WDILibrary::get('current_id', 0);
310
  }
311
- $view->edit($id);
312
  }
313
 
314
- private function apply() {
315
- $this->save_slider_db();
316
- $this->save_slide_db();
317
- $this->edit();
318
- }
319
- private function duplicate_all($id) {
320
 
321
- global $wpdb;
322
- $sliders_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . WDI_THEME_TABLE);
323
- foreach ($sliders_ids_col as $theme_id) {
324
- $check_id = WDILibrary::get('check_' . $theme_id, '');
325
- if ( !empty($check_id) ) {
326
- $msg = $this->duplicate_tabels($theme_id);
327
- }
328
- }
329
- if(!isset($msg)){
330
- echo WDILibrary::message(__('Please select at least one item',"wd-instagram-feed"), 'error');
331
- }
332
- elseif($msg['msg'] == false){
333
- echo WDILibrary::message(__('Cannot Write on database. Check database permissions.',"wd-instagram-feed"), 'error');
334
- }else{
335
- echo WDILibrary::message(__('Items Succesfully Duplicated.', "wd-instagram-feed"), 'updated');
336
- }
337
-
338
- $this->display();
339
  }
340
 
341
- private function duplicate_tabels($theme_id) {
342
- global $wpdb;
343
- if ($theme_id) {
344
- $theme_row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . WDI_THEME_TABLE.' where id="%d"', $theme_id));
345
- }
346
-
347
- if ($theme_row) {
348
- $duplicate_values = WDILibrary::objectToArray($theme_row);
349
- unset($duplicate_values['id']);
350
- $duplicate_values['default_theme'] = 0;
351
- $save = $wpdb->insert($wpdb->prefix . WDI_THEME_TABLE,$duplicate_values, $this->data_format);
352
- $new_theme_id = $wpdb->get_var('SELECT MAX(id) FROM ' . $wpdb->prefix . WDI_THEME_TABLE);
353
- }
354
- return array('id'=>$new_theme_id,"msg"=>$save);
355
- }
356
-
357
-
358
- private function delete($id) {
359
- global $wpdb;
360
- //checking for default
361
- $theme_row = $wpdb->get_row($wpdb->prepare("SELECT * FROM ".$wpdb->prefix . WDI_THEME_TABLE." WHERE id = %d",$id));
362
- if($theme_row->default_theme == '0'){
363
-
364
- $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . WDI_THEME_TABLE. ' WHERE id="%d"', $id);
365
-
366
- if ($wpdb->query($query)) {
367
- echo WDILibrary::message(__('Item Succesfully Deleted.',"wd-instagram-feed"), 'updated');
368
- }
369
- else {
370
- echo WDILibrary::message(__('Error. Please install plugin again.',"wd-instagram-feed"), 'error');
371
- }
372
- }else{
373
- echo WDILibrary::message(__('You cannot delete default theme.',"wd-instagram-feed"), 'error');
374
- }
375
- $this->display();
376
- }
377
-
378
- private function delete_all() {
379
- global $wpdb;
380
- $flag = FALSE;
381
- $defaultFalg = false;
382
- $sliders_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . WDI_THEME_TABLE);
383
- foreach ($sliders_ids_col as $theme_id) {
384
- $defaulFlag = false;
385
- $theme_row = $wpdb->get_row($wpdb->prepare("SELECT * FROM ".$wpdb->prefix . WDI_THEME_TABLE." WHERE id = %d",$theme_id));
386
- $check_id = WDILibrary::get('check_' . $theme_id, '');
387
- $check_all_items = WDILibrary::get('check_all_items', '');
388
- if ( !empty($check_id) || !empty($check_all_items) ) {
389
- if( $theme_row->default_theme == '0' ) {
390
- $flag = TRUE;
391
- $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . WDI_THEME_TABLE.' WHERE id="%d"', $theme_id);
392
- $wpdb->query($query);
393
- }
394
- else {
395
- $defaulFlag = true;
396
- echo WDILibrary::message(__('You cannot delete default theme.',"wd-instagram-feed"), 'error');
397
- }
398
- }
399
- }
400
- if ($flag) {
401
- echo WDILibrary::message(__('Items Succesfully Deleted.',"wd-instagram-feed"), 'updated');
402
- }
403
- else {
404
- if($defaulFlag==false){
405
- echo WDILibrary::message(__('You must select at least one item.',"wd-instagram-feed"), 'error');
406
- }
407
-
408
- }
409
- $this->display();
410
- }
411
-
412
- private function set_default($id) {
413
- global $wpdb;
414
- $reset =$wpdb->update($wpdb->prefix . WDI_THEME_TABLE, array('default_theme' => 0), array('default_theme' => '1'));
415
- $save = $wpdb->update($wpdb->prefix . WDI_THEME_TABLE, array('default_theme' => 1), array('id' => $id));
416
- $this->display();
417
- }
418
-
419
- private function sanitize_input($settings,$defaults){
420
-
421
- require_once WDI_DIR . "/admin/models/WDIModelThemes_wdi.php";
422
- $model = new WDIModelThemes_wdi();
423
- $sanitize_types=$model->get_sanitize_types();
424
- $sanitized_output = array();
425
- foreach ($settings as $setting_name => $value) {
426
-
427
- switch($sanitize_types[$setting_name]){
428
- case 'string':{
429
- $sanitized_val=$this->sanitize_string($value,$defaults[$setting_name]);
430
- $sanitized_output[$setting_name] = $sanitized_val;
431
- break;
432
- }
433
- case 'number':{
434
- $sanitized_val=$this->sanitize_number($value,$defaults[$setting_name]);
435
- $sanitized_output[$setting_name] = $sanitized_val;
436
- break;
437
- }
438
- case 'bool':{
439
- $sanitized_val=$this->sanitize_bool($value,$defaults[$setting_name]);
440
- $sanitized_output[$setting_name] = $sanitized_val;
441
- break;
442
- }
443
- case 'url':{
444
- $sanitized_val=$this->sanitize_url($value,$defaults[$setting_name]);
445
- $sanitized_output[$setting_name] = $sanitized_val;
446
- break;
447
- }
448
- case 'length':{
449
- $sanitized_val=$this->sanitize_length($value,$defaults[$setting_name]);
450
- $sanitized_output[$setting_name] = $sanitized_val;
451
- break;
452
- }
453
- case 'length_multi':{
454
- $sanitized_val=$this->sanitize_length_multi($value,$defaults[$setting_name]);
455
- $sanitized_output[$setting_name] = $sanitized_val;
456
- break;
457
- }
458
- case 'color':{
459
- $sanitized_val=$this->sanitize_color($value,$defaults[$setting_name]);
460
- $sanitized_output[$setting_name] = $sanitized_val;
461
- break;
462
- }
463
- case 'position':{
464
- $sanitized_val=$this->sanitize_position($value,$defaults[$setting_name]);
465
- $sanitized_output[$setting_name] = $sanitized_val;
466
- break;
467
- }
468
- case 'css_box_shadow':{
469
- $sanitized_val=$this->sanitize_css_box_shadow($value,$defaults[$setting_name]);
470
- $sanitized_output[$setting_name] = $sanitized_val;
471
- break;
472
- }
473
- case 'number_max_100':{
474
- $sanitized_val=$this->sanitize_number_max_100($value,$defaults[$setting_name]);
475
- $sanitized_output[$setting_name] = $sanitized_val;
476
- break;
477
- }
478
- case 'number_neg':{
479
- $sanitized_val=$this->sanitize_number_neg($value,$defaults[$setting_name]);
480
- $sanitized_output[$setting_name] = $sanitized_val;
481
- break;
482
- }
483
- }
484
- }
485
- return $sanitized_output;
486
- }
487
-
488
- private function sanitize_bool($value,$default){
489
- if($value == 1 || $value == 0){
490
- return $value;
491
- }
492
- else{
493
- return $default;
494
- }
495
- }
496
- private function sanitize_string($value,$default){
497
- $sanitized_val = strip_tags(stripslashes($value));
498
- if($sanitized_val == ''){
499
- return $default;
500
- }else{
501
- return $sanitized_val;
502
- }
503
- }
504
- private function sanitize_number($value,$default){
505
- if(is_numeric($value) && $value>=0){
506
- return $value;
507
- }else{
508
- return $default;
509
- }
510
- }
511
- private function sanitize_number_neg($value,$default){
512
- if(is_numeric($value)){
513
- return $value;
514
- }else{
515
- return $default;
516
- }
517
- }
518
- private function sanitize_number_max_100($value,$default){
519
- if(is_numeric($value) && $value>=0 && $value<=100){
520
- return $value;
521
- }else{
522
- return $default;
523
- }
524
- }
525
- private function sanitize_css_box_shadow($value,$default){
526
- $value = trim($value);
527
- $values = explode(' ',$value);
528
-
529
- if($value === 'none' || $value === 'initial' || $value =="0"){
530
- return $value;
531
- }
532
- if(count($values)<3) {return $default;}
533
- //first check test
534
- $first_check_flag = false;
535
- for($i=0;$i<count($values);$i++){
536
- if($i != 2){
537
- if($this->sanitize_length($values[$i], 'error') === 'error'){
538
- $first_check_flag = true;
539
- }
540
- }else{
541
- if($this->sanitize_color($values[$i], 'error') === 'error'){
542
- $first_check_flag = true;
543
- }
544
- }
545
- }
546
- if($first_check_flag == false) {return $value;}
547
-
548
- //second check test
549
- //if(count($values) < 4) {return $default;}
550
- $second_check_flag = false;
551
- for($i=0;$i<count($values);$i++){
552
- if($i != 3){
553
- if($this->sanitize_length($values[$i], 'error') === 'error'){
554
- $second_check_flag = true;
555
- }
556
- }else{
557
- if($this->sanitize_color($values[$i], 'error') === 'error'){
558
- $second_check_flag = true;
559
- }
560
- }
561
- }
562
- if($second_check_flag == false) {return $value;}
563
- $third_check_flag = false;
564
- for($i=0;$i<count($values);$i++){
565
- if($i != 4){
566
- if($this->sanitize_length($values[$i], 'error') === 'error'){
567
- $third_check_flag = true;
568
- }
569
- }else{
570
- if($this->sanitize_color($values[$i], 'error') === 'error'){
571
- $third_check_flag = true;
572
- }
573
- }
574
- }
575
- if($third_check_flag === false) {
576
- return $value;
577
- }
578
- return $default;
579
-
580
- }
581
- private function sanitize_url($value,$default){
582
- if (function_exists('filter_var') && !filter_var($value, FILTER_VALIDATE_URL) === false) {
583
- return $value;
584
- } else {
585
- return $default;
586
- }
587
- }
588
-
589
- private function sanitize_length($value,$default){
590
-
591
- $value = trim($value);
592
-
593
- if($value == 0){
594
- return $value;
595
- }
596
-
597
- $opt1 = substr($value,strlen($value)-2,strlen($value));
598
- $opt2 = substr($value,strlen($value)-1,strlen($value));
599
- $val = floatval($value);
600
- $val1 = substr($value,0,strlen($value)-2);
601
- $val2 = substr($value,0,strlen($value)-1);
602
- if(is_numeric($val)){
603
- if( is_numeric(substr($val1,-1)) && ($opt1=='px' || $opt1=='em')){
604
- return $value;
605
- }else if(is_numeric(substr($val2,-1)) && $opt2=='%'){
606
- return $value;
607
- }
608
- else{
609
- return $default;
610
- }
611
- }else{
612
- return $default;
613
- }
614
- }
615
- private function sanitize_color($value,$default){
616
- $val = WDILibrary::regexColor($value,1);
617
-
618
- if($val == false){
619
- return $default;
620
- }else{
621
- return $val;
622
- }
623
-
624
- }
625
- private function sanitize_position($value,$default){
626
- $value = strtolower(trim($value));
627
- if($value == 'left' || $value == 'right' || $value == 'center' || $value == 'top' || $value == 'bottom'){
628
- return $value;
629
- }else{
630
- return $default;
631
- }
632
- }
633
-
634
- private function sanitize_length_multi($value1,$default){
635
- $value1 = trim($value1);
636
- $output = '';
637
- $values = explode(' ',$value1);
638
- $flag = false;
639
- $counter = 0;
640
- foreach ($values as $value) {
641
- if($value == '')
642
- continue;
643
- $counter++;
644
- $value = trim($value);
645
- $opt1 = substr($value,strlen($value)-2,strlen($value));
646
- $opt2 = substr($value,strlen($value)-1,strlen($value));
647
- $val = floatval($value);
648
- $val1 = substr($value,0,strlen($value)-2);
649
- $val2 = substr($value,0,strlen($value)-1);
650
- if(is_numeric($val)){
651
- if( is_numeric(substr($val1,-1)) && ($opt1=='px' || $opt1=='em')){
652
- $output.=' '.$value.' ';
653
- }else if((is_numeric(substr($val2,-1)) && $opt2=='%') || ($val == 0)){
654
- $output.=' '.$value .' ';
655
- }
656
- else{
657
- $flag = true;
658
- }
659
- }else{
660
- $flag = true;
661
- }
662
- }
663
- $output = trim($output);
664
- if($flag == false && $counter<=4){
665
- return $output;
666
- }else{
667
- return $default;
668
- }
669
-
670
- }
671
-
672
- private function message($text,$type){
673
- require_once WDI_DIR . "/admin/models/WDIModelThemes_wdi.php";
674
- $model = new WDIModelThemes_wdi();
675
- require_once WDI_DIR . "/admin/views/WDIViewThemes_wdi.php";
676
- $view = new WDIViewThemes_wdi($model);
677
- echo WDILibrary::message($text, $type);
678
- }
679
  }
680
  ?>
5
  private $view,$model;
6
 
7
  public function __construct() {
 
8
  require_once (WDI_DIR . "/admin/models/WDIModelThemes_wdi.php");
9
  $this->model = new WDIModelThemes_wdi();
10
 
13
  }
14
 
15
  public function execute() {
16
+ $this->display();
 
 
 
 
 
 
 
 
 
 
17
  }
18
 
19
  public function display() {
26
  }
27
 
28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
 
35
+ public static function remove_theme_file($theme_id){
36
+ $wp_upload_dir = wp_upload_dir();
37
+ $wp_upload_dir = $wp_upload_dir['basedir'];
38
+ $folder = $wp_upload_dir . '/wd-instagram-feed';
39
+ $file = $folder."/wdi_theme_" . $theme_id . '.css';
40
+ if(file_exists($file)){
41
+ return unlink($file);
 
 
 
 
42
  }
43
+ return null;
44
  }
45
 
46
+ public static function remove_all_themes_files(){
47
+ $wp_upload_dir = wp_upload_dir();
48
+ $wp_upload_dir = $wp_upload_dir['basedir'];
49
+ $folder = $wp_upload_dir . '/wd-instagram-feed';
 
 
50
 
51
+ require_once(WDI_DIR . '/framework/WDILibrary.php');
52
+ WDILibrary::remove_folder($folder);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  }
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  }
56
  ?>
admin/controllers/WDIControllerUninstall_wdi.php CHANGED
@@ -3,24 +3,7 @@
3
  class WDIControllerUninstall_wdi {
4
 
5
  function __construct(){
6
-
7
- global $wdi_wd_plugin_options;
8
- if(!class_exists("TenWebLibConfig")){
9
- include_once (WDI_DIR . "/wd/config.php");
10
- }
11
-
12
- if(!class_exists("TenWebLibDeactivate")) {
13
- include_once(WDI_DIR . "/wd/includes/deactivate.php");
14
- }
15
- $config = new TenWebLibConfig();
16
-
17
- $config->set_options( $wdi_wd_plugin_options );
18
- $deactivate_reasons = new TenWebLibDeactivate($config);
19
- //$deactivate_reasons->add_deactivation_feedback_dialog_box();
20
- $deactivate_reasons->submit_and_deactivate();
21
-
22
-
23
- }
24
 
25
  public function execute() {
26
  $task = WDILibrary::get('task');
@@ -67,7 +50,7 @@ class WDIControllerUninstall_wdi {
67
  }
68
 
69
  private function uninstall(){
70
- $verify = WDILibrary::get('wdi_verify', 0);
71
  if ( !$this->is_uninstalled() ) {
72
  if( $verify == '1' ) {
73
  global $wpdb;
@@ -106,7 +89,8 @@ class WDIControllerUninstall_wdi {
106
  delete_option('wdi_sample_feed_post_id');
107
  delete_option('wdi_sample_feed_post_url');
108
  delete_option('wdi_first_user_username');
109
- delete_option('tenweb_notice_status');
 
110
 
111
  $default_option=array();
112
  $default_option['wdi_plugin_uninstalled'] = 'true';
@@ -117,17 +101,18 @@ class WDIControllerUninstall_wdi {
117
  if ( !empty($row[0]) ) {
118
  wp_delete_post( $row[0]->ID, true );
119
  }
 
 
120
  }else{
121
  $this->display();
122
  }
123
  }
124
  else{
125
- $this->already_uninstalled();
126
  }
127
  delete_option('wdi_subscribe_done');
128
  delete_option('wdi_redirect_to_settings');
129
  delete_option('wdi_do_activation_set_up_redirect');
130
- delete_option('tenweb_notice_version');
131
  }
132
 
133
  private function is_uninstalled(){
@@ -138,4 +123,10 @@ class WDIControllerUninstall_wdi {
138
  return false;
139
  }
140
  }
 
 
 
 
 
 
141
  }
3
  class WDIControllerUninstall_wdi {
4
 
5
  function __construct(){
6
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
  public function execute() {
9
  $task = WDILibrary::get('task');
50
  }
51
 
52
  private function uninstall(){
53
+ $verify = WDILibrary::get('wdi_verify', 0, 'intval');
54
  if ( !$this->is_uninstalled() ) {
55
  if( $verify == '1' ) {
56
  global $wpdb;
89
  delete_option('wdi_sample_feed_post_id');
90
  delete_option('wdi_sample_feed_post_url');
91
  delete_option('wdi_first_user_username');
92
+ delete_option('wdi_theme_keys');
93
+ delete_option('wdi_admin_notice');
94
 
95
  $default_option=array();
96
  $default_option['wdi_plugin_uninstalled'] = 'true';
101
  if ( !empty($row[0]) ) {
102
  wp_delete_post( $row[0]->ID, true );
103
  }
104
+
105
+ $this->remove_theme_files();
106
  }else{
107
  $this->display();
108
  }
109
  }
110
  else{
111
+ $this->already_uninstalled();
112
  }
113
  delete_option('wdi_subscribe_done');
114
  delete_option('wdi_redirect_to_settings');
115
  delete_option('wdi_do_activation_set_up_redirect');
 
116
  }
117
 
118
  private function is_uninstalled(){
123
  return false;
124
  }
125
  }
126
+
127
+ private function remove_theme_files(){
128
+ require_once WDI_DIR . '/admin/controllers/WDIControllerThemes_wdi.php';
129
+ WDIControllerThemes_wdi::remove_all_themes_files();
130
+ }
131
+
132
  }
admin/controllers/WDIControllerWidget.php CHANGED
@@ -35,8 +35,10 @@ class WDIControllerWidget extends WP_Widget {
35
  parent::get_field_id('feed_id'),
36
  parent::get_field_name('feed_id'),
37
  parent::get_field_id('img_number'),
38
- parent::get_field_name('img_number'),
39
- parent::get_field_id('show_likes_comments'),
 
 
40
  parent::get_field_name('show_likes_comments'),
41
  parent::get_field_id('number_of_columns'),
42
  parent::get_field_name('number_of_columns'),
@@ -47,9 +49,11 @@ class WDIControllerWidget extends WP_Widget {
47
 
48
  // Update Settings.
49
  public function update($new_instance, $old_instance) {
 
50
  $instance['title'] = wp_filter_nohtml_kses($new_instance['title']);
51
  $instance['feed_id'] = intval($new_instance['feed_id']);
52
  $instance['img_number'] = intval($new_instance['img_number']) ? intval($new_instance['img_number']) : 4;
 
53
  $instance['show_likes_comments'] = isset($new_instance['show_likes_comments']) ? 1 : 0;
54
  $instance['number_of_columns'] = intval($new_instance['number_of_columns']) ? intval($new_instance['number_of_columns']) : 1;
55
  $instance['enable_loading_buttons'] = isset($new_instance['enable_loading_buttons']) ? 1 : 0;
35
  parent::get_field_id('feed_id'),
36
  parent::get_field_name('feed_id'),
37
  parent::get_field_id('img_number'),
38
+ parent::get_field_name('img_number'),
39
+ parent::get_field_id('show_description'),
40
+ parent::get_field_name('show_description'),
41
+ parent::get_field_id('show_likes_comments'),
42
  parent::get_field_name('show_likes_comments'),
43
  parent::get_field_id('number_of_columns'),
44
  parent::get_field_name('number_of_columns'),
49
 
50
  // Update Settings.
51
  public function update($new_instance, $old_instance) {
52
+
53
  $instance['title'] = wp_filter_nohtml_kses($new_instance['title']);
54
  $instance['feed_id'] = intval($new_instance['feed_id']);
55
  $instance['img_number'] = intval($new_instance['img_number']) ? intval($new_instance['img_number']) : 4;
56
+ $instance['show_description'] = 0;
57
  $instance['show_likes_comments'] = isset($new_instance['show_likes_comments']) ? 1 : 0;
58
  $instance['number_of_columns'] = intval($new_instance['number_of_columns']) ? intval($new_instance['number_of_columns']) : 1;
59
  $instance['enable_loading_buttons'] = isset($new_instance['enable_loading_buttons']) ? 1 : 0;
admin/controllers/feeds.php ADDED
@@ -0,0 +1,552 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Feeds_controller_wdi {
4
+ // private $model;
5
+ // private $view;
6
+ private $dataFormat;
7
+
8
+ public function __construct() {
9
+ // require_once (WDI_DIR . '/admin/models/feeds.php');
10
+ // $this->model = new Feeds_model_wdi();
11
+ //
12
+ // require_once (WDI_DIR . '/admin/views/feeds.php');
13
+ // $this->view = new Feeds_view_wdi($model);
14
+ $this->setDataFormat();
15
+ }
16
+
17
+ public function execute() {
18
+ $task = WDILibrary::get('task');
19
+ $id = WDILibrary::get('current_id', 0);
20
+ $message = WDILibrary::get('message');
21
+ if ( !empty($message) ) {
22
+ $message = explode(',', $message);
23
+ foreach ( $message as $msg_id ) {
24
+ echo WDILibrary::message_id($msg_id);
25
+ }
26
+ }
27
+ $get_method_tasks = array(
28
+ "add",
29
+ "edit",
30
+ "display",
31
+ );
32
+ $get_task = "";
33
+ if ( WDILibrary::get('task') != '' ) {
34
+ $get_task = WDILibrary::get('task');
35
+ }
36
+ if ( method_exists($this, $task) ) {
37
+ if ( !in_array($get_task, $get_method_tasks) ) {
38
+ check_admin_referer('nonce_wd', 'nonce_wd');
39
+ }
40
+ $this->$task($id);
41
+ }
42
+ else {
43
+ $search_value = WDILibrary::get('search_value');
44
+ if ( $search_value != '' ) {
45
+ WDILibrary::wdi_spider_redirect(add_query_arg(array(
46
+ 'page' => WDILibrary::get('page'),
47
+ 'task' => 'display',
48
+ 'search' => $search_value,
49
+ ), admin_url('admin.php')));
50
+ }
51
+ else {
52
+ $this->display();
53
+ }
54
+ }
55
+ }
56
+
57
+ public function create_feed( $settings = array() ) {
58
+ require_once WDI_DIR . '/admin/models/feeds.php';
59
+ $model = new Feeds_model_wdi();
60
+ $defaults = $model->wdi_get_feed_defaults();
61
+ if ( !empty($settings) ) {
62
+ $settings = $this->sanitize_input($settings, $defaults);
63
+ $settings = wp_parse_args($settings, $defaults);
64
+ }
65
+ else {
66
+ $settings = $defaults;
67
+ }
68
+ global $wpdb;
69
+ $wpdb->insert($wpdb->prefix . WDI_FEED_TABLE, $settings, $this->dataFormat);
70
+
71
+ return $wpdb->insert_id;
72
+ }
73
+
74
+ private function setDataFormat() {
75
+ $this->dataFormat = array(
76
+ '%s',/*feed_name*/
77
+ '%s',/*feed_thumb*/
78
+ '%s',/*thumb_user*/
79
+ '%d',/*published*/
80
+ '%d',/*theme_id*/
81
+ '%s',/*feed_users*/
82
+ '%s',/*feed_display_view*/
83
+ '%s',/*sort_images_by*/
84
+ '%s',/*display_order*/
85
+ '%d',/*follow_on_instagram_btn*/
86
+ '%d',/*display_header*/
87
+ '%d',/*number_of_photos*/
88
+ '%d',/*load_more_number*/
89
+ '%d',/*'pagination_per_page_number'*/
90
+ '%d',/*'pagination_preload_number'*/
91
+ '%d',/*image_browser_preload_number*/
92
+ '%d',/*image_browser_load_number*/
93
+ '%d',/*number_of_columns*/
94
+ '%d',/*resort_after_load_more*/
95
+ '%d',/*show_likes*/
96
+ '%d',/*show_description*/
97
+ '%d',/*show_comments*/
98
+ '%d',/*show_usernames*/
99
+ '%d',/*display_user_info*/
100
+ '%d',//'display_user_post_follow_number'
101
+ '%d',/*show_full_description*/
102
+ '%d',/*disable_mobile_layout*/
103
+ '%s',/*feed_type*/
104
+ '%s',/*feed_item_onclick*/
105
+ '%d',//'popup_fullscreen'=>'bool',
106
+ '%d',//'popup_width'=>'number',
107
+ '%d',//'popup_height'=>'number',
108
+ '%s',//'popup_type'=>'string',
109
+ '%d',//'popup_autoplay'=>'bool',
110
+ '%d',//'popup_interval'=>'number',
111
+ '%d',//'popup_enable_filmstrip'=>'bool',
112
+ '%d',//'popup_filmstrip_height'=>'number',
113
+ '%d',//'autohide_lightbox_navigation'=>'bool',
114
+ '%d',//'popup_enable_ctrl_btn'=>'bool',
115
+ '%d',//'popup_enable_fullscreen'=>'bool',
116
+ '%d',//'popup_enable_info'=>'bool',
117
+ '%d',//'popup_info_always_show'=>'bool',
118
+ '%d',//'popup_info_full_width'=>'bool',
119
+ '%d',//'popup_enable_comment'=>'bool',
120
+ '%d',//'popup_enable_fullsize_image'=>'bool',
121
+ '%d',//'popup_enable_download'=>'bool',
122
+ '%d',//popup_enable_share_buttons=>'bool',
123
+ '%d',//'popup_enable_facebook'=>'bool',
124
+ '%d',//'popup_enable_twitter'=>'bool',
125
+ '%d',//'popup_enable_google'=>'bool',
126
+ '%d',//'popup_enable_pinterest'=>'bool',
127
+ '%d',//'popup_enable_tumblr'=>'bool',
128
+ '%d',//'show_image_counts'=>'bool',
129
+ '%d',//'enable_loop'=>'bool'
130
+ '%d',//popup_image_right_click=>'bool'
131
+ '%s',//'conditional_filters' => 'string',
132
+ '%s',//'conditional_filter_type' => 'string'
133
+ '%d',/*show_username_on_thumb*/
134
+ '%d',//'conditional_filter_enable'=>'0',
135
+ '%s',//'liked_feed' => 'string'
136
+ '%d',//'mobile_breakpoint'=>'640',
137
+ '%s',//'redirect_url',
138
+ '%s',//'feed_resolution',
139
+ );
140
+ }
141
+
142
+ private function display() {
143
+ require_once(WDI_DIR . '/admin/models/feeds.php');
144
+ $model = new Feeds_model_wdi();
145
+ require_once(WDI_DIR . '/admin/views/feeds.php');
146
+ $view = new Feeds_view_wdi($model);
147
+ $view->display();
148
+ }
149
+
150
+ private function add() {
151
+ require_once WDI_DIR . '/admin/models/feeds.php';
152
+ $model = new Feeds_model_wdi();
153
+ require_once WDI_DIR . '/admin/views/feeds.php';
154
+ $view = new Feeds_view_wdi($model);
155
+ $view->edit(0);
156
+ }
157
+
158
+ private function edit( $customId = '' ) {
159
+ require_once WDI_DIR . '/admin/models/feeds.php';
160
+ $model = new Feeds_model_wdi();
161
+ require_once WDI_DIR . '/admin/views/feeds.php';
162
+ $view = new Feeds_view_wdi($model);
163
+ if ( $customId != '' ) {
164
+ $id = $customId;
165
+ }
166
+ else {
167
+ $id = WDILibrary::get('current_id', 0, 'intval');
168
+ }
169
+ $view->edit($id);
170
+ }
171
+ // @todo not used remove ?
172
+ private function apply() {
173
+ $this->save_slider_db();
174
+ $this->save_slide_db();
175
+ $this->edit();
176
+ }
177
+
178
+ private function save_feed() {
179
+ require_once WDI_DIR . '/admin/models/feeds.php';
180
+ $model = new Feeds_model_wdi();
181
+ $settings = WDILibrary::get(WDI_FSN);
182
+ $defaults = $model->wdi_get_feed_defaults();
183
+ $settings = $this->sanitize_input($settings, $defaults);
184
+ $settings = wp_parse_args($settings, $defaults);
185
+ global $wpdb;
186
+ $action = WDILibrary::get('add_or_edit');
187
+ if ( $action == '' ) {
188
+ $wpdb->insert($wpdb->prefix . WDI_FEED_TABLE, $settings, $this->dataFormat);
189
+ if ( $wpdb->insert_id == FALSE ) {
190
+ $this->message(__('Cannot Write on database. Check database permissions.', 'wd-instagram-feed'), 'error');
191
+ }
192
+ }
193
+ else {
194
+ $msg = $wpdb->update($wpdb->prefix . WDI_FEED_TABLE, $settings, array( 'id' => $action ), $this->dataFormat, array( '%d' ));
195
+ if ( $msg == FALSE ) {
196
+ $this->message(__("You have not made new changes", 'wd-instagram-feed'), 'notice');
197
+ }
198
+ else {
199
+ $this->message(__("Successfully saved", 'wd-instagram-feed'), "updated");
200
+ }
201
+ }
202
+ $this->display();
203
+ }
204
+
205
+ private function apply_changes() {
206
+ require_once WDI_DIR . '/admin/models/feeds.php';
207
+ global $wpdb;
208
+ global $wdi_options;
209
+ $model = new Feeds_model_wdi();
210
+ $posts = WDILibrary::get(WDI_FSN);
211
+ $defaults = $model->wdi_get_feed_defaults();
212
+ $settings = $this->sanitize_input($posts, $defaults);
213
+ $settings = wp_parse_args($settings, $defaults);
214
+ $action = WDILibrary::get('add_or_edit');
215
+ require_once (WDI_DIR."/framework/WDIInstagram.php");
216
+ $WDIInstagram = new WDIInstagram();
217
+ $WDIInstagram->wdi_preload_cache(json_decode(stripslashes($posts["feed_users"]), TRUE));
218
+
219
+
220
+
221
+ if ( !empty($wdi_options['wdi_authenticated_users_list']) ) {
222
+ $authenticated_users = json_decode($wdi_options['wdi_authenticated_users_list'], TRUE);
223
+ if ( !empty($authenticated_users[$posts['user_name']]) ) {
224
+ $user = $authenticated_users[$posts['user_name']];
225
+ if ( $user['type'] == 'personal' ) {
226
+ $settings['display_user_post_follow_number'] = 0;
227
+ $settings['display_user_info'] = 0;
228
+ }
229
+ }
230
+ }
231
+
232
+ $message_id = 23;
233
+ if ( $action == '' ) {
234
+ $wpdb->insert($wpdb->prefix . WDI_FEED_TABLE, $settings, $this->dataFormat);
235
+ if ( $wpdb->insert_id == FALSE ) {
236
+ $message_id = 24;
237
+ }
238
+ }
239
+ else {
240
+ $msg = $wpdb->update($wpdb->prefix . WDI_FEED_TABLE, $settings, array( 'id' => $action ), $this->dataFormat, array( '%d' ));
241
+ if ( $msg == FALSE ) {
242
+ $message_id = 24;
243
+ }
244
+ }
245
+ $wdi_current_task = 'edit';
246
+ if ( !empty($action) ) {
247
+ $wdi_current_id = $action;
248
+ }
249
+ elseif ( $wpdb->insert_id != FALSE ) {
250
+ $wdi_current_id = $wpdb->insert_id;
251
+ }
252
+ else {
253
+ $wdi_current_task = "display";
254
+ $wdi_current_id = 0;
255
+ }
256
+ WDILibrary::wdi_spider_redirect(add_query_arg(array(
257
+ 'page' => WDILibrary::get('page'),
258
+ 'task' => $wdi_current_task,
259
+ 'current_id' => $wdi_current_id,
260
+ 'message' => $message_id,
261
+ ), admin_url('admin.php')));
262
+ }
263
+
264
+ private function reset_changes() {
265
+ require_once WDI_DIR . '/admin/models/feeds.php';
266
+ $model = new Feeds_model_wdi();
267
+ $defaults = $model->wdi_get_feed_defaults();
268
+ global $wpdb;
269
+ $action = WDILibrary::get('add_or_edit');
270
+ if ( $action == '' ) {
271
+ $wpdb->insert($wpdb->prefix . WDI_FEED_TABLE, $defaults, $this->dataFormat);
272
+ if ( $wpdb->insert_id == FALSE ) {
273
+ $this->message(__("Cannot Write on database. Check database permissions.", 'wd-instagram-feed'), 'error');
274
+ $this->display();
275
+ }
276
+ else {
277
+ $this->edit($wpdb->insert_id);
278
+ }
279
+ }
280
+ else {
281
+ $msg = $wpdb->update($wpdb->prefix . WDI_FEED_TABLE, $defaults, array( 'id' => $action ), $this->dataFormat, array( '%d' ));
282
+ if ( $msg == FALSE ) {
283
+ $this->message(__("You have not made new changes", 'wd-instagram-feed'), 'notice');
284
+ $this->edit();
285
+ }
286
+ else {
287
+ $this->message(__("Feed successfully reseted", 'wd-instagram-feed'), "updated");
288
+ $this->edit();
289
+ }
290
+ }
291
+ }
292
+
293
+ private function cancel() {
294
+ $this->display();
295
+ }
296
+
297
+ private function duplicate( $id ) {
298
+ $message = 20;
299
+ $duplicated = $this->duplicate_tabels($id);
300
+ if ( $duplicated ) {
301
+ $message = 18;
302
+ }
303
+ WDILibrary::wdi_spider_redirect(add_query_arg(array(
304
+ 'page' => WDILibrary::get('page'),
305
+ 'task' => 'display',
306
+ 'message' => $message,
307
+ ), admin_url('admin.php')));
308
+ }
309
+
310
+ private function duplicate_all( $id ) {
311
+ global $wpdb;
312
+ $message = 19;
313
+ $flag = FALSE;
314
+ $feed_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . WDI_FEED_TABLE);
315
+ foreach ( $feed_ids_col as $slider_id ) {
316
+ if ( WDILibrary::get('check_' . $slider_id) != '' ) {
317
+ if ( !$flag ) {
318
+ $flag = TRUE;
319
+ }
320
+ $this->duplicate_tabels($slider_id);
321
+ }
322
+ }
323
+ if ( !$flag ) {
324
+ $message = 6;
325
+ }
326
+ WDILibrary::wdi_spider_redirect(add_query_arg(array(
327
+ 'page' => WDILibrary::get('page'),
328
+ 'task' => 'display',
329
+ 'message' => $message,
330
+ ), admin_url('admin.php')));
331
+ }
332
+
333
+ private function duplicate_tabels( $feed_id ) {
334
+ global $wpdb;
335
+ if ( $feed_id ) {
336
+ $feed_row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . WDI_FEED_TABLE . ' where id="%d"', $feed_id));
337
+ }
338
+ if ( $feed_row ) {
339
+ $duplicate_values = WDILibrary::objectToArray($feed_row);
340
+ unset($duplicate_values['id']);
341
+ $save = $wpdb->insert($wpdb->prefix . WDI_FEED_TABLE, $duplicate_values, $this->dataFormat);
342
+ $new_slider_id = $wpdb->get_var('SELECT MAX(id) FROM ' . $wpdb->prefix . WDI_FEED_TABLE);
343
+ }
344
+
345
+ return $new_slider_id;
346
+ }
347
+
348
+ private function delete( $id ) {
349
+ global $wpdb;
350
+ $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . WDI_FEED_TABLE . ' WHERE id="%d"', $id);
351
+ if ( $wpdb->query($query) ) {
352
+ $message = 3;
353
+ }
354
+ else {
355
+ $message = 20;
356
+ }
357
+ WDILibrary::wdi_spider_redirect(add_query_arg(array(
358
+ 'page' => WDILibrary::get('page'),
359
+ 'task' => 'display',
360
+ 'message' => $message,
361
+ ), admin_url('admin.php')));
362
+ }
363
+
364
+ private function delete_all() {
365
+ global $wpdb;
366
+ $flag = FALSE;
367
+ $feed_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . WDI_FEED_TABLE);
368
+ foreach ( $feed_ids_col as $slider_id ) {
369
+ if ( WDILibrary::get('check_' . $slider_id) != '' || WDILibrary::get('check_all_items') != '' ) {
370
+ $flag = TRUE;
371
+ $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . WDI_FEED_TABLE . ' WHERE id="%d"', $slider_id);
372
+ $wpdb->query($query);
373
+ }
374
+ }
375
+ if ( $flag ) {
376
+ $message = 5;
377
+ }
378
+ else {
379
+ $message = 6;
380
+ }
381
+ WDILibrary::wdi_spider_redirect(add_query_arg(array(
382
+ 'page' => WDILibrary::get('page'),
383
+ 'task' => 'display',
384
+ 'message' => $message,
385
+ ), admin_url('admin.php')));
386
+ }
387
+
388
+ private function publish( $id ) {
389
+ global $wpdb;
390
+ $message = 20;
391
+ $save = $wpdb->update($wpdb->prefix . WDI_FEED_TABLE, array( 'published' => 1 ), array( 'id' => $id ));
392
+ if ( $save !== FALSE ) {
393
+ $message = 9;
394
+ }
395
+ WDILibrary::wdi_spider_redirect(add_query_arg(array(
396
+ 'page' => WDILibrary::get('page'),
397
+ 'task' => 'display',
398
+ 'message' => $message,
399
+ ), admin_url('admin.php')));
400
+ }
401
+
402
+ private function publish_all() {
403
+ global $wpdb;
404
+ $flag = FALSE;
405
+ if ( WDILibrary::get('check_all_items') != '' ) {
406
+ $wpdb->query('UPDATE ' . $wpdb->prefix . WDI_FEED_TABLE . ' SET published=1');
407
+ $flag = TRUE;
408
+ }
409
+ else {
410
+ $feed_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . WDI_FEED_TABLE);
411
+ foreach ( $feed_ids_col as $slider_id ) {
412
+ if ( WDILibrary::get('check_' . $slider_id) != '' ) {
413
+ $flag = TRUE;
414
+ $wpdb->update($wpdb->prefix . WDI_FEED_TABLE, array( 'published' => 1 ), array( 'id' => $slider_id ));
415
+ }
416
+ }
417
+ }
418
+ if ( $flag ) {
419
+ $message = 10;
420
+ }
421
+ else {
422
+ $message = 6;
423
+ }
424
+ WDILibrary::wdi_spider_redirect(add_query_arg(array(
425
+ 'page' => WDILibrary::get('page'),
426
+ 'task' => 'display',
427
+ 'message' => $message,
428
+ ), admin_url('admin.php')));
429
+ }
430
+
431
+ private function unpublish( $id ) {
432
+ global $wpdb;
433
+ $message = 20;
434
+ $save = $wpdb->update($wpdb->prefix . WDI_FEED_TABLE, array( 'published' => 0 ), array( 'id' => $id ));
435
+ if ( $save !== FALSE ) {
436
+ $message = 11;
437
+ }
438
+ WDILibrary::wdi_spider_redirect(add_query_arg(array(
439
+ 'page' => WDILibrary::get('page'),
440
+ 'task' => 'display',
441
+ 'message' => $message,
442
+ ), admin_url('admin.php')));
443
+ }
444
+
445
+ private function unpublish_all() {
446
+ global $wpdb;
447
+ $flag = FALSE;
448
+ if ( WDILibrary::get('check_all_items') != '' ) {
449
+ $wpdb->query('UPDATE ' . $wpdb->prefix . WDI_FEED_TABLE . ' SET published=0');
450
+ $flag = TRUE;
451
+ }
452
+ else {
453
+ $feed_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . WDI_FEED_TABLE);
454
+ foreach ( $feed_ids_col as $slider_id ) {
455
+ if ( WDILibrary::get('check_' . $slider_id) != '' ) {
456
+ $flag = TRUE;
457
+ $wpdb->update($wpdb->prefix . WDI_FEED_TABLE, array( 'published' => 0 ), array( 'id' => $slider_id ));
458
+ }
459
+ }
460
+ }
461
+ if ( $flag ) {
462
+ $message = 12;
463
+ }
464
+ else {
465
+ $message = 6;
466
+ }
467
+ WDILibrary::wdi_spider_redirect(add_query_arg(array(
468
+ 'page' => WDILibrary::get('page'),
469
+ 'task' => 'display',
470
+ 'message' => $message,
471
+ ), admin_url('admin.php')));
472
+ }
473
+
474
+ private function sanitize_input( $settings, $defaults ) {
475
+ require_once WDI_DIR . '/admin/models/feeds.php';
476
+ $model = new Feeds_model_wdi();
477
+ $sanitize_types = $model->get_sanitize_types();
478
+ $sanitized_output = array();
479
+ foreach ( $settings as $setting_name => $value ) {
480
+ switch ( $sanitize_types[$setting_name] ) {
481
+ case 'string':
482
+ {
483
+ $sanitized_val = $this->sanitize_string($value, $defaults[$setting_name]);
484
+ $sanitized_output[$setting_name] = $sanitized_val;
485
+ break;
486
+ }
487
+ case 'number':
488
+ {
489
+ $sanitized_val = $this->sanitize_number($value, $defaults[$setting_name]);
490
+ $sanitized_output[$setting_name] = $sanitized_val;
491
+ break;
492
+ }
493
+ case 'bool':
494
+ {
495
+ $sanitized_val = $this->sanitize_bool($value, $defaults[$setting_name]);
496
+ $sanitized_output[$setting_name] = $sanitized_val;
497
+ break;
498
+ }
499
+ case 'url':
500
+ {
501
+ $sanitized_val = $this->sanitize_url($value, $defaults[$setting_name]);
502
+ $sanitized_output[$setting_name] = $sanitized_val;
503
+ break;
504
+ }
505
+ }
506
+ }
507
+
508
+ return $sanitized_output;
509
+ }
510
+
511
+ private function sanitize_bool( $value, $default ) {
512
+ if ( $value == 1 || $value == 0 ) {
513
+ return $value;
514
+ }
515
+ else {
516
+ return $default;
517
+ }
518
+ }
519
+
520
+ private function sanitize_string( $value, $default ) {
521
+ $sanitized_val = strip_tags(stripslashes($value));
522
+ if ( $sanitized_val == '' ) {
523
+ return $default;
524
+ }
525
+ else {
526
+ return $sanitized_val;
527
+ }
528
+ }
529
+
530
+ private function sanitize_number( $value, $default ) {
531
+ if ( is_numeric($value) && $value > 0 ) {
532
+ return $value;
533
+ }
534
+ else {
535
+ return $default;
536
+ }
537
+ }
538
+
539
+ private function sanitize_url( $value, $default ) {
540
+ if ( function_exists('filter_var') && !filter_var($value, FILTER_VALIDATE_URL) === FALSE ) {
541
+ return $value;
542
+ }
543
+ else {
544
+ return $default;
545
+ }
546
+ }
547
+
548
+ private function message( $text, $type ) {
549
+ require_once(WDI_DIR . '/framework/WDILibrary.php');
550
+ echo WDILibrary::message($text, $type);
551
+ }
552
+ }
admin/controllers/settings.php ADDED
@@ -0,0 +1,223 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Settings_controller_wdi {
4
+
5
+ private $view;
6
+
7
+ function __construct() {
8
+ require_once(WDI_DIR . '/admin/views/settings.php');
9
+ $this->view = new Settings_view_wdi();
10
+ }
11
+
12
+ public function execute() {
13
+ $task = WDILibrary::get('task');
14
+ if ( method_exists($this, $task) ) {
15
+ check_admin_referer('wdi_nonce', 'wdi_nonce');
16
+ $this->$task();
17
+ }
18
+ else {
19
+ $this->display();
20
+ }
21
+ }
22
+
23
+ public function display() {
24
+ $wdi_options = wdi_get_options();
25
+ $settings = wdi_get_settings();
26
+ $db_options = array();
27
+ foreach ( $settings as $setting ) {
28
+ $settingDefault = isset($setting['default']) ? $setting['default'] : '';
29
+ $db_options[$setting['name']] = $settingDefault;
30
+ }
31
+ $options = wp_parse_args($wdi_options, $db_options);
32
+
33
+ $this->reset_access_token();
34
+ $this->basic_instagram_api_connect();
35
+
36
+ /*is_free*/
37
+ //$this->graph_instagram_api_connect();
38
+
39
+ $message = WDILibrary::get('message', '');
40
+ if ( !empty($message) ) {
41
+ echo WDILibrary::message($message, 'error');
42
+ }
43
+ $args = array();
44
+ $args['options'] = $options;
45
+ $args['authenticated_users_list'] = json_decode($wdi_options['wdi_authenticated_users_list'], TRUE);
46
+ $args['min_capability'] = array(
47
+ 'manage_options' => __('Administrator', 'wd-instagram-feed'),
48
+ 'publish_posts' => __('Author', 'wd-instagram-feed'),
49
+ 'contributor' => __('Contributor', 'wd-instagram-feed'),
50
+ );
51
+ $this->view->display($args);
52
+ }
53
+
54
+ /**
55
+ * Save.
56
+ */
57
+ private function save() {
58
+ $post = WDILibrary::get(WDI_OPT);
59
+ $wdi_options = wdi_get_options();
60
+ $wdi_options['wdi_upd_microtime'] = microtime();
61
+ $wdi_options['wdi_transient_time'] = intval($post['wdi_transient_time']);
62
+ $wdi_options['wdi_feeds_min_capability'] = $post['wdi_feeds_min_capability'];
63
+ $wdi_options['wdi_custom_css'] = esc_js(str_replace(array( "\n", "\r" ), "", $post['wdi_custom_css']));
64
+ $wdi_options['wdi_custom_js'] = esc_js(str_replace(array( "\n", "\r" ), "", $post['wdi_custom_js']));
65
+ $update = update_option(WDI_OPT, $wdi_options);
66
+ $message_id = 8;
67
+ WDILibrary::redirect(add_query_arg(array(
68
+ 'page' => 'wdi_settings',
69
+ 'message' => $message_id,
70
+ ), admin_url('admin.php')));
71
+ }
72
+
73
+ private function reset_access_token() {
74
+ $reset_access_token = WDILibrary::get('wdi_reset_access_token_input', '');
75
+ if ( !empty($reset_access_token) && $reset_access_token == '1' ) {
76
+ global $wpdb;
77
+ $wpdb->query('DELETE FROM ' . $wpdb->prefix . 'options WHERE option_name = "wdi_instagram_options"');
78
+ $wpdb->query('DELETE FROM ' . $wpdb->prefix . 'options WHERE option_name = "wdi_first_user_username"');
79
+ WDILibrary::redirect(add_query_arg(array( 'page' => 'wdi_settings' ), admin_url('admin.php')));
80
+ }
81
+ }
82
+
83
+ private function basic_instagram_api_connect() {
84
+ if ( !empty($_REQUEST['wdi_access_token']) && !empty($_REQUEST['user_id']) ) {
85
+ $wdi_options = wdi_get_options();
86
+ $time = time();
87
+ /* @ToDo in the next version
88
+ * In this part we need to transfer the data from the API to the "base64_encode" type, as done in 'graph_instagram_api_connect'.
89
+ * And let's add an error check operation
90
+ */
91
+ $user_id = WDILibrary::get('user_id', '');
92
+ $user_name = WDILibrary::get('username', '');
93
+ $expires_in = WDILibrary::get('expires_in', '');
94
+ $access_token = WDILibrary::get('wdi_access_token', '');
95
+ $authenticated_users_list = array();
96
+ if ( !empty($wdi_options['wdi_authenticated_users_list']) ) {
97
+ $authenticated_users_list = json_decode($wdi_options['wdi_authenticated_users_list'], TRUE);
98
+ }
99
+
100
+ $authenticated_users_list[$user_name] = array(
101
+ 'type' => 'personal',
102
+ 'user_id' => $user_id,
103
+ 'user_name' => $user_name,
104
+ 'access_token' => $access_token,
105
+ 'start_in' => $time,
106
+ 'expires_in' => $expires_in,
107
+ );
108
+
109
+ $wdi_options['wdi_authenticated_users_list'] = $authenticated_users_list;
110
+
111
+ if ( empty($wdi_options['wdi_user_name']) ) {
112
+ $wdi_options['wdi_user_id'] = $user_id;
113
+ $wdi_options['wdi_user_name'] = $user_name;
114
+ $wdi_options['wdi_start_in'] = $time;
115
+ $wdi_options['wdi_expires_in'] = $expires_in;
116
+ $wdi_options['wdi_access_token'] = $access_token;
117
+ }
118
+ update_option(WDI_OPT, $wdi_options);
119
+
120
+ WDILibrary::redirect(add_query_arg(array(
121
+ 'page' => 'wdi_settings',
122
+ 'message' => 29,
123
+ ), admin_url('admin.php')));
124
+ }
125
+ }
126
+ /*is_free*/
127
+ /*private function graph_instagram_api_connect() {
128
+ if ( !empty($_REQUEST['wdi_business_access_token']) ) {
129
+ $ig_users = json_decode(base64_decode($_REQUEST['ig_user_data']), TRUE);
130
+ $facebook_pages = json_decode(base64_decode($_REQUEST['fb_page_data']), TRUE);
131
+ // invalid access token
132
+ if ( empty($facebook_pages) ) {
133
+ WDILibrary::redirect(add_query_arg(array(
134
+ 'page' => 'wdi_settings',
135
+ 'message' => 26,
136
+ ), admin_url('admin.php')));
137
+ }
138
+ // no business accounts
139
+ if ( empty($ig_users) ) {
140
+ WDILibrary::redirect(add_query_arg(array(
141
+ 'page' => 'wdi_settings',
142
+ 'message' => 27,
143
+ ), admin_url('admin.php')));
144
+ }
145
+
146
+ if ( !empty($ig_users) ) {
147
+ $wdi_options = wdi_get_options();
148
+ $authenticated_users_list = array();
149
+ if ( !empty($wdi_options['wdi_authenticated_users_list']) ) {
150
+ $authenticated_users_list = json_decode($wdi_options['wdi_authenticated_users_list'], TRUE);
151
+ }
152
+ $user_facebook_page = array();
153
+ foreach ( $facebook_pages as $facebook_page ) {
154
+ $user_facebook_page[$facebook_page['id']] = $facebook_page;
155
+ }
156
+
157
+ foreach ( $ig_users as $business_account_id => $ig_user ) {
158
+ $access_token = $user_facebook_page[$business_account_id]['access_token'];
159
+ $user = array(
160
+ 'type' => 'business',
161
+ 'user_id' => $ig_user['id'],
162
+ 'user_name' => $ig_user['username'],
163
+ 'biography' => !empty($ig_user['biography']) ? $ig_user['biography'] : '',
164
+ 'profile_picture_url' => !empty($ig_user['profile_picture_url']) ? $ig_user['profile_picture_url'] : '',
165
+ 'followers_count' => !empty($ig_user['followers_count']) ? $ig_user['followers_count'] : '',
166
+ 'follows_count' => !empty($ig_user['follows_count']) ? $ig_user['follows_count'] : '',
167
+ 'media_count' => !empty($ig_user['media_count']) ? $ig_user['media_count'] : '',
168
+ 'website' => !empty($ig_user['website']) ? $ig_user['website'] : '',
169
+ 'access_token' => $access_token,
170
+ 'start_in' => time(),
171
+ 'expires_in' => 5183944, // 60 deys
172
+ // 'facebook_page' => $user_facebook_page[$business_account_id]
173
+ );
174
+ $authenticated_users_list[$ig_user['username']] = $user;
175
+ }
176
+
177
+ $wdi_options['wdi_authenticated_users_list'] = $authenticated_users_list;
178
+ update_option( WDI_OPT, $wdi_options );
179
+
180
+ WDILibrary::redirect(add_query_arg(array(
181
+ 'page' => 'wdi_settings',
182
+ 'message' => 28,
183
+ ), admin_url('admin.php')));
184
+ }
185
+ }
186
+ }*/
187
+
188
+ function account_refresh() {
189
+ $json = array();
190
+ $user_name = WDILibrary::get('user_name');
191
+ var_dump($user_name);
192
+ // @ToDo if the type is business, change all businesses.
193
+ echo json_encode($json);
194
+ exit;
195
+ }
196
+ /**
197
+ * Account disconnect.
198
+ *
199
+ * @return json
200
+ */
201
+ function account_disconnect() {
202
+ $user_name = WDILibrary::get('user_name');
203
+ $wdi_options = wdi_get_options();
204
+ if ( !empty($wdi_options['wdi_authenticated_users_list']) ) {
205
+ $authenticated_users_list = json_decode($wdi_options['wdi_authenticated_users_list'], TRUE);
206
+ unset($authenticated_users_list[$user_name]);
207
+ $wdi_options['wdi_authenticated_users_list'] = json_encode($authenticated_users_list);
208
+ $update = update_option(WDI_OPT, $wdi_options);
209
+ $json = array(
210
+ 'message' => __('Failed.', 'wd-instagram-feed'),
211
+ 'success' => FALSE,
212
+ );
213
+ if ( $update ) {
214
+ $json = array(
215
+ 'message' => __('Item Succesfully is Deleted.', 'wd-instagram-feed'),
216
+ 'success' => TRUE,
217
+ );
218
+ }
219
+ echo json_encode($json);
220
+ exit;
221
+ }
222
+ }
223
+ }
admin/models/WDIModelSettings_wdi.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class WDIModelSettings_wdi {
4
-
5
- public $active_tab = 'configure';
6
-
7
- public function __construct() {
8
- $this->activeTab = WDILibrary::get('form_action', 'configure');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
admin/models/WDIModelThemes_wdi.php CHANGED
@@ -5,40 +5,47 @@ class WDIModelThemes_wdi {
5
  private $page_number = null;
6
  private $search_text = "";
7
  public function __construct() {
 
 
 
 
 
 
 
 
 
 
8
  }
9
 
10
  public function get_rows_data() {
11
  global $wpdb;
12
- $search_value = WDILibrary::get('search_value', '');
13
- $where = ( !empty($search_value) ) ? 'WHERE theme_name LIKE "%' . esc_html(stripslashes($search_value)) . '%"' : '';
14
-
15
- $order = WDILibrary::get('asc_or_desc', 'asc');
16
  $order_by_arr = array('id', 'theme_name', 'default_theme');
17
- $order_by = WDILibrary::get('order_by', 'id');
18
- $order_by = ( in_array($order_by, $order_by_arr) ) ? $order_by : 'id';
19
- $order_by = ' ORDER BY `' . $order_by . '` ' . $order;
20
- $page_number = (int) WDILibrary::get('page_number');
21
- if (isset($page_number) && $page_number) {
22
- $limit = ( $page_number - 1 ) * 20;
23
  }
24
  else {
25
  $limit = 0;
26
  }
27
- $query = "SELECT * FROM " . $wpdb->prefix . WDI_THEME_TABLE .' '. $where . $order_by . " LIMIT " . $limit . ",20";
 
28
 
29
  $rows = $wpdb->get_results($query);
30
  return $rows;
31
  }
32
 
 
33
  public function page_nav() {
34
  global $wpdb;
35
- $search_value = WDILibrary::get('search_value', '');
36
- $where = ( !empty($search_value) ) ? 'WHERE theme_name LIKE "%' . esc_html(stripslashes($search_value)) . '%"' : '';
37
  $total = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . WDI_THEME_TABLE. ' ' . $where);
38
  $page_nav['total'] = $total;
39
- $page_number = (int) WDILibrary::get('page_number');
40
- if ( isset($page_number) && $page_number ) {
41
- $limit = ( $page_number - 1 ) * 20;
42
  }
43
  else {
44
  $limit = 0;
@@ -86,7 +93,7 @@ class WDIModelThemes_wdi {
86
  'user_border_size' => '0px',//*
87
  'user_border_color' => '',//*
88
  'user_img_width' => '40px',//enabled
89
- 'user_border_radius' => '0',//enabled
90
  'user_background_color' => '',//*
91
  'users_border_size' => '0px',//*
92
  'users_border_color' => '',//*
@@ -286,7 +293,7 @@ class WDIModelThemes_wdi {
286
  'load_more_text_font_size' => '14px',
287
  'load_more_wrap_hover_color' => 'transparent',
288
  'pagination_ctrl_color' => '#0f4973',
289
- 'pagination_size' => '40px',
290
  'pagination_ctrl_margin' => '15px',
291
  'pagination_ctrl_hover_color' => '#25292c',
292
  'pagination_position' => 'center',
5
  private $page_number = null;
6
  private $search_text = "";
7
  public function __construct() {
8
+ if ( WDILibrary::get('paged', 0, 'intval') != 0 ) {
9
+ $this->page_number = WDILibrary::get('paged', 0, 'intval');
10
+ } elseif ( WDILibrary::get('page_number', 0, 'intval') != 0 ) {
11
+ $this->page_number = WDILibrary::get('page_number', 0, 'intval');
12
+ }
13
+ if ( WDILibrary::get('search_value') != '' ) {
14
+ $this->search_text = WDILibrary::get('search_value');
15
+ } elseif ( WDILibrary::get('search') != '' ) {
16
+ $this->search_text = WDILibrary::get('search');
17
+ }
18
  }
19
 
20
  public function get_rows_data() {
21
  global $wpdb;
22
+ $where = ((!empty($this->search_text)) ? 'WHERE theme_name LIKE "%' . esc_html(stripslashes($this->search_text)) . '%"' : '');
23
+ $asc_or_desc = WDILibrary::get('order') == 'asc' ? 'asc' : 'desc';
 
 
24
  $order_by_arr = array('id', 'theme_name', 'default_theme');
25
+ $order_by = WDILibrary::get('order_by');
26
+ $order_by = (in_array($order_by, $order_by_arr)) ? $order_by : 'id';
27
+ $order_by = ' ORDER BY `' . $order_by . '` ' . $asc_or_desc;
28
+ if (isset($this->page_number) && $this->page_number) {
29
+ $limit = ((int) $this->page_number - 1) * 20;
 
30
  }
31
  else {
32
  $limit = 0;
33
  }
34
+ $query_limit = " LIMIT " . $limit . ",20";
35
+ $query = "SELECT * FROM " . $wpdb->prefix . WDI_THEME_TABLE .' '. $where . $order_by . $query_limit;
36
 
37
  $rows = $wpdb->get_results($query);
38
  return $rows;
39
  }
40
 
41
+
42
  public function page_nav() {
43
  global $wpdb;
44
+ $where = ((isset($this->search_text) && !empty($this->search_text) && (esc_html(stripslashes($this->search_text)) != '')) ? 'WHERE theme_name LIKE "%' . esc_html(stripslashes($this->search_text)) . '%"' : '');
 
45
  $total = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . WDI_THEME_TABLE. ' ' . $where);
46
  $page_nav['total'] = $total;
47
+ if (isset($this->page_number) && $this->page_number) {
48
+ $limit = ((int) $this->page_number - 1) * 20;
 
49
  }
50
  else {
51
  $limit = 0;
93
  'user_border_size' => '0px',//*
94
  'user_border_color' => '',//*
95
  'user_img_width' => '40px',//enabled
96
+ 'user_border_radius' => '0px',//enabled
97
  'user_background_color' => '',//*
98
  'users_border_size' => '0px',//*
99
  'users_border_color' => '',//*
293
  'load_more_text_font_size' => '14px',
294
  'load_more_wrap_hover_color' => 'transparent',
295
  'pagination_ctrl_color' => '#0f4973',
296
+ 'pagination_size' => '18px',
297
  'pagination_ctrl_margin' => '15px',
298
  'pagination_ctrl_hover_color' => '#25292c',
299
  'pagination_position' => 'center',
admin/models/{WDIModelFeeds_wdi.php → feeds.php} RENAMED
@@ -1,40 +1,44 @@
1
  <?php
2
 
3
- class WDIModelFeeds_wdi {
4
 
5
  private $page_number = null;
6
 
7
  private $search_text = "";
8
 
9
  public function __construct() {
10
- $this->page_number = WDILibrary::get('paged', '');
11
- if( empty($this->page_number) ){
12
- $this->page_number = WDILibrary::get('page_number', '');
 
13
  }
14
- $this->search_text = WDILibrary::get('search_value', '');
15
- if( empty($this->search_text) ){
16
- $this->search_text = WDILibrary::get('search', '');
 
17
  }
18
  }
19
 
20
  public function get_slides_row_data($slider_id) {
21
  global $wpdb;
22
  $row = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . WDI_FEED_TABLE. " WHERE slider_id='%d' ORDER BY `order` ASC", $slider_id));
23
-
 
 
 
24
  return $row;
25
  }
26
 
27
-
28
  public function get_rows_data() {
29
  global $wpdb;
30
 
31
  $where = ((!empty($this->search_text)) ? 'WHERE feed_name LIKE "%' . esc_html(stripslashes($this->search_text)) . '%"' : '');
32
- $order = WDILibrary::get('order', 'desc');
33
 
34
  $order_by_arr = array('id', 'feed_name', 'published');
35
- $order_by = WDILibrary::get('order_by', 'id');
36
- $order_by = ( in_array($order_by, $order_by_arr) ) ? $order_by : 'id';
37
- $order_by = ' ORDER BY `' . $order_by . '` ' . $order;
38
  if (isset($this->page_number) && $this->page_number) {
39
  $limit = ((int) $this->page_number - 1) * 20;
40
  }
@@ -71,20 +75,16 @@ class WDIModelFeeds_wdi {
71
  }
72
 
73
  public static function wdi_get_feed_defaults() {
74
- global $wdi_options;
75
  global $wpdb;
76
  $query = $wpdb->prepare("SELECT id FROM " . $wpdb->prefix . WDI_THEME_TABLE . " WHERE default_theme='%d'", 1);
77
  $default_theme = WDILibrary::objectToArray($wpdb->get_results($query));
78
- $default_user = new stdClass();
79
- $default_user->username = $wdi_options['wdi_user_name'];
80
- $default_user->id = $wdi_options['wdi_user_id'];
81
  $settings = array(
82
- 'thumb_user' => $wdi_options['wdi_user_name'],
83
  'feed_name' => 'Sample Feed',
84
- 'feed_thumb' => WDI_URL . '/images/no-image.png',
85
  'published' => '1',
86
  'theme_id' => $default_theme[0]['id'],
87
- 'feed_users' => json_encode(array( $default_user )),
88
  'feed_display_view' => 'load_more_btn',
89
  'sort_images_by' => 'date',
90
  'display_order' => 'desc',
@@ -98,35 +98,35 @@ class WDIModelFeeds_wdi {
98
  'image_browser_load_number' => '10',
99
  'number_of_columns' => '4',
100
  'resort_after_load_more' => '0',
101
- 'show_likes' => '0', // @TODO API Changes 2020
102
- 'show_description' => '0', // @TODO API Changes 2020
103
- 'show_comments' => '0', // @TODO API Changes 2020
104
- 'show_usernames' => '0', // @TODO API Changes 2020
105
- 'display_user_info' => '0', // @TODO API Changes 2020
106
- 'display_user_post_follow_number' => '0', // @TODO API Changes 2020
107
- 'show_full_description' => '0', // @TODO API Changes 2020
108
  'disable_mobile_layout' => '0',
109
  'feed_type' => 'thumbnails',
110
  'feed_item_onclick' => 'lightbox',
111
  //lightbox defaults
112
  'popup_fullscreen' => '0',
113
- 'popup_width' => '640',
114
- 'popup_height' => '640',
115
- 'popup_type' => 'none',
116
  'popup_autoplay' => '0',
117
  'popup_interval' => '5',
118
- 'popup_enable_filmstrip' => '0',
119
  'popup_filmstrip_height' => '70',
120
  'autohide_lightbox_navigation' => '1',
121
  'popup_enable_ctrl_btn' => '1',
122
  'popup_enable_fullscreen' => '1',
123
- 'popup_enable_info' => '0',
124
  'popup_info_always_show' => '0',
125
  'popup_info_full_width' => '0',
126
- 'popup_enable_comment' => '0', // @TODO API Changes 2020
127
  'popup_enable_fullsize_image' => '1',
128
  'popup_enable_download' => '0',
129
- 'popup_enable_share_buttons' => '0',
130
  'popup_enable_facebook' => '0',
131
  'popup_enable_twitter' => '0',
132
  'popup_enable_google' => '0',
@@ -145,7 +145,18 @@ class WDIModelFeeds_wdi {
145
  'feed_resolution' => 'optimal',
146
  'hashtag_top_recent' => '1',
147
  );
148
-
 
 
 
 
 
 
 
 
 
 
 
149
  return $settings;
150
  }
151
 
@@ -183,7 +194,6 @@ class WDIModelFeeds_wdi {
183
  'feed_item_onclick' => 'string',
184
 
185
  //lightbox defaults
186
-
187
  'popup_fullscreen'=>'bool',
188
  'popup_width'=>'number',
189
  'popup_height'=>'number',
@@ -225,53 +235,11 @@ class WDIModelFeeds_wdi {
225
  }
226
 
227
  public function get_feed_row($current_id){
228
- global $wpdb;
229
- $settings = $wpdb->get_row($wpdb->prepare("SELECT * FROM ". $wpdb->prefix.WDI_FEED_TABLE. " WHERE id ='%d' ",$current_id));
230
-
231
- $feed_row = $this->check_settings( $settings );
232
- return $feed_row;
233
- }
234
-
235
- private function check_settings($settings){
236
- $settings = WDILibrary::objectToArray($settings);
237
-
238
- if(isset($settings['feed_users'])){
239
- $settings['feed_users'] = json_decode($settings['feed_users']);
240
- $settings['feed_users'] = json_encode(array($settings['feed_users'][0]));
241
- };
242
- if(isset($settings['theme_id']) && intval($settings['theme_id']) > 1){
243
- $settings['theme_id'] = '1';
244
- };
245
- if(isset($settings['feed_display_view']) && $settings['feed_display_view'] === 'infinite_scroll'){
246
- $settings['feed_display_view'] = 'load_more_btn';
247
- }
248
- if(isset($settings['feed_type']) && $settings['feed_type'] === 'masonry' || $settings['feed_type'] === 'blog_style'){
249
- $settings['feed_type'] = 'thumbnails';
250
- }
251
- if(isset($settings['popup_enable_filmstrip']) && $settings['popup_enable_filmstrip'] == '1'){
252
- $settings['popup_enable_filmstrip'] = '0';
253
- }
254
-
255
- if(isset($settings['show_username_on_thumb']) && $settings['show_username_on_thumb'] == '1'){
256
- $settings['show_username_on_thumb'] = '0';
257
- }
258
-
259
- if(isset($settings['conditional_filter_enable']) && $settings['conditional_filter_enable'] == '1'){
260
- $settings['conditional_filter_enable'] = '0';
261
- }
262
-
263
- if(isset($settings['popup_filmstrip_height']) && $settings['popup_filmstrip_height'] != '70'){
264
- $settings['popup_filmstrip_height'] = '70';
265
- }
266
- if(isset($settings['popup_enable_comment']) && $settings['popup_enable_comment'] == '1'){
267
- $settings['popup_enable_comment'] = '0';
268
- }
269
- if(isset($settings['popup_enable_share_buttons']) && $settings['popup_enable_share_buttons'] == '1'){
270
- $settings['popup_enable_share_buttons'] = '0';
271
- }
272
- $settings = WDILibrary::arrayToObject($settings);
273
- return $settings;
274
  }
 
275
  /**
276
  * Create Preview Instagram post.
277
  *
@@ -313,4 +281,4 @@ class WDIModelFeeds_wdi {
313
  }
314
  }
315
  }
316
- }
1
  <?php
2
 
3
+ class Feeds_model_wdi {
4
 
5
  private $page_number = null;
6
 
7
  private $search_text = "";
8
 
9
  public function __construct() {
10
+ if ( WDILibrary::get('paged', 0, 'intval') != 0 ) {
11
+ $this->page_number = WDILibrary::get('paged', 0, 'intval');
12
+ } elseif ( WDILibrary::get('page_number', 0, 'intval') != 0 ) {
13
+ $this->page_number = WDILibrary::get('page_number', 0, 'intval');
14
  }
15
+ if ( WDILibrary::get('search_value') != '' ) {
16
+ $this->search_text = WDILibrary::get('search_value');
17
+ } elseif ( WDILibrary::get('search', '', 'sanitize_text_field', 'GET' ) != '' ) {
18
+ $this->search_text = WDILibrary::get('search', '', 'sanitize_text_field', 'GET' );
19
  }
20
  }
21
 
22
  public function get_slides_row_data($slider_id) {
23
  global $wpdb;
24
  $row = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . WDI_FEED_TABLE. " WHERE slider_id='%d' ORDER BY `order` ASC", $slider_id));
25
+ if ( $row ) {
26
+ // $row->image_url = $row->image_url ? $row->image_url : WD_S_URL . '/images/no-image.png';
27
+ // $row->thumb_url = $row->thumb_url ? $row->thumb_url : WD_S_URL . '/images/no-image.png';
28
+ }
29
  return $row;
30
  }
31
 
 
32
  public function get_rows_data() {
33
  global $wpdb;
34
 
35
  $where = ((!empty($this->search_text)) ? 'WHERE feed_name LIKE "%' . esc_html(stripslashes($this->search_text)) . '%"' : '');
36
+ $asc_or_desc = WDILibrary::get('order') == 'asc' ? 'asc' : 'desc';
37
 
38
  $order_by_arr = array('id', 'feed_name', 'published');
39
+ $order_by = WDILibrary::get('order_by');
40
+ $order_by = (in_array($order_by, $order_by_arr)) ? $order_by : 'id';
41
+ $order_by = ' ORDER BY `' . $order_by . '` ' . $asc_or_desc;
42
  if (isset($this->page_number) && $this->page_number) {
43
  $limit = ((int) $this->page_number - 1) * 20;
44
  }
75
  }
76
 
77
  public static function wdi_get_feed_defaults() {
 
78
  global $wpdb;
79
  $query = $wpdb->prepare("SELECT id FROM " . $wpdb->prefix . WDI_THEME_TABLE . " WHERE default_theme='%d'", 1);
80
  $default_theme = WDILibrary::objectToArray($wpdb->get_results($query));
 
 
 
81
  $settings = array(
82
+ 'thumb_user' => '',
83
  'feed_name' => 'Sample Feed',
84
+ 'feed_thumb' => '',
85
  'published' => '1',
86
  'theme_id' => $default_theme[0]['id'],
87
+ 'feed_users' => '',
88
  'feed_display_view' => 'load_more_btn',
89
  'sort_images_by' => 'date',
90
  'display_order' => 'desc',
98
  'image_browser_load_number' => '10',
99
  'number_of_columns' => '4',
100
  'resort_after_load_more' => '0',
101
+ 'show_likes' => '1', // @ToDo API Changes 2020 (change to 0)
102
+ 'show_description' => '1', // @ToDo API Changes 2020 (change to 0)
103
+ 'show_comments' => '1', // @ToDo API Changes 2020 (change to 0)
104
+ 'show_usernames' => '1', // @ToDo API Changes 2020 (change to 0)
105
+ 'display_user_info' => '1', // @ToDo API Changes 2020 (change to 0)
106
+ 'display_user_post_follow_number' => '1', // @ToDo API Changes 2020 (change to 0)
107
+ 'show_full_description' => '1', // @ToDo API Changes 2020 (change to 0)
108
  'disable_mobile_layout' => '0',
109
  'feed_type' => 'thumbnails',
110
  'feed_item_onclick' => 'lightbox',
111
  //lightbox defaults
112
  'popup_fullscreen' => '0',
113
+ 'popup_width' => '648',
114
+ 'popup_height' => '648',
115
+ 'popup_type' => 'fade',
116
  'popup_autoplay' => '0',
117
  'popup_interval' => '5',
118
+ 'popup_enable_filmstrip' => '1',
119
  'popup_filmstrip_height' => '70',
120
  'autohide_lightbox_navigation' => '1',
121
  'popup_enable_ctrl_btn' => '1',
122
  'popup_enable_fullscreen' => '1',
123
+ 'popup_enable_info' => '1',
124
  'popup_info_always_show' => '0',
125
  'popup_info_full_width' => '0',
126
+ 'popup_enable_comment' => '1', // @ToDo API Changes 2020 (change to 0)
127
  'popup_enable_fullsize_image' => '1',
128
  'popup_enable_download' => '0',
129
+ 'popup_enable_share_buttons' => '1',
130
  'popup_enable_facebook' => '0',
131
  'popup_enable_twitter' => '0',
132
  'popup_enable_google' => '0',
145
  'feed_resolution' => 'optimal',
146
  'hashtag_top_recent' => '1',
147
  );
148
+ if(IS_FREE){
149
+ $settings["show_description"] = "0";
150
+ $settings["show_likes"] = "0";
151
+ $settings["show_comments"] = "0";
152
+ $settings["show_username_on_thumb"] = "0";
153
+ $settings['popup_enable_filmstrip'] = '0';
154
+ $settings['popup_info_always_show'] = '0';
155
+ $settings['popup_info_full_width'] = '0';
156
+ $settings['popup_enable_info'] = '0';
157
+ $settings['popup_enable_comment'] = '0';
158
+ $settings['popup_enable_share_buttons'] = '0';
159
+ }
160
  return $settings;
161
  }
162
 
194
  'feed_item_onclick' => 'string',
195
 
196
  //lightbox defaults
 
197
  'popup_fullscreen'=>'bool',
198
  'popup_width'=>'number',
199
  'popup_height'=>'number',
235
  }
236
 
237
  public function get_feed_row($current_id){
238
+ global $wpdb;
239
+ $feed_row = $wpdb->get_row($wpdb->prepare("SELECT * FROM ". $wpdb->prefix.WDI_FEED_TABLE. " WHERE id ='%d' ", $current_id));
240
+ return $feed_row;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
241
  }
242
+
243
  /**
244
  * Create Preview Instagram post.
245
  *
281
  }
282
  }
283
  }
284
+ }
admin/models/settings.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Settings_model_wdi {
4
+
5
+ public $active_tab = 'configure';
6
+
7
+ public function __construct() {
8
+ $form_action_get = WDILibrary::get('form_action', '', 'sanitize_text_field', 'GET');
9
+ $form_action_post = WDILibrary::get('form_action', 'configure', 'sanitize_text_field', 'POST');
10
+ $this->activeTab = $form_action_get != '' ? $form_action_get : $form_action_post;
11
+ }
12
+ }
admin/views/WDIViewFeeds_wdi.php DELETED
@@ -1,668 +0,0 @@
1
- <?php
2
-
3
- class WDIViewFeeds_wdi
4
- {
5
-
6
- private $model;
7
-
8
- public function __construct($model)
9
- {
10
- $this->model = $model;
11
- }
12
-
13
- public function display()
14
- {
15
- /*My Edit*/
16
- global $wdi_options;
17
- $rows_data = $this->model->get_rows_data();
18
- $page_nav = $this->model->page_nav();
19
- $search_value = WDILibrary::get('search_value', '');
20
- if( empty($search_value) ){
21
- $search_value = WDILibrary::get('search', '');
22
- }
23
-
24
- $asc_or_desc = WDILibrary::get('order', 'asc');
25
- $order_by = WDILibrary::get('order_by', 'id');
26
- if($order_by==="feed_name"){
27
- $wdi_sort = " sorted ";
28
- }else{
29
- $wdi_sort = " sortable ";
30
- }
31
- $order_class = 'manage-column column-title '.$wdi_sort . $asc_or_desc;
32
- $ids_string = '';
33
- $wdi_button_array = array(
34
- 'publish_all' => __('Publish', 'wdi'),
35
- 'unpublish_all' => __('Unpublish', 'wdi'),
36
- 'duplicate_all' => __('Duplicate', 'wdi'),
37
- 'delete_all' => __('Delete', 'wdi'),
38
- );
39
-
40
- WDILibrary::topbar();
41
- ?>
42
- <div class="wrap">
43
- <form class="" id="wdi_feed_form" method="post" action="admin.php?page=wdi_feeds" >
44
- <?php wp_nonce_field('nonce_wd', 'nonce_wd'); ?>
45
- <input type="hidden" id="wdi_access_token" name="access_token"
46
- value="<?php echo isset($wdi_options['wdi_access_token']) ? $wdi_options['wdi_access_token'] : ''; ?>">
47
- <div class="wd-page-title wd-header">
48
- <h1 class="wp-heading-inline"><?php _e('Feeds', "wd-instagram-feed"); ?></h1>
49
- <?php
50
- $add_page_data = array(
51
- 'task' => 'add'
52
- );
53
- ?>
54
- <a href="<?php echo WDILibrary::get_page_link($add_page_data);?>" class="add-new-h2"><?php _e('Add new', "wd-instagram-feed"); ?></a>
55
- </div>
56
- <?php
57
- WDILibrary::search(__('Name', "wd-instagram-feed"), $search_value, 'wdi_feed_form');
58
- ?>
59
-
60
- <div class="tablenav top">
61
- <div class="alignleft actions bulkactions">
62
- <select class="bulk_action">
63
- <option value=""><?php _e('Bulk Actions', 'wd-instagram-feed'); ?></option>
64
- <?php
65
- foreach ($wdi_button_array as $key => $value) {
66
- ?>
67
- <option value="<?php echo $key; ?>"><?php echo $value; ?></option>
68
- <?php
69
- }
70
- ?>
71
- </select>
72
- <input class="button action" type="button" title="<?php _e('Apply', 'wds'); ?>" onclick="if (!wdi_bulk_actions('.bulk_action')) {return false}" value="<?php _e('Apply', 'wds'); ?>" />
73
- </div>
74
- <?php
75
- WDILibrary::html_page_nav($page_nav['total'], $page_nav['limit'], 'wdi_feed_form');
76
- ?>
77
- </div>
78
-
79
- <table class="wp-list-table widefat fixed pages media">
80
- <thead>
81
- <td class="manage-column column-cb check-column"><input id="check_all" type="checkbox" onclick="wdi_spider_check_all(this)"/></td>
82
-
83
- <th class="column-primary table_large_col <?php
84
- echo $order_class;
85
- ?>">
86
- <?php
87
- if($asc_or_desc==="asc"){
88
- $wdi_order = 'desc';
89
- }else{
90
- $wdi_order = 'asc';
91
- }
92
- ?>
93
- <a href="<?php echo WDILibrary::get_page_link(array('order_by'=>'feed_name', 'order'=>$wdi_order));?>">
94
- <span><?php _e('Title', "wd-instagram-feed"); ?></span><span class="sorting-indicator"></span>
95
- </a>
96
- </th>
97
- <th class="table_big_col"><?php _e('Shortcode', "wd-instagram-feed"); ?></th>
98
- <th class="table_large_col"><?php _e('PHP function', "wd-instagram-feed"); ?></th>
99
- </thead>
100
- <tbody id="tbody_arr">
101
- <?php
102
- if ($rows_data) {
103
- $instagram_preview_post = $this->model->get_instagram_preview_post();
104
- foreach ($rows_data as $row_data) {
105
- $alternate = (!isset($alternate) || $alternate == 'class="alternate"') ? '' : 'class="alternate"';
106
- $published_image = (($row_data->published) ? 'publish' : 'unpublish');
107
- $published = (($row_data->published) ? 'unpublish' : 'publish');
108
- $prev_img_url = $this->model->get_slider_prev_img($row_data->id);
109
- $edit_page_data = array(
110
- 'task' => 'edit',
111
- 'current_id' => $row_data->id,
112
- );
113
- $wdi_nonce_wd = wp_create_nonce('nonce_wd');
114
- ?>
115
- <tr id="tr_<?php echo $row_data->id; ?>" <?php echo $alternate; ?>>
116
- <th class="table_small_col check-column"><input id="check_<?php echo $row_data->id; ?>"
117
- name="check_<?php echo $row_data->id; ?>"
118
- onclick="wdi_spider_check_all(this)" type="checkbox"/>
119
- </th>
120
- <td class="column-primary column-title" data-colname="Name">
121
- <strong>
122
- <a href="<?php echo WDILibrary::get_page_link($edit_page_data);?>"
123
- title="Edit">
124
- <span class="media-icon image-icon">
125
- <img title="<?php echo $row_data->feed_name; ?>"
126
- style="border: 1px solid #CCCCCC; max-width: 70px; max-height: 50px;"
127
- src="<?php echo $prev_img_url; ?>">
128
- </span>
129
- <?php echo $row_data->feed_name; ?>
130
- </a>
131
- <?php
132
- if ( !$row_data->published ) {
133
- ?>
134
-
135
- <span class="post-state"><?php _e('Unpublished', "wd-instagram-feed"); ?></span>
136
- <?php
137
- }
138
-
139
- ?>
140
- </strong>
141
- <div class="row-actions">
142
- <span>
143
- <a href="<?php echo WDILibrary::get_page_link($edit_page_data);?>"
144
- title="Edit"><?php _e('Edit', "wd-instagram-feed"); ?>
145
- </a>
146
- |
147
- </span>
148
- <span>
149
- <a href="<?php echo WDILibrary::get_page_link(array('task'=>'duplicate','current_id'=>$row_data->id, 'nonce_wd'=>$wdi_nonce_wd));?>"><?php _e('Duplicate', "wd-instagram-feed"); ?></a>
150
- |
151
- </span>
152
- <span>
153
- <a href="<?php echo WDILibrary::get_page_link(array('task'=>$published,'current_id'=>$row_data->id, 'nonce_wd'=>$wdi_nonce_wd));?>" ><?php echo ( $row_data->published ? __('Unpublish', "wd-instagram-feed") : __('Publish', "wd-instagram-feed")); ?></a>
154
- |
155
- </span>
156
- <span class="trash">
157
- <a onclick="if (!confirm('<?php esc_attr_e('Do you want to delete selected items?', "wd-instagram-feed"); ?>')){return false;}" href="<?php echo WDILibrary::get_page_link(array('task'=>"delete",'current_id'=>$row_data->id, 'nonce_wd'=>$wdi_nonce_wd));?>">Delete</a>
158
- |
159
- </span>
160
- <span>
161
- <a href="<?php echo add_query_arg( array('feed_id' => $row_data->id), $instagram_preview_post); ?>" target="_blank"><?php _e('Preview', "wd-instagram-feed"); ?></a>
162
- </span>
163
- </div>
164
- <button class="toggle-row" type="button">
165
- <span class="screen-reader-text"><?php _e('Show more details', "wd-instagram-feed"); ?></span>
166
- </button>
167
- </td>
168
- <td class="table_big_col" data-colname="Shortcode" >
169
- <input type="text" value='[wdi_feed id="<?php echo $row_data->id; ?>"]'
170
- onclick="wdi_spider_select_value(this)" size="12" readonly="readonly"
171
- style="padding-left: 1px; padding-right: 1px; text-align: center;"/>
172
- </td>
173
- <td class="table_large_col" data-colname="PHP function" >
174
- <input type="text" value="&#60;?php echo wdi_feed(array('id'=>'<?php echo $row_data->id; ?>')); ?&#62;"
175
- onclick="wdi_spider_select_value(this)" size="30" readonly="readonly"
176
- style="padding-left: 1px; padding-right: 1px; text-align: center;"/>
177
- </td>
178
- </tr>
179
- <?php
180
- $ids_string .= $row_data->id . ',';
181
- }
182
- }
183
- ?>
184
- </tbody>
185
- </table>
186
- <input id="task" name="task" type="hidden" value=""/>
187
- <input id="current_id" name="current_id" type="hidden" value=""/>
188
- <input id="ids_string" name="ids_string" type="hidden" value="<?php echo $ids_string; ?>"/>
189
- <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="asc"/>
190
- <input id="order_by" name="order_by" type="hidden" value="<?php echo $order_by; ?>"/>
191
- </form>
192
- </div>
193
- <?php
194
- }
195
-
196
- public function edit($type)
197
- {
198
- if ($type === 0) {
199
- $this->generateForm();
200
- ?>
201
- <script>jQuery(document).ready(function ()
202
- {
203
- wdi_controller.switchFeedTabs('feed_settings');
204
- });</script>
205
- <?php
206
- }
207
- else {
208
- global $wdi_new_feed;
209
- $wdi_new_feed = true;
210
- $current_id = $type;
211
- $feed_row = $this->model->get_feed_row($current_id);
212
- $view_id = $feed_row->feed_type;
213
- $this->generateForm($current_id);
214
- $tab = WDILibrary::get('wdi_refresh_tab', 'feed_settings');
215
- ?>
216
- <script>jQuery(document).ready(function ()
217
- {
218
- wdi_controller.switchFeedTabs("<?php echo $tab;?>", "<?php echo $view_id;?>");
219
- });</script>
220
- <?php
221
-
222
- }
223
-
224
-
225
- }
226
-
227
-
228
- public function getFormElements($current_id = ''){
229
- require_once(WDI_DIR . '/admin/models/WDIModelThemes_wdi.php');
230
- $themes = WDIModelThemes_wdi::get_themes();
231
-
232
- $tabs = array(
233
- "feed_settings" => array(
234
- "media" => array(
235
- "title" => "Media",
236
- "type" => "full",
237
- "column" => "two",
238
- "visibility" =>"show",
239
- "section_name"=>"wdi_media",
240
- "elements" => array(
241
- array(
242
- //'feed_name' => array('name' => 'feed_name', 'title' => __('Feed Title', "wd-instagram-feed"), 'type' => 'input', 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
243
- 'liked_feed' => array('disabled_options' => array('liked'), 'disabled' => array('text' => __("Feed of liked media is available only in premium version", "wd-instagram-feed")), 'name' => 'liked_feed', 'title' => __('Feed Media', "wd-instagram-feed"), 'type' => 'select', 'valid_options' => array('userhash' => __('Username/Hashtag', "wd-instagram-feed"), 'liked' => __('Media I liked', "wd-instagram-feed")), 'break' => 'false', 'hide_ids' => array(), 'tooltip' => __('Display media of User/Hashtag or the media I liked', "wd-instagram-feed"), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
244
- 'feed_users' => array('name' => 'feed_users', 'title' => __('Feed Username and Hashtags', "wd-instagram-feed"), 'type' => 'input', 'input_type' => 'hidden', 'tooltip' => sprintf('%s <span class="wdi_settings_notification">%s</span>', __('Add username or hashtags to your feed. Hashtags must start with #, username shouldn\'t start with @.', "wd-instagram-feed"), __('Note, that the more hashtags you add, the slower feed loading will be on front-end.', "wd-instagram-feed")), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
245
- 'hashtag_top_recent' => array('name' => 'hashtag_top_recent', 'title' => __('Hashtag Top/Recent', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Recent', "wd-instagram-feed"), '0' => __('Top', "wd-instagram-feed")), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings')), 'hide_ids' => array('1' => 'popup_width,popup_height')),
246
- ),
247
- array(
248
- 'sort_images_by' => array('name' => 'sort_images_by', 'title' => __('Sort Media By', "wd-instagram-feed"), 'valid_options' => array('date' => __('Date', "wd-instagram-feed"), 'likes' => __('Likes', "wd-instagram-feed"), 'comments' => __('Comments', "wd-instagram-feed"), 'random' => __('Random', "wd-instagram-feed")), 'type' => 'select', 'tooltip' => "", 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
249
- 'display_order' => array('name' => 'display_order', 'title' => __('Sorting Order', "wd-instagram-feed"), 'valid_options' => array('asc' => 'Ascending', 'desc' => 'Descending '), 'type' => 'select', 'tooltip' => "", 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
250
- 'feed_item_onclick' => array('name' => 'feed_item_onclick', 'title' => __('Action OnClick', "wd-instagram-feed"), 'type' => 'select', 'valid_options' => array('lightbox' => __('Open Lightbox', "wd-instagram-feed"), 'instagram' => __('Redirect To Instagram', "wd-instagram-feed"), 'custom_redirect' => __('Custom Redirect', "wd-instagram-feed"), 'none' => __('Do Nothing', "wd-instagram-feed")), 'break' => 'true', 'hide_ids' => array('lightbox' => 'redirect_url', 'instagram' => 'redirect_url', 'none' => 'redirect_url'), 'tooltip' => __('Do this action when user clicks on image/video in the feed', 'wd-instagram-feed'), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
251
- 'redirect_url' => array('name' => 'redirect_url', 'title' => __('Redirect URL', "wd-instagram-feed"), 'type' => 'input', 'tooltip' => __('Absolute Url to redirect to.', 'wd-instagram-feed'), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
252
- )
253
- )
254
- ),
255
- "layout" => array(
256
- "title" => "Layout and Pagination",
257
- "type" => "half",
258
- "column" => "one",
259
- "section_name"=>"wdi_layout",
260
- "elements" => array(
261
- array(
262
- 'feed_display_view' => array('name' => 'feed_display_view', 'title' => __('New Media Loading', "wd-instagram-feed"), 'type' => 'select', 'valid_options' => array('pagination' => __('Pagination', "wd-instagram-feed"), 'load_more_btn' => __('Load More Button', "wd-instagram-feed"), 'infinite_scroll' => __('Infinite Scroll', "wd-instagram-feed"), 'none' => __('None', "wd-instagram-feed")),'disabled_options' => array('infinite_scroll'),'disabled' => array('text' => __("Infinite Scroll option is available only in premium version", "wd-instagram-feed")), 'break' => 'true', 'hide_ids' => array('pagination' => 'number_of_photos,load_more_number,resort_after_load_more', 'load_more_btn' => 'pagination_per_page_number,pagination_preload_number', 'infinite_scroll' => 'pagination_per_page_number,pagination_preload_number', 'none' => 'pagination_preload_number,pagination_per_page_number,load_more_number,resort_after_load_more'), 'tooltip' => __('How to load and display new images/videos', "wd-instagram-feed"), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style'))),
263
- 'number_of_columns' => array('name' => 'number_of_columns', 'title' => __('Number of Columns', "wd-instagram-feed"), 'type' => 'select', 'valid_options' => array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8'), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry'))),
264
- 'number_of_photos' => array('name' => 'number_of_photos', 'title' => __('Number of Images/Videos', "wd-instagram-feed"), 'type' => 'input', 'input_type' => 'number', 'tooltip' => __('Number of images/videos to show when feed is loaded first time', "wd-instagram-feed"), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style'))),
265
- 'load_more_number' => array('name' => 'load_more_number', 'title' => __('Number of New Media', "wd-instagram-feed"), 'type' => 'input', 'input_type' => 'number', 'tooltip' => __('Number of new media added to the feed, when user clicks on load more button or triggers infinite scroll', "wd-instagram-feed"), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style'))),
266
- 'pagination_per_page_number' => array('name' => 'pagination_per_page_number', 'title' => __('Number of Media Per Page', "wd-instagram-feed"), 'type' => 'input', 'input_type' => 'number', 'tooltip' => __('Number of images to show on each pagination page', "wd-instagram-feed"), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style'))),
267
- 'pagination_preload_number' => array('name' => 'pagination_preload_number', 'title' => __('Pages To Preload', "wd-instagram-feed"), 'type' => 'input', 'input_type' => 'number', 'tooltip' => __('Preload all the media of several first pages', "wd-instagram-feed"), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style'))),
268
- 'image_browser_preload_number' => array('name' => 'image_browser_preload_number', 'title' => __('Number of Media for Initial Preload', "wd-instagram-feed"), 'type' => 'input', 'input_type' => 'number', 'tooltip' => __('A number of first images/videos are preloaded', "wd-instagram-feed"), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'image_browser'))),
269
- 'image_browser_load_number' => array('name' => 'image_browser_load_number', 'title' => __('Number of Media for Pagination Preload', "wd-instagram-feed"), 'type' => 'input', 'input_type' => 'number', 'tooltip' => "", 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'image_browser'))),
270
- 'resort_after_load_more' => array('name' => 'resort_after_load_more', 'title' => __('Combine and Sort Again After Loading More', "wd-instagram-feed"), 'type' => 'checkbox', 'tooltip' => __('If this option is enabled, both newly loaded and existing media are mixed then resorted together', "wd-instagram-feed"), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style'))),
271
- 'disable_mobile_layout' => array('name' => 'disable_mobile_layout', 'title' => __('Make Layout Not Responsive', "wd-instagram-feed"), 'type' => 'checkbox', 'tooltip' => __('When checked, layout does not become single-column on mobile. Columns number stays the same', "wd-instagram-feed"), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry'))),
272
- )
273
- )
274
- ),
275
- "advanced" => array(
276
- "title" => "Advanced",
277
- "type" => "half",
278
- "column" => "one",
279
- "section_name"=>"wdi_advanced",
280
- "elements" => array(
281
- array(
282
- 'theme_id' => array('switched' => 'off', 'label' => array('place' => 'after', 'class' => 'wdi_pro_only', 'text' => __("Changing Theme is available only in premium version", "wd-instagram-feed"), 'br' => 'true'), 'name' => 'theme_id', 'title' => __('Theme', "wd-instagram-feed"), 'valid_options' => $themes, 'type' => 'select', 'tooltip' => __('Styling theme of the feed. You can create themes in themes menu', "wd-instagram-feed"), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
283
- 'feed_resolution' => array('name' => 'feed_resolution', 'title' => __('Feed Media Resolution', "wd-instagram-feed"), 'type' => 'select', 'label' => array('text' => '', 'place' => 'after'), 'valid_options' => array('optimal' => 'Optimal', 'standard' => 'Large (1080 pixels)', 'low' => 'Low (320 pixels)', 'thumbnail' => 'Thumbnail (150 pixels)'), 'tooltip' => 'If set optimal, loaded media size is calculated according to container size. Fast loading and no stretched images.', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
284
- 'thumb_user' => array('switched' => 'off','name' => 'thumb_user', 'label' => array('place' => 'after', 'class' => 'wdi_pro_only', 'text' => __("Featured Image is available only in premium version", "wd-instagram-feed"), 'br' => 'true'), 'title' => __('Featured Image', "wd-instagram-feed"), 'valid_options' => array(), 'type' => 'select', 'tooltip' => __('Select featured image for header section', "wd-instagram-feed"), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
285
- 'display_header' => array('name' => 'display_header', 'title' => __('Show Feed Header', "wd-instagram-feed"), 'type' => 'checkbox', 'tooltip' => __('Header includes feed title', "wd-instagram-feed"), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
286
- 'show_usernames' => array('name' => 'show_usernames', 'title' => __('Show User Data', "wd-instagram-feed"), 'type' => 'checkbox', 'tooltip' => '','hide_ids' => array('display_user_info','display_user_post_follow_number','follow_on_instagram_btn'), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
287
- 'follow_on_instagram_btn' => array('name' => 'follow_on_instagram_btn', 'title' => __('Show "Follow On Instagram" button', "wd-instagram-feed"), 'type' => 'checkbox', 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
288
- /* @TODO API Changes 2020. */
289
- 'display_user_post_follow_number' => array('switched' => 'off', 'name' => 'display_user_post_follow_number', 'title' => __('Show User Posts and Followers count', "wd-instagram-feed"), 'type' => 'checkbox', 'label' => array('place' => 'after', 'class' => 'wdi_pro_only', 'text' => __("This feature is available only in premium version", "wd-instagram-feed"), 'br' => 'true'), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
290
- 'display_user_info' => array('switched' => 'off','name' => 'display_user_info', 'title' => __('Show User Bio and Website', "wd-instagram-feed"), 'type' => 'checkbox', 'label' => array('place' => 'after', 'class' => 'wdi_pro_only', 'text' => __("This feature is available only in premium version", "wd-instagram-feed"), 'br' => 'true'), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
291
- 'show_description' => array('switched' => 'off', 'name' => 'show_description', 'title' => __('Show Media Caption', "wd-instagram-feed"), 'type' => 'checkbox', 'label' => array('place' => 'after', 'class' => 'wdi_pro_only', 'text' => __("This feature is available only in premium version", "wd-instagram-feed"), 'br' => 'true'), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
292
- 'show_full_description' => array('name' => 'show_full_description', 'title' => __('Show Full Description', "wd-instagram-feed"), 'type' => 'checkbox', 'tooltip' => __('Discription will be shown no matter how long it is', "wd-instagram-feed"), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'masonry'))),
293
- 'show_likes' => array('switched' => 'off', 'name' => 'show_likes', 'title' => __('Show Number of Likes', "wd-instagram-feed"), 'type' => 'checkbox', 'label' => array('place' => 'after', 'class' => 'wdi_pro_only', 'text' => __("This feature is available only in premium version", "wd-instagram-feed"), 'br' => 'true'), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
294
- 'show_comments' => array('switched' => 'off', 'name' => 'show_comments', 'title' => __('Show Number of Comments', "wd-instagram-feed"), 'type' => 'checkbox', 'label' => array('place' => 'after', 'class' => 'wdi_pro_only', 'text' => __("This feature is available only in premium version", "wd-instagram-feed"), 'br' => 'true'), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
295
- 'show_username_on_thumb' => array('switched' => 'off', 'name' => 'show_username_on_thumb', 'title' => __('Show Username On Image Thumb', "wd-instagram-feed"), 'type' => 'checkbox', 'label' => array('place' => 'after', 'class' => 'wdi_pro_only', 'text' => __("This feature is available only in premium version", "wd-instagram-feed"), 'br' => 'true'), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry'))),
296
- ),
297
- ),
298
- ),
299
- ),
300
- "lightbox_settings" => array(
301
- "general" => array(
302
- "title" => "General",
303
- "type" => "full",
304
- "column" => "two",
305
- "visibility" =>"show",
306
- "section_name"=>"wdi_lightbox_general",
307
- "elements" => array(
308
- array(
309
- 'popup_fullscreen' => array('name' => 'popup_fullscreen', 'title' => __('Full width lightbox', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings')), 'hide_ids' => array('1' => 'popup_width,popup_height')),
310
- 'popup_width' => array('name' => 'popup_width', 'title' => __('Lightbox Width', "wd-instagram-feed"), 'type' => 'input', 'input_type' => 'number', 'label' => array('text' => 'px', 'place' => 'after'), 'tooltip' => '', 'attr' => array(array('name' => 'class', 'value' => 'small_input'), array('name' => 'tab', 'value' => 'lightbox_settings'))),
311
- 'popup_height' => array('name' => 'popup_height', 'title' => __('Lightbox Height', "wd-instagram-feed"), 'type' => 'input', 'input_type' => 'number', 'label' => array('text' => 'px', 'place' => 'after'), 'tooltip' => '', 'attr' => array(array('name' => 'class', 'value' => 'small_input'), array('name' => 'tab', 'value' => 'lightbox_settings'))),
312
- 'popup_type' => array('name' => 'popup_type', 'title' => __('Lightbox Effect', "wd-instagram-feed"), 'valid_options' => array('none' => 'None', 'cubeH' => 'Cube Horizontal', 'cubeV' => 'Cube Vertical', 'fade' => 'Fade', 'sliceH' => 'Slice Horizontal', 'sliceV' => 'Slice Vertical', 'slideH' => 'Slide Horizontal', 'slideV' => 'Slide Vertical', 'scaleOut' => 'Scale Out', 'scaleIn' => 'Scale In', 'blockScale' => 'Block Scale', 'kaleidoscope' => 'Kaleidoscope', 'fan' => 'Fan', 'blindH' => 'Blind Horizontal', 'blindV' => 'Blinde Vertical', 'random' => 'Random'), 'disabled_options' => array('cubeH', 'cubeV', 'sliceH', 'sliceV', 'slideH', 'slideV', 'scaleOut', 'scaleIn', 'blockScale', 'kaleidoscope', 'fan', 'blindH', 'blindV', 'random'), 'disabled' => array('text' => __("Effects are available only in premium version", "wd-instagram-feed")), 'type' => 'select', 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
313
- ),
314
- array(
315
- 'popup_autoplay' => array('name' => 'popup_autoplay', 'title' => __('Lightbox autoplay', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'hide_ids' => array('0' => 'popup_interval'), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
316
- 'popup_interval' => array('name' => 'popup_interval', 'title' => __('Autoplay Interval', "wd-instagram-feed"), 'type' => 'input', 'input_type' => 'number', 'label' => array('text' => 'sec', 'place' => 'after'), 'tooltip' => '', 'attr' => array(array('name' => 'class', 'value' => 'small_input'), array('name' => 'tab', 'value' => 'lightbox_settings'))),
317
- )
318
- )
319
- ),
320
- "advanced" => array(
321
- "title" => "Advanced",
322
- "type" => "full",
323
- "column" => "two",
324
- "section_name"=>"wdi_lightbox_advanced",
325
- "elements" => array(
326
- array(
327
- 'popup_enable_filmstrip' => array('disabled_options' => array('1' => '', '0' => ''), 'label' => array('place' => 'after', 'class' => 'wdi_pro_only', 'text' => __("This feature is available only in premium version", "wd-instagram-feed"), 'br' => 'true'), 'name' => 'popup_enable_filmstrip', 'title' => __('Enable Filmstrip', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'hide_ids' => array('0' => 'popup_filmstrip_height'), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
328
- 'popup_filmstrip_height' => array('name' => 'popup_filmstrip_height', 'title' => __('Filmstrip Thumbnail Size', "wd-instagram-feed"), 'type' => 'input', 'input_type' => 'number', 'label' => array('text' => 'px', 'place' => 'after'), 'tooltip' => '', 'attr' => array(array('name' => 'class', 'value' => 'small_input'), array('name' => 'tab', 'value' => 'lightbox_settings'))),
329
- 'autohide_lightbox_navigation' => array('name' => 'autohide_lightbox_navigation', 'title' => __('Show Next / Previous Buttons', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('On Hover', "wd-instagram-feed"), '0' => __('Always', "wd-instagram-feed")), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
330
- 'popup_info_always_show' => array('disabled_options' => array('1' => '', '0' => ''), 'name' => 'popup_info_always_show', 'title' => __('Caption Displayed by Default', "wd-instagram-feed"), 'type' => 'radio', 'label' => array('place' => 'after', 'class' => 'wdi_pro_only', 'text' => __("This feature is available only in premium version", "wd-instagram-feed"), 'br' => 'true'), 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
331
- 'popup_info_full_width' => array('disabled_options' => array('1' => '', '0' => ''), 'name' => 'popup_info_full_width', 'title' => __('Full Width Caption', "wd-instagram-feed"), 'type' => 'radio', 'label' => array('place' => 'after', 'class' => 'wdi_pro_only', 'text' => __("This feature is available only in premium version", "wd-instagram-feed"), 'br' => 'true'), 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
332
- 'enable_loop' => array('name' => 'enable_loop', 'title' => __('Enable Loop', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
333
- 'popup_image_right_click' => array('name' => 'popup_image_right_click', 'title' => __('Right Click Protection', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'tooltip' => __('Protect lightbox images from downloading', "wd-instagram-feed"), 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
334
- ),
335
- array(
336
- 'popup_enable_ctrl_btn' => array('name' => 'popup_enable_ctrl_btn', 'title' => __('Enable Control Buttons', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'hide_ids' => array('0' => 'popup_enable_info,popup_enable_fullscreen,popup_enable_info,popup_enable_comment,popup_enable_download,popup_enable_share_buttons,popup_enable_fullsize_image'), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
337
- 'popup_enable_info' => array('disabled_options' => array('1' => '', '0' => ''), 'name' => 'popup_enable_info', 'title' => __('Enable Caption Control', "wd-instagram-feed"), 'type' => 'radio', 'label' => array('place' => 'after', 'class' => 'wdi_pro_only', 'text' => __("This feature is available only in premium version", "wd-instagram-feed"), 'br' => 'true'), 'valid_options' => array('1' => 'Yes', '0' => 'No'), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
338
- 'popup_enable_fullscreen' => array('name' => 'popup_enable_fullscreen', 'title' => __('Show Fullscreen Control Button', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
339
- /* @TODO API Changes 2020. */
340
- 'popup_enable_comment' => array('switched' => 'off', 'disabled_options' => array('1' => '', '0' => ''), 'label' => array('place' => 'after', 'class' => 'wdi_pro_only', 'text' => __("This feature is available only in premium version", "wd-instagram-feed"), 'br' => 'true'), 'name' => 'popup_enable_comment', 'title' => __('Enable Comments Control', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
341
- 'popup_enable_fullsize_image' => array('name' => 'popup_enable_fullsize_image', 'title' => __('Add Link to Instagram Post', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
342
- 'popup_enable_download' => array('name' => 'popup_enable_download', 'title' => __('Enable Download Button', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
343
- 'popup_enable_share_buttons' => array('disabled_options' => array('1' => '', '0' => ''), 'label' => array('place' => 'after', 'class' => 'wdi_pro_only', 'text' => __("This feature is available only in premium version", "wd-instagram-feed"), 'br' => 'true'), 'name' => 'popup_enable_share_buttons', 'title' => __('Show Share Buttons', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
344
- 'popup_enable_facebook' => array('status' => 'disabled', 'name' => 'popup_enable_facebook', 'title' => __('Enable Facebook button', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
345
- 'popup_enable_twitter' => array('status' => 'disabled', 'name' => 'popup_enable_twitter', 'title' => __('Enable Twitter button', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
346
- 'popup_enable_google' => array('status' => 'disabled', 'name' => 'popup_enable_google', 'title' => __('Enable Google+ button', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
347
- 'popup_enable_pinterest' => array('status' => 'disabled', 'name' => 'popup_enable_pinterest', 'title' => __('Enable Pinterest button', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
348
- 'popup_enable_tumblr' => array('status' => 'disabled', 'name' => 'popup_enable_tumblr', 'title' => __('Enable Tumblr button', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
349
- 'show_image_counts' => array('status' => 'disabled', 'name' => 'show_image_counts', 'title' => __('Show Images Count', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
350
- )
351
- )
352
- ),
353
- ),
354
- "conditional_filters" => array(
355
- "" => array(
356
- "title" => __("This is free version, Conditional filters are available only in premium version", "wd-instagram-feed"),
357
- "type" => "full",
358
- "column" => "one",
359
- "visibility" =>"show",
360
- "section_name"=>"wdi_conditional_filters",
361
- "elements" => array(
362
- array(
363
- 'conditional_filter_enable' => array('name' => 'conditional_filter_enable', 'title' => __('Enable Conditional Filters', "wd-instagram-feed"), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', "wd-instagram-feed"), '0' => __('No', "wd-instagram-feed")), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'conditional_filters'))),
364
- 'conditional_filter_type' => array('name' => 'conditional_filter_type', 'title' => __('Filter Logic', "wd-instagram-feed"), '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'))),
365
- )
366
- )
367
- )
368
- ),
369
- "how_to_publish" => array(
370
- "" => array(
371
- "title" => __("How to Publish Feed", "wd-instagram-feed"),
372
- "type" => "full",
373
- "column" => "one",
374
- "visibility" =>"show",
375
- "section_name"=>"wdi_how_to_publish",
376
- "elements" => array(
377
- array(
378
- 'how_to_publish' => array(
379
- 'name' => 'how_to_publish',
380
- 'type' => 'how_to_publish',
381
- 'title' => "",
382
- 'tooltip' => ''
383
- )
384
- )
385
- )
386
- )
387
- )
388
- );
389
- $return = array('tabs' => $tabs, 'current_id' => $current_id);
390
- return $return;
391
- }
392
-
393
-
394
- public function genarateFeedViews()
395
- {
396
- ?>
397
- <div class="wdi_border_wrapper">
398
- <div id="wdi_layout_section" class="wdi_layout_section display_type_content wdi_section">
399
- <h3 data-section_name="wdi_layout_section" class="wdi_display_content wdi_section_name wdi_section_close">Select layout</h3>
400
- <div data-display="table" class="display_type_container wdi_clear_tag wdi_elements">
401
- <div class="display_type" tab="feed_settings">
402
- <div style="text-align:center;padding:2px;"><input type="radio" id="thumbnails" name="feed_type"
403
- value="thumbnails"><label for="thumbnails">Thumbnails</label>
404
- </div>
405
- <label for="thumbnails"><img src="<?php echo plugins_url('../../images/feed_views/thumbnails.png', __FILE__); ?>"></label>
406
- </div>
407
-
408
- <div class="display_type wdi_tooltip" wdi-tooltip="<?php _e('Available In Premium Version') ?>" tab="feed_settings">
409
- <div style="text-align:center;padding:2px;"><input type="radio" disabled id="masonry" name="feed_type"
410
- value="masonry"><label for="masonry" class="wdi_pro_only">Masonry</label>
411
- </div>
412
- <label for="masonry" class="wdi_pro_only_op"><img
413
- src="<?php echo plugins_url('../../images/feed_views/masonry.png', __FILE__); ?>"></label>
414
- </div>
415
-
416
- <div class="display_type wdi_tooltip" wdi-tooltip="<?php _e('Available In Premium Version') ?>" tab="feed_settings">
417
- <div style="text-align:center;padding:2px;"><input disabled type="radio" id="blog_style" name="feed_type"
418
- value="blog_style"><label for="blog_style"
419
- class="wdi_pro_only">Blog
420
- Style</label></div>
421
- <label for="blog_style" class="wdi_pro_only_op"><img
422
- src="<?php echo plugins_url('../../images/feed_views/blog_style.png', __FILE__); ?>"></label>
423
- </div>
424
-
425
- <div class="display_type" tab="feed_settings">
426
- <div style="text-align:center;padding:2px;"><input type="radio" id="image_browser" name="feed_type"
427
- value="image_browser"><label for="image_browser">Image
428
- Browser</label></div>
429
- <label for="image_browser"><img
430
- src="<?php echo plugins_url('../../images/feed_views/image_browser.png', __FILE__); ?>"></label>
431
- </div>
432
- </div>
433
- </div>
434
-
435
- <?php
436
- }
437
-
438
- public function generateTabs()
439
- {
440
- ?>
441
- <div id="wdi_feed_tabs">
442
- <div class="wdi_feed_tabs" id="wdi_feed_settings" onclick="wdi_controller.switchFeedTabs('feed_settings');">
443
- <span class="dashicons dashicons-before dashicons-admin-generic"></span>
444
- <span class="wdi_feed_tab_title"><?php _e('Feed Settings', "wd-instagram-feed") ?></span>
445
- </div>
446
- <div class="wdi_feed_tabs" id="wdi_lightbox_settings" onclick="wdi_controller.switchFeedTabs('lightbox_settings');">
447
- <span class="dashicons dashicons-before dashicons-admin-page"></span>
448
- <span class="wdi_feed_tab_title"><?php _e('Lightbox Settings', "wd-instagram-feed") ?></span>
449
- </div>
450
- <div class="wdi_feed_tabs" id="wdi_conditional_filters" onclick="wdi_controller.switchFeedTabs('conditional_filters');">
451
- <span class="dashicons dashicons-before dashicons-filter"></span>
452
- <span class="wdi_feed_tab_title"><?php _e('Conditional Filters', "wd-instagram-feed") ?></span>
453
- </div>
454
- <div class="wdi_feed_tabs" id="wdi_how_to_publish" onclick="wdi_controller.switchFeedTabs('how_to_publish');">
455
- <span class="dashicons dashicons-before dashicons-editor-help"></span>
456
- <span class="wdi_feed_tab_title"><?php _e('How To Publish Feed', "wd-instagram-feed") ?></span>
457
- </div>
458
- </div>
459
- <?php
460
- }
461
-
462
- public function generateForm($current_id = ''){
463
- if ( $current_id === "" ) {
464
- $wdi_preview_btn = false;
465
- $save_btn_name = __('Publish', "wd-instagram-feed");
466
- }
467
- else {
468
- $wdi_preview_btn = true;
469
- $save_btn_name = __('Update', "wd-instagram-feed");
470
- }
471
-
472
- $formInfo = $this->getFormElements($current_id);
473
- $tabs = $formInfo['tabs'];
474
- $wdi_preview_link = $this->model->get_instagram_preview_post();
475
-
476
- global $wdi_options;
477
- //for edit
478
- $edit = false;
479
- if ($current_id != '') {
480
- $feed_row = WDILibrary::objectToarray($this->model->get_feed_row($current_id));
481
- $edit = true;
482
- }
483
- else {
484
- $feed_row = '';
485
- }
486
- $feed_row_id = "";
487
- if(isset($feed_row["id"])){
488
- $feed_row_id = $feed_row["id"];
489
- }
490
-
491
- if(isset($feed_row['liked_feed'])) {
492
- $feed_row['liked_feed'] = 'userhash';
493
- }
494
-
495
- WDILibrary::topbar();
496
- ?>
497
- <div class="wrap">
498
- <h2 class="wdi-h2-message"></h2>
499
- <form method="post" action="admin.php?page=wdi_feeds" id='wdi_save_feed'>
500
- <div class="wdi-page-header">
501
- <h1 class="wp-heading-inline"><?php echo __('Feed Title', "wd-instagram-feed")?></h1>
502
- <input id="WDI_feed_name" class="WDI_title_input" name="wdi_feed_settings[feed_name]" type="text" value="<?php echo ($edit == true && isset($feed_row['feed_name'])) ? $feed_row['feed_name'] : "Sample Feed";?>">
503
- <div class="wdi_buttons">
504
- <div id="wdi_save_feed_apply" class="button button-primary"><?php echo $save_btn_name;?></div>
505
- <button class="button preview-button button-large"<?php if (!$wdi_preview_btn) echo ' disabled="disabled"' ?> <?php echo ($wdi_preview_btn) ? 'onclick="window.open(\''. add_query_arg( array('feed_id' => $feed_row_id), $wdi_preview_link ) .'\', \'_blank\'); return false;"' : ''; ?>><?php echo __('Preview', "wd-instagram-feed");?></button>
506
- </div>
507
- </div>
508
- <?php $this->generateTabs(); ?>
509
- <?php $this->genarateFeedViews(); ?>
510
- <?php wp_nonce_field('nonce_wd', 'nonce_wd'); ?>
511
- <input type="hidden" id="wdi_feed_type" name='<?php echo WDI_FSN . '[feed_type]' ?>'>
512
- <input type="hidden" id="task" name='task'>
513
- <input type="hidden" id="wdi_feed_thumb" name="<?php echo WDI_FSN . '[feed_thumb]' ?>">
514
- <input type="hidden" id="wdi_access_token" name="access_token"
515
- value="<?php echo $wdi_options['wdi_access_token']; ?>">
516
- <input type="hidden" id="wdi_add_or_edit" name="add_or_edit" value="<?php echo $current_id; ?>">
517
- <input type="hidden" id="wdi_thumb_user"
518
- value="<?php echo isset($feed_row['thumb_user']) ? $feed_row['thumb_user'] : $wdi_options['wdi_user_name']; ?>">
519
- <input type="hidden" id="wdi_default_user" value="<?php echo $wdi_options['wdi_user_name']; ?>">
520
- <input type="hidden" id="wdi_default_user_id" value="<?php echo $wdi_options['wdi_user_id']; ?>">
521
- <input type="hidden" name="<?php echo WDI_FSN . '[published]' ?>"
522
- value="<?php echo isset($feed_row['published']) ? $feed_row['published'] : '1'; ?>">
523
- <input type="hidden" id="wdi_current_id" name="current_id" value=''>
524
- <input type="hidden" id="wdi_refresh_tab" name="wdi_refresh_tab">
525
- <div class="form-table">
526
- <?php foreach ($tabs as $key => $tab) { ?>
527
- <div id="<?php echo $key; ?>_tab" class="wdi_tab" style="<?php echo $key == "feed_settings" ? "display:block;" : ""; ?>">
528
- <?php foreach ($tab as $key => $section) {
529
- $section_class = "wdi_section_open";
530
- if(isset($section["visibility"]) && $section["visibility"]==="show"){
531
- $section_class = "wdi_section_close";
532
- }
533
- ?>
534
- <div id="<?php echo $key; ?>_section" class="wdi_section <?php echo $section["type"]; ?> <?php echo $section["column"]; ?>">
535
- <h3 data-section_name="<?php echo $section['section_name']?>" class="wdi_section_name <?php echo $section_class;?>"><?php echo $section["title"]; ?></h3>
536
- <div class="wdi_elements wdi_clear_tag">
537
- <?php foreach ($section["elements"] as $elements) { ?>
538
- <div class="section_col">
539
- <?php
540
-
541
- foreach ($elements as $key => $element) {
542
- if ($element['name'] == 'conditional_filter_enable') { ?>
543
- <div id="wdi-conditional-filters-ui" class="wdi_demo_img">
544
- <div class="wdi-pro-overlay"><img src="<?php echo WDI_URL . '/demo_images/filters.png'; ?>" alt=""></div>
545
- </div><?php
546
- continue;
547
- }
548
-
549
- if ($element['name'] == 'conditional_filter_type') {
550
- continue;
551
- }
552
-
553
- if (isset($element['status'])) {
554
- if ($element['status'] == 'disabled') {
555
- continue;
556
- }
557
- } ?>
558
-
559
- <div class="wdi_element wdi_element_name_<?php echo $element['name'] ; ?>">
560
- <div class="wdi_element_title">
561
- <span class="wdi_settings_link" ><?php echo $element['title']; ?></span>
562
- </div>
563
- <div class="wdi_element_content">
564
- <?php $this->buildField($element, $feed_row); ?>
565
- <!-- FEED USERS -->
566
- <?php if ($element['name'] == 'feed_users'): ?>
567
- <input type="text" id="wdi_add_user_ajax_input">
568
- <div id="wdi_add_user_ajax" class="button"><?php _e('Add', "wd-instagram-feed"); ?></div>
569
- <div id="wdi_feed_users">
570
- <?php $this->display_feed_users($feed_row); ?>
571
- </div>
572
- <?php endif; ?>
573
- <!-- END FEED USERS -->
574
- <?php
575
- if($element['tooltip'] && $element['tooltip']!=""){
576
- echo "<p class='wdi_about_filed'>".$element['tooltip']."</p>";
577
- }
578
- ?>
579
- </div>
580
- </div>
581
- <?php } ?>
582
- </div>
583
- <?php } ?>
584
- </div>
585
- </div>
586
- <?php } ?>
587
- </div><?php
588
- }
589
- ?>
590
- </div>
591
- </form>
592
- </div>
593
- </div>
594
- <?php
595
- }
596
-
597
- private function buildField($element, $feed_row = '')
598
- {
599
- require_once(WDI_DIR . '/framework/WDI_form_builder.php');
600
- $element['defaults'] = $this->model->wdi_get_feed_defaults();
601
- $element['CONST'] = WDI_FSN;
602
- $builder = new WDI_form_builder();
603
- switch ($element['type']) {
604
- case 'input': {
605
- $builder->input($element, $feed_row);
606
- break;
607
- }
608
- case 'select': {
609
- $builder->select($element, $feed_row);
610
- break;
611
- }
612
- case 'radio': {
613
- $builder->radio($element, $feed_row);
614
- break;
615
- }
616
- case 'checkbox': {
617
- $builder->checkbox($element, $feed_row);
618
- break;
619
- }
620
- case 'how_to_publish': {
621
- $builder->how_to_publish($element, $feed_row);
622
- break;
623
- }
624
- }
625
- }
626
-
627
-
628
- public function display_feed_users($feed_row){
629
- global $wdi_options;
630
-
631
- $users = isset($feed_row['feed_users']) ? $feed_row['feed_users'] : "";
632
- $users = json_decode($users);
633
-
634
- if ($users === null) {
635
- $users = array();
636
- }
637
-
638
- $token = WDILibrary::get_user_access_token($users);
639
- ?>
640
- <script>
641
- jQuery(document).ready(function ()
642
- {
643
- var users_list = JSON.parse(wdi_options.wdi_authenticated_users_list);
644
- if (typeof users_list !== 'object') {
645
- users_list = {};
646
- }
647
-
648
- var usersnames = [wdi_options.wdi_user_name];
649
- for(var i in users_list){
650
- usersnames.push(users_list[i].user_name);
651
- }
652
-
653
- wdi_controller.users_list = users_list;
654
- wdi_controller.usersnames = usersnames;
655
- wdi_controller.instagram = new WDIInstagram();
656
- wdi_controller.feed_users = [];
657
- wdi_controller.instagram.addToken(<?php echo '"' . $token . '"'; ?>);
658
-
659
- wdi_controller.updateFeaturedImageSelect(<?php echo '"' . $wdi_options['wdi_user_name'] . '"'; ?>, 'add', 'selected');
660
-
661
- <?php foreach ($users as $user) : ?>
662
- wdi_controller.makeInstagramUserRequest(<?php echo '"' . $user->username . '"'?>, true);
663
- <?php endforeach; ?>
664
- });
665
- </script>
666
- <?php
667
- }
668
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/views/WDIViewSettings_wdi.php DELETED
@@ -1,132 +0,0 @@
1
- <?php
2
- class WDIViewSettings_wdi {
3
-
4
- private $model;
5
-
6
- public function __construct($model) {
7
- $this->model = $model;
8
- }
9
-
10
- public function display(){
11
- global $wdi_options;
12
- require_once(WDI_DIR . '/framework/WDI_admin_view.php');
13
- $access_token = WDILibrary::get('wdi_access_token', '');
14
- if( !empty($access_token) ) {
15
- /*dismiss api update notice*/
16
- $admin_notices_option = get_option('wdi_admin_notice', array());
17
- $admin_notices_option['api_update_token_reset'] = array(
18
- 'start' => current_time("n/j/Y"),
19
- 'int' => 0,
20
- 'dismissed' => 1,
21
- );
22
- update_option('wdi_admin_notice', $admin_notices_option);
23
- ?>
24
- <script>
25
- wdi_controller.instagram = new WDIInstagram();
26
- if (wdi_controller.getCookie('wdi_autofill') != 'false') {
27
- wdi_controller.apiRedirected();
28
- document.cookie = "wdi_autofill=false";
29
- jQuery(document).ready(function ()
30
- {
31
- jQuery(document).on('wdi_settings_filled', function ()
32
- {
33
- jQuery('#submit').trigger('click');
34
- })
35
- });
36
- }
37
- </script>
38
- <?php
39
- }
40
- WDILibrary::topbar();
41
- ?>
42
-
43
-
44
- <h1 id="settings_wdi_title"><?php _e('Settings', "wd-instagram-feed"); ?></h1>
45
- <form method="post" action="<?php echo add_query_arg( array('page' => 'wdi_settings'), 'admin.php' ); ?>" class="wdi_settings_form">
46
- <input type="hidden" id="wdi_reset_access_token_input" name="wdi_reset_access_token_input" value="0">
47
- <input type="hidden" id="wdi_user_id" name="<?php echo WDI_OPT . '[wdi_user_id]' ?>" value="<?php echo !empty($wdi_options['wdi_user_id']) ? $wdi_options['wdi_user_id'] : ''; ?>">
48
- <?php settings_fields('wdi_all_settings'); ?>
49
- <?php do_settings_sections('settings_wdi'); ?>
50
- <div id="wdi_options_page_buttons_wrapper">
51
- <div id="wdi_reset_access_token_button" class="button button-secondary"><?php _e("Reset Primary Access Token", "wd-instagram-feed") ?></div>
52
- <?php submit_button(); ?>
53
- </div>
54
- </form>
55
- <style>
56
- <?php if((!isset($wdi_options['wdi_access_token']) || empty($wdi_options['wdi_access_token'])) && empty($wdi_options['fb_token'])){ ?>
57
- body.instagram-feed_page_wdi_settings table:nth-of-type(2){
58
- display:none;
59
- }
60
- body.toplevel_page_wdi_settings table:nth-of-type(2){
61
- display:none;
62
- }
63
-
64
- body.instagram-feed_page_wdi_settings table:nth-of-type(3){
65
- display:none;
66
- }
67
- body.toplevel_page_wdi_settings table:nth-of-type(3){
68
- display:none;
69
- }
70
- <?php } ?>
71
- </style>
72
- <script>
73
- jQuery(document).ready(function () {
74
- jQuery(".wdi_settings_form").submit(function () {
75
- jQuery.ajax({
76
- type: "POST",
77
- url: wdi_ajax.ajax_url,
78
- dataType:"json",
79
- data: {
80
- wdi_nonce:wdi_ajax.wdi_nonce,
81
- action:"wdi_set_reset_cache"
82
- },
83
- success: function(data){
84
-
85
- }
86
- });
87
- });
88
-
89
- jQuery('#wdi_reset_access_token_button').on('click', function () {
90
- if (confirm("<?php _e('Are you sure that you want to reset access token and username, after resetting it you will need to log in with Instagram again for using plugin', 'wd-instagram-feed')?>")) {
91
- jQuery.ajax({
92
- type: "POST",
93
- url: wdi_ajax.ajax_url,
94
- dataType:"json",
95
- data: {
96
- wdi_nonce:wdi_ajax.wdi_nonce,
97
- action:"wdi_set_reset_cache"
98
- },
99
- success: function(data){
100
-
101
- }
102
- });
103
-
104
- jQuery('#wdi_reset_access_token_input').attr('value', '1');
105
- jQuery('#wdi_user_id').attr('value', '');
106
- jQuery('#wdi_user_name').attr('value', '');
107
- jQuery('#wdi_access_token').attr('value', '');
108
- jQuery('#business_account_id').attr('value', '');
109
- jQuery('#fb_token').attr('value', '');
110
- document.cookie = "wdi_autofill=false";
111
- <?php if(get_option("wdi_token_error_flag") === "1") { ?>
112
- jQuery.ajax({
113
- type: "POST",
114
- url: "<?php echo admin_url('admin-ajax.php');?>",
115
- dataType: 'json',
116
- data: {
117
- action: "wdi_delete_token_flag",
118
- wdi_token_flag_nonce: "<?php echo wp_create_nonce('');?>",
119
- },
120
- success: function(data) {
121
-
122
- }
123
- });
124
- <?php } ?>
125
- jQuery(this).parent().parent().find('#submit').trigger('click');
126
- }
127
- });
128
- });
129
- </script>
130
- <?php
131
- }
132
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/views/WDIViewThemes_wdi.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  class WDIViewThemes_wdi {
4
-
5
  private $model;
6
 
7
  public function __construct($model) {
@@ -12,15 +12,15 @@ class WDIViewThemes_wdi {
12
  WDILibrary::topbar();
13
  ?>
14
  <div class="wrap">
15
- <div class="wdi_pro_notice"> <?php _e("This is free version, Customizing themes is available only in premium version","wd-instagram-feed"); ?> </div>
16
- <?php
17
- $this->buildFreeThemeDemo();
18
- ?>
19
  </div>
20
  <?php
21
- }
22
 
23
- public function buildFreeThemeDemo(){
24
  ?>
25
  <div class="wdi_demo_img" demo-tab="general"><img src="<?php echo WDI_URL . '/demo_images/1.png'; ?>" alt=""></div>
26
  <div class="wdi_demo_img" demo-tab="header"><img src="<?php echo WDI_URL . '/demo_images/2.png'; ?>" alt=""></div>
1
  <?php
2
 
3
  class WDIViewThemes_wdi {
4
+
5
  private $model;
6
 
7
  public function __construct($model) {
12
  WDILibrary::topbar();
13
  ?>
14
  <div class="wrap">
15
+ <div class="wdi_pro_notice"> <?php _e("This is free version, Customizing themes is available only in premium version","wd-instagram-feed"); ?> </div>
16
+ <?php
17
+ $this->buildFreeThemeDemo();
18
+ ?>
19
  </div>
20
  <?php
21
+ }
22
 
23
+ public function buildFreeThemeDemo(){
24
  ?>
25
  <div class="wdi_demo_img" demo-tab="general"><img src="<?php echo WDI_URL . '/demo_images/1.png'; ?>" alt=""></div>
26
  <div class="wdi_demo_img" demo-tab="header"><img src="<?php echo WDI_URL . '/demo_images/2.png'; ?>" alt=""></div>
admin/views/WDIViewWidget.php CHANGED
@@ -16,6 +16,7 @@ class WDIViewWidget {
16
  $title = (isset($instance['title']) ? $instance['title'] : "");
17
  $feed_id = (isset($instance['feed_id']) ? $instance['feed_id'] : 0);
18
  $img_number = (isset($instance['img_number']) ? $instance['img_number'] : 4);
 
19
  $show_likes_comments = (isset($instance['show_likes_comments']) ? $instance['show_likes_comments'] : 0);
20
  $number_of_columns = (isset($instance['number_of_columns']) ? $instance['number_of_columns'] : 1);
21
  $enable_loading_buttons = (isset($instance['enable_loading_buttons']) ? $instance['enable_loading_buttons'] : 0);
@@ -29,6 +30,7 @@ class WDIViewWidget {
29
  $widget_params = array(
30
  'widget' => true,
31
  'widget_image_num' => $img_number,
 
32
  'widget_show_likes_and_comments' => $show_likes_comments,
33
  'number_of_columns'=>$number_of_columns,
34
  'enable_loading_buttons' => $enable_loading_buttons,
@@ -44,13 +46,16 @@ class WDIViewWidget {
44
  $id_title, $name_title,
45
  $id_feed_id, $name_feed_id,
46
  $id_img_number, $name_img_number,
 
47
  $id_show_likes_comments, $name_show_likes_comments,
48
  $id_number_of_columns,$name_number_of_columns,
49
  $id_enable_loading_buttons, $name_enable_loading_buttons) {
 
50
  $defaults = array(
51
  'title' => 'Instagram Feed',
52
  'feed_id' => 1,
53
  'img_number' => 4,
 
54
  'show_likes_comments' => 0,
55
  'number_of_columns' => 1,
56
  'enable_loading_buttons' => 0
@@ -91,6 +96,10 @@ class WDIViewWidget {
91
  <label for="<?php echo $id_img_number; ?>"><?php _e("Number of images to show", 'wd-instagram-feed'); ?></label>
92
  <input class="widefat" id="<?php echo $id_img_number; ?>" name="<?php echo $name_img_number; ?>" type="text" value="<?php echo $instance['img_number']; ?>"/>
93
  </p>
 
 
 
 
94
  <p>
95
  <input <?php if($instance['show_likes_comments']=='1') echo "checked"?> class="widefat" id="<?php echo $id_show_likes_comments; ?>" name="<?php echo $name_show_likes_comments; ?>" type="checkbox" value="<?php echo $instance['show_likes_comments']; ?>"/>
96
  <label for="<?php echo $id_show_likes_comments; ?>"><?php _e("Show likes and comments", 'wd-instagram-feed'); ?></label>
16
  $title = (isset($instance['title']) ? $instance['title'] : "");
17
  $feed_id = (isset($instance['feed_id']) ? $instance['feed_id'] : 0);
18
  $img_number = (isset($instance['img_number']) ? $instance['img_number'] : 4);
19
+ $show_description = (isset($instance['show_description']) ? $instance['show_description'] : 0);
20
  $show_likes_comments = (isset($instance['show_likes_comments']) ? $instance['show_likes_comments'] : 0);
21
  $number_of_columns = (isset($instance['number_of_columns']) ? $instance['number_of_columns'] : 1);
22
  $enable_loading_buttons = (isset($instance['enable_loading_buttons']) ? $instance['enable_loading_buttons'] : 0);
30
  $widget_params = array(
31
  'widget' => true,
32
  'widget_image_num' => $img_number,
33
+ 'widget_show_description' => $show_description,
34
  'widget_show_likes_and_comments' => $show_likes_comments,
35
  'number_of_columns'=>$number_of_columns,
36
  'enable_loading_buttons' => $enable_loading_buttons,
46
  $id_title, $name_title,
47
  $id_feed_id, $name_feed_id,
48
  $id_img_number, $name_img_number,
49
+ $id_show_description, $name_show_description,
50
  $id_show_likes_comments, $name_show_likes_comments,
51
  $id_number_of_columns,$name_number_of_columns,
52
  $id_enable_loading_buttons, $name_enable_loading_buttons) {
53
+
54
  $defaults = array(
55
  'title' => 'Instagram Feed',
56
  'feed_id' => 1,
57
  'img_number' => 4,
58
+ 'show_description' => 0,
59
  'show_likes_comments' => 0,
60
  'number_of_columns' => 1,
61
  'enable_loading_buttons' => 0
96
  <label for="<?php echo $id_img_number; ?>"><?php _e("Number of images to show", 'wd-instagram-feed'); ?></label>
97
  <input class="widefat" id="<?php echo $id_img_number; ?>" name="<?php echo $name_img_number; ?>" type="text" value="<?php echo $instance['img_number']; ?>"/>
98
  </p>
99
+ <p>
100
+ <input <?php if($instance['show_description']=='1') echo "checked"?> class="widefat" id="<?php echo $id_show_description; ?>" name="<?php echo $name_show_description; ?>" type="checkbox" value="<?php echo $instance['show_description']; ?>"/>
101
+ <label for="<?php echo $id_show_description; ?>"><?php _e("Show Description", 'wd-instagram-feed'); ?></label>
102
+ </p>
103
  <p>
104
  <input <?php if($instance['show_likes_comments']=='1') echo "checked"?> class="widefat" id="<?php echo $id_show_likes_comments; ?>" name="<?php echo $name_show_likes_comments; ?>" type="checkbox" value="<?php echo $instance['show_likes_comments']; ?>"/>
105
  <label for="<?php echo $id_show_likes_comments; ?>"><?php _e("Show likes and comments", 'wd-instagram-feed'); ?></label>
admin/views/feeds.php ADDED
@@ -0,0 +1,1039 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Feeds_view_wdi {
4
+
5
+ private $model;
6
+
7
+ public function __construct($model) {
8
+ $this->model = $model;
9
+ }
10
+
11
+ public function display() {
12
+ /*My Edit*/
13
+ global $wdi_options;
14
+ $rows_data = $this->model->get_rows_data();
15
+ $page_nav = $this->model->page_nav();
16
+ $search_value = "";
17
+ if ( WDILibrary::get('search_value') != '' ) {
18
+ $this->search_text = WDILibrary::get('search_value');
19
+ } elseif ( WDILibrary::get('search', '', 'sanitize_text_field', 'GET') != '' ) {
20
+ $this->search_text = WDILibrary::get('search', '', 'sanitize_text_field', 'GET');
21
+ }
22
+
23
+ $asc_or_desc = stripslashes( WDILibrary::get('order', 'asc', 'sanitize_text_field', 'GET' ) );
24
+ $order_by = stripslashes( WDILibrary::get('order_by', 'id', 'sanitize_text_field', 'GET' ) );
25
+ if($order_by==="feed_name"){
26
+ $wdi_sort = " sorted ";
27
+ }else{
28
+ $wdi_sort = " sortable ";
29
+ }
30
+ $order_class = 'manage-column column-title '.$wdi_sort . $asc_or_desc;
31
+ $ids_string = '';
32
+ $wdi_button_array = array(
33
+ 'publish_all' => __('Publish', 'wdi'),
34
+ 'unpublish_all' => __('Unpublish', 'wdi'),
35
+ 'duplicate_all' => __('Duplicate', 'wdi'),
36
+ 'delete_all' => __('Delete', 'wdi'),
37
+ );
38
+ if(IS_FREE){
39
+ WDILibrary::topbar();
40
+ }
41
+ ?>
42
+ <div class="wrap">
43
+ <h2 class="wdi_page_title"></h2>
44
+ <?php if(!IS_FREE){?>
45
+ <div class="update-nag wdi_help_bar_wrap">
46
+ <span class="wdi_help_bar_text">
47
+ <?php _e('Here You Can Change Feed Parameters.', 'wd-instagram-feed'); ?>
48
+ <a class="wdi_hb_t_link" target="_blank"
49
+ href="https://help.10web.io/hc/en-us/articles/360016497251-Creating-Instagram-Feed?utm_source=instagram_feed&utm_medium=free_plugin"><?php _e('Read More in User Guide', 'wd-instagram-feed'); ?></a>
50
+ </span>
51
+ </div>
52
+ <?php }?>
53
+ <form class="" id="wdi_feed_form" method="post" action="admin.php?page=wdi_feeds" >
54
+ <div class="wd-page-title wd-header">
55
+ <h1 class="wp-heading-inline"><?php _e('Feeds', 'wd-instagram-feed'); ?></h1>
56
+ <?php
57
+ $add_page_data = array(
58
+ 'task' => 'add',
59
+ );
60
+ ?>
61
+ <a href="<?php echo WDILibrary::get_page_link($add_page_data);?>" class="add-new-h2"><?php _e('Add new', 'wd-instagram-feed'); ?></a>
62
+ </div>
63
+ <?php WDILibrary::search(__('Name', 'wd-instagram-feed'), $search_value, 'wdi_feed_form'); ?>
64
+ <div class="tablenav top">
65
+ <div class="alignleft actions bulkactions">
66
+ <select class="bulk_action">
67
+ <option value=""><?php _e('Bulk Actions', 'wd-instagram-feed'); ?></option>
68
+ <?php
69
+ foreach ($wdi_button_array as $key => $value) {
70
+ ?>
71
+ <option value="<?php echo $key; ?>"><?php echo $value; ?></option>
72
+ <?php
73
+ }
74
+ ?>
75
+ </select>
76
+ <input class="button action" type="button" title="<?php _e('Apply', 'wds'); ?>" onclick="if (!wdi_bulk_actions('.bulk_action')) {return false}" value="<?php _e('Apply', 'wds'); ?>" />
77
+ </div>
78
+ <?php
79
+ WDILibrary::html_page_nav($page_nav['total'], $page_nav['limit'], 'wdi_feed_form');
80
+ ?>
81
+ </div>
82
+ <table class="wp-list-table widefat fixed pages media">
83
+ <thead>
84
+ <td class="manage-column column-cb check-column"><input id="check_all" type="checkbox" onclick="wdi_spider_check_all(this)"/></td>
85
+
86
+ <th class="column-primary table_large_col <?php
87
+ echo $order_class;
88
+ ?>">
89
+ <?php
90
+ if($asc_or_desc==="asc"){
91
+ $wdi_order = 'desc';
92
+ }else{
93
+ $wdi_order = 'asc';
94
+ }
95
+ ?>
96
+ <a href="<?php echo WDILibrary::get_page_link(array('order_by'=>'feed_name', 'order'=>$wdi_order));?>">
97
+ <span><?php _e('Title', 'wd-instagram-feed'); ?></span><span class="sorting-indicator"></span>
98
+ </a>
99
+ </th>
100
+ <th class="table_big_col"><?php _e('Shortcode', 'wd-instagram-feed'); ?></th>
101
+ <th class="table_large_col"><?php _e('PHP function', 'wd-instagram-feed'); ?></th>
102
+ </thead>
103
+ <tbody id="tbody_arr">
104
+ <?php
105
+ if ($rows_data) {
106
+ $instagram_preview_post = $this->model->get_instagram_preview_post();
107
+ foreach ($rows_data as $row_data) {
108
+ $alternate = (!isset($alternate) || $alternate == 'class="alternate"') ? '' : 'class="alternate"';
109
+ $published_image = (($row_data->published) ? 'publish' : 'unpublish');
110
+ $published = (($row_data->published) ? 'unpublish' : 'publish');
111
+ $prev_img_url = $this->model->get_slider_prev_img($row_data->id);
112
+ $edit_page_data = array(
113
+ 'task' => 'edit',
114
+ 'current_id' => $row_data->id,
115
+ );
116
+ $wdi_nonce_wd = wp_create_nonce('nonce_wd');
117
+ ?>
118
+ <tr id="tr_<?php echo $row_data->id; ?>" <?php echo $alternate; ?>>
119
+ <th class="table_small_col check-column"><input id="check_<?php echo $row_data->id; ?>"
120
+ name="check_<?php echo $row_data->id; ?>"
121
+ onclick="wdi_spider_check_all(this)" type="checkbox"/>
122
+ </th>
123
+ <td class="column-primary column-title" data-colname="Name">
124
+ <strong>
125
+ <a href="<?php echo WDILibrary::get_page_link($edit_page_data);?>"
126
+ title="Edit">
127
+ <span class="media-icon image-icon">
128
+ <img title="<?php echo $row_data->feed_name; ?>"
129
+ style="border: 1px solid #CCCCCC; max-width: 70px; max-height: 50px;"
130
+ src="<?php echo $prev_img_url; ?>">
131
+ </span>
132
+ <?php echo $row_data->feed_name; ?>
133
+ </a>
134
+ <?php
135
+ if ( !$row_data->published ) {
136
+ ?>
137
+
138
+ <span class="post-state"><?php _e('Unpublished', 'wd-instagram-feed'); ?></span>
139
+ <?php
140
+ }
141
+
142
+ ?>
143
+ </strong>
144
+ <div class="row-actions">
145
+ <span>
146
+ <a href="<?php echo WDILibrary::get_page_link($edit_page_data);?>"
147
+ title="Edit"><?php _e('Edit', 'wd-instagram-feed'); ?>
148
+ </a>
149
+ |
150
+ </span>
151
+ <span>
152
+ <a href="<?php echo WDILibrary::get_page_link(array('task'=>'duplicate','current_id'=>$row_data->id, 'nonce_wd'=>$wdi_nonce_wd));?>"><?php _e('Duplicate', 'wd-instagram-feed'); ?></a>
153
+ |
154
+ </span>
155
+ <span>
156
+ <a href="<?php echo WDILibrary::get_page_link(array('task'=>$published,'current_id'=>$row_data->id, 'nonce_wd'=>$wdi_nonce_wd));?>" ><?php echo ( $row_data->published ? __('Unpublish', 'wd-instagram-feed') : __('Publish', 'wd-instagram-feed')); ?></a>
157
+ |
158
+ </span>
159
+ <span class="trash">
160
+ <a onclick="if (!confirm('<?php esc_attr_e('Do you want to delete selected items?', 'wd-instagram-feed'); ?>')){return false;}" href="<?php echo WDILibrary::get_page_link(array('task'=>"delete",'current_id'=>$row_data->id, 'nonce_wd'=>$wdi_nonce_wd));?>">Delete</a>
161
+ |
162
+ </span>
163
+ <span>
164
+ <a href="<?php echo add_query_arg( array('feed_id' => $row_data->id), $instagram_preview_post); ?>" target="_blank"><?php _e('Preview', 'wd-instagram-feed'); ?></a>
165
+ </span>
166
+ </div>
167
+ <button class="toggle-row" type="button">
168
+ <span class="screen-reader-text"><?php _e('Show more details', 'wd-instagram-feed'); ?></span>
169
+ </button>
170
+ </td>
171
+ <td class="table_big_col" data-colname="Shortcode" >
172
+ <input type="text" value='[wdi_feed id="<?php echo $row_data->id; ?>"]'
173
+ onclick="wdi_spider_select_value(this)" size="12" readonly="readonly"
174
+ style="padding-left: 1px; padding-right: 1px; text-align: center;"/>
175
+ </td>
176
+ <td class="table_large_col" data-colname="PHP function" >
177
+ <input type="text" value="&#60;?php echo wdi_feed(array('id'=>'<?php echo $row_data->id; ?>')); ?&#62;"
178
+ onclick="wdi_spider_select_value(this)" size="30" readonly="readonly"
179
+ style="padding-left: 1px; padding-right: 1px; text-align: center;"/>
180
+ </td>
181
+ </tr>
182
+ <?php
183
+ $ids_string .= $row_data->id . ',';
184
+ }
185
+ }
186
+ ?>
187
+ </tbody>
188
+ </table>
189
+ <?php wp_nonce_field('nonce_wd', 'nonce_wd'); ?>
190
+ <input type="hidden" id="wdi_access_token" name="access_token" value="<?php echo isset($wdi_options['wdi_access_token']) ? $wdi_options['wdi_access_token'] : ''; ?>">
191
+ <input id="task" name="task" type="hidden" value=""/>
192
+ <input id="current_id" name="current_id" type="hidden" value=""/>
193
+ <input id="ids_string" name="ids_string" type="hidden" value="<?php echo $ids_string; ?>"/>
194
+ <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="asc"/>
195
+ <input id="order_by" name="order_by" type="hidden" value="<?php echo $order_by; ?>"/>
196
+ </form>
197
+ </div>
198
+ <?php
199
+ }
200
+
201
+ public function edit($type) {
202
+ if ($type === 0) {
203
+ $this->generateForm();
204
+ ?>
205
+ <script>
206
+ jQuery(document).ready(function (){
207
+ wdi_controller.switchFeedTabs('feed_settings');
208
+ });
209
+ </script>
210
+ <?php
211
+ }
212
+ else {
213
+ global $wdi_new_feed;
214
+ $wdi_new_feed = TRUE;
215
+ $current_id = $type;
216
+ $feed_row = $this->model->get_feed_row($current_id);
217
+ $view_id = $feed_row->feed_type;
218
+ $this->generateForm($current_id);
219
+ $tab = WDILibrary::get('wdi_refresh_tab', 'feed_settings');
220
+ ?>
221
+ <script>
222
+ jQuery(document).ready(function (){
223
+ wdi_controller.switchFeedTabs('<?php echo $tab; ?>', '<?php echo $view_id;?>');
224
+ });
225
+ </script>
226
+ <?php
227
+ }
228
+ }
229
+
230
+ public function getFormElements($current_id = ''){
231
+ global $wdi_options;
232
+ if ( !empty($wdi_options['wdi_authenticated_users_list']) ) {
233
+ $authenticated_users_list = json_decode($wdi_options['wdi_authenticated_users_list'], TRUE);
234
+ if ( !empty($authenticated_users_list) ) {
235
+ foreach($authenticated_users_list as $key => $user ) {
236
+ $optgroups[$user['type']][$key] = array(
237
+ 'id' => $user['user_id'],
238
+ 'name' => $user['user_name'],
239
+ 'access_token' => $user['access_token'],
240
+ );
241
+ }
242
+ }
243
+ }
244
+ require_once(WDI_DIR . '/admin/models/WDIModelThemes_wdi.php');
245
+ $themes = WDIModelThemes_wdi::get_themes();
246
+
247
+ $tabs = array(
248
+ "feed_settings" => array(
249
+ "media" => array(
250
+ "title" => "Media",
251
+ "type" => "full",
252
+ "column" => "two",
253
+ "visibility" =>"show",
254
+ "section_name"=>"wdi_media",
255
+ "elements" => array(
256
+ array(
257
+ //'feed_name' => array('name' => 'feed_name', 'title' => __('Feed Title', 'wd-instagram-feed'), 'type' => 'input', 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
258
+ 'liked_feed' => array('disabled_options' => array('liked'), 'name' => 'liked_feed', 'title' => __('Feed Media', 'wd-instagram-feed'), 'type' => 'select', 'valid_options' => array('userhash' => __('Username/Hashtag', 'wd-instagram-feed'), 'liked' => __('Media I liked', 'wd-instagram-feed')), 'break' => 'false', 'hide_ids' => array(), 'tooltip' => __('Display media of User/Hashtag or the media I liked', 'wd-instagram-feed'), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
259
+ 'user_name' => array(
260
+ 'name' => 'user_name',
261
+ 'type' => 'selectgroup',
262
+ 'title' => __('Users', 'wd-instagram-feed'),
263
+ 'valid_options' => $optgroups,
264
+ 'tooltip' => "",
265
+ 'hide_ids' => array(
266
+ 'feed_users',
267
+ 'hashtag_top_recent',
268
+ 'display_user_post_follow_number',
269
+ 'display_user_info'
270
+ ),
271
+ 'attr' => array(
272
+ array(
273
+ 'name' => 'tab',
274
+ 'value' => 'feed_settings',
275
+ ),
276
+ array(
277
+ 'name' => 'section',
278
+ 'value' => 'thumbnails,masonry,blog_style,image_browser',
279
+ ),
280
+ ),
281
+ ),
282
+ 'feed_users' => array(
283
+ 'name' => 'feed_users',
284
+ 'title' => __('Hashtags', 'wd-instagram-feed'),
285
+ 'type' => 'input',
286
+ 'input_type' => 'hidden',
287
+ 'tooltip' => sprintf('%s <span class="wdi_settings_notification">%s</span>', __('Add hashtags to your feed. Hashtags must start with #.', 'wd-instagram-feed'), __('Note, that the more hashtags you add, the slower feed loading will be on front-end.', 'wd-instagram-feed')),
288
+ 'attr' => array(
289
+ array(
290
+ 'name' => 'tab',
291
+ 'value' => 'feed_settings'
292
+ ),
293
+ array(
294
+ 'name' => 'section',
295
+ 'value' => 'thumbnails,masonry,blog_style,image_browser'
296
+ )
297
+ )
298
+ ),
299
+ 'hashtag_top_recent' => array(
300
+ 'name' => 'hashtag_top_recent',
301
+ 'title' => __('Hashtag Top/Recent', 'wd-instagram-feed'),
302
+ 'type' => 'radio',
303
+ 'valid_options' => array(
304
+ '1' => __('Recent', 'wd-instagram-feed'),
305
+ '0' => __('Top', 'wd-instagram-feed')
306
+ ),
307
+ 'tooltip' => '',
308
+ 'attr' => array(
309
+ array(
310
+ 'name' => 'tab',
311
+ 'value' => 'lightbox_settings')
312
+ ),
313
+ 'hide_ids' => array(
314
+ '1' => 'popup_width,popup_height')
315
+ ),
316
+ ),
317
+ array(
318
+ 'sort_images_by' => array('name' => 'sort_images_by', 'title' => __('Sort Media By', 'wd-instagram-feed'), 'valid_options' => array('date' => __('Date', 'wd-instagram-feed'), 'likes' => __('Likes', 'wd-instagram-feed'), 'comments' => __('Comments', 'wd-instagram-feed'), 'random' => __('Random', 'wd-instagram-feed')), 'type' => 'select', 'tooltip' => "", 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
319
+ 'display_order' => array('name' => 'display_order', 'title' => __('Sorting Order', 'wd-instagram-feed'), 'valid_options' => array('asc' => 'Ascending', 'desc' => 'Descending '), 'type' => 'select', 'tooltip' => "", 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
320
+ 'feed_item_onclick' => array('name' => 'feed_item_onclick', 'title' => __('Action OnClick', 'wd-instagram-feed'), 'type' => 'select', 'valid_options' => array('lightbox' => __('Open Lightbox', 'wd-instagram-feed'), 'instagram' => __('Redirect To Instagram', 'wd-instagram-feed'), 'custom_redirect' => __('Custom Redirect', 'wd-instagram-feed'), 'none' => __('Do Nothing', 'wd-instagram-feed')), 'break' => 'true', 'hide_ids' => array('lightbox' => 'redirect_url', 'instagram' => 'redirect_url', 'none' => 'redirect_url'), 'tooltip' => __('Do this action when user clicks on image/video in the feed', 'wd-instagram-feed'), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
321
+ 'redirect_url' => array('name' => 'redirect_url', 'title' => __('Redirect URL', 'wd-instagram-feed'), 'type' => 'input', 'tooltip' => __('Absolute Url to redirect to.', 'wd-instagram-feed'), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
322
+ ),
323
+ ),
324
+ ),
325
+ "layout" => array(
326
+ "title" => "Layout and Pagination",
327
+ "type" => "half",
328
+ "column" => "one",
329
+ "section_name"=>"wdi_layout",
330
+ "elements" => array(
331
+ array(
332
+ 'feed_display_view' => array('name' => 'feed_display_view', 'title' => __('New Media Loading', 'wd-instagram-feed'), 'type' => 'select', 'valid_options' => array('pagination' => __('Pagination', 'wd-instagram-feed'), 'load_more_btn' => __('Load More Button', 'wd-instagram-feed'), 'infinite_scroll' => __('Infinite Scroll', 'wd-instagram-feed'), 'none' => __('None', 'wd-instagram-feed')), 'break' => 'true', 'hide_ids' => array('pagination' => 'number_of_photos,load_more_number,resort_after_load_more', 'load_more_btn' => 'pagination_per_page_number,pagination_preload_number', 'infinite_scroll' => 'pagination_per_page_number,pagination_preload_number', 'none' => 'pagination_preload_number,pagination_per_page_number,load_more_number,resort_after_load_more'), 'tooltip' => __('How to load and display new images/videos', 'wd-instagram-feed'), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style'))),
333
+ 'number_of_columns' => array('name' => 'number_of_columns', 'title' => __('Number of Columns', 'wd-instagram-feed'), 'type' => 'select', 'valid_options' => array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8'), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry'))),
334
+ 'number_of_photos' => array('name' => 'number_of_photos', 'title' => __('Number of Images/Videos', 'wd-instagram-feed'), 'type' => 'input', 'input_type' => 'number', 'tooltip' => __('Number of images/videos to show when feed is loaded first time', 'wd-instagram-feed'), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style'))),
335
+ 'load_more_number' => array('name' => 'load_more_number', 'title' => __('Number of New Media', 'wd-instagram-feed'), 'type' => 'input', 'input_type' => 'number', 'tooltip' => __('Number of new media added to the feed, when user clicks on load more button or triggers infinite scroll', 'wd-instagram-feed'), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style'))),
336
+ 'pagination_per_page_number' => array('name' => 'pagination_per_page_number', 'title' => __('Number of Media Per Page', 'wd-instagram-feed'), 'type' => 'input', 'input_type' => 'number', 'tooltip' => __('Number of images to show on each pagination page', 'wd-instagram-feed'), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style'))),
337
+ 'pagination_preload_number' => array('name' => 'pagination_preload_number', 'title' => __('Pages To Preload', 'wd-instagram-feed'), 'type' => 'input', 'input_type' => 'number', 'tooltip' => __('Preload all the media of several first pages', 'wd-instagram-feed'), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style'))),
338
+ 'image_browser_preload_number' => array('name' => 'image_browser_preload_number', 'title' => __('Number of Media for Initial Preload', 'wd-instagram-feed'), 'type' => 'input', 'input_type' => 'number', 'tooltip' => __('A number of first images/videos are preloaded', 'wd-instagram-feed'), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'image_browser'))),
339
+ 'image_browser_load_number' => array('name' => 'image_browser_load_number', 'title' => __('Number of Media for Pagination Preload', 'wd-instagram-feed'), 'type' => 'input', 'input_type' => 'number', 'tooltip' => "", 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'image_browser'))),
340
+ 'resort_after_load_more' => array('name' => 'resort_after_load_more', 'title' => __('Combine and Sort Again After Loading More', 'wd-instagram-feed'), 'type' => 'checkbox', 'tooltip' => __('If this option is enabled, both newly loaded and existing media are mixed then resorted together', 'wd-instagram-feed'), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style'))),
341
+ 'disable_mobile_layout' => array('name' => 'disable_mobile_layout', 'title' => __('Make Layout Not Responsive', 'wd-instagram-feed'), 'type' => 'checkbox', 'tooltip' => __('When checked, layout does not become single-column on mobile. Columns number stays the same', 'wd-instagram-feed'), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry'))),
342
+ ),
343
+ ),
344
+ ),
345
+ "advanced" => array(
346
+ "title" => "Advanced",
347
+ "type" => "half",
348
+ "column" => "one",
349
+ "section_name"=>"wdi_advanced",
350
+ "elements" => array(
351
+ array(
352
+ 'theme_id' => array(
353
+ 'name' => 'theme_id',
354
+ 'title' => __('Theme', 'wd-instagram-feed'),
355
+ 'valid_options' => $themes,
356
+ 'type' => 'select',
357
+ 'tooltip' => __('Styling theme of the feed. You can create themes in themes menu', 'wd-instagram-feed'),
358
+ 'attr' => array(
359
+ array(
360
+ 'name' => 'tab',
361
+ 'value' => 'feed_settings'
362
+ ),
363
+ array(
364
+ 'name' => 'section',
365
+ 'value' => 'thumbnails,masonry,blog_style,image_browser')
366
+ )
367
+ ),
368
+ 'feed_resolution' => array('name' => 'feed_resolution', 'title' => __('Feed Media Resolution', 'wd-instagram-feed'), 'type' => 'select', 'label' => array('text' => '', 'place' => 'after'), 'valid_options' => array('optimal' => 'Optimal', 'standard' => 'Large (1080 pixels)', 'low' => 'Low (320 pixels)', 'thumbnail' => 'Thumbnail (150 pixels)'), 'tooltip' => 'If set optimal, loaded media size is calculated according to container size. Fast loading and no stretched images.', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
369
+ 'thumb_user' => array(
370
+ 'name' => 'thumb_user',
371
+ 'title' => __('Featured Image', 'wd-instagram-feed'),
372
+ 'valid_options' => array(),
373
+ 'type' => 'select',
374
+ 'tooltip' => __('Select featured image for header section', 'wd-instagram-feed'),
375
+ 'attr' => array(
376
+ array(
377
+ 'name' => 'tab',
378
+ 'value' => 'feed_settings'
379
+ ),
380
+ array(
381
+ 'name' => 'section',
382
+ 'value' => 'thumbnails,masonry,blog_style,image_browser')
383
+ )
384
+ ),
385
+ 'display_header' => array('name' => 'display_header', 'title' => __('Show Feed Header', 'wd-instagram-feed'), 'type' => 'checkbox', 'tooltip' => __('Header includes feed title', 'wd-instagram-feed'), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
386
+ 'show_usernames' => array(
387
+ 'name' => 'show_usernames',
388
+ 'title' => __('Show User Data', 'wd-instagram-feed'),
389
+ 'type' => 'checkbox',
390
+ 'tooltip' => '',
391
+ 'hide_ids' => array(
392
+ 'display_user_info',
393
+ 'display_user_post_follow_number'
394
+ ),
395
+ 'attr' => array(
396
+ array(
397
+ 'name' => 'tab',
398
+ 'value' => 'feed_settings'
399
+ ),
400
+ array(
401
+ 'name' => 'section',
402
+ 'value' => 'thumbnails,masonry,blog_style,image_browser')
403
+ )
404
+ ),
405
+ 'display_user_post_follow_number' => array(
406
+ 'name' => 'display_user_post_follow_number',
407
+ 'title' => __('Show User Posts and Followers count', 'wd-instagram-feed'),
408
+ 'type' => 'checkbox',
409
+ 'tooltip' => '',
410
+ 'attr' => array(
411
+ array(
412
+ 'name' => 'tab',
413
+ 'value' => 'feed_settings'
414
+ ),
415
+ array(
416
+ 'name' => 'section',
417
+ 'value' => 'thumbnails,masonry,blog_style,image_browser'
418
+ )
419
+ )
420
+ ),
421
+ 'display_user_info' => array('name' => 'display_user_info', 'title' => __('Show User Bio and Website', 'wd-instagram-feed'), 'type' => 'checkbox', 'tooltip' => __('User bio will be displayed if feed has only one user', 'wd-instagram-feed'), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
422
+ 'follow_on_instagram_btn' => array(
423
+ 'name' => 'follow_on_instagram_btn',
424
+ 'title' => __('Show "Follow On Instagram" button', 'wd-instagram-feed'),
425
+ 'type' => 'checkbox',
426
+ 'tooltip' => '',
427
+ 'attr' => array(
428
+ array(
429
+ 'name' => 'tab',
430
+ 'value' => 'feed_settings',
431
+ ),
432
+ array(
433
+ 'name' => 'section',
434
+ 'value' => 'thumbnails,masonry,blog_style,image_browser'),
435
+ ),
436
+ ),
437
+ 'show_description' => array('name' => 'show_description', 'title' => __('Show Media Caption', 'wd-instagram-feed'), 'type' => 'checkbox', 'tooltip' => '','hide_ids'=>array('show_full_description'), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
438
+ 'show_full_description' => array('name' => 'show_full_description', 'title' => __('Show Full Description', 'wd-instagram-feed'), 'type' => 'checkbox', 'tooltip' => __('Discription will be shown no matter how long it is', 'wd-instagram-feed'), 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'masonry'))),
439
+ 'show_likes' => array('name' => 'show_likes', 'title' => __('Show Number of Likes', 'wd-instagram-feed'), 'type' => 'checkbox', 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
440
+ 'show_comments' => array('name' => 'show_comments', 'title' => __('Show Number of Comments', 'wd-instagram-feed'), 'type' => 'checkbox', 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry,blog_style,image_browser'))),
441
+ 'show_username_on_thumb' => array('name' => 'show_username_on_thumb', 'title' => __('Show Username On Image Thumb', 'wd-instagram-feed'), 'type' => 'checkbox', 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'feed_settings'), array('name' => 'section', 'value' => 'thumbnails,masonry'))),
442
+ ),
443
+ ),
444
+ ),
445
+ ),
446
+ "lightbox_settings" => array(
447
+ "general" => array(
448
+ "title" => "General",
449
+ "type" => "full",
450
+ "column" => "two",
451
+ "visibility" =>"show",
452
+ "section_name"=>"wdi_lightbox_general",
453
+ "elements" => array(
454
+ array(
455
+ 'popup_fullscreen' => array('name' => 'popup_fullscreen', 'title' => __('Full width lightbox', 'wd-instagram-feed'), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', 'wd-instagram-feed'), '0' => __('No', 'wd-instagram-feed')), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings')), 'hide_ids' => array('1' => 'popup_width,popup_height')),
456
+ 'popup_width' => array('name' => 'popup_width', 'title' => __('Lightbox Width', 'wd-instagram-feed'), 'type' => 'input', 'input_type' => 'number', 'label' => array('text' => 'px', 'place' => 'after'), 'tooltip' => '', 'attr' => array(array('name' => 'class', 'value' => 'small_input'), array('name' => 'tab', 'value' => 'lightbox_settings'))),
457
+ 'popup_height' => array('name' => 'popup_height', 'title' => __('Lightbox Height', 'wd-instagram-feed'), 'type' => 'input', 'input_type' => 'number', 'label' => array('text' => 'px', 'place' => 'after'), 'tooltip' => '', 'attr' => array(array('name' => 'class', 'value' => 'small_input'), array('name' => 'tab', 'value' => 'lightbox_settings'))),
458
+ 'popup_type' => array('name' => 'popup_type', 'title' => __('Lightbox Effect', 'wd-instagram-feed'), 'valid_options' => array('none' => 'None', 'cubeH' => 'Cube Horizontal', 'cubeV' => 'Cube Vertical', 'fade' => 'Fade', 'sliceH' => 'Slice Horizontal', 'sliceV' => 'Slice Vertical', 'slideH' => 'Slide Horizontal', 'slideV' => 'Slide Vertical', 'scaleOut' => 'Scale Out', 'scaleIn' => 'Scale In', 'blockScale' => 'Block Scale', 'kaleidoscope' => 'Kaleidoscope', 'fan' => 'Fan', 'blindH' => 'Blind Horizontal', 'blindV' => 'Blinde Vertical', 'random' => 'Random'), 'type' => 'select', 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
459
+ ),
460
+ array(
461
+ 'popup_autoplay' => array('name' => 'popup_autoplay', 'title' => __('Lightbox autoplay', 'wd-instagram-feed'), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', 'wd-instagram-feed'), '0' => __('No', 'wd-instagram-feed')), 'hide_ids' => array('0' => 'popup_interval'), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
462
+ 'popup_interval' => array('name' => 'popup_interval', 'title' => __('Autoplay Interval', 'wd-instagram-feed'), 'type' => 'input', 'input_type' => 'number', 'label' => array('text' => 'sec', 'place' => 'after'), 'tooltip' => '', 'attr' => array(array('name' => 'class', 'value' => 'small_input'), array('name' => 'tab', 'value' => 'lightbox_settings'))),
463
+ ),
464
+ ),
465
+ ),
466
+ "advanced" => array(
467
+ "title" => "Advanced",
468
+ "type" => "full",
469
+ "column" => "two",
470
+ "section_name"=>"wdi_lightbox_advanced",
471
+ "elements" => array(
472
+ array(
473
+ 'popup_enable_filmstrip' => array('name' => 'popup_enable_filmstrip', 'title' => __('Enable Filmstrip', 'wd-instagram-feed'), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', 'wd-instagram-feed'), '0' => __('No', 'wd-instagram-feed')), 'hide_ids' => array('0' => 'popup_filmstrip_height'), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
474
+ 'popup_filmstrip_height' => array('name' => 'popup_filmstrip_height', 'title' => __('Filmstrip Thumbnail Size', 'wd-instagram-feed'), 'type' => 'input', 'input_type' => 'number', 'label' => array('text' => 'px', 'place' => 'after'), 'tooltip' => '', 'attr' => array(array('name' => 'class', 'value' => 'small_input'), array('name' => 'tab', 'value' => 'lightbox_settings'))),
475
+ 'autohide_lightbox_navigation' => array('name' => 'autohide_lightbox_navigation', 'title' => __('Show Next / Previous Buttons', 'wd-instagram-feed'), 'type' => 'radio', 'valid_options' => array('1' => __('On Hover', 'wd-instagram-feed'), '0' => __('Always', 'wd-instagram-feed')), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
476
+ 'popup_info_always_show' => array('name' => 'popup_info_always_show', 'title' => __('Caption Displayed by Default', 'wd-instagram-feed'), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', 'wd-instagram-feed'), '0' => __('No', 'wd-instagram-feed')), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
477
+ 'popup_info_full_width' => array('name' => 'popup_info_full_width', 'title' => __('Full Width Caption', 'wd-instagram-feed'), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', 'wd-instagram-feed'), '0' => __('No', 'wd-instagram-feed')), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
478
+ 'enable_loop' => array('name' => 'enable_loop', 'title' => __('Enable Loop', 'wd-instagram-feed'), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', 'wd-instagram-feed'), '0' => __('No', 'wd-instagram-feed')), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
479
+ 'popup_image_right_click' => array('name' => 'popup_image_right_click', 'title' => __('Right Click Protection', 'wd-instagram-feed'), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', 'wd-instagram-feed'), '0' => __('No', 'wd-instagram-feed')), 'tooltip' => __('Protect lightbox images from downloading', 'wd-instagram-feed'), 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
480
+ ),
481
+ array(
482
+ 'popup_enable_ctrl_btn' => array('name' => 'popup_enable_ctrl_btn', 'title' => __('Enable Control Buttons', 'wd-instagram-feed'), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', 'wd-instagram-feed'), '0' => __('No', 'wd-instagram-feed')), 'hide_ids' => array('0' => 'popup_enable_info,popup_enable_fullscreen,popup_enable_info,popup_enable_comment,popup_enable_download,popup_enable_share_buttons,popup_enable_fullsize_image'), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
483
+ 'popup_enable_info' => array('name' => 'popup_enable_info', 'title' => __('Enable Caption Control', 'wd-instagram-feed'), 'type' => 'radio', 'valid_options' => array('1' => 'Yes', '0' => 'No'), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
484
+ 'popup_enable_fullscreen' => array('name' => 'popup_enable_fullscreen', 'title' => __('Show Fullscreen Control Button', 'wd-instagram-feed'), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', 'wd-instagram-feed'), '0' => __('No', 'wd-instagram-feed')), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
485
+ /* @ToDo API Changes 2020*/
486
+ 'popup_enable_comment' => array('name' => 'popup_enable_comment', 'title' => __('Enable Comments Control', 'wd-instagram-feed'), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', 'wd-instagram-feed'), '0' => __('No', 'wd-instagram-feed')), 'tooltip' => '', 'attr' => array( array('name' => 'tab', 'value' => 'lightbox_settings'))),
487
+ 'popup_enable_fullsize_image' => array('name' => 'popup_enable_fullsize_image', 'title' => __('Add Link to Instagram Post', 'wd-instagram-feed'), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', 'wd-instagram-feed'), '0' => __('No', 'wd-instagram-feed')), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
488
+ 'popup_enable_download' => array('name' => 'popup_enable_download', 'title' => __('Enable Download Button', 'wd-instagram-feed'), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', 'wd-instagram-feed'), '0' => __('No', 'wd-instagram-feed')), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
489
+ 'popup_enable_share_buttons' => array('name' => 'popup_enable_share_buttons', 'title' => __('Show Share Buttons', 'wd-instagram-feed'), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', 'wd-instagram-feed'), '0' => __('No', 'wd-instagram-feed')), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
490
+ 'popup_enable_facebook' => array('status' => 'disabled', 'name' => 'popup_enable_facebook', 'title' => __('Enable Facebook button', 'wd-instagram-feed'), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', 'wd-instagram-feed'), '0' => __('No', 'wd-instagram-feed')), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
491
+ 'popup_enable_twitter' => array('status' => 'disabled', 'name' => 'popup_enable_twitter', 'title' => __('Enable Twitter button', 'wd-instagram-feed'), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', 'wd-instagram-feed'), '0' => __('No', 'wd-instagram-feed')), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
492
+ 'popup_enable_google' => array('status' => 'disabled', 'name' => 'popup_enable_google', 'title' => __('Enable Google+ button', 'wd-instagram-feed'), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', 'wd-instagram-feed'), '0' => __('No', 'wd-instagram-feed')), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
493
+ 'popup_enable_pinterest' => array('status' => 'disabled', 'name' => 'popup_enable_pinterest', 'title' => __('Enable Pinterest button', 'wd-instagram-feed'), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', 'wd-instagram-feed'), '0' => __('No', 'wd-instagram-feed')), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
494
+ 'popup_enable_tumblr' => array('status' => 'disabled', 'name' => 'popup_enable_tumblr', 'title' => __('Enable Tumblr button', 'wd-instagram-feed'), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', 'wd-instagram-feed'), '0' => __('No', 'wd-instagram-feed')), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
495
+ 'show_image_counts' => array('status' => 'disabled', 'name' => 'show_image_counts', 'title' => __('Show Images Count', 'wd-instagram-feed'), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', 'wd-instagram-feed'), '0' => __('No', 'wd-instagram-feed')), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'lightbox_settings'))),
496
+ ),
497
+ ),
498
+ ),
499
+ ),
500
+ "conditional_filters" => array(
501
+ "" => array(
502
+ "title" => __("Conditional Filters", 'wd-instagram-feed'),
503
+ "type" => "full",
504
+ "column" => "one",
505
+ "visibility" =>"show",
506
+ "section_name"=>"wdi_conditional_filters",
507
+ "elements" => array(
508
+ array(
509
+ 'conditional_filter_enable' => array('name' => 'conditional_filter_enable', 'title' => __('Enable Conditional Filters', 'wd-instagram-feed'), 'type' => 'radio', 'valid_options' => array('1' => __('Yes', 'wd-instagram-feed'), '0' => __('No', 'wd-instagram-feed')), 'tooltip' => '', 'attr' => array(array('name' => 'tab', 'value' => 'conditional_filters'))),
510
+ 'conditional_filter_type' => array('name' => 'conditional_filter_type', 'title' => __('Filter Logic', 'wd-instagram-feed'), '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'))),
511
+ ),
512
+ ),
513
+ ),
514
+ ),
515
+ "how_to_publish" => array(
516
+ "" => array(
517
+ "title" => __("How to Publish Feed", 'wd-instagram-feed'),
518
+ "type" => "full",
519
+ "column" => "one",
520
+ "visibility" =>"show",
521
+ "section_name"=>"wdi_how_to_publish",
522
+ "elements" => array(
523
+ array(
524
+ 'how_to_publish' => array(
525
+ 'name' => 'how_to_publish',
526
+ 'type' => 'how_to_publish',
527
+ 'title' => "",
528
+ 'tooltip' => '',
529
+ ),
530
+ ),
531
+ ),
532
+ ),
533
+ ),
534
+ );
535
+ if(IS_FREE){
536
+ $tabs["conditional_filters"][""]["title"] = __("This is free version, Conditional filters are available only in premium version", "wd-instagram-feed");
537
+ $tabs["feed_settings"]["advanced"]["elements"][0]["theme_id"]["switched"]="off";
538
+ $tabs["feed_settings"]["advanced"]["elements"][0]["theme_id"]["label"] = array(
539
+ 'place' => 'after',
540
+ 'class' => 'wdi_pro_only',
541
+ 'text' => __("Changing Theme is available only in premium version", "wd-instagram-feed"),
542
+ 'br' => 'true'
543
+ );
544
+
545
+ $tabs["feed_settings"]["advanced"]["elements"][0]["thumb_user"]["switched"]="off";
546
+ $tabs["feed_settings"]["advanced"]["elements"][0]["thumb_user"]["label"] = array(
547
+ 'place' => 'after',
548
+ 'class' => 'wdi_pro_only',
549
+ 'text' => __("Featured Image is available only in premium version", "wd-instagram-feed"),
550
+ 'br' => 'true'
551
+ );
552
+
553
+ $tabs["feed_settings"]["layout"]["elements"][0]["feed_display_view"]["disabled_options"]=array('infinite_scroll');
554
+ $tabs["feed_settings"]["layout"]["elements"][0]["feed_display_view"]["disabled"]=array(
555
+ 'text' => __("Infinite Scroll option is available only in premium version", "wd-instagram-feed")
556
+ );
557
+
558
+
559
+ $tabs["feed_settings"]["advanced"]["elements"][0]["show_description"]["switched"]="off";
560
+ $tabs["feed_settings"]["advanced"]["elements"][0]["show_description"]["label"]= array(
561
+ 'place' => 'after',
562
+ 'class' => 'wdi_pro_only',
563
+ 'text' => __("This feature is available only in premium version", "wd-instagram-feed"),
564
+ 'br' => 'true'
565
+ );
566
+
567
+ $tabs["feed_settings"]["advanced"]["elements"][0]["show_likes"]["switched"]="off";
568
+ $tabs["feed_settings"]["advanced"]["elements"][0]["show_likes"]["label"]= array(
569
+ 'place' => 'after',
570
+ 'class' => 'wdi_pro_only',
571
+ 'text' => __("This feature is available only in premium version", "wd-instagram-feed"),
572
+ 'br' => 'true'
573
+ );
574
+
575
+ $tabs["feed_settings"]["advanced"]["elements"][0]["show_comments"]["switched"]="off";
576
+ $tabs["feed_settings"]["advanced"]["elements"][0]["show_comments"]["label"]= array(
577
+ 'place' => 'after',
578
+ 'class' => 'wdi_pro_only',
579
+ 'text' => __("This feature is available only in premium version", "wd-instagram-feed"),
580
+ 'br' => 'true'
581
+ );
582
+
583
+ $tabs["feed_settings"]["advanced"]["elements"][0]["show_username_on_thumb"]["switched"]="off";
584
+ $tabs["feed_settings"]["advanced"]["elements"][0]["show_username_on_thumb"]["label"]= array(
585
+ 'place' => 'after',
586
+ 'class' => 'wdi_pro_only',
587
+ 'text' => __("This feature is available only in premium version", "wd-instagram-feed"),
588
+ 'br' => 'true'
589
+ );
590
+
591
+
592
+ $tabs["lightbox_settings"]["general"]["elements"][0]["popup_type"]["disabled_options"]= array(
593
+ 'cubeH',
594
+ 'cubeV',
595
+ 'sliceH',
596
+ 'sliceV',
597
+ 'slideH',
598
+ 'slideV',
599
+ 'scaleOut',
600
+ 'scaleIn',
601
+ 'blockScale',
602
+ 'kaleidoscope',
603
+ 'fan',
604
+ 'blindH',
605
+ 'blindV',
606
+ 'random'
607
+ );
608
+ $tabs["lightbox_settings"]["general"]["elements"][0]["popup_type"]["disabled"]= array(
609
+ 'text' => __("Effects are available only in premium version", "wd-instagram-feed")
610
+ );
611
+
612
+
613
+ $tabs["lightbox_settings"]["advanced"]["elements"][0]["popup_enable_filmstrip"]["disabled_options"]= array(
614
+ '1' => '',
615
+ '0' => ''
616
+ );
617
+ $tabs["lightbox_settings"]["advanced"]["elements"][0]["popup_enable_filmstrip"]["label"]= array(
618
+ 'place' => 'after',
619
+ 'class' => 'wdi_pro_only',
620
+ 'text' => __("This feature is available only in premium version", "wd-instagram-feed"),
621
+ 'br' => 'true'
622
+ );
623
+
624
+ $tabs["lightbox_settings"]["advanced"]["elements"][0]["popup_info_always_show"]["disabled_options"]= array(
625
+ '1' => '',
626
+ '0' => ''
627
+ );
628
+ $tabs["lightbox_settings"]["advanced"]["elements"][0]["popup_info_always_show"]["label"]= array(
629
+ 'place' => 'after',
630
+ 'class' => 'wdi_pro_only',
631
+ 'text' => __("This feature is available only in premium version", "wd-instagram-feed"),
632
+ 'br' => 'true'
633
+ );
634
+
635
+ $tabs["lightbox_settings"]["advanced"]["elements"][0]["popup_info_full_width"]["disabled_options"]= array(
636
+ '1' => '',
637
+ '0' => ''
638
+ );
639
+ $tabs["lightbox_settings"]["advanced"]["elements"][0]["popup_info_full_width"]["label"]= array(
640
+ 'place' => 'after',
641
+ 'class' => 'wdi_pro_only',
642
+ 'text' => __("This feature is available only in premium version", "wd-instagram-feed"),
643
+ 'br' => 'true'
644
+ );
645
+
646
+
647
+ $tabs["lightbox_settings"]["advanced"]["elements"][1]["popup_enable_info"]["disabled_options"]= array(
648
+ '1' => '',
649
+ '0' => ''
650
+ );
651
+ $tabs["lightbox_settings"]["advanced"]["elements"][1]["popup_enable_info"]["label"]= array(
652
+ 'place' => 'after',
653
+ 'class' => 'wdi_pro_only',
654
+ 'text' => __("This feature is available only in premium version", "wd-instagram-feed"),
655
+ 'br' => 'true'
656
+ );
657
+
658
+ $tabs["lightbox_settings"]["advanced"]["elements"][1]["popup_enable_comment"]["disabled_options"]= array(
659
+ '1' => '',
660
+ '0' => ''
661
+ );
662
+ $tabs["lightbox_settings"]["advanced"]["elements"][1]["popup_enable_comment"]["label"]= array(
663
+ 'place' => 'after',
664
+ 'class' => 'wdi_pro_only',
665
+ 'text' => __("This feature is available only in premium version", "wd-instagram-feed"),
666
+ 'br' => 'true'
667
+ );
668
+
669
+
670
+ $tabs["lightbox_settings"]["advanced"]["elements"][1]["popup_enable_share_buttons"]["disabled_options"]= array(
671
+ '1' => '',
672
+ '0' => ''
673
+ );
674
+ $tabs["lightbox_settings"]["advanced"]["elements"][1]["popup_enable_share_buttons"]["label"]= array(
675
+ 'place' => 'after',
676
+ 'class' => 'wdi_pro_only',
677
+ 'text' => __("This feature is available only in premium version", "wd-instagram-feed"),
678
+ 'br' => 'true'
679
+ );
680
+
681
+ }
682
+ $return = array('tabs' => $tabs, 'current_id' => $current_id);
683
+ return $return;
684
+ }
685
+
686
+ public function genarateFeedViews()
687
+ {
688
+ ?>
689
+ <div class="wdi_border_wrapper">
690
+ <div id="wdi_layout_section" class="wdi_layout_section display_type_content wdi_section">
691
+ <h3 data-section_name="wdi_layout_section" class="wdi_display_content wdi_section_name wdi_section_close">Select layout</h3>
692
+ <div data-display="table" class="display_type_container wdi_clear_tag wdi_elements">
693
+ <div class="display_type" tab="feed_settings">
694
+ <div style="text-align:center;padding:2px;"><input type="radio" id="thumbnails" name="feed_type"
695
+ value="thumbnails"><label for="thumbnails">Thumbnails</label>
696
+ </div>
697
+ <label for="thumbnails"><img src="<?php echo plugins_url('../../images/feed_views/thumbnails.png', __FILE__); ?>"></label>
698
+ </div>
699
+
700
+ <div class="display_type <?php echo (IS_FREE)?"wdi_tooltip":""; ?>" <?php echo (IS_FREE)?"wdi-tooltip='Available In Premium Version'":""; ?> tab="feed_settings">
701
+ <div style="text-align:center;padding:2px;"><input type="radio" <?php echo (IS_FREE)?"disabled":""; ?> id="masonry" name="feed_type"
702
+ value="masonry">
703
+ <label for="masonry" <?php echo (IS_FREE)?"class='wdi_pro_only'":""; ?>>Masonry</label></div>
704
+ <label for="masonry"><img
705
+ src="<?php echo plugins_url('../../images/feed_views/masonry.png', __FILE__); ?>"></label>
706
+ </div>
707
+
708
+ <div class="display_type <?php echo (IS_FREE)?"wdi_tooltip":""; ?>" <?php echo (IS_FREE)?"wdi-tooltip='Available In Premium Version'":""; ?> tab="feed_settings">
709
+ <div style="text-align:center;padding:2px;">
710
+ <input type="radio" <?php echo (IS_FREE)?"disabled":""; ?> id="blog_style" name="feed_type" value="blog_style">
711
+ <label for="blog_style" <?php echo (IS_FREE)?"class='wdi_pro_only'":""; ?>>Blog Style</label>
712
+ </div>
713
+ <label for="blog_style"><img src="<?php echo plugins_url('../../images/feed_views/blog_style.png', __FILE__); ?>"></label>
714
+ </div>
715
+
716
+ <div class="display_type" tab="feed_settings">
717
+ <div style="text-align:center;padding:2px;"><input type="radio" id="image_browser" name="feed_type"
718
+ value="image_browser"><label for="image_browser">Image
719
+ Browser</label></div>
720
+ <label for="image_browser"><img
721
+ src="<?php echo plugins_url('../../images/feed_views/image_browser.png', __FILE__); ?>"></label>
722
+ </div>
723
+ </div>
724
+ </div>
725
+ <?php
726
+ }
727
+
728
+ public function generateTabs() {
729
+ ?>
730
+ <div id="wdi_feed_tabs">
731
+ <div class="wdi_feed_tabs" id="wdi_feed_settings" onclick="wdi_controller.switchFeedTabs('feed_settings');">
732
+ <span class="dashicons dashicons-before dashicons-admin-generic"></span>
733
+ <span class="wdi_feed_tab_title"><?php _e('Feed Settings', 'wd-instagram-feed') ?></span>
734
+ </div>
735
+ <div class="wdi_feed_tabs" id="wdi_lightbox_settings" onclick="wdi_controller.switchFeedTabs('lightbox_settings');">
736
+ <span class="dashicons dashicons-before dashicons-admin-page"></span>
737
+ <span class="wdi_feed_tab_title"><?php _e('Lightbox Settings', 'wd-instagram-feed') ?></span>
738
+ </div>
739
+ <div class="wdi_feed_tabs" id="wdi_conditional_filters" onclick="wdi_controller.switchFeedTabs('conditional_filters');">
740
+ <span class="dashicons dashicons-before dashicons-filter"></span>
741
+ <span class="wdi_feed_tab_title"><?php _e('Conditional Filters', 'wd-instagram-feed') ?></span>
742
+ </div>
743
+ <div class="wdi_feed_tabs" id="wdi_how_to_publish" onclick="wdi_controller.switchFeedTabs('how_to_publish');">
744
+ <span class="dashicons dashicons-before dashicons-editor-help"></span>
745
+ <span class="wdi_feed_tab_title"><?php _e('How To Publish Feed', 'wd-instagram-feed') ?></span>
746
+ </div>
747
+ </div>
748
+ <?php
749
+ }
750
+
751
+ public function generateForm( $current_id = '' ) {
752
+ global $wdi_options;
753
+ if ( $current_id === '' ) {
754
+ $wdi_preview_btn = FALSE;
755
+ $save_btn_name = __('Publish', 'wd-instagram-feed');
756
+ }
757
+ else {
758
+ $wdi_preview_btn = TRUE;
759
+ $save_btn_name = __('Update', 'wd-instagram-feed');
760
+ }
761
+
762
+ $formInfo = $this->getFormElements($current_id);
763
+ $tabs = $formInfo['tabs'];
764
+ $wdi_preview_link = $this->model->get_instagram_preview_post();
765
+ // for edit
766
+ $edit = FALSE;
767
+
768
+ if ($current_id != '') {
769
+ $feed_row = WDILibrary::objectToarray($this->model->get_feed_row($current_id));
770
+ $users = (array) json_decode($feed_row['feed_users'], TRUE);
771
+ if ( !empty($users) ) {
772
+ foreach($users as $user) {
773
+ if( substr($user['username'], 0, 1) === '#' ) {
774
+ continue;
775
+ }
776
+ $feed_row['user_name'] = $user['username'];
777
+ }
778
+ }
779
+
780
+ $edit = TRUE;
781
+ }
782
+ else {
783
+ $feed_row = '';
784
+ }
785
+ $feed_row_id = "";
786
+ if(isset($feed_row["id"])){
787
+ $feed_row_id = $feed_row["id"];
788
+ }
789
+
790
+ if(isset($feed_row['liked_feed'])) {
791
+ $feed_row['liked_feed'] = 'userhash';
792
+ }
793
+ ?>
794
+ <div class="wrap">
795
+ <div class="update-nag wdi_help_bar_wrap">
796
+ <span class="wdi_help_bar_text">
797
+ <?php _e('Here You Can Change Feed Parameters.', 'wd-instagram-feed'); ?>
798
+ <a style="color: #5CAEBD; text-decoration: none;border-bottom: 1px dotted;" class="wdi_hb_t_link" target="_blank" href="https://help.10web.io/hc/en-us/articles/360016497251-Creating-Instagram-Feed?utm_source=instagram_feed&utm_medium=free_plugin"><?php _e('Read More in User Guide', 'wd-instagram-feed'); ?></a>
799
+ </span>
800
+ </div>
801
+ <h2 class="wdi-h2-message"></h2>
802
+ <form method="post" action="admin.php?page=wdi_feeds" id='wdi_save_feed'>
803
+ <div class="wdi-page-header">
804
+ <h1 class="wp-heading-inline"><?php echo __('Feed Title', 'wd-instagram-feed')?></h1>
805
+ <input id="WDI_feed_name" class="WDI_title_input" name="wdi_feed_settings[feed_name]" type="text" value="<?php echo ($edit == TRUE && isset($feed_row['feed_name'])) ? $feed_row['feed_name'] : "Sample Feed";?>">
806
+ <div class="wdi_buttons">
807
+ <div id="wdi_save_feed_apply" class="button button-primary"><?php echo $save_btn_name;?></div>
808
+ <button class="button preview-button button-large"<?php if (!$wdi_preview_btn) echo ' disabled="disabled"' ?> <?php echo ($wdi_preview_btn) ? 'onclick="window.open(\''. add_query_arg( array('feed_id' => $feed_row_id), $wdi_preview_link ) .'\', \'_blank\'); return false;"' : ''; ?>><?php echo __('Preview', 'wd-instagram-feed');?></button>
809
+ </div>
810
+ </div>
811
+ <?php
812
+ $this->generateTabs();
813
+ $this->genarateFeedViews();
814
+ // wp_nonce_field('wdi_nonce', 'wdi_nonce');
815
+ wp_nonce_field('nonce_wd', 'nonce_wd');
816
+ ?>
817
+ <input type="hidden" id="task" name='task'>
818
+ <input type="hidden" id="wdi_feed_type" name='<?php echo WDI_FSN . '[feed_type]' ?>'>
819
+ <input type="hidden" id="wdi_feed_thumb" name="<?php echo WDI_FSN . '[feed_thumb]' ?>">
820
+ <input type="hidden" id="wdi_access_token" name="access_token" value="<?php echo $wdi_options['wdi_access_token']; ?>">
821
+ <input type="hidden" id="wdi_add_or_edit" name="add_or_edit" value="<?php echo $current_id; ?>">
822
+ <input type="hidden" id="wdi_thumb_user" value="<?php echo isset($feed_row['thumb_user']) ? $feed_row['thumb_user'] : $wdi_options['wdi_user_name']; ?>">
823
+ <input type="hidden" id="wdi_default_user" value="<?php echo $wdi_options['wdi_user_name']; ?>">
824
+ <input type="hidden" id="wdi_default_user_id" value="<?php echo $wdi_options['wdi_user_id']; ?>">
825
+ <input type="hidden" name="<?php echo WDI_FSN . '[published]' ?>" value="<?php echo isset($feed_row['published']) ? $feed_row['published'] : '1'; ?>">
826
+ <input type="hidden" id="wdi_current_id" name="current_id" value=''>
827
+ <input type="hidden" id="wdi_refresh_tab" name="wdi_refresh_tab">
828
+ <div class="form-table">
829
+ <?php
830
+ foreach ($tabs as $key => $tab) { ?>
831
+ <div id="<?php echo $key; ?>_tab" class="wdi_tab" style="<?php echo $key == "feed_settings" ? "display:block;" : ""; ?>">
832
+ <?php foreach ($tab as $key => $section) {
833
+ $section_class = "wdi_section_open";
834
+ if(isset($section["visibility"]) && $section["visibility"]==="show"){
835
+ $section_class = "wdi_section_close";
836
+ }
837
+ ?>
838
+ <div id="<?php echo $key; ?>_section" class="wdi_section <?php echo $section["type"]; ?> <?php echo $section["column"]; ?>">
839
+ <h3 data-section_name="<?php echo $section['section_name']?>" class="wdi_section_name <?php echo $section_class;?>"><?php echo $section["title"]; ?></h3>
840
+ <div class="wdi_elements wdi_clear_tag">
841
+ <?php foreach ($section["elements"] as $elements) { ?>
842
+ <div class="section_col">
843
+ <?php foreach ($elements as $key => $element) {
844
+ if (isset($element['status'])) {
845
+ if ($element['status'] == 'disabled') {
846
+ continue;
847
+ }
848
+ }
849
+ if ($element['name'] == 'conditional_filter_enable') { ?>
850
+ <div id="wdi-conditional-filters-ui" class="wdi_demo_img">
851
+ <div class="wdi-pro-overlay"><img src="<?php echo WDI_URL . '/demo_images/filters.png'; ?>" alt=""></div>
852
+ </div><?php
853
+ continue;
854
+ }
855
+
856
+ if ($element['name'] == 'conditional_filter_type') {
857
+ continue;
858
+ }
859
+
860
+ if (isset($element['status'])) {
861
+ if ($element['status'] == 'disabled') {
862
+ continue;
863
+ }
864
+ } ?>
865
+ <div class="wdi_element wdi_element_name_<?php echo $element['name'] ; ?>">
866
+ <div class="wdi_element_title">
867
+ <span class="wdi_settings_link" ><?php echo $element['title']; ?></span>
868
+ </div>
869
+ <div class="wdi_element_content">
870
+ <?php $this->buildField($element, $feed_row); ?>
871
+ <!-- FEED USERS -->
872
+ <?php if ($element['name'] == 'feed_users') { ?>
873
+ <input type="text" id="wdi_add_user_ajax_input">
874
+ <div id="wdi_add_user_ajax" class="button button-primary"><?php _e('Add', 'wd-instagram-feed'); ?></div>
875
+ <div id="wdi_feed_users_ajax" class="wdi_clear_tag">
876
+ <?php $this->display_feed_users($feed_row); ?>
877
+ </div>
878
+ <?php } ?>
879
+ <!-- END FEED USERS -->
880
+ <?php if ( $element['tooltip'] && $element['tooltip'] != '' ) {
881
+ echo "<p class='wdi_about_filed'>".$element['tooltip']."</p>";
882
+ }
883
+ ?>
884
+ </div>
885
+ </div>
886
+ <!-- CONDITIONAL FILTERS BOTTOM -->
887
+ <?php if ($element['name'] == 'conditional_filter_type') { ?>
888
+ <div class="wdi_element">
889
+ <div class="wdi_element_title">
890
+ <span class="wdi_settings_link"><?php _e('Add Condition', 'wd-instagram-feed'); ?></span>
891
+ </div>
892
+ <div class="wdi_element_content">
893
+ <div id="WDI_conditional_filters" class="selectoff">
894
+ <div>
895
+ <div>
896
+ <div tab="conditional_filters"></div>
897
+ </div>
898
+ </div>
899
+ <textarea style="display:none" id="wdi_conditional_filters_textarea" name='<?php echo WDI_FSN . '[conditional_filters]' ?>'> <?php echo isset($feed_row['conditional_filters']) ? $feed_row['conditional_filters'] : ''; ?> </textarea>
900
+ <div class="wdi_filter_ctrl_container">
901
+ <div class="wdi_filter_input">
902
+ <input id="wdi_filter_input" placeholder="<?php _e('Enter Your Condition Here...', 'wd-instagram-feed'); ?>" type="text">
903
+ <select name="wdi_filter_type" id="wdi_filter_type">
904
+ <option value="" disabled selected><?php _e('Condition Type', 'wd-instagram-feed') ?></option>
905
+ <option value="hashtag"><?php _e('Hashtag', 'wd-instagram-feed') ?></option>
906
+ <option value="mention"><?php _e('Mention', 'wd-instagram-feed') ?></option>
907
+ <option value="description"><?php _e('Description', 'wd-instagram-feed') ?></option>
908
+ <option value="url"><?php _e('Instagram Media Link', 'wd-instagram-feed') ?></option>
909
+ </select>
910
+ <div id="wdi_add_filter" class="button button-primary"><?php _e('Add Condition', 'wd-instagram-feed'); ?></div>
911
+ <br><label style="font-size:12px"for="wdi_filter_input">
912
+ <?php _e('Write your condition, select condition type and click on Add Condition. You can add as many conditions as you want. You can add different condition types mixed together as well.', 'wd-instagram-feed'); ?>
913
+ <span class="wdi_settings_notification"><?php _e('Note, that the more filters you add, the slower feed loading will be on front-end. Some filters with rare conditions may slow loading drastically.', 'wd-instagram-feed'); ?></span>
914
+ </label>
915
+ </div>
916
+ </div>
917
+ </div>
918
+ </div>
919
+ </div>
920
+ <div id='wdi_final_condition' class="wdi_element">
921
+ <div class="wdi_element_title">
922
+ <span class="wdi_settings_link" ><?php _e('Result', 'wd-instagram-feed'); ?></span>
923
+ </div>
924
+ <div class="wdi_element_content">
925
+ <div>
926
+ <div>
927
+ <div>
928
+ <div tab="conditional_filters"></div>
929
+ </div>
930
+ </div>
931
+ </div>
932
+ <span class="filters_description"><?php _e("Posts Which Meet Following Condition Would Be Shown") ?></span>
933
+ <div id="wdi_filters_ui" class="wdi_filters_ui selectoff"></div>
934
+ </div>
935
+ </div>
936
+ <?php } ?>
937
+ <!-- END CONDITIONAL FILTERS BOTTOM -->
938
+ <?php } ?>
939
+ </div>
940
+ <?php } ?>
941
+ </div>
942
+ </div>
943
+ <?php } ?>
944
+ </div>
945
+ <?php } ?>
946
+ </div>
947
+ </form>
948
+ </div>
949
+ </div>
950
+ <?php
951
+ }
952
+
953
+ private function buildField($element, $feed_row = '') {
954
+ require_once(WDI_DIR . '/framework/WDI_form_builder.php');
955
+ $element['defaults'] = $this->model->wdi_get_feed_defaults();
956
+ $element['CONST'] = WDI_FSN;
957
+ $builder = new WDI_form_builder();
958
+ switch ($element['type']) {
959
+ case 'input': {
960
+ $builder->input($element, $feed_row);
961
+ break;
962
+ }
963
+ case 'select': {
964
+ $builder->select($element, $feed_row);
965
+ break;
966
+ }
967
+ case 'selectgroup': {
968
+ $builder->selectgroup($element, $feed_row);
969
+ break;
970
+ }
971
+ case 'radio': {
972
+ $builder->radio($element, $feed_row);
973
+ break;
974
+ }
975
+ case 'checkbox': {
976
+ $builder->checkbox($element, $feed_row);
977
+ break;
978
+ }
979
+ case 'how_to_publish': {
980
+ $builder->how_to_publish($element, $feed_row);
981
+ break;
982
+ }
983
+ }
984
+ }
985
+
986
+ public function display_feed_users( $feed_row ) {
987
+ global $wdi_options;
988
+ $users = isset($feed_row['feed_users']) ? $feed_row['feed_users'] : "";
989
+ $users = json_decode($users);
990
+ if ( !empty($users) ) {
991
+ foreach ( $users as $user ) {
992
+ if ( !empty($user->tag_id) ) {
993
+ $tag_name = str_replace('#', '', $user->username);
994
+ ?>
995
+ <div class="wdi_user">
996
+ <a target="_blank" href="https://instagram.com/explore/tags/<?php echo $tag_name; ?>">
997
+ <img class="wdi_profile_pic" src="<?php echo WDI_URL ?>/images/hashtag.png">
998
+ <span class="wdi_hashtag"><?php echo $tag_name; ?></span><i style="display:table-cell;width:25px;"></i>
999
+ </a>
1000
+ <img class="wdi_remove_user" onclick="wdi_controller.removeFeedUser(jQuery(this))" src="<?php echo WDI_URL ?>/images/delete_user.png">
1001
+ </div>
1002
+ <?php
1003
+ }
1004
+ }
1005
+ }
1006
+
1007
+ if ( $users === NULL ) {
1008
+ $users = array();
1009
+ }
1010
+ $token = WDILibrary::get_user_access_token($users);
1011
+ ?>
1012
+ <script>
1013
+ jQuery(document).ready(function () {
1014
+ var users_list = JSON.parse(wdi_options.wdi_authenticated_users_list);
1015
+ if (typeof users_list !== 'object') {
1016
+ users_list = {};
1017
+ }
1018
+
1019
+ var usersnames = [wdi_options.wdi_user_name];
1020
+ for(var i in users_list){
1021
+ usersnames.push(users_list[i].user_name);
1022
+ }
1023
+
1024
+ wdi_controller.users_list = users_list;
1025
+ wdi_controller.usersnames = usersnames;
1026
+ wdi_controller.instagram = new WDIInstagram();
1027
+ wdi_controller.feed_users = [];
1028
+ wdi_controller.instagram.addToken(<?php echo '"' . $token . '"'; ?>);
1029
+
1030
+ wdi_controller.updateFeaturedImageSelect(<?php echo '"' . $wdi_options['wdi_user_name'] . '"'; ?>, 'add', 'selected');
1031
+
1032
+ <?php foreach ( $users as $user ) { ?>
1033
+ // wdi_controller.makeInstagramUserRequest(<?php echo '"' . $user->username . '"'?>, true);
1034
+ <?php } ?>
1035
+ });
1036
+ </script>
1037
+ <?php
1038
+ }
1039
+ }
admin/views/settings.php ADDED
@@ -0,0 +1,230 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Settings_view_wdi {
4
+
5
+ public function display( $args = array() ) {
6
+ $options = $args['options'];
7
+ $authenticated_users_list = $args['authenticated_users_list'];
8
+ $min_capability = $args['min_capability'];
9
+ require_once(WDI_DIR . '/framework/WDI_admin_view.php');
10
+ if ( !empty( WDILibrary::get('wdi_access_token', '', 'sanitize_text_field', 'REQUEST') ) ) {
11
+ /*dismiss api update notice*/
12
+ $admin_notices_option = get_option('wdi_admin_notice', array());
13
+ $admin_notices_option['api_update_token_reset'] = array(
14
+ 'start' => current_time("n/j/Y"),
15
+ 'int' => 0,
16
+ 'dismissed' => 1,
17
+ );
18
+ update_option('wdi_admin_notice', $admin_notices_option);
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"; // @ToDo What is this part for?
25
+ jQuery(document).ready(function () {
26
+ jQuery(document).on('wdi_settings_filled', function () {
27
+ jQuery('#submit').trigger('click');
28
+ });
29
+ });
30
+ }
31
+ </script>
32
+ <?php
33
+ }
34
+ ?>
35
+ <div class="wdi-settings-page">
36
+ <?php if(!IS_FREE){?>
37
+ <div class="update-nag wdi_help_bar_wrap">
38
+ <p class="wdi_help_bar_text">
39
+ <?php _e('This section allows you to set API parameters.', 'wd-instagram-feed'); ?>
40
+ <a style="color: #5CAEBD; text-decoration: none;border-bottom: 1px dotted;" class="wdi_hb_t_link" target="_blank"
41
+ href="https://help.10web.io/hc/en-us/articles/360016277532-Configuring-Instagram-Access-Token?utm_source=instagram_feed&utm_medium=free_plugin"><?php _e('Read More in User Guide', 'wd-instagram-feed'); ?></a>
42
+ </p>
43
+ </div>
44
+ <?php }else{
45
+ WDILibrary::topbar();
46
+ }?>
47
+ <form method="post" action="<?php echo add_query_arg(array( 'page' => 'wdi_settings' ), 'admin.php'); ?>" class="wdi_settings_form">
48
+ <h2 class="wdi-page-title"><?php _e('Settings', 'wd-instagram-feed'); ?></h2>
49
+ <div class="wdi-connect-instagram" onclick="wdi_popup_open()"></div>
50
+ <div class="wdi-access-token-missing">
51
+ <p><?php _e('You need Access Token for using Instagram API. Click sign in with Instagram button above to get yours.', 'wd-instagram-feed'); ?></p>
52
+ <p><?php _e('This will not show your Instagram media. After that you may create your feed.', 'wd-instagram-feed'); ?></p>
53
+ </div>
54
+ <?php if ( !empty($authenticated_users_list) ) { ?>
55
+ <h2 class="wdi-page-title"><?php _e('Accounts', 'wd-instagram-feed'); ?></h2>
56
+ <ul class="wdi-accounts-list">
57
+ <?php foreach ( $authenticated_users_list as $user_name => $user ) { ?>
58
+ <li class="wdi-account-list-<?php echo $user_name ?>">
59
+ <div class="wdi-account-block">
60
+ <div>
61
+ <div class="wdi-account-user-info">
62
+ <h4 class="wdi-account-name"><?php echo $user['user_name']; ?></h4>
63
+ <p class="wdi-account-type"><?php echo $user['type']; ?> <?php _e('(New API)', 'wd-instagram-feed'); ?></p>
64
+ </div>
65
+ <div class="wdi-account-show-token">
66
+ <i class="dashicons dashicons-arrow-down-alt2"></i>
67
+ </div>
68
+ </div>
69
+ <div>
70
+ <span class="button wdi-account-remove" onclick="wdi_account_remove('<?php echo $user_name; ?>')"><?php _e('Remove', 'wd-instagram-feed'); ?></span>
71
+ </div>
72
+ </div>
73
+ <div class="wdi-account-accesstoken">
74
+ <div>
75
+ <p class="wdi-input-group">
76
+ <label><?php _e('User ID:', 'wd-instagram-feed'); ?></label>
77
+ <input type="text" value="<?php echo $user['user_id']; ?>" readonly="readonly"
78
+ onclick="this.focus();this.select()"
79
+ title="<?php _e('To copy, click the field then press Ctrl + C (PC) or Cmd + C (Mac).', 'wd-instagram-feed'); ?>">
80
+ </p>
81
+ <p class="wdi-input-group">
82
+ <label><?php _e('Access Token:', 'wd-instagram-feed'); ?></label>
83
+ <input type="text" value="<?php echo $user['access_token']; ?>" readonly="readonly"
84
+ onclick="this.focus();this.select()"
85
+ title="<?php _e('To copy, click the field then press Ctrl + C (PC) or Cmd + C (Mac).', 'wd-instagram-feed'); ?>">
86
+ </p>
87
+ <p class="wdi-input-group">
88
+ <label><?php _e('Refresh Access Token', 'wd-instagram-feed'); ?></label>
89
+ <span class="button" onclick="wdi_account_refresh('<?php echo $user_name; ?>')"><?php _e('Refresh', 'wd-instagram-feed'); ?></span>
90
+ </p>
91
+ </div>
92
+ <span class="button wdi-account-remove"
93
+ onclick="wdi_account_remove('<?php echo $user_name; ?>')"><?php _e('Remove', 'wd-instagram-feed'); ?></span>
94
+ <div class="wdi_clear"></div>
95
+ </div>
96
+ </li>
97
+ <?php } ?>
98
+ </ul>
99
+ <?php } ?>
100
+ <div class="wdi-advanced-options">
101
+ <div class="wdi-advanced-headline">
102
+ <h2 class="wdi-page-title"><?php _e('Advanced Options', 'wd-instagram-feed'); ?></h2>
103
+ <i class="dashicons dashicons-arrow-down-alt2"></i>
104
+ <span class="wdi_clear"></span>
105
+ </div>
106
+ <div class="wdi-advanced-body">
107
+ <p class="wdi-input-group">
108
+ <label><?php _e('Check for new posts every (min)', 'wd-instagram-feed'); ?></label>
109
+ <input type="text" name="<?php echo WDI_OPT . '[wdi_transient_time]' ?>" value="<?php echo $options['wdi_transient_time']; ?>">
110
+ </p>
111
+ <?php /* @ToDo It must be separate for each user */ ?>
112
+ <p class="wdi-input-group">
113
+ <label><?php _e('Reset cache with Instagram data', 'wd-instagram-feed'); ?></label>
114
+ <a href="#" id="wdi_reset_cache" class="button"><?php _e('Reset cache', 'wd-instagram-feed'); ?></a>
115
+ </p>
116
+ <p class="wdi-input-group">
117
+ <label><?php _e('Minimal role to add and manage Feeds or Themes', 'wd-instagram-feed'); ?></label>
118
+ <select name="<?php echo WDI_OPT . '[wdi_feeds_min_capability]' ?>">
119
+ <?php
120
+ foreach ( $min_capability as $capability_key => $capability_name ) {
121
+ $selected = ( $options['wdi_feeds_min_capability'] == $capability_key ) ? 'selected' : '';
122
+ ?>
123
+ <option value="<?php echo $capability_key; ?>" <?php echo $selected; ?>><?php echo $capability_name; ?></option>
124
+ <?php } ?>
125
+ </select>
126
+ <p class="wdi-input-group">
127
+ <label><?php _e('Custom CSS', 'wd-instagram-feed'); ?></label>
128
+ <textarea name="<?php echo WDI_OPT . '[wdi_custom_css]' ?>"><?php echo $options['wdi_custom_css']; ?></textarea>
129
+ </p>
130
+ <p class="wdi-input-group">
131
+ <label><?php _e('Custom JavaScript', 'wd-instagram-feed'); ?></label>
132
+ <textarea name="<?php echo WDI_OPT . '[wdi_custom_js]' ?>"><?php echo $options['wdi_custom_js']; ?></textarea>
133
+ </p>
134
+ <p class="wdi-input-group">
135
+ <label><?php _e('Uninstall', 'wd-instagram-feed'); ?></label>
136
+ <a href="<?php echo admin_url('admin.php?page=wdi_uninstall'); ?>"
137
+ class="button"><?php _e('Uninstall', 'wd-instagram-feed'); ?></a>
138
+ </p>
139
+ </div>
140
+ </div>
141
+ <input type="hidden" name="<?php echo WDI_OPT . '[wdi_user_id]' ?>" value="<?php echo $options['wdi_user_id']; ?>">
142
+ <input type="hidden" name="<?php echo WDI_OPT . '[wdi_user_name]' ?>" value="<?php echo $options['wdi_user_name']; ?>">
143
+ <input type="hidden" name="<?php echo WDI_OPT . '[wdi_access_token]' ?>" value="<?php echo $options['wdi_access_token']; ?>">
144
+ <input type="hidden" name="task" value="save">
145
+ <?php
146
+ wp_nonce_field('wdi_nonce', 'wdi_nonce');
147
+ submit_button();
148
+ ?>
149
+ </form>
150
+ </div>
151
+ <script>
152
+ jQuery(document).ready(function () {
153
+ jQuery('#wdi-personal-business-popup input[name="wdi-connect-type"]').on('click', function () {
154
+ var href = jQuery(this).val();
155
+ jQuery('#wdi-personal-business-popup .wdi-connect').attr('href', href);
156
+ });
157
+ jQuery('#wdi-personal-business-popup .wdi-radio-button .dashicons-info').hover(function () {
158
+ jQuery(this).parents('p').find('.wdi-radio-info-text').addClass('active');
159
+ }, function () {
160
+ jQuery('.wdi-radio-info-text').removeClass('active');
161
+ });
162
+ jQuery(".wdi_settings_form").submit(function () {
163
+ jQuery.ajax({
164
+ type: "POST",
165
+ url: wdi_ajax.ajax_url,
166
+ dataType: "json",
167
+ data: {
168
+ wdi_nonce: wdi_ajax.wdi_nonce,
169
+ action: "wdi_set_reset_cache"
170
+ },
171
+ success: function ( data ) {
172
+ }
173
+ });
174
+ });
175
+
176
+ <?php if(!IS_FREE):?>
177
+ jQuery('input[name ="wdi-connect-type"]').change(function() {
178
+ if(this.checked) {
179
+ jQuery(".wdi_input_group").removeClass("wdi_active");
180
+ jQuery(this).closest(".wdi_input_group").addClass("wdi_active");
181
+ }
182
+ });
183
+ <?php else:?>
184
+ jQuery(".wdi-label-business").click(function () {
185
+ window.open("https://10web.io/plugins/wordpress-instagram-feed/");
186
+ });
187
+ jQuery(".wdi-label-business").css({"cursor":"pointer"});
188
+ <?php endif;?>
189
+ });
190
+ </script>
191
+ <?php
192
+ echo $this->personal_business_popup();
193
+ }
194
+
195
+ private function personal_business_popup() {
196
+ $auth_urls = wdi_get_auth_urls();
197
+ $personal_href = $auth_urls['personal'];
198
+ $business_href = $auth_urls['business'];
199
+ ?>
200
+ <div id="wdi-personal-business-popup" class="wdi-popup">
201
+ <div class="wdi-popup-container">
202
+ <i class="wdi-popup-close" onclick="wdi_popup_close()"></i>
203
+ <h3><?php _e('Are you connecting a Personal or<br class="wdi_desktop"> Business Instagram Profile?', 'wd-instagram-feed'); ?></h3>
204
+ <div class="wdi-radio-button">
205
+ <p class="wdi-label-personal wdi_input_group wdi_active <?php echo (IS_FREE)?"wdi_free":"wdi_pro"; ?>">
206
+ <label for="wdi-personal">
207
+ <input type="radio" id="wdi-personal" name="wdi-connect-type" value="<?php echo $personal_href; ?>"
208
+ checked="checked">
209
+ <span class="wdi_account_type"><?php _e('Personal', 'wd-instagram-feed'); ?></span>
210
+ </label>
211
+ <span class="wdi_info_text"><?php _e('Used for displaying user feeds from a "Personal"<br class="wdi_desktop"> Instagram account.', 'wd-instagram-feed'); ?></span>
212
+ </p>
213
+ <p class="wdi-label-business wdi_input_group <?php echo (IS_FREE)?"wdi_free":"wdi_pro"; ?>">
214
+ <label for="wdi-business">
215
+ <input type="radio" id="wdi-business" <?php echo (IS_FREE)?"disabled":""; ?> name="wdi-connect-type" value="<?php echo $business_href; ?>">
216
+ <span class="wdi_account_type"><?php _e('Business', 'wd-instagram-feed'); ?></span>
217
+ </label>
218
+ <span class="wdi_info_text"><?php _e('Used for displaying user feeds and <span>hashtags</span><br class="wdi_desktop"> from a “Business” Instagram account.', 'wd-instagram-feed'); ?></span>
219
+ <?php if(IS_FREE):?>
220
+ <a href="#" class="wdi_paid">This option is available in Premium version</a>
221
+ <?php endif;?>
222
+ </p>
223
+ </div>
224
+ <a href="<?php echo $personal_href; ?>" class="button button-primary wdi-connect"><?php _e('Connect', 'wd-instagram-feed'); ?></a>
225
+ </div>
226
+ </div>
227
+ <?php
228
+ }
229
+ }
230
+
css/default_theme.css DELETED
@@ -1,1079 +0,0 @@
1
- .wdi_feed_theme_1 .wdi_feed_wrapper {
2
- width: 100%;
3
- background-color: #FFFFFF;
4
- text-align: left
5
- }
6
-
7
- .wdi_feed_theme_1 .wdi_feed_header {
8
- margin: 0px;
9
- padding: 5px;
10
- border: 0px solid #DDDDDD;
11
- text-align: left
12
- }
13
-
14
- .wdi_feed_theme_1 .wdi_header_text {
15
- font-size: 18px;
16
- font-style: normal;
17
- padding: 5px;
18
- color: #0F4973;
19
- font-weight: 400;
20
- line-height: 40px
21
- }
22
-
23
- .wdi_feed_theme_1 .wdi_single_user {
24
- padding-top: 5px;
25
- padding-bottom: 5px;
26
- padding-left: 5px;
27
- padding-right: 5px
28
- }
29
-
30
- .wdi_feed_theme_1 .wdi_header_hashtag h3 {
31
- margin-top: 11px
32
- }
33
-
34
- .wdi_feed_theme_1 .wdi_header_user_text h3 {
35
- font-size: 18px;
36
- font-style: normal;
37
- line-height: 18px;
38
- color: #0F4973;
39
- }
40
-
41
- .wdi_feed_theme_1 .wdi_user_img_wrap img {
42
- height: 40px;
43
- width: 40px;
44
- border-radius: 40px
45
- }
46
-
47
- .wdi_feed_theme_1 .wdi_media_info {
48
- margin-left: 50px;
49
- line-height: 18px;
50
- color: #0F4973
51
- }
52
-
53
- .wdi_feed_theme_1 .wdi_bio {
54
- color: #0F4973;
55
- font-size: 14px
56
- }
57
-
58
- .wdi_feed_theme_1 .wdi_follow_btn {
59
- border-radius: 3px;
60
- font-size: 18px;
61
- background-color: #FFFFFF;
62
- border-color: #0F4973;
63
- color: #0F4973;
64
- margin-left: 10px;
65
- padding: 0 25px
66
- }
67
-
68
- .wdi_feed_theme_1 .wdi_follow_btn:hover {
69
- border-color: #0F4973;
70
- color: #0F4973;
71
- background-color: #FFFFFF
72
- }
73
-
74
- .wdi_feed_theme_1 .wdi_filter_overlay {
75
- width: 40px;
76
- height: 40px;
77
- border-radius: 40px;
78
- background-color: #125688
79
- }
80
-
81
- .wdi_feed_theme_1 .wdi_filter_icon span {
82
- width: 40px;
83
- height: 40px
84
- }
85
-
86
- .wdi_feed_theme_1 .wdi_load_more_text {
87
- color: #1E73BE;
88
- font-size: 14px
89
- }
90
-
91
- .wdi_feed_theme_1 .wdi_load_more_text img {
92
- height: 90px;
93
- width: 90px
94
- }
95
-
96
- .wdi_feed_theme_1 .wdi_load_more_wrap:hover {
97
- background-color: transparent
98
- }
99
-
100
- .wdi_feed_theme_1 .wdi_pagination {
101
- text-align: center;
102
- color: #0F4973;
103
- font-size: 18px
104
- }
105
-
106
- .wdi_feed_theme_1 .wdi_pagination_ctrl {
107
- margin: 15px
108
- }
109
-
110
- .wdi_feed_theme_1 .wdi_pagination_ctrl:hover {
111
- color: #25292C
112
- }
113
-
114
- .wdi_feed_theme_1 .wdi_filter_active_col {
115
- color: #429FFF;
116
- border-color: #429FFF
117
- }
118
-
119
- .wdi_feed_thumbnail_1 .wdi_feed_container {
120
- width: 100%;
121
- background-color: #FFFFFF;
122
- border-bottom: 5px solid #FFFFFF;
123
- }
124
-
125
- .wdi_feed_thumbnail_1 .wdi_header_img_wrap {
126
- height: 40px;
127
- width: 40px;
128
- border-radius: 0px
129
- }
130
-
131
- .wdi_feed_thumbnail_1 .wdi_photo_wrap {
132
- padding: 5px;
133
- width: calc(100% - 2 * 5px)
134
- }
135
-
136
- .wdi_feed_thumbnail_1 .wdi_photo_wrap_inner {
137
- border: 5px solid #FFFFFF;
138
- background-color: #FFFFFF
139
- }
140
-
141
- .wdi_feed_thumbnail_1 .wdi_photo_img {
142
- border-radius: 0px
143
- }
144
-
145
- .wdi_feed_thumbnail_1 .wdi_photo_meta {
146
- background-color: #FFFFFF
147
- }
148
-
149
- .wdi_feed_thumbnail_1 .wdi_thumb_likes {
150
- width: 50%;
151
- float: left;
152
- font-size: 13px;;
153
- color: #8A8D8E
154
- }
155
-
156
- .wdi_feed_thumbnail_1 .wdi_thumb_comments {
157
- width: 50%;
158
- float: left;
159
- font-size: 13px;;
160
- color: #8A8D8E
161
- }
162
-
163
- .wdi_feed_thumbnail_1 .wdi_photo_title {
164
- font-size: 14px;
165
- color: #125688
166
- }
167
-
168
- .wdi_feed_thumbnail_1 .wdi_photo_title:hover {
169
- color: #8E8E8E
170
- }
171
-
172
- .wdi_feed_thumbnail_1 .wdi_load_more_spinner {
173
- color: #1E73BE;
174
- font-size: 18.2px
175
- }
176
-
177
- .wdi_feed_thumbnail_1 .wdi_load_more, .wdi_feed_thumbnail_1 .wdi_spinner {
178
- background-color: #FFFFFF;
179
- text-align: center
180
- }
181
-
182
- .wdi_feed_thumbnail_1 .wdi_load_more_wrap, .wdi_feed_thumbnail_1 .wdi_spinner_wrap {
183
- padding: 4px;
184
- background-color: #FFFFFF;
185
- border-radius: 500px;
186
- height: 90px;
187
- width: 90px;
188
- border: 1px solid #0F4973;
189
- }
190
-
191
- .wdi_feed_thumbnail_1 .wdi_photo_overlay:hover {
192
- background-color: rgba(18, 86, 136, 0.5)
193
- }
194
-
195
- .wdi_feed_thumbnail_1 .wdi_photo_overlay i {
196
- font-size: 25px
197
- }
198
-
199
- .wdi_feed_thumbnail_1 .wdi_photo_overlay:hover i {
200
- color: #FFFFFF
201
- }
202
-
203
- .wdi_feed_thumbnail_1 .wdi_photo_img:hover img {
204
- -webkit-transform: translateX(-50%) translateY(-50%) none;
205
- -moz-transform: translateX(-50%) translateY(-50%) none;
206
- -ms-transform: translateX(-50%) translateY(-50%) none;
207
- -o-transform: translateX(-50%) translateY(-50%) none;
208
- transform: translateX(-50%) translateY(-50%) none
209
- }
210
-
211
- .wdi_feed_thumbnail_1 .wdi_filter_active_bg {
212
- background-color: #429FFF
213
- }
214
-
215
- .wdi_feed_thumbnail_1 .wdi_media_user {
216
- color: #FFFFFF;;
217
- background-color: #429FFF;
218
- }
219
-
220
- .wdi_feed_masonry_1 .wdi_feed_container {
221
- width: 100%;
222
- background-color: #FFFFFF;
223
- border-bottom: 5px solid #FFFFFF;
224
- }
225
-
226
- .wdi_feed_masonry_1 .wdi_header_img_wrap, .wdi_feed_masonry_1 .wdi_users_img_wrap {
227
- height: 40px;
228
- width: 40px;
229
- border-radius: 0px
230
- }
231
-
232
- .wdi_feed_masonry_1 .wdi_photo_wrap {
233
- padding: 5px
234
- }
235
-
236
- .wdi_feed_masonry_1 .wdi_photo_wrap_inner {
237
- border: 0px solid gray;
238
- background-color: #FFFFFF
239
- }
240
-
241
- .wdi_feed_masonry_1 .wdi_photo_img {
242
- border-radius: 0px
243
- }
244
-
245
- .wdi_feed_masonry_1 .wdi_photo_meta {
246
- background-color: #FFFFFF
247
- }
248
-
249
- .wdi_feed_masonry_1 .wdi_thumb_likes {
250
- width: 50%;
251
- float: left;
252
- font-size: 13px;;
253
- color: #8A8D8E
254
- }
255
-
256
- .wdi_feed_masonry_1 .wdi_thumb_comments {
257
- width: 50%;
258
- float: left;
259
- font-size: 13px;;
260
- color: #8A8D8E
261
- }
262
-
263
- .wdi_feed_masonry_1 .wdi_photo_title {
264
- font-size: 14px;
265
- color: #125688
266
- }
267
-
268
- .wdi_feed_masonry_1 .wdi_photo_title:hover {
269
- color: #8E8E8E
270
- }
271
-
272
- .wdi_feed_masonry_1 .wdi_load_more_spinner {
273
- color: #1E73BE;
274
- font-size: 21px
275
- }
276
-
277
- .wdi_feed_masonry_1 .wdi_load_more, .wdi_feed_masonry_1 .wdi_spinner {
278
- background-color: #FFFFFF;
279
- text-align: center
280
- }
281
-
282
- .wdi_feed_masonry_1 .wdi_load_more_wrap, .wdi_feed_masonry_1 .wdi_spinner_wrap {
283
- padding: 4px;
284
- background-color: #FFFFFF;
285
- border-radius: 500px;
286
- height: 90px;
287
- width: 90px;
288
- border: 1px solid #0F4973;
289
- }
290
-
291
- .wdi_feed_masonry_1 .wdi_photo_overlay:hover {
292
- background-color: rgba(18, 86, 136, 0.5)
293
- }
294
-
295
- .wdi_feed_masonry_1 .wdi_photo_overlay i {
296
- font-size: 25px
297
- }
298
-
299
- .wdi_feed_masonry_1 .wdi_photo_overlay:hover i {
300
- color: #FFFFFF
301
- }
302
-
303
- .wdi_feed_masonry_1 .wdi_photo_img:hover img {
304
- transform: none
305
- }
306
-
307
- .wdi_feed_masonry_1 .wdi_filter_active_bg {
308
- background-color: #429FFF
309
- }
310
-
311
- .wdi_feed_masonry_1 .wdi_media_user {
312
- color: #FFFFFF;;
313
- background-color: #429FFF;
314
- }
315
-
316
- .wdi_feed_blog_1 .wdi_feed_container {
317
- width: 100%;
318
- background-color: #FFFFFF
319
- }
320
-
321
- .wdi_feed_blog_1 .wdi_header_img_wrap, .wdi_feed_blog_1 .wdi_users_img_wrap {
322
- height: 40px;
323
- width: 40px;
324
- border-radius: 0px
325
- }
326
-
327
- .wdi_feed_blog_1 .wdi_photo_wrap {
328
- padding: 5px
329
- }
330
-
331
- .wdi_feed_blog_1 .wdi_photo_wrap_inner {
332
- border: 0px solid gray;
333
- background-color: #FFFFFF
334
- }
335
-
336
- .wdi_feed_blog_1 .wdi_photo_img {
337
- border-radius: 0px
338
- }
339
-
340
- .wdi_feed_blog_1 .wdi_photo_meta {
341
- background-color: #FFFFFF
342
- }
343
-
344
- .wdi_feed_blog_1 .wdi_thumb_likes {
345
- width: 50%;
346
- float: left;
347
- font-size: 20px;;
348
- color: #8A8D8E
349
- }
350
-
351
- .wdi_feed_blog_1 .wdi_thumb_comments {
352
- width: 50%;
353
- float: left;
354
- font-size: 20px;;
355
- color: #8A8D8E
356
- }
357
-
358
- .wdi_feed_blog_1 .wdi_photo_title {
359
- font-size: 16px;
360
- color: #125688
361
- }
362
-
363
- .wdi_feed_blog_1 .wdi_photo_title:hover {
364
- color: #8E8E8E
365
- }
366
-
367
- .wdi_feed_blog_1 .wdi_load_more_spinner {
368
- color: #1E73BE;
369
- font-size: 21px
370
- }
371
-
372
- .wdi_feed_blog_1 .wdi_load_more, .wdi_feed_blog_1 .wdi_spinner {
373
- background-color: #FFFFFF;
374
- text-align: center
375
- }
376
-
377
- .wdi_feed_blog_1 .wdi_load_more_wrap, .wdi_feed_blog_1 .wdi_spinner_wrap {
378
- padding: 4px;
379
- background-color: #FFFFFF;
380
- border-radius: 500px;
381
- height: 90px;
382
- width: 90px;
383
- border: 1px solid #0F4973;
384
- }
385
-
386
- .wdi_feed_browser_1 .wdi_feed_container {
387
- width: 100%;
388
- background-color: #FFFFFF;
389
- border-bottom: 5px solid #FFFFFF;
390
- }
391
-
392
- .wdi_feed_browser_1 .wdi_header_img_wrap, .wdi_feed_browser_1 .wdi_users_img_wrap {
393
- height: 40px;
394
- width: 40px;
395
- border-radius: 0px
396
- }
397
-
398
- .wdi_feed_browser_1 .wdi_photo_wrap {
399
- padding: 5px
400
- }
401
-
402
- .wdi_feed_browser_1 .wdi_photo_wrap_inner {
403
- border: 0px solid gray;
404
- background-color: #FFFFFF
405
- }
406
-
407
- .wdi_feed_browser_1 .wdi_photo_img {
408
- border-radius: 0px
409
- }
410
-
411
- .wdi_feed_browser_1 .wdi_photo_meta {
412
- background-color: #FFFFFF
413
- }
414
-
415
- .wdi_feed_browser_1 .wdi_thumb_likes {
416
- width: 50%;
417
- float: left;
418
- font-size: 20px;;
419
- color: #8A8D8E
420
- }
421
-
422
- .wdi_feed_browser_1 .wdi_thumb_comments {
423
- width: 50%;
424
- float: left;
425
- font-size: 20px;;
426
- color: #8A8D8E
427
- }
428
-
429
- .wdi_feed_browser_1 .wdi_photo_title {
430
- font-size: 16px;
431
- color: #125688
432
- }
433
-
434
- .wdi_feed_browser_1 .wdi_photo_title:hover {
435
- color: #8E8E8E
436
- }
437
-
438
- .wdi_feed_browser_1 .wdi_load_more {
439
- background-color: #FFFFFF;
440
- text-align: center
441
- }
442
-
443
- .wdi_feed_browser_1 .wdi_load_more_wrap {
444
- padding: 4px;
445
- background-color: #FFFFFF;
446
- border-radius: 500px;
447
- height: 90px;
448
- width: 90px;
449
- border: 1px solid #0F4973;
450
- }
451
-
452
- .wdi_spider_popup_wrap * {
453
- -moz-box-sizing: border-box;
454
- -webkit-box-sizing: border-box;
455
- box-sizing: border-box
456
- }
457
-
458
- .wdi_feed_theme_1 .wdi_spider_popup_overlay {
459
- background-color: #25292C;
460
- opacity: 0.9
461
- }
462
-
463
- .wdi_lightbox_theme_1.wdi_spider_popup_wrap {
464
- background-color: #FFFFFF;
465
- display: inline-block;
466
- left: 50%;
467
- outline: medium none;
468
- position: fixed;
469
- text-align: center;
470
- top: 50%;
471
- z-index: 100000
472
- }
473
-
474
- .wdi_lightbox_theme_1 .wdi_ctrl_btn {
475
- color: #FFFFFF;
476
- font-size: 20px;
477
- margin: 10px 7px;
478
- opacity: 1.00;
479
- filter: Alpha(opacity=100)
480
- }
481
-
482
- .wdi_lightbox_theme_1 .wdi_toggle_btn {
483
- color: #FFFFFF;
484
- font-size: 14px;
485
- margin: 0;
486
- opacity: 1.00;
487
- filter: Alpha(opacity=100);
488
- padding: 0
489
- }
490
-
491
- .wdi_btn_container {
492
- bottom: 0;
493
- left: 0;
494
- overflow: hidden;
495
- position: absolute;
496
- right: 0;
497
- top: 0
498
- }
499
-
500
- .wdi_lightbox_theme_1 .wdi_ctrl_btn_container {
501
- background-color: rgba(42, 91, 131, 0.80);
502
- bottom: 0;
503
- border-top-left-radius: 4px;
504
- border-top-right-radius: 4px;
505
- height: 40px;
506
- position: absolute;
507
- text-align: center;
508
- width: 100%;
509
- z-index: 10150;
510
- padding: 8px;
511
- }
512
-
513
- .wdi_lightbox_theme_1 .wdi_toggle_container {
514
- background: none repeat scroll 0 0 #2A5B83;
515
- border-top-left-radius: 4px;
516
- border-top-right-radius: 4px;
517
- border-radius: 4px;
518
- bottom: 40px;
519
- cursor: pointer;
520
- left: 50%;
521
- line-height: 0;
522
- margin-left: -50px;
523
- opacity: 0.80;
524
- filter: Alpha(opacity=80);
525
- position: absolute;
526
- text-align: center;
527
- width: 100px;
528
- z-index: 10150
529
- }
530
-
531
- .wdi_lightbox_theme_1 .wdi_close_btn {
532
- opacity: 1.00;
533
- filter: Alpha(opacity=100)
534
- }
535
-
536
- .wdi_lightbox_theme_1 .wdi_spider_popup_close {
537
- background-color: #2A5B83;
538
- border-radius: 16px;
539
- border: 2px none #FFFFFF;
540
- box-shadow: none;
541
- color: #FFFFFF;
542
- height: 20px;
543
- font-size: 15px;
544
- right: -10px;
545
- top: -10px;
546
- width: 20px
547
- }
548
-
549
- .wdi_lightbox_theme_1 .wdi_spider_popup_close_fullscreen {
550
- color: #000000;
551
- font-size: 15px;
552
- right: 15px
553
- }
554
-
555
- .wdi_spider_popup_close span, #wdi_spider_popup_left-ico span, #wdi_spider_popup_right-ico span {
556
- display: table-cell;
557
- text-align: center;
558
- vertical-align: middle
559
- }
560
-
561
- .wdi_lightbox_theme_1 #wdi_spider_popup_left-ico, .wdi_lightbox_theme_1 #wdi_spider_popup_right-ico {
562
- background-color: #2A5B83;
563
- border-radius: 20px;
564
- border: 0px none #FFFFFF;
565
- box-shadow: none;
566
- color: #FFFFFF;
567
- height: 40px;
568
- font-size: 20px;
569
- width: 40px;
570
- opacity: 0.80;
571
- filter: Alpha(opacity=80)
572
- }
573
-
574
- .wdi_lightbox_theme_1 .wdi_ctrl_btn:hover, .wdi_lightbox_theme_1 .wdi_toggle_btn:hover, .wdi_lightbox_theme_1 #wdi_spider_popup_left-ico:hover, .wdi_lightbox_theme_1 #wdi_spider_popup_right-ico:hover {
575
- color: #25292C;
576
- cursor: pointer
577
- }
578
-
579
- .wdi_lightbox_theme_1 .wdi_spider_popup_close:hover, .wdi_lightbox_theme_1 .wdi_spider_popup_close_fullscreen:hover {
580
- color: #000000;
581
- cursor: pointer
582
- }
583
-
584
- .wdi_image_wrap {
585
- height: inherit;
586
- display: table;
587
- position: absolute;
588
- text-align: center;
589
- width: inherit
590
- }
591
-
592
- .wdi_image_wrap * {
593
- -moz-user-select: none;
594
- -khtml-user-select: none;
595
- -webkit-user-select: none;
596
- -ms-user-select: none;
597
- user-select: none
598
- }
599
-
600
- .wdi_embed_frame {
601
- text-align: center
602
- }
603
-
604
- .wdi_comment_wrap {
605
- bottom: 0;
606
- left: 0;
607
- overflow: hidden;
608
- position: absolute;
609
- right: 0;
610
- top: 0;
611
- z-index: -1
612
- }
613
-
614
- .wdi_lightbox_theme_1 .wdi_comment_container {
615
- -moz-box-sizing: border-box;
616
- background-color: #FFFFFF;
617
- color: #000000;
618
- font-size: 12px;
619
- font-family: segoe ui;
620
- height: 100%;
621
- overflow: hidden;
622
- position: absolute;
623
- right: -400px;
624
- top: 0;
625
- width: 400px;
626
- z-index: 10103
627
- }
628
-
629
- .wdi_lightbox_theme_1 .wdi_comments {
630
- bottom: 0;
631
- font-size: 12px;
632
- font-family: segoe ui;
633
- height: 100%;
634
- left: 0;
635
- overflow-x: hidden;
636
- overflow-y: auto;
637
- position: absolute;
638
- top: 0;
639
- width: 100%;
640
- z-index: 10101
641
- }
642
-
643
- .wdi_comments p, .wdi_comment_body_p {
644
- margin: 5px !important;
645
- text-align: left;
646
- word-wrap: break-word;
647
- word-break: break-word
648
- }
649
-
650
- .wdi_no_comment {
651
- text-align: center !important
652
- }
653
-
654
- .wdi_lightbox_theme_1 .wdi_comments input[type="submit"] {
655
- background: none repeat scroll 0 0 #616161;
656
- border: 1px none #666666;
657
- border-radius: 3px;
658
- color: #000000;
659
- cursor: pointer;
660
- padding: 3px 10px
661
- }
662
-
663
- .wdi_lightbox_theme_1 .wdi_comments input[type="text"], .wdi_lightbox_theme_1 .wdi_comments textarea {
664
- background: none repeat scroll 0 0 #333333;
665
- border: 1px none #666666;
666
- border-radius: 0px;
667
- color: #000000;
668
- padding: 2px;
669
- width: 100%
670
- }
671
-
672
- .wdi_comments textarea {
673
- resize: vertical
674
- }
675
-
676
- .wdi_lightbox_theme_1 .wdi_comment_header_p {
677
- border-top: 1px solid #125688
678
- }
679
-
680
- .wdi_lightbox_theme_1 .wdi_comment_header {
681
- margin-top: 2px;
682
- display: inline-block;
683
- color: #000000;
684
- font-size: 14px
685
- }
686
-
687
- .wdi_lightbox_theme_1 .wdi_comment_date {
688
- color: #000000;
689
- float: right;
690
- font-size: 10px
691
- }
692
-
693
- .wdi_lightbox_theme_1 .wdi_comment_body {
694
- color: #000000;
695
- font-size: 12px
696
- }
697
-
698
- .wdi_comment_delete_btn {
699
- color: #FFFFFF;
700
- cursor: pointer;
701
- float: right;
702
- font-size: 14px;
703
- margin: 2px
704
- }
705
-
706
- .wdi_lightbox_theme_1 .wdi_comments_close {
707
- cursor: pointer;
708
- line-height: 0;
709
- position: absolute;
710
- font-size: 13px;
711
- text-align: left;
712
- margin: 5px;
713
- left: 0;
714
- top: 0;
715
- background-color: #FFFFFF;
716
- z-index: 10202
717
- }
718
-
719
- .wdi_comments_close i {
720
- z-index: 10201
721
- }
722
-
723
- .wdi_comment_textarea::-webkit-scrollbar {
724
- width: 4px
725
- }
726
-
727
- .wdi_comment_textarea::-webkit-scrollbar-track {
728
- }
729
-
730
- .wdi_comment_textarea::-webkit-scrollbar-thumb {
731
- background-color: rgba(255, 255, 255, 0.55);
732
- border-radius: 2px
733
- }
734
-
735
- .wdi_comment_textarea::-webkit-scrollbar-thumb:hover {
736
- background-color: #D9D9D9
737
- }
738
-
739
- .wdi_ctrl_btn_container a, .wdi_ctrl_btn_container a:hover {
740
- text-decoration: none
741
- }
742
-
743
- .wdi_facebook:hover {
744
- color: #3B5998 !important;
745
- cursor: pointer
746
- }
747
-
748
- .wdi_twitter:hover {
749
- color: #4099FB !important;
750
- cursor: pointer
751
- }
752
-
753
- .wdi_google:hover {
754
- color: #DD4B39 !important;
755
- cursor: pointer
756
- }
757
-
758
- .wdi_pinterest:hover {
759
- color: #CB2027 !important;
760
- cursor: pointer
761
- }
762
-
763
- .wdi_tumblr:hover {
764
- color: #2F5070 !important;
765
- cursor: pointer
766
- }
767
-
768
- .wdi_linkedin:hover {
769
- color: #0077B5 !important;
770
- cursor: pointer
771
- }
772
-
773
- .wdi_lightbox_theme_1 .wdi_facebook, .wdi_lightbox_theme_1 .wdi_twitter, .wdi_lightbox_theme_1 .wdi_google, .wdi_lightbox_theme_1 .wdi_pinterest, .wdi_lightbox_theme_1 .wdi_tumblr, .wdi_lightbox_theme_1 .wdi_linkedin {
774
- color: #FFFFFF !important
775
- }
776
-
777
- .wdi_lightbox_theme_1 .wdi_thumb_active {
778
- opacity: 1;
779
- filter: Alpha(opacity=100);
780
- border: 0px solid #FFFFFF
781
- }
782
-
783
- .wdi_lightbox_theme_1 .wdi_thumb_deactive {
784
- opacity: 0.70;
785
- filter: Alpha(opacity=70)
786
- }
787
-
788
- .wdi_lightbox_theme_1 .wdi_filmstrip_thumbnail_img {
789
- display: block;
790
- opacity: 1;
791
- filter: Alpha(opacity=100)
792
- }
793
-
794
- .wdi_lightbox_theme_1 .wdi_filmstrip_left i, .wdi_lightbox_theme_1 .wdi_filmstrip_right i {
795
- color: #FFFFFF;
796
- font-size: 20px
797
- }
798
-
799
- .wdi_none_selectable {
800
- -webkit-touch-callout: none;
801
- -webkit-user-select: none;
802
- -khtml-user-select: none;
803
- -moz-user-select: none;
804
- -ms-user-select: none;
805
- user-select: none
806
- }
807
-
808
- .wdi_slide_container {
809
- display: table-cell;
810
- position: absolute;
811
- vertical-align: middle;
812
- width: 100%;
813
- height: 100%
814
- }
815
-
816
- .wdi_slide_bg {
817
- margin: 0 auto;
818
- width: inherit;
819
- height: inherit
820
- }
821
-
822
- .wdi_slider {
823
- height: inherit;
824
- width: inherit
825
- }
826
-
827
- .wdi_popup_image_spun {
828
- height: inherit;
829
- display: table-cell;
830
- filter: Alpha(opacity=100);
831
- opacity: 1;
832
- position: absolute;
833
- vertical-align: middle;
834
- width: inherit;
835
- z-index: 2
836
- }
837
-
838
- .wdi_popup_image_second_spun {
839
- width: inherit;
840
- height: inherit;
841
- display: table-cell;
842
- filter: Alpha(opacity=0);
843
- opacity: 0;
844
- position: absolute;
845
- vertical-align: middle;
846
- z-index: 1
847
- }
848
-
849
- .wdi_grid {
850
- display: none;
851
- height: 100%;
852
- overflow: hidden;
853
- position: absolute;
854
- width: 100%
855
- }
856
-
857
- .wdi_gridlet {
858
- opacity: 1;
859
- filter: Alpha(opacity=100);
860
- position: absolute
861
- }
862
-
863
- .wdi_lightbox_theme_1 .wdi_image_info_spun {
864
- text-align: right;
865
- vertical-align: top
866
- }
867
-
868
- .wdi_lightbox_theme_1 .wdi_image_title, .wdi_lightbox_theme_1 .wdi_image_title * {
869
- color: #FFFFFF !important;
870
- font-family: segoe ui;
871
- font-size: 13px;
872
- font-weight: bold
873
- }
874
-
875
- .wdi_lightbox_theme_1 .wdi_image_description, .wdi_lightbox_theme_1 .wdi_image_description * {
876
- color: #FFFFFF !important;
877
- font-family: segoe ui;
878
- font-size: 14px;
879
- font-weight: normal
880
- }
881
-
882
- .wdi_title {
883
- display: inline-table
884
- }
885
-
886
- .wdi_title:hover {
887
- cursor: pointer
888
- }
889
-
890
- .wdi_title .wdi_users_img_wrap {
891
- width: 50px;
892
- display: table-cell;
893
- vertical-align: middle;
894
- float: right;
895
- padding-left: 10px;
896
- overflow: hidden
897
- }
898
-
899
- .wdi_title .wdi_users_img_wrap img {
900
- width: 100%
901
- }
902
-
903
- .wdi_title .wdi_header_text {
904
- display: table-cell;
905
- vertical-align: middle;
906
- word-break: break-all
907
- }
908
-
909
- .wdi_lightbox_theme_1 .wdi_share_btns {
910
- position: absolute;
911
- top: -115%;
912
- width: 150px;
913
- border-radius: 3px;
914
- left: -150%;
915
- margin: 0;
916
- z-index: 200000;
917
- background-color: rgba(42, 91, 131, 0.80)
918
- }
919
-
920
- .wdi_share_btns_container {
921
- position: relative;
922
- display: inline-block
923
- }
924
-
925
- .wdi_lightbox_theme_1 .wdi_share_popup_btn {
926
- color: #FFFFFF;
927
- padding: 3px;
928
- opacity: 1.00;
929
- filter: Alpha(opacity=100);
930
- font-size: 20px
931
- }
932
-
933
- .wdi_lightbox_theme_1 .wdi_share_caret {
934
- font-size: 15px;
935
- color: #2A5B83;
936
- opacity: 0.80;
937
- position: absolute;
938
- top: -25px;
939
- left: 13px
940
- }
941
-
942
- .wdi_share_toggler {
943
- display: block !important
944
- }
945
-
946
- .wdi_facebook_btn:hover {
947
- color: #45619D
948
- }
949
-
950
- .wdi_facebook_btn:hover {
951
- color: #4099FB
952
- }
953
-
954
- .wdi_lightbox_theme_1 .wdi_comment_header a, .wdi_lightbox_theme_1 .wdi_comment_header a:visited {
955
- color: #125688 !important
956
- }
957
-
958
- .wdi_lightbox_theme_1 .wdi_comm_text_link, .wdi_lightbox_theme_1 a.wdi_comm_text_link:visited {
959
- color: #125688 !important
960
- }
961
-
962
- .wdi_lightbox_theme_1 .wdi_comment_header a:hover, .wdi_lightbox_theme_1 a.wdi_comm_text_link:hover {
963
- text-decoration: none;
964
- color: #002160 !important
965
- }
966
-
967
- .wdi_lightbox_theme_1 .wdi_load_more_comments {
968
- display: inline-block;
969
- color: #125688;
970
- background-color: #FFFFFF;
971
- -webkit-user-select: none;
972
- -moz-user-select: none;
973
- -ms-user-select: none;
974
- -o-user-select: none;
975
- user-select: none;
976
- font-family: 'Verdana', sans-serif;
977
- text-transform: capitalize;
978
- font-size: 17px
979
- }
980
-
981
- .wdi_lightbox_theme_1 .wdi_load_more_comments:hover {
982
- color: #000000;
983
- cursor: pointer
984
- }
985
-
986
- .wdi_popup_image {
987
- vertical-align: middle;
988
- display: inline-block
989
- }
990
-
991
- .wdi_popup_embed {
992
- vertical-align: middle;
993
- text-align: center;
994
- display: inline-block
995
- }
996
-
997
- .wdi_image_container {
998
- display: table;
999
- position: absolute;
1000
- text-align: center;
1001
- vertical-align: middle;
1002
- width: 100%
1003
- }
1004
-
1005
- .wdi_lightbox_theme_1 .wdi_filmstrip_container {
1006
- display: table;
1007
- position: absolute;
1008
- z-index: 10105;
1009
- top: 0
1010
- }
1011
-
1012
- .wdi_filmstrip {
1013
- overflow: hidden;
1014
- position: absolute;
1015
- z-index: 10106
1016
- }
1017
-
1018
- .wdi_filmstrip_thumbnails {
1019
- margin: 0 auto;
1020
- overflow: hidden;
1021
- position: relative
1022
- }
1023
-
1024
- .wdi_lightbox_theme_1 .wdi_filmstrip_thumbnail {
1025
- position: relative;
1026
- background: none;
1027
- border: 1px solid #25292C;
1028
- border-radius: 0px;
1029
- cursor: pointer;
1030
- float: left;
1031
- margin: 0 1px;
1032
- overflow: hidden
1033
- }
1034
-
1035
- .wdi_lightbox_theme_1 .wdi_filmstrip_left {
1036
- background-color: #3B3B3B;
1037
- cursor: pointer;
1038
- display: table-cell;
1039
- vertical-align: middle;
1040
- z-index: 10106
1041
- }
1042
-
1043
- .wdi_lightbox_theme_1 .wdi_filmstrip_right {
1044
- background-color: #3B3B3B;
1045
- cursor: pointer;
1046
- right: 0;
1047
- display: table-cell;
1048
- vertical-align: middle;
1049
- z-index: 10106
1050
- }
1051
-
1052
- .wdi_lightbox_theme_1 .wdi_image_info {
1053
- background: rgba(59, 59, 59, 0.80);
1054
- border: 1px none #3B3B3B;
1055
- border-radius: 5px;
1056
- padding: 5px;
1057
- overflow: auto
1058
- }
1059
-
1060
- @media (max-width: 480px) {
1061
- .wdi_image_count_container {
1062
- display: none
1063
- }
1064
-
1065
- .wdi_image_title, .wdi_image_title * {
1066
- font-size: 12px
1067
- }
1068
-
1069
- .wdi_image_description, .wdi_image_description * {
1070
- font-size: 10px
1071
- }
1072
- }
1073
-
1074
- .wdi_image_count_container {
1075
- left: 0;
1076
- line-height: 1;
1077
- position: absolute;
1078
- vertical-align: middle
1079
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/instagram.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="30.3" height="30.3" viewBox="0 0 30.3 30.3"><defs><style>.a{fill:#fff;}</style></defs><path class="a" d="M20.831,0H9.469A9.47,9.47,0,0,0,0,9.469V20.831A9.47,9.47,0,0,0,9.469,30.3H20.831A9.47,9.47,0,0,0,30.3,20.831V9.469A9.47,9.47,0,0,0,20.831,0Zm6.628,20.831a6.635,6.635,0,0,1-6.628,6.628H9.469a6.635,6.635,0,0,1-6.628-6.628V9.469A6.635,6.635,0,0,1,9.469,2.841H20.831a6.635,6.635,0,0,1,6.628,6.628Z"/><path class="a" d="M135.575,128a7.575,7.575,0,1,0,7.575,7.575A7.575,7.575,0,0,0,135.575,128Zm0,12.309a4.734,4.734,0,1,1,4.734-4.734A4.741,4.741,0,0,1,135.575,140.309Z" transform="translate(-120.425 -120.425)"/><circle class="a" cx="1.009" cy="1.009" r="1.009" transform="translate(22.284 5.998)"/></svg>
css/wdi_backend.css CHANGED
@@ -1,4 +1,6 @@
1
- .wdi_clear{
 
 
2
  clear: both;
3
  }
4
  .wdi_clear_tag:after{
@@ -6,163 +8,131 @@
6
  display:table;
7
  clear: both;
8
  }
9
- #wdi_unistall{
10
  background-color: #D82121;
11
  border-color: #D31818;
12
- box-shadow: inset 0 1px 0 rgba(230, 120, 120, 0.5),0 1px 0 rgba(0,0,0,.15);
13
  }
14
- #wdi_unistall:hover{
 
15
  background-color: #DA1313;
16
  }
17
- #wdi_unistall_table th{
 
18
  width: 45%;
19
  }
20
 
21
- .display_type_content {
22
- background: #fff;
23
- border: 1px solid #dedede;
24
- margin-bottom: 15px;
25
- }
26
 
27
  /*tooltip css*/
28
  .wdi_tooltip,
29
  .wdi_settings_link {
30
- display: block;
31
- font-size: 14px !important;
32
- font-weight: bold;
33
- line-height: 20px;
34
- margin-bottom: 5px;
35
- color: #444;
36
- text-decoration: none;
37
- }
38
- p.wdi_about_filed {
39
- font-size: 13px;
40
- font-style: italic;
41
- }
42
- .wdi_tooltip:hover,.wdi_settings_link:hover {
43
- color: rgb(35, 40, 45);
44
- position: relative;
45
- }
46
- .wdi_tooltip:hover:after {
47
- content: attr(wdi-tooltip);
48
- padding: 4px 8px;
49
- color: #dbdbe0;
50
- position: absolute;
51
- left: 0;
52
- top: 100%;
53
- white-space: nowrap;
54
- z-index: 20;
55
- -moz-border-radius: 3px;
56
- -webkit-border-radius: 3px;
57
- border-radius: 2px;
58
- -moz-box-shadow: 0px 0px 4px #222;
59
- -webkit-box-shadow: 0px 0px 4px #222;
60
- box-shadow: 0px 0px 4px rgba(0,0,0,0.5);
61
- background-color: rgba(0,0,0,0.75);
62
- font-size: 12px;
63
- }
64
- .wdi_pro_only{
65
- font-style: italic;
66
- color: #4E4E4E !important;
67
- background-color: #cccccc !important;
68
  text-decoration: none;
69
  }
70
- .wdi_pro_only_op{
71
- opacity: 0.6;
72
- }
73
- .wdi_pro_notice{
74
- text-align: right;
75
- color: #15699F;
76
- font-size: 20px !important;
77
- padding: 10px;
78
- }
79
- .wdi_pro_only_btn{
80
- background-color: #c5c0c0 !important;
81
- border-top-color: #c5c0c0 !important;
82
- }
83
- .wdi-pro-overlay img{
84
- opacity: 0.7;
85
  }
86
 
 
 
 
 
 
87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
 
89
  /*feeds page*/
90
- #wdi_feed_users{
91
- width: 100%;
 
 
 
 
92
  margin-top: 2px;
93
  }
94
 
95
  #wdi_feed_tabs .wdi_feed_tabs {
96
- border: 1px solid #F1F1F1;
97
- color: #444;
98
- cursor: pointer;
99
- font-size: 13px;
100
- font-weight: bold;
101
- padding: 12px;
102
- background: #fff;
103
- text-decoration: none;
104
- display: inline-block;
105
  }
106
  #wdi_feed_tabs {
107
- margin: 16px 0;
108
  }
109
  #wdi_feed_tabs .wdi_feed_tab_active,
110
  #wdi_feed_tabs .wdi_feed_tabs:hover {
111
- background: none repeat scroll 0 0 #FFFFFF;
112
- /*border: 1px solid #46ACC3;*/
113
  color: #9a2465;
114
  }
115
-
116
- #how_to_publish_tab .wdi_howto_container .wdi_howto_content .wdi_howto_wrapper{
117
- max-width: 270px;
118
- margin: 0 auto;
119
- }
120
-
121
- #how_to_publish_tab .wdi_howto_container .wdi_howto_content .wdi_howto_wrapper img{
122
- max-width: 100%;
123
- }
124
-
125
  #wdi_feed_tabs .wdi_feed_tab_title{
126
  margin-top: 1px;
127
  display: inline-block;
128
  }
129
-
130
- .wdi_border_wrapper [scope='row'] + td, .wdi_border_wrapper [scope='row'] {
131
- padding: 8px;
132
- }
133
- .display_type_container.wdi_clear_tag {
134
- display: table;
135
- margin: 10px auto;
136
- }
137
- .display_type_container > div {
138
- float: left;
139
- margin-right: 15px;
140
  }
141
 
142
  .wdi_user {
143
- border: 1px solid rgb(185, 185, 185);
144
- background-color: rgba(0, 0, 0, .05);
145
- margin: 0px 4px 0 0;
146
- border-radius: 5px;
147
- height: 28px;
148
- position: relative;
149
- display: inline-block;
150
- }
151
- .wdi_user:hover{
 
152
  background-color: rgba(0, 0, 0, .08);
153
  }
154
- .wdi_user a{
 
 
 
 
155
  text-decoration: none;
156
  color: black;
157
  line-height: 28px;
158
- width:70%;
159
  margin-left: 12%;
160
  margin-right: 18%;
161
  height: 100%;
162
  display: table-row;
163
  padding-right: 3px;
164
  }
165
- .wdi_user .wdi_profile_pic{
 
166
  width: 20px;
167
  height: 20px;
168
  top: 4px;
@@ -171,14 +141,17 @@ border: 1px solid rgb(185, 185, 185);
171
  vertical-align: middle;
172
  display: table-cell;
173
  }
174
- .wdi_user span{
 
175
  display: table-cell;
176
  vertical-align: middle;
177
  left: 55px;
178
  font-weight: bold;
179
  font-size: 14px;
180
  }
181
- .wdi_user .wdi_remove_user,.wdi_user .wdi_check_thumb_user{
 
 
182
  position: absolute;
183
  right: 4px;
184
  width: 15px;
@@ -186,56 +159,49 @@ border: 1px solid rgb(185, 185, 185);
186
  top: 6.5px;
187
  transition: all 0.1s ease;
188
  }
 
189
  .wdi_user .wdi_remove_user:hover {
190
  cursor: pointer;
191
- transform: rotate(180deg);
192
- /*top: 6px;*/
193
  }
194
- .wdi_user .wdi_check_thumb_user:hover{
 
195
  cursor: pointer;
196
  }
197
- .wdi_user .wdi_check_thumb_user{
 
198
  left: 4px;
199
  }
200
 
201
  .wdi_border_wrapper [scope='row'] {
202
- padding: 2px;
203
- font-size: 13px;
204
- min-width: 250px;
205
  }
206
- .wdi_border_wrapper [scope='row'] + td, .wdi_border_wrapper [scope='row'] {
207
- padding: 2px;
 
 
208
  }
209
 
210
  /*.notice {*/
211
- /*display: inline-block;*/
212
- /*line-height: 19px;*/
213
- /*font-size: 14px;*/
214
- /*text-align: left;*/
215
- /*background-color: #fff;*/
216
- /*border-left: 4px solid #ffba00;*/
217
- /*-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);*/
218
- /*box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);*/
219
  /*}*/
220
 
221
-
222
- .small_input{
223
  width: 60px;
224
  text-align: center;
225
  }
226
- .display_type{
227
- text-align: center;
228
- }
229
-
230
- .wdi_access_token_missing{
231
- font-size: 14px;
232
- color: #000000;
233
- clear: both;
234
- max-width: 720px;
235
- }
236
 
237
- .instagram-feed_page_wdi_settings form{
238
- width: 65%;
239
  }
240
 
241
  .instagram-feed_page_wdi_settings table td{
@@ -253,12 +219,23 @@ border: 1px solid rgb(185, 185, 185);
253
  {
254
  float: right;
255
  }
256
-
 
 
 
 
 
 
 
 
 
 
 
257
  #login_with_instagram {
258
  height: 43px;
259
  }
260
 
261
- #login_with_instagram .wdi_sign_in_button{
262
  background-image: url('../images/sign_in_with_instagram.png');
263
  background-repeat: no-repeat;
264
  background-position: left top;
@@ -266,13 +243,13 @@ border: 1px solid rgb(185, 185, 185);
266
  height: 43px;
267
  display:inline-block;
268
  float: left;
 
269
  }
270
 
271
  #login_with_instagram .wdi_sign_in_button:hover {
272
- /*background-image: url('../images/sign_in_with_instagram_hover.png');*/
273
  }
274
 
275
-
276
  #login_with_instagram .wdi_default_feed_button,
277
  #login_with_instagram .wdi_edit_default_feed_button{
278
 
@@ -311,12 +288,7 @@ border: 1px solid rgb(185, 185, 185);
311
  padding-bottom: 5px;
312
  }
313
 
314
- .wdi_element_name_hashtag_top_recent{
315
- display: none;
316
- }
317
-
318
 
319
- /*
320
  .wdi_multiple_accounts_section tr:not(:first-child) th{
321
  font-style: italic;
322
  }
@@ -377,13 +349,6 @@ border: 1px solid rgb(185, 185, 185);
377
  margin-left: 15px;
378
  }
379
 
380
- #wdi_reset_access_token {
381
- margin-top: 0;
382
- float: left;
383
- width: 232px;
384
- text-align: center;
385
- }
386
-
387
  .wdi_advanced_option {
388
  width: 100%;
389
  position: relative;
@@ -453,21 +418,11 @@ border: 1px solid rgb(185, 185, 185);
453
  display: none;
454
  }
455
 
456
- .instagram-feed_page_wdi_settings form h2 {
457
- display: none;
458
- }
459
-
460
  #wdi_options_page_buttons_wrapper{
461
  margin-top: 10px;
462
  width: 700px;
463
  }
464
 
465
-
466
- .wdi_hide{
467
- display: none;
468
- }
469
-
470
-
471
  /*---------------------------------------------------------
472
  ------------------Conditional Filters Ui-------------------
473
  ---------------------------------------------------------*/
@@ -491,17 +446,17 @@ border: 1px solid rgb(185, 185, 185);
491
  .wdi_filter_radio label {
492
  vertical-align: text-bottom;
493
  }
494
-
495
- .wdi_filter_input {
496
- margin-top: 10px;
 
 
497
  }
498
 
499
  .wdi_filter_input input {
500
- height: 28px;
501
  width: 250px;
502
  margin-right: 0;
503
  padding-right: 0;
504
- line-height: 28px;
505
  }
506
  #wdi_filter_type{
507
  line-height: 28px;
@@ -530,8 +485,8 @@ border: 1px solid rgb(185, 185, 185);
530
  }
531
  .wdi_logic{
532
  display: inline-block;
533
- padding: 5px;
534
- font-weight: bold;
535
  }
536
  .wdi_filter_by_location {
537
  background-color: #509833;
@@ -563,17 +518,23 @@ border: 1px solid rgb(185, 185, 185);
563
 
564
 
565
  .wdi_source_user{
 
 
 
 
 
566
  display: inline-block;
567
- padding: 5px;
568
  }
569
  .wdi_source_img{
570
  display: inline-block;
571
  }
572
  .wdi_source_img img{
573
- width: 30px;
574
- height: 30px;
575
  border-radius: 15px;
576
  display: block;
 
577
  }
578
  .wdi_source_username{
579
  display: inline-block;
@@ -591,7 +552,6 @@ border: 1px solid rgb(185, 185, 185);
591
  }
592
 
593
 
594
-
595
  .wdi_help_bar_wrap {
596
  background-color: #ffffff;
597
  border: none;
@@ -603,9 +563,11 @@ border: 1px solid rgb(185, 185, 185);
603
  line-height: 30px;
604
  padding: 15px;
605
  vertical-align: middle;
606
- width: 100%;
607
  margin: 20px 0 0 0;
608
-
 
 
609
  }
610
  .wdi_help_bar_text{
611
  float:left;
@@ -615,8 +577,8 @@ border: 1px solid rgb(185, 185, 185);
615
  text-decoration: none;
616
  }
617
  .wdi_hb_buy_pro{
 
618
  padding:0;
619
- margin-top: 50px;
620
  }
621
 
622
  .wdi_hb_buy_pro a,
@@ -656,218 +618,217 @@ border: 1px solid rgb(185, 185, 185);
656
  #rl_butt_type,
657
  #rl_butt_color,
658
  #rl_butt_style {
659
- margin: 0 10px 0 0;
660
- width: 100px;
661
  }
662
 
663
  .wds_ctrl_btn_upload {
664
- display: block !important;
665
- margin: 5px 0 !important;
666
- text-align: center;
667
- vertical-align: middle;
668
- width: 95%;
669
  }
670
 
671
  .wds_reverse {
672
- margin: 0 5px !important;
673
  }
674
 
675
  .wds_free_button,
676
  .wds_free_button:hover {
677
- background: linear-gradient(to bottom, #E5E5E5, #E5E5E5) repeat scroll 0 0 #f3f3f3 !important;
678
- border-color: #bbb !important;
679
- color: #888888 !important;
680
  }
681
 
682
  .wdi_spider_free_version_label,
683
  .wdi_spider_free_version_label * {
684
- color: #808080 !important;
685
  }
686
 
687
  .wdi_spider_free_version {
688
- background-color: #DFDFDF;
689
- border: 1px solid #797979;
690
- border-radius: 2px;
691
- padding: 2px;
692
- width: 210px;
693
  }
694
 
695
  .wds_more {
696
- font-size: 12px;
697
  }
698
 
699
  .wrap .button {
700
- border-radius: 3px !important;
701
- text-shadow: none !important;
702
  }
703
 
704
  .wdi_spider_message_cont {
705
- display: none;
706
- width: 99%;
707
  }
708
 
709
  .wdi_spider_load {
710
- display: none;
711
  }
712
 
713
  .wdi_spider_load_cont {
714
- background-color: rgba(0, 0, 0, 0.2);
715
- left: 0;
716
- height: 100%;
717
- position: fixed;
718
- top: 0;
719
- width: 100%;
720
- z-index: 99998;
721
  }
722
 
723
  .wdi_spider_load_icon {
724
- left: 0;
725
- height: 100%;
726
- position: fixed;
727
- text-align: center;
728
- top: 0;
729
- width: 100%;
730
- z-index: 99999;
731
  }
732
 
733
  .wdi_spider_ajax_loading {
734
- border: none !important;
735
- margin-top: 200px;
736
- width: 50px;
737
- -webkit-animation: spin 2.5s infinite linear;
738
- -moz-animation: spin 2.5s infinite linear;
739
- -o-animation: spin 2.5s infinite linear;
740
- animation: spin 2.5s infinite linear;
741
  }
742
 
743
  @-moz-keyframes spin {
744
- 0% {
745
- -moz-transform: rotate(0deg);
746
- }
747
- 100% {
748
- -moz-transform: rotate(359deg);
749
- }
750
  }
751
  @-webkit-keyframes spin {
752
- 0% {
753
- -webkit-transform: rotate(0deg);
754
- }
755
- 100% {
756
- -webkit-transform: rotate(359deg);
757
- }
758
  }
759
  @-o-keyframes spin {
760
- 0% {
761
- -o-transform: rotate(0deg);
762
- }
763
- 100% {
764
- -o-transform: rotate(359deg);
765
- }
766
  }
767
  @-ms-keyframes spin {
768
- 0% {
769
- -ms-transform: rotate(0deg);
770
- }
771
- 100% {
772
- -ms-transform: rotate(359deg);
773
- }
774
  }
775
  @keyframes spin {
776
- 0% {
777
- transform: rotate(0deg);
778
- }
779
- 100% {
780
- transform: rotate(359deg);
781
- }
782
  }
783
 
784
  #TB_window,
785
  #TB_iframeContent {
786
- width: 800px !important;
787
- height: 500px !important;
788
  }
789
 
790
  #TB_window {
791
- margin-left: -400px !important;
792
  }
793
 
794
-
795
  .input_th {
796
- margin-left: 0px !important;
797
- width: 160px !important;
798
- font-family: sans-serif;
799
  }
800
  .input_th2 {
801
- margin-left: 0px !important;
802
- width: 160px !important;
803
- margin-top:5px;
804
- height: 19px;
805
  }
806
 
807
  .edit_input {
808
- height: 28px !important;
809
- padding-bottom: 7px !important;
810
  }
811
 
812
  .add_tag_th {
813
- padding-left: 21px;
814
- font-size: 12px;
815
- font-family: sans-serif;
816
  }
817
 
818
  .pointer{
819
- cursor: pointer;
820
  }
821
 
822
  .non_selectable {
823
- -webkit-touch-callout: none;
824
- -webkit-user-select: none;
825
- -khtml-user-select: none;
826
- -moz-user-select: none;
827
- -ms-user-select: none;
828
- user-select: none;
829
  }
830
 
831
  .wds_position_table td,
832
  .wds_position_table input{
833
- border: 1px solid #CCCCCC;
834
- margin: 2px;
835
  }
836
 
837
  .wds_position_table .wds_position_td {
838
- background-color: #f4f4f4;
839
- display: inline-block;
840
- line-height: 1;
841
- padding: 0 !important;
842
  }
843
 
844
  .wdi_spider_div_options {
845
- background: none repeat scroll 0 0 #F4F4F4;
846
- border: 1px solid #8F8D8D;
847
- border-radius: 8px 8px 8px 8px;
848
- display: none;
849
- margin: 2px 0 0 190px;
850
- padding: 13px;
851
- min-height: 300px;
852
- min-width: 600px;
853
- vertical-align: top;
854
  }
855
 
856
 
857
-
858
  .table_medium_col {
859
- text-align: center !important;
860
- width: 70px;
861
  }
862
 
863
 
864
- .table_medium_col_uncenter {
865
- width: 80px;
 
866
  }
867
 
868
  .table_extra_large_col {
869
- padding: 4px !important;
870
- width: 150px !important;
871
  }
872
 
873
  .first-page,
@@ -878,82 +839,94 @@ border: 1px solid rgb(185, 185, 185);
878
  .table_medium_col a,
879
  .table_big_col a,
880
  .table_small_col a {
881
- cursor: pointer;
882
  }
883
 
884
  .wdi_spider_word_wrap {
885
- word-wrap: normal;
886
  }
887
 
888
  .wdi_spider_description {
889
- color: #666666;
890
- font-size: 0.923em;
891
- line-height: 1.231em;
892
  }
893
 
894
  .handle {
895
- background: url("../images/draggable.png") no-repeat transparent;
896
- border: none;
897
- cursor: move;
898
- display: inline-block;
899
- height: 15px;
900
- margin: 0 auto;
901
- vertical-align: middle;
902
- width: 15px;
 
 
 
 
903
  }
904
-
905
  .slider-icon {
906
- background-image: url("../images/slider-icon.png");
907
- background-repeat: no-repeat;
908
- border: none;
909
- float: left;
910
- height: 32px;
911
- margin: 7px 8px 0 0;
912
- width: 32px;
 
 
 
 
 
 
 
 
 
913
  }
914
  .uninstall-icon {
915
- background-image: url("../images/uninstall-icon.png");
916
- background-repeat: no-repeat;
917
- border: none;
918
- float: left;
919
- height: 32px;
920
- margin: 7px 8px 0 0;
921
- width: 32px;
922
  }
923
 
924
  .wdi_spider_label {
925
- font-weight: bold;
926
- width: 100px;
927
  }
928
 
929
  .wdi_spider_label_top {
930
- font-weight: bold;
931
- padding-top: 3px;
932
- vertical-align: top;
933
- width: 100px;
934
  }
935
 
936
  .wdi_spider_fieldset .wdi_spider_label {
937
- font-weight: bold;
938
- vertical-align: top;
939
- width: 150px;
940
  }
941
 
942
  .wdi_spider_label_options {
943
- font-weight: bold;
944
- vertical-align: top;
945
- width: 150px;
946
  }
947
 
948
  .wdi_spider_choose_option {
949
- display: table;
950
- box-shadow: 0px 0px 1px 1px #D2D2D2;
951
- margin-bottom: 5px;
952
- border-radius: 2px;
953
- padding: 2px;
954
- box-sizing: border-box;
955
- cursor: pointer;
956
- width: 100%;
957
  }
958
 
959
  .wdi_spider_options_cont,
@@ -962,510 +935,512 @@ border: 1px solid rgb(185, 185, 185);
962
  .wdi_spider_options_color_cont,
963
  .wdi_spider_bull_options_color_cont,
964
  .wdi_spider_pp_options_color_cont {
965
- display: none;
966
- width: 180px;
967
- height: 150px;
968
- overflow: scroll;
969
- overflow-x: hidden;
970
- overflow-y: scroll;
971
  }
972
 
973
  .wdi_spider_option_cont {
974
- display: block;
975
- border-bottom: 1px solid #D3D3D3;
976
- padding: 3px 0px 3px 0px;
977
- box-sizing: content-box;
978
- width: 98%;
979
- border-radius: 0px;
980
- cursor: pointer;
981
  }
982
 
983
  .wdi_spider_option_cont_title {
984
- display: table-cell;
985
- vertical-align: middle;
986
- padding: 0px 0px 0px 4px;
987
  }
988
 
989
  .wdi_spider_option_cont_img {
990
- display: table-cell;
991
- width: 23%;
992
- height: 15px;
993
- text-align: right;
994
- padding: 5px 4px 0px 0px;
995
- box-sizing: border-box;
996
- background-color: #EEEEEE;
997
  }
998
 
999
  .wdi_spider_option_main_title {
1000
- display: table-cell;
1001
- width: 65%;
1002
- vertical-align: middle;
1003
- padding: 0px 0px 0px 4px;
1004
- color: #555;
1005
  }
1006
 
1007
  .wdi_spider_sel_option_ic {
1008
- display: table-cell;
1009
- width: 20%;
1010
- height: 15px;
1011
- text-align: right;
1012
- padding: 0px 6px 0px 0px;
1013
- box-sizing: border-box;
1014
  }
1015
 
1016
  .wdi_spider_int_input {
1017
- width: 45px;
1018
  }
1019
 
1020
  .wdi_spider_char_input {
1021
- width: 115px;
1022
  }
1023
 
1024
  .wdi_spider_text_input {
1025
- width: 190px;
1026
  }
1027
 
1028
  .wdi_spider_slider_div {
1029
- display: inline-block;
1030
- vertical-align: middle;
1031
- width: 140px;
1032
  }
1033
 
1034
  .wdi_spider_slider_percentage,
1035
  .wdi_spider_slider_percentage input,
1036
  .wdi_spider_slider_percentage input :focus {
1037
- background: transparent;
1038
- border: none;
1039
- color: #00AEEF;
1040
- display: inline;
1041
- font-weight: bold;
1042
- text-align: right;
1043
- vertical-align: middle;
1044
- width: 30px;
1045
  }
1046
 
1047
  .updated,
1048
  .error {
1049
- margin: 5px 0 2px !important;
1050
  }
1051
 
1052
  .buttons_div {
1053
- clear: both;
1054
- float: right;
1055
- margin: 5px 0;
1056
  }
1057
 
1058
  .buttons_div_left {
1059
- float: left;
1060
- margin: 5px 0;
 
1061
  }
1062
 
1063
  .buttons_div_right {
1064
- float: right;
1065
- margin: 5px 0;
1066
  }
1067
 
1068
  .wdi_spider_delete_img {
1069
- background-image: url("../images/delete.png");
1070
- border: none;
1071
- cursor: pointer;
1072
- display: inline-block;
1073
- vertical-align: middle;
1074
- height: 14px;
1075
- width: 14px;
1076
  }
1077
 
1078
  .wdi_spider_delete_img_small {
1079
- background-image: url("../images/delete.png");
1080
- background-size: 10px auto;
1081
- border: medium none;
1082
- cursor: pointer;
1083
- display: inline-block;
1084
- height: 10px;
1085
- margin-top: 2px;
1086
- vertical-align: middle;
1087
- width: 10px;
1088
  }
1089
 
1090
  .wdi_spider_fieldset {
1091
- background: none repeat scroll 0 0 #F4F4F4;
1092
- border: 1px solid #8F8D8D;
1093
- border-radius: 8px 8px 8px 8px;
1094
- display: none;
1095
- float: left;
1096
- margin: 4px;
1097
- padding: 13px;
1098
- width: 97%;
1099
  }
1100
 
1101
  .wdi_spider_type_fieldset {
1102
- background: none repeat scroll 0 0 #F4F4F4;
1103
- border-radius: 8px 8px 8px 8px;
1104
- display: none;
1105
- float: left;
1106
- width: 100%;
1107
  }
1108
 
1109
  .wdi_spider_child_fieldset {
1110
- background: none repeat scroll 0 0 #F4F4F4;
1111
- border: 1px solid #8F8D8D;
1112
- border-radius: 8px 8px 8px 8px;
1113
- float: left;
1114
- margin: 4px;
1115
- width: 30%;
1116
- padding: 13px;
1117
- display: block;
1118
  }
1119
 
1120
  .wdi_spider_table td {
1121
- padding: 0;
1122
- vertical-align: middle;
1123
  }
1124
 
1125
  .wdi_spider_ctrls {
1126
- padding: 4px;
1127
- text-align: center;
1128
- width: 40px;
1129
  }
1130
 
1131
  .theme_type {
1132
- background-color: #F4F4F4;
1133
- border: 1px solid #8F8D8D;
1134
- border-radius: 8px 8px 8px 8px;
1135
- cursor: pointer;
1136
- display: inline-block;
1137
- font-size: 16px;
1138
- height: 24px;
1139
- padding-top: 5px;
1140
- text-align: center;
1141
- vertical-align: middle;
1142
- width: 123px;
1143
- margin: 2px 0px 2px 0px;
1144
  }
1145
 
1146
  .ui-slider-handle {
1147
- cursor: pointer !important;
1148
  }
1149
 
1150
  .thumb {
1151
- border: 1px solid #CCCCCC;
1152
- max-height: 120px;
1153
- max-width: 120px;
1154
  }
1155
 
1156
  .fileDescription {
1157
- color: #666666;
1158
- cursor: pointer;
1159
- font-family: sans-serif;
1160
- font-size: 12px;
1161
  }
1162
 
1163
  .filename {
1164
- font-size: 13px;
1165
  }
1166
 
1167
  .tag_div {
1168
- background-clip: padding-box;
1169
- background-color: #F3F3F3;
1170
- border: 1px solid #AAAAAA;
1171
- border-radius: 3px 3px 3px 3px;
1172
- box-shadow: 0 0 2px #FFFFFF inset, 0 1px 0 rgba(0, 0, 0, 0.05);
1173
- color: #666666;
1174
- line-height: 13px;
1175
- margin: 2px 0;
1176
- padding: 2px 5px 2px 5px;
1177
- width: 132px;
1178
  }
1179
 
1180
  .tags_div {
1181
- overflow-y: auto;
1182
- height: 65px;
1183
  }
1184
 
1185
  .tag_name {
1186
- width: 118px;
1187
  }
1188
 
1189
  .edit_thumb {
1190
- cursor: pointer;
1191
  }
1192
 
1193
  .wdi_spider_rotate {
1194
- border-radius: 2px;
1195
- border: 1px solid #FFFFFF;
1196
- height: 30px;
1197
  }
1198
 
1199
  .wdi_spider_search_value {
1200
- height: 2em;
1201
- margin: 0 0 4px;
1202
  }
1203
 
1204
  #th_order,
1205
  .wdi_spider_order {
1206
- display: none;
1207
  }
1208
 
1209
  .wds_add_video,
1210
  .wds_resize_image,
1211
  .wds_import,
1212
  .wds_exports {
1213
- display: none;
1214
- padding: 10px;
1215
- height: 60px;
1216
- background-color: #FFFFFF;
1217
- border: 1px solid #999999;
1218
- top: 50%;
1219
- position: fixed;
1220
- left: 50%;
1221
- text-align: left;
1222
- z-index: 100000;
1223
- border-radius: 3px;
1224
- margin-top: -45px;
1225
  }
1226
 
1227
  .wds_add_video,
1228
  .wds_resize_image {
1229
- margin-left: -340px;
1230
  }
1231
 
1232
  .wds_exports {
1233
- margin-left: -240px;
1234
  }
1235
 
1236
  .wds_import {
1237
- margin-left: -185px;
1238
  }
1239
 
1240
  .wds_add_video input[type="text"],
1241
  .wds_resize_image input[type="text"] {
1242
- width: 500px;
1243
  }
1244
 
1245
 
1246
  .wds_opacity_video,
1247
  .wds_opacity_import,
1248
  .wds_opacity_export {
1249
- background-color: #000000;
1250
- display: none;
1251
- opacity: 0.75;
1252
- filter: Alpha(opacity=75);
1253
- position: fixed;
1254
- top: 0;
1255
- left: 0;
1256
- width: 100%;
1257
- height: 100%;
1258
- z-index: 99998;
1259
  }
1260
 
1261
 
 
1262
  .wds_tabs {
1263
- clear: both;
1264
- display: none;
1265
- position: relative;
1266
- z-index: 1;
1267
  }
1268
 
1269
  .wds_tabs a.wds_sub_active,
1270
  .wds_tabs a.wds_active {
1271
- background-color: #F5F5F5;
1272
- border-bottom: 1px solid #F5F5F5;
1273
- color: #333;
1274
  }
1275
 
1276
  .wds_tabs a {
1277
- background-color: #f9f9f9;
1278
- border: 1px solid #dfdfdf;
1279
- border-top-left-radius: 3px;
1280
- border-top-right-radius: 3px;
1281
- color: #c7c7c7;
1282
- display: block !important;
1283
- float: left;
1284
- font: bold 17px/32px Arial,serif;
1285
- height: 30px;
1286
- margin: 3px 3px 0 0;
1287
- padding: 0 10px;
1288
- position: relative;
1289
- text-decoration: none;
1290
- width: 130px;
1291
  }
1292
 
1293
  .wbs_subtab a {
1294
- font: bold 14px/26px Arial,serif;
1295
- height: 26px;
1296
- padding: 0 5px;
1297
- width: 105px;
1298
  }
1299
 
1300
  .wds_add_layer {
1301
- font: normal 20px/28px Arial,serif !important;
1302
- width: initial !important;
1303
- padding: 0 9px !important;
1304
  }
1305
 
1306
  .wds_tab_title {
1307
- background: none repeat scroll 0 0 transparent !important;
1308
- border: none !important;
1309
- cursor: pointer;
1310
- opacity: 0.5;
1311
- filter: Alpha(opacity=50);
1312
- padding: 1px;
1313
- vertical-align: middle;
1314
- width: 50px;
1315
  }
1316
 
1317
  .wds_sub_active .wds_tab_title,
1318
  .wds_layer_title {
1319
- background-color: #FFFFFF !important;
1320
- border-color: #DFDFDF !important;
1321
- border-radius: 3px !important;
1322
- border-style: solid !important;
1323
- border-width: 1px !important;
1324
- cursor: pointer;
1325
- opacity: 1;
1326
- filter: Alpha(opacity=100);
1327
  }
1328
 
1329
  .wds_tab_remove {
1330
- background-image: url("../images/close.png");
1331
- background-repeat: no-repeat;
1332
- background-size: 100% 100%;
1333
- display: inline-block;
1334
- width: 9px;
1335
- height: 9px;
1336
- opacity: 0.5;
1337
- filter: Alpha(opacity=50);
1338
- vertical-align: middle;
1339
- }
1340
 
1341
  .wds_layer_remove {
1342
- background-image: url("../images/close.png");
1343
- background-repeat: no-repeat;
1344
- background-size: 100% 100%;
1345
- display: inline-block;
1346
- width: 15px;
1347
- height: 15px;
1348
- margin: 5px;
1349
- float: right;
1350
  }
1351
 
1352
  .wds_layer_dublicate {
1353
- background-image: url("../images/duplicate.png");
1354
- background-repeat: no-repeat;
1355
- background-size: 100% 100%;
1356
- display: inline-block;
1357
- width: 15px;
1358
- height: 15px;
1359
- margin: 5px;
1360
- float: right;
1361
  }
1362
 
1363
  .wds_slide_dublicate {
1364
- background-image: url("../images/duplicate.png");
1365
- background-repeat: no-repeat;
1366
- background-size: 100% 100%;
1367
- display: inline-block;
1368
- width: 12px;
1369
- height: 12px;
1370
- vertical-align: middle;
1371
  }
1372
 
1373
  .wds_layer_depth {
1374
- float: right;
1375
- font-size: 13px;
1376
- line-height: 15px;
1377
- margin: 1px 5px;
1378
- text-align: left;
1379
- width: 40px;
1380
  }
1381
 
1382
  .wds_layer_label {
1383
- display: inline-block;
1384
- font-size: 13px;
1385
- width: 80%;
1386
  }
1387
 
1388
  .wds_sub_active .wds_tab_remove {
1389
- cursor: pointer !important;
1390
- opacity: 1;
1391
- filter: Alpha(opacity=100);
1392
  }
1393
 
1394
  .wds_box.wds_sub_active,
1395
  .wds_box.wds_active {
1396
- display: block;
1397
  }
1398
 
1399
  .wds_tab_label {
1400
- display: block;
1401
- width: inherit;
1402
  }
1403
 
1404
  .wds_box {
1405
- display: none;
1406
- margin-top: 0 !important;
1407
- position: relative;
1408
- top: -1px;
1409
  }
1410
 
1411
  .wds_box {
1412
- border: 1px solid #dfdfdf;
1413
- border-radius: 3px;
1414
- box-shadow: 0 0 10px #f2f2f2;
1415
- margin-top: 15px;
1416
- position: relative;
1417
  }
1418
 
1419
  .wds_clear {
1420
- clear: both;
1421
- float: none !important;
1422
  }
1423
 
1424
  .wds_box thead td {
1425
- border-bottom: 0 none !important;
1426
  }
1427
 
1428
  .wds_box tbody {
1429
- background-color: #FFFFFF;
1430
- border-top: 0 none;
1431
- padding-left: 10px;
1432
  }
1433
 
1434
  .wds_box thead {
1435
- background: -webkit-linear-gradient(#F5F5F5, #FFFFFF);
1436
- background: -o-linear-gradient(#F5F5F5, #FFFFFF);
1437
- background: -moz-linear-gradient(#F5F5F5, #FFFFFF);
1438
- background: linear-gradient(#F5F5F5, #FFFFFF);
1439
- border-top: 0 none;
1440
- border-bottom: 0 none;
1441
- color: #333;
1442
- font: bold 12px/29px Arial,serif;
1443
- height: 29px;
1444
- margin: 0;
1445
- padding: 0 10px;
1446
- text-align: left;
1447
- text-shadow: 0 1px 0 #fff;
1448
  }
1449
 
1450
  .wds_box table {
1451
- border-collapse: collapse;
1452
- border-spacing: 0;
1453
- width: 100%;
1454
  }
1455
 
1456
  .wds_nav_tabs {
1457
- background-color: #F5F5F5;
1458
- border-right: 1px solid #DFDFDF;
1459
- float: left;
1460
- height: 640px;
1461
- margin: 0;
1462
- width: 150px;
1463
  }
1464
 
1465
  .wds_nav_tabs ul {
1466
- list-style: none outside none;
1467
- margin: 10px 0;
1468
- padding: 0;
1469
  }
1470
 
1471
  .wds_nav_tabs .wds_sub_active,
@@ -1474,120 +1449,133 @@ border: 1px solid rgb(185, 185, 185);
1474
  .wds_nav_tabs .wds_active,
1475
  .wds_nav_tabs .wds_active a,
1476
  .wds_nav_tabs .wds_active a:hover {
1477
- background: none repeat scroll 0 0 #fff;
1478
- color: #333;
1479
  }
1480
 
1481
  .wds_nav_tabs .wds_active {
1482
- border-color: #DFDFDF;
1483
- border-width: 1px 0 1px 1px;
1484
- border-style: solid;
1485
- margin: 0 -1px 0 -4px;
1486
- padding: 0;
1487
  }
1488
 
1489
  .wds_nav_tabs li {
1490
- border-color: transparent;
1491
- border-style: solid;
1492
- border-width: 1px 0;
1493
- list-style-type: none;
1494
- margin-bottom: 0;
1495
  }
1496
 
1497
  .wds_nav_tabs a {
1498
- display: block;
1499
- line-height: 18px;
1500
- padding: 5px 5px 5px 12px;
1501
- text-decoration: none;
1502
  }
1503
 
1504
  .wds_nav_box {
1505
- background: none repeat scroll 0 0 #fff;
1506
- display: none;
1507
- height: 610px;
1508
- overflow: auto;
1509
- padding: 15px;
1510
  }
1511
 
1512
  .wds_nav_box.wds_active {
1513
- display: block;
1514
  }
1515
 
1516
  .wds_layer_head {
1517
- background-color: #F5F5F5;
1518
- border-bottom: 1px solid #DFDFDF;
1519
- border-top: 1px solid #DFDFDF;
1520
- cursor: pointer;
1521
- padding: 5px;
1522
  }
1523
 
1524
  .wds_layer_head .handle {
1525
- cursor: move;
1526
- display: inline-block;
1527
- margin: 5px;
1528
  }
1529
 
1530
  .wds_box td {
1531
- padding: 10px !important;
1532
  }
1533
 
1534
  .wds_draggable {
1535
- box-sizing: border-box;
1536
- cursor: move;
1537
  }
1538
 
1539
  .wds_box .color {
1540
- width: 60px;
1541
  }
1542
 
1543
  .wds_active_layer {
1544
- box-shadow: rgb(44, 36, 36) 0px 0px 5px;
1545
- border-radius: 3px;
1546
  }
1547
 
1548
  .wds_draggable a,
1549
  .wds_draggable a:hover {
1550
- color: inherit !important;
1551
- font-size: inherit !important;
1552
- font-style: inherit !important;
1553
- font-weight: inherit !important;
1554
- text-decoration: none;
1555
  }
1556
 
1557
  #add_embed_help {
1558
- height: 200px;
1559
- width: 672px;
1560
- top: 40%;
1561
  }
1562
 
1563
  #add_embed input[type="text"] {
1564
- width: 500px;
1565
  }
1566
 
1567
  .wds_buttons {
1568
- float: right;
1569
- font-weight: normal;
1570
- position: relative;
1571
  }
1572
 
1573
  .wds_reset_button {
1574
- display: none;
1575
- font-weight: normal;
1576
- margin: 10px 0;
1577
- position: absolute;
1578
- right: 40px;
1579
- z-index: 1;
1580
  }
1581
 
 
 
 
 
 
1582
  #wdi_save_feed .two .section_col {
1583
- width: 47%;
1584
- float: left;
1585
- margin: 0 1.5% 18px;
 
 
 
1586
  }
1587
  #wdi_save_feed .wdi_element {
1588
- margin: 0 0 18px;
1589
  }
1590
 
 
 
 
 
 
1591
  #wdi_save_feed .half .wdi_element,
1592
  #wdi_save_feed .one .wdi_element {
1593
  width: 96%;
@@ -1599,31 +1587,31 @@ border: 1px solid rgb(185, 185, 185);
1599
  display: none !important;
1600
  }
1601
 
1602
-
1603
  #wdi_save_feed .wdi_element p {
1604
- margin: 2px 0 0;
1605
  }
1606
  .wdi_section_name {
1607
- font-size: 19px;
1608
- margin: 0 auto 15px;
1609
- width: 100%;
1610
- box-sizing: border-box;
1611
- padding: 15px;
1612
- border-bottom: 1px solid #f1f1f1;
1613
  color: #444;
1614
  cursor: pointer;
1615
  }
1616
  .wdi_section {
1617
- border: 1px solid #dedede;
1618
  margin-bottom: 20px;
1619
  background:#fff;
1620
  }
 
1621
  .wdi_section .optioninput * {
1622
- text-align: left;
1623
  }
1624
  .wdi_section.half {
1625
- width: 49%;
1626
- float: left;
1627
  -webkit-box-sizing:border-box;
1628
  -moz-box-sizing:border-box;
1629
  box-sizing:border-box;
@@ -1632,10 +1620,19 @@ border: 1px solid rgb(185, 185, 185);
1632
  text-align:right;
1633
  margin-top: 7px;
1634
  }
 
1635
  .wdi_tab .wdi_section.half:last-child{
1636
  margin-left:2%;
1637
  }
1638
 
 
 
 
 
 
 
 
 
1639
  /*wdi how to publish*/
1640
  #how_to_publish_tab .wdi_howto_container{
1641
  display: flex;
@@ -1661,56 +1658,110 @@ border: 1px solid rgb(185, 185, 185);
1661
  margin: 0;
1662
  padding: 11px 15px 4px 0;
1663
  }
 
 
 
 
 
 
 
 
1664
 
1665
  #how_to_publish_tab .wdi_howto_container .wdi_howto_content input{
1666
  margin: 0 auto;
1667
  text-align: center;
1668
  width: 100%;
1669
  }
 
1670
  .wdi_buttons button.button.preview-button {
1671
- height: 28px;
1672
  }
 
1673
  @media (max-width: 782px) {
1674
  .wdi_buttons button.button.preview-button {
1675
  height: auto;
1676
  }
1677
  }
1678
 
1679
- @media (min-width: 768px) {
1680
- .wdi_border_wrapper .wdi_element_content{
1681
- width: 100%;
1682
- display: block;
1683
- }
1684
- .wdi_border_wrapper .wdi_element_title{
1685
- display: block;
1686
- }
1687
- .wdi_border_wrapper .wdi_element_content input[type=text]:not(.wp-color-picker){
1688
- width: calc(100% - 30px);
1689
- height: 28px;
1690
- }
1691
- .wdi_border_wrapper .wdi_element_content input#wdi_add_user_ajax_input{
1692
- width: calc(100% - 78px);
1693
- }
1694
- .wdi_border_wrapper .wdi_element_content input[type=number]{
1695
- width: calc(100% - 30px);
1696
- }
1697
- .wdi_border_wrapper .wdi_element_content select{
1698
- width: calc(100% - 30px);
1699
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1700
  }
 
1701
  @media (max-width: 768px) {
 
 
 
 
 
 
 
 
 
 
1702
  #wdi_save_feed .two .section_col {
1703
  width: 96%;
1704
  float: none;
1705
  margin: 0 2% 18px;
1706
  }
 
1707
  .wdi_section.half {
1708
  width: 100%;
1709
  float: none;
1710
- margin:0 0 20px 0 !important;
 
 
 
1711
  }
1712
  }
1713
 
 
 
1714
  .wdi_section_close::before{
1715
  content: "\f142";
1716
  display: inline-block;
@@ -1744,63 +1795,481 @@ border: 1px solid rgb(185, 185, 185);
1744
  margin: 0 0 3px;
1745
  background-color: #fff;
1746
  }
 
 
 
1747
 
1748
 
1749
- .wdi_demo_img{
1750
- margin-top: 20px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1751
  }
1752
 
1753
 
 
 
 
1754
 
 
 
 
 
 
1755
 
1756
- #wdi_feed_form .wd-page-title.wd-header {
1757
- width: 100%;
1758
- padding: 10px 0;
1759
  }
1760
- @media screen and (max-width: 782px){
1761
- #wdi_feed_form p.search-box {
1762
- margin-bottom: 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1763
  }
1764
- #wdi_feed_form p.search-box input[type="search"]{
1765
- width:100%;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1766
  height: auto !important;
1767
  }
1768
- #wdi_feed_form p.search-box input[type="button"]{
1769
- margin-bottom: 10px;
1770
- padding: 6px 14px;
1771
- line-height: normal;
1772
- font-size: 14px;
1773
- height: auto;
 
1774
  }
1775
- .wdi-page-header .WDI_title_input {
1776
- width: 60%;
 
 
 
1777
  }
1778
- .wdi-page-header .wdi_buttons {
1779
- float: none;
1780
- text-align: center;
 
1781
  }
 
 
 
 
1782
  }
1783
- .wdi_reset_cache_success{
1784
  float: right;
 
1785
  }
1786
- #wdi_reset_cache{
1787
- float: right;
1788
  }
1789
 
1790
-
1791
- /*body.toplevel_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(3),*/
1792
- body.toplevel_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(4),
1793
- body.toplevel_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(5){
 
 
 
 
 
 
 
1794
  display: none;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1795
  }
1796
-
1797
- body.instagram-feed_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(3){
1798
- display: table-row !important;
 
 
 
 
 
 
 
 
1799
  }
1800
- body.instagram-feed_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(4){
1801
- display: table-row !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1802
  }
1803
 
1804
- #wpbody-content>div:not(.wrap):not(.wd_topic), .wrap .notice:not(.wd-notice), .notice:not(.wd-notice) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1805
  display: none;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1806
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wdi_clear {
2
+ display: block;
3
+ height: 0px;
4
  clear: both;
5
  }
6
  .wdi_clear_tag:after{
8
  display:table;
9
  clear: both;
10
  }
11
+ #wdi_unistall {
12
  background-color: #D82121;
13
  border-color: #D31818;
14
+ box-shadow: inset 0 1px 0 rgba(230, 120, 120, 0.5), 0 1px 0 rgba(0, 0, 0, .15);
15
  }
16
+
17
+ #wdi_unistall:hover {
18
  background-color: #DA1313;
19
  }
20
+
21
+ #wdi_unistall_table th {
22
  width: 45%;
23
  }
24
 
 
 
 
 
 
25
 
26
  /*tooltip css*/
27
  .wdi_tooltip,
28
  .wdi_settings_link {
29
+ display: block;
30
+ font-size: 14px !important;
31
+ font-weight: bold;
32
+ line-height: 20px;
33
+ margin-bottom: 5px;
34
+ color: #444;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  text-decoration: none;
36
  }
37
+ .wdi_theme.wdi_border_wrapper{
38
+ background:#fff;
39
+ padding: 5px 0;
 
 
 
 
 
 
 
 
 
 
 
 
40
  }
41
 
42
+ .wdi_tooltip:hover,
43
+ .wdi_settings_link:hover {
44
+ color: rgb(35, 40, 45);
45
+ position: relative;
46
+ }
47
 
48
+ .wdi_tooltip:hover:after {
49
+ content: attr(wdi-tooltip);
50
+ padding: 4px 8px;
51
+ color: #dbdbe0;
52
+ position: absolute;
53
+ left: 0;
54
+ top: 100%;
55
+ white-space: nowrap;
56
+ z-index: 20;
57
+ -moz-border-radius: 3px;
58
+ -webkit-border-radius: 3px;
59
+ border-radius: 2px;
60
+ -moz-box-shadow: 0px 0px 4px #222;
61
+ -webkit-box-shadow: 0px 0px 4px #222;
62
+ box-shadow: 0px 0px 4px rgba(0,0,0,0.5);
63
+ background-color: rgba(0,0,0,0.75);
64
+ font-size: 12px;
65
+ }
66
 
67
  /*feeds page*/
68
+ .display_type_container > div {
69
+ float: left;
70
+ margin-right: 15px;
71
+ }
72
+ #wdi_feed_users_ajax {
73
+ width: 100%;
74
  margin-top: 2px;
75
  }
76
 
77
  #wdi_feed_tabs .wdi_feed_tabs {
78
+ border: 1px solid #F1F1F1;
79
+ color: #444;
80
+ cursor: pointer;
81
+ font-size: 13px;
82
+ font-weight: bold;
83
+ padding: 12px;
84
+ background: #fff;
85
+ text-decoration: none;
86
+ display: inline-block;
87
  }
88
  #wdi_feed_tabs {
89
+ margin: 16px 0;
90
  }
91
  #wdi_feed_tabs .wdi_feed_tab_active,
92
  #wdi_feed_tabs .wdi_feed_tabs:hover {
93
+ background: none repeat scroll 0 0 #FFFFFF;
94
+ /*border: 1px solid #46ACC3;*/
95
  color: #9a2465;
96
  }
 
 
 
 
 
 
 
 
 
 
97
  #wdi_feed_tabs .wdi_feed_tab_title{
98
  margin-top: 1px;
99
  display: inline-block;
100
  }
101
+ .wdi_border_wrapper [scope='row'] + td,
102
+ .wdi_border_wrapper [scope='row'] {
103
+ padding: 8px;
 
 
 
 
 
 
 
 
104
  }
105
 
106
  .wdi_user {
107
+ border: 1px solid rgb(185, 185, 185);
108
+ background-color: rgba(0, 0, 0, .05);
109
+ margin: 0px 4px 0 0;
110
+ border-radius: 5px;
111
+ height: 28px;
112
+ position: relative;
113
+ display: inline-block;
114
+ }
115
+
116
+ .wdi_user:hover {
117
  background-color: rgba(0, 0, 0, .08);
118
  }
119
+ .display_type_container.wdi_clear_tag {
120
+ display: table;
121
+ margin: 10px auto;
122
+ }
123
+ .wdi_user a {
124
  text-decoration: none;
125
  color: black;
126
  line-height: 28px;
127
+ width: 70%;
128
  margin-left: 12%;
129
  margin-right: 18%;
130
  height: 100%;
131
  display: table-row;
132
  padding-right: 3px;
133
  }
134
+
135
+ .wdi_user .wdi_profile_pic {
136
  width: 20px;
137
  height: 20px;
138
  top: 4px;
141
  vertical-align: middle;
142
  display: table-cell;
143
  }
144
+
145
+ .wdi_user span {
146
  display: table-cell;
147
  vertical-align: middle;
148
  left: 55px;
149
  font-weight: bold;
150
  font-size: 14px;
151
  }
152
+
153
+ .wdi_user .wdi_remove_user,
154
+ .wdi_user .wdi_check_thumb_user {
155
  position: absolute;
156
  right: 4px;
157
  width: 15px;
159
  top: 6.5px;
160
  transition: all 0.1s ease;
161
  }
162
+
163
  .wdi_user .wdi_remove_user:hover {
164
  cursor: pointer;
165
+ transform: rotate(180deg); /*top: 6px;*/
 
166
  }
167
+
168
+ .wdi_user .wdi_check_thumb_user:hover {
169
  cursor: pointer;
170
  }
171
+
172
+ .wdi_user .wdi_check_thumb_user {
173
  left: 4px;
174
  }
175
 
176
  .wdi_border_wrapper [scope='row'] {
177
+ padding: 2px;
178
+ font-size: 13px;
179
+ min-width: 250px;
180
  }
181
+
182
+ .wdi_border_wrapper [scope='row'] + td,
183
+ .wdi_border_wrapper [scope='row'] {
184
+ padding: 2px;
185
  }
186
 
187
  /*.notice {*/
188
+ /*display: inline-block;*/
189
+ /*line-height: 19px;*/
190
+ /*font-size: 14px;*/
191
+ /*text-align: left;*/
192
+ /*background-color: #fff;*/
193
+ /*border-left: 4px solid #ffba00;*/
194
+ /*-webkit-box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .1);*/
195
+ /*box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .1);*/
196
  /*}*/
197
 
198
+ .small_input {
 
199
  width: 60px;
200
  text-align: center;
201
  }
 
 
 
 
 
 
 
 
 
 
202
 
203
+ .display_type {
204
+ text-align: center;
205
  }
206
 
207
  .instagram-feed_page_wdi_settings table td{
219
  {
220
  float: right;
221
  }
222
+ .wdi-settings-page {
223
+ }
224
+ .wdi-settings-page .wdi_help_bar_wrap {
225
+ background-color:unset;
226
+ padding: 15px 15px 15px 0;
227
+ }
228
+ .wdi-settings-page .wdi_settings_form {
229
+ margin-right: 20px;
230
+ padding: 30px 20px;
231
+ background: #fff;
232
+ }
233
+ /*
234
  #login_with_instagram {
235
  height: 43px;
236
  }
237
 
238
+ #login_with_instagram .wdi_sign_in_button {
239
  background-image: url('../images/sign_in_with_instagram.png');
240
  background-repeat: no-repeat;
241
  background-position: left top;
243
  height: 43px;
244
  display:inline-block;
245
  float: left;
246
+ text-indent: -999px;
247
  }
248
 
249
  #login_with_instagram .wdi_sign_in_button:hover {
250
+ background-image: url('../images/sign_in_with_instagram_hover.png');
251
  }
252
 
 
253
  #login_with_instagram .wdi_default_feed_button,
254
  #login_with_instagram .wdi_edit_default_feed_button{
255
 
288
  padding-bottom: 5px;
289
  }
290
 
 
 
 
 
291
 
 
292
  .wdi_multiple_accounts_section tr:not(:first-child) th{
293
  font-style: italic;
294
  }
349
  margin-left: 15px;
350
  }
351
 
 
 
 
 
 
 
 
352
  .wdi_advanced_option {
353
  width: 100%;
354
  position: relative;
418
  display: none;
419
  }
420
 
 
 
 
 
421
  #wdi_options_page_buttons_wrapper{
422
  margin-top: 10px;
423
  width: 700px;
424
  }
425
 
 
 
 
 
 
 
426
  /*---------------------------------------------------------
427
  ------------------Conditional Filters Ui-------------------
428
  ---------------------------------------------------------*/
446
  .wdi_filter_radio label {
447
  vertical-align: text-bottom;
448
  }
449
+ .filters_description{
450
+ font-size: 13px;
451
+ font-weight: bold;
452
+ margin-top: 8px;
453
+ display: inline-block;
454
  }
455
 
456
  .wdi_filter_input input {
 
457
  width: 250px;
458
  margin-right: 0;
459
  padding-right: 0;
 
460
  }
461
  #wdi_filter_type{
462
  line-height: 28px;
485
  }
486
  .wdi_logic{
487
  display: inline-block;
488
+ padding: 5px;
489
+ font-weight: bold;
490
  }
491
  .wdi_filter_by_location {
492
  background-color: #509833;
518
 
519
 
520
  .wdi_source_user{
521
+ border: 1px solid rgb(212, 212, 212);
522
+ background-color: rgba(0, 0, 0, 0.03);
523
+ margin: 0px 4px 0 0;
524
+ border-radius: 5px;
525
+ height: 29px;
526
  display: inline-block;
527
+ padding: 2px 0 0 4px;
528
  }
529
  .wdi_source_img{
530
  display: inline-block;
531
  }
532
  .wdi_source_img img{
533
+ width: 22px;
534
+ height: 22px;
535
  border-radius: 15px;
536
  display: block;
537
+ padding: 0px;
538
  }
539
  .wdi_source_username{
540
  display: inline-block;
552
  }
553
 
554
 
 
555
  .wdi_help_bar_wrap {
556
  background-color: #ffffff;
557
  border: none;
563
  line-height: 30px;
564
  padding: 15px;
565
  vertical-align: middle;
566
+ width: 100%;
567
  margin: 20px 0 0 0;
568
+ }
569
+ .wdi_help_bar_wrap span,.wdi_help_bar_wrap a{
570
+ font-size: 14px;
571
  }
572
  .wdi_help_bar_text{
573
  float:left;
577
  text-decoration: none;
578
  }
579
  .wdi_hb_buy_pro{
580
+ float:right;
581
  padding:0;
 
582
  }
583
 
584
  .wdi_hb_buy_pro a,
618
  #rl_butt_type,
619
  #rl_butt_color,
620
  #rl_butt_style {
621
+ margin: 0 10px 0 0;
622
+ width: 100px;
623
  }
624
 
625
  .wds_ctrl_btn_upload {
626
+ display: block !important;
627
+ margin: 5px 0 !important;
628
+ text-align: center;
629
+ vertical-align: middle;
630
+ width: 95%;
631
  }
632
 
633
  .wds_reverse {
634
+ margin: 0 5px !important;
635
  }
636
 
637
  .wds_free_button,
638
  .wds_free_button:hover {
639
+ background: linear-gradient(to bottom, #E5E5E5, #E5E5E5) repeat scroll 0 0 #f3f3f3 !important;
640
+ border-color: #bbb !important;
641
+ color: #888888 !important;
642
  }
643
 
644
  .wdi_spider_free_version_label,
645
  .wdi_spider_free_version_label * {
646
+ color: #808080 !important;
647
  }
648
 
649
  .wdi_spider_free_version {
650
+ background-color: #DFDFDF;
651
+ border: 1px solid #797979;
652
+ border-radius: 2px;
653
+ padding: 2px;
654
+ width: 210px;
655
  }
656
 
657
  .wds_more {
658
+ font-size: 12px;
659
  }
660
 
661
  .wrap .button {
662
+ border-radius: 3px !important;
663
+ text-shadow: none !important;
664
  }
665
 
666
  .wdi_spider_message_cont {
667
+ display: none;
668
+ width: 99%;
669
  }
670
 
671
  .wdi_spider_load {
672
+ display: none;
673
  }
674
 
675
  .wdi_spider_load_cont {
676
+ background-color: rgba(0, 0, 0, 0.2);
677
+ left: 0;
678
+ height: 100%;
679
+ position: fixed;
680
+ top: 0;
681
+ width: 100%;
682
+ z-index: 99998;
683
  }
684
 
685
  .wdi_spider_load_icon {
686
+ left: 0;
687
+ height: 100%;
688
+ position: fixed;
689
+ text-align: center;
690
+ top: 0;
691
+ width: 100%;
692
+ z-index: 99999;
693
  }
694
 
695
  .wdi_spider_ajax_loading {
696
+ border: none !important;
697
+ margin-top: 200px;
698
+ width: 50px;
699
+ -webkit-animation: spin 2.5s infinite linear;
700
+ -moz-animation: spin 2.5s infinite linear;
701
+ -o-animation: spin 2.5s infinite linear;
702
+ animation: spin 2.5s infinite linear;
703
  }
704
 
705
  @-moz-keyframes spin {
706
+ 0% {
707
+ -moz-transform: rotate(0deg);
708
+ }
709
+ 100% {
710
+ -moz-transform: rotate(359deg);
711
+ }
712
  }
713
  @-webkit-keyframes spin {
714
+ 0% {
715
+ -webkit-transform: rotate(0deg);
716
+ }
717
+ 100% {
718
+ -webkit-transform: rotate(359deg);
719
+ }
720
  }
721
  @-o-keyframes spin {
722
+ 0% {
723
+ -o-transform: rotate(0deg);
724
+ }
725
+ 100% {
726
+ -o-transform: rotate(359deg);
727
+ }
728
  }
729
  @-ms-keyframes spin {
730
+ 0% {
731
+ -ms-transform: rotate(0deg);
732
+ }
733
+ 100% {
734
+ -ms-transform: rotate(359deg);
735
+ }
736
  }
737
  @keyframes spin {
738
+ 0% {
739
+ transform: rotate(0deg);
740
+ }
741
+ 100% {
742
+ transform: rotate(359deg);
743
+ }
744
  }
745
 
746
  #TB_window,
747
  #TB_iframeContent {
748
+ width: 800px !important;
749
+ height: 500px !important;
750
  }
751
 
752
  #TB_window {
753
+ margin-left: -400px !important;
754
  }
755
 
 
756
  .input_th {
757
+ margin-left: 0px !important;
758
+ width: 160px !important;
759
+ font-family: sans-serif;
760
  }
761
  .input_th2 {
762
+ margin-left: 0px !important;
763
+ width: 160px !important;
764
+ margin-top:5px;
765
+ height: 19px;
766
  }
767
 
768
  .edit_input {
769
+ height: 28px !important;
770
+ padding-bottom: 7px !important;
771
  }
772
 
773
  .add_tag_th {
774
+ padding-left: 21px;
775
+ font-size: 12px;
776
+ font-family: sans-serif;
777
  }
778
 
779
  .pointer{
780
+ cursor: pointer;
781
  }
782
 
783
  .non_selectable {
784
+ -webkit-touch-callout: none;
785
+ -webkit-user-select: none;
786
+ -khtml-user-select: none;
787
+ -moz-user-select: none;
788
+ -ms-user-select: none;
789
+ user-select: none;
790
  }
791
 
792
  .wds_position_table td,
793
  .wds_position_table input{
794
+ border: 1px solid #CCCCCC;
795
+ margin: 2px;
796
  }
797
 
798
  .wds_position_table .wds_position_td {
799
+ background-color: #f4f4f4;
800
+ display: inline-block;
801
+ line-height: 1;
802
+ padding: 0 !important;
803
  }
804
 
805
  .wdi_spider_div_options {
806
+ background: none repeat scroll 0 0 #F4F4F4;
807
+ border: 1px solid #8F8D8D;
808
+ border-radius: 8px 8px 8px 8px;
809
+ display: none;
810
+ margin: 2px 0 0 190px;
811
+ padding: 13px;
812
+ min-height: 300px;
813
+ min-width: 600px;
814
+ vertical-align: top;
815
  }
816
 
817
 
 
818
  .table_medium_col {
819
+ text-align: center !important;
820
+ width: 70px;
821
  }
822
 
823
 
824
+
825
+ .table_medium_col_uncenter {
826
+ width: 80px;
827
  }
828
 
829
  .table_extra_large_col {
830
+ padding: 4px !important;
831
+ width: 150px !important;
832
  }
833
 
834
  .first-page,
839
  .table_medium_col a,
840
  .table_big_col a,
841
  .table_small_col a {
842
+ cursor: pointer;
843
  }
844
 
845
  .wdi_spider_word_wrap {
846
+ word-wrap: normal;
847
  }
848
 
849
  .wdi_spider_description {
850
+ color: #666666;
851
+ font-size: 0.923em;
852
+ line-height: 1.231em;
853
  }
854
 
855
  .handle {
856
+ background: url("../images/draggable.png") no-repeat transparent;
857
+ border: none;
858
+ cursor: move;
859
+ display: inline-block;
860
+ height: 15px;
861
+ margin: 0 auto;
862
+ vertical-align: middle;
863
+ width: 15px;
864
+ }
865
+ .wdi_page_title{
866
+ font-size: 1.5em;
867
+ font-weight: 500;
868
  }
 
869
  .slider-icon {
870
+ background-image: url("../images/slider-icon.png");
871
+ background-repeat: no-repeat;
872
+ border: none;
873
+ float: left;
874
+ height: 32px;
875
+ margin: 7px 8px 0 0;
876
+ width: 32px;
877
+ }
878
+ .theme-icon {
879
+ background-image: url("../images/theme-2.png");
880
+ background-repeat: no-repeat;
881
+ border: none;
882
+ float: left;
883
+ height: 32px;
884
+ margin: 7px 8px 0 0;
885
+ width: 32px;
886
  }
887
  .uninstall-icon {
888
+ background-image: url("../images/uninstall-icon.png");
889
+ background-repeat: no-repeat;
890
+ border: none;
891
+ float: left;
892
+ height: 32px;
893
+ margin: 7px 8px 0 0;
894
+ width: 32px;
895
  }
896
 
897
  .wdi_spider_label {
898
+ font-weight: bold;
899
+ width: 100px;
900
  }
901
 
902
  .wdi_spider_label_top {
903
+ font-weight: bold;
904
+ padding-top: 3px;
905
+ vertical-align: top;
906
+ width: 100px;
907
  }
908
 
909
  .wdi_spider_fieldset .wdi_spider_label {
910
+ font-weight: bold;
911
+ vertical-align: top;
912
+ width: 150px;
913
  }
914
 
915
  .wdi_spider_label_options {
916
+ font-weight: bold;
917
+ vertical-align: top;
918
+ width: 150px;
919
  }
920
 
921
  .wdi_spider_choose_option {
922
+ display: table;
923
+ box-shadow: 0px 0px 1px 1px #D2D2D2;
924
+ margin-bottom: 5px;
925
+ border-radius: 2px;
926
+ padding: 2px;
927
+ box-sizing: border-box;
928
+ cursor: pointer;
929
+ width: 100%;
930
  }
931
 
932
  .wdi_spider_options_cont,
935
  .wdi_spider_options_color_cont,
936
  .wdi_spider_bull_options_color_cont,
937
  .wdi_spider_pp_options_color_cont {
938
+ display: none;
939
+ width: 180px;
940
+ height: 150px;
941
+ overflow: scroll;
942
+ overflow-x: hidden;
943
+ overflow-y: scroll;
944
  }
945
 
946
  .wdi_spider_option_cont {
947
+ display: block;
948
+ border-bottom: 1px solid #D3D3D3;
949
+ padding: 3px 0px 3px 0px;
950
+ box-sizing: content-box;
951
+ width: 98%;
952
+ border-radius: 0px;
953
+ cursor: pointer;
954
  }
955
 
956
  .wdi_spider_option_cont_title {
957
+ display: table-cell;
958
+ vertical-align: middle;
959
+ padding: 0px 0px 0px 4px;
960
  }
961
 
962
  .wdi_spider_option_cont_img {
963
+ display: table-cell;
964
+ width: 23%;
965
+ height: 15px;
966
+ text-align: right;
967
+ padding: 5px 4px 0px 0px;
968
+ box-sizing: border-box;
969
+ background-color: #EEEEEE;
970
  }
971
 
972
  .wdi_spider_option_main_title {
973
+ display: table-cell;
974
+ width: 65%;
975
+ vertical-align: middle;
976
+ padding: 0px 0px 0px 4px;
977
+ color: #555;
978
  }
979
 
980
  .wdi_spider_sel_option_ic {
981
+ display: table-cell;
982
+ width: 20%;
983
+ height: 15px;
984
+ text-align: right;
985
+ padding: 0px 6px 0px 0px;
986
+ box-sizing: border-box;
987
  }
988
 
989
  .wdi_spider_int_input {
990
+ width: 45px;
991
  }
992
 
993
  .wdi_spider_char_input {
994
+ width: 115px;
995
  }
996
 
997
  .wdi_spider_text_input {
998
+ width: 190px;
999
  }
1000
 
1001
  .wdi_spider_slider_div {
1002
+ display: inline-block;
1003
+ vertical-align: middle;
1004
+ width: 140px;
1005
  }
1006
 
1007
  .wdi_spider_slider_percentage,
1008
  .wdi_spider_slider_percentage input,
1009
  .wdi_spider_slider_percentage input :focus {
1010
+ background: transparent;
1011
+ border: none;
1012
+ color: #00AEEF;
1013
+ display: inline;
1014
+ font-weight: bold;
1015
+ text-align: right;
1016
+ vertical-align: middle;
1017
+ width: 30px;
1018
  }
1019
 
1020
  .updated,
1021
  .error {
1022
+ margin: 5px 0 2px !important;
1023
  }
1024
 
1025
  .buttons_div {
1026
+ clear: both;
1027
+ float: right;
1028
+ margin: 5px 0;
1029
  }
1030
 
1031
  .buttons_div_left {
1032
+ float: left;
1033
+ margin: 5px 0;
1034
+ width: 100%;
1035
  }
1036
 
1037
  .buttons_div_right {
1038
+ float: right;
1039
+ margin: 5px 0;
1040
  }
1041
 
1042
  .wdi_spider_delete_img {
1043
+ background-image: url("../images/delete.png");
1044
+ border: none;
1045
+ cursor: pointer;
1046
+ display: inline-block;
1047
+ vertical-align: middle;
1048
+ height: 14px;
1049
+ width: 14px;
1050
  }
1051
 
1052
  .wdi_spider_delete_img_small {
1053
+ background-image: url("../images/delete.png");
1054
+ background-size: 10px auto;
1055
+ border: medium none;
1056
+ cursor: pointer;
1057
+ display: inline-block;
1058
+ height: 10px;
1059
+ margin-top: 2px;
1060
+ vertical-align: middle;
1061
+ width: 10px;
1062
  }
1063
 
1064
  .wdi_spider_fieldset {
1065
+ background: none repeat scroll 0 0 #F4F4F4;
1066
+ border: 1px solid #8F8D8D;
1067
+ border-radius: 8px 8px 8px 8px;
1068
+ display: none;
1069
+ float: left;
1070
+ margin: 4px;
1071
+ padding: 13px;
1072
+ width: 97%;
1073
  }
1074
 
1075
  .wdi_spider_type_fieldset {
1076
+ background: none repeat scroll 0 0 #F4F4F4;
1077
+ border-radius: 8px 8px 8px 8px;
1078
+ display: none;
1079
+ float: left;
1080
+ width: 100%;
1081
  }
1082
 
1083
  .wdi_spider_child_fieldset {
1084
+ background: none repeat scroll 0 0 #F4F4F4;
1085
+ border: 1px solid #8F8D8D;
1086
+ border-radius: 8px 8px 8px 8px;
1087
+ float: left;
1088
+ margin: 4px;
1089
+ width: 30%;
1090
+ padding: 13px;
1091
+ display: block;
1092
  }
1093
 
1094
  .wdi_spider_table td {
1095
+ padding: 0;
1096
+ vertical-align: middle;
1097
  }
1098
 
1099
  .wdi_spider_ctrls {
1100
+ padding: 4px;
1101
+ text-align: center;
1102
+ width: 40px;
1103
  }
1104
 
1105
  .theme_type {
1106
+ background-color: #F4F4F4;
1107
+ border: 1px solid #8F8D8D;
1108
+ border-radius: 8px 8px 8px 8px;
1109
+ cursor: pointer;
1110
+ display: inline-block;
1111
+ font-size: 16px;
1112
+ height: 24px;
1113
+ padding-top: 5px;
1114
+ text-align: center;
1115
+ vertical-align: middle;
1116
+ width: 123px;
1117
+ margin: 2px 0px 2px 0px;
1118
  }
1119
 
1120
  .ui-slider-handle {
1121
+ cursor: pointer !important;
1122
  }
1123
 
1124
  .thumb {
1125
+ border: 1px solid #CCCCCC;
1126
+ max-height: 120px;
1127
+ max-width: 120px;
1128
  }
1129
 
1130
  .fileDescription {
1131
+ color: #666666;
1132
+ cursor: pointer;
1133
+ font-family: sans-serif;
1134
+ font-size: 12px;
1135
  }
1136
 
1137
  .filename {
1138
+ font-size: 13px;
1139
  }
1140
 
1141
  .tag_div {
1142
+ background-clip: padding-box;
1143
+ background-color: #F3F3F3;
1144
+ border: 1px solid #AAAAAA;
1145
+ border-radius: 3px 3px 3px 3px;
1146
+ box-shadow: 0 0 2px #FFFFFF inset, 0 1px 0 rgba(0, 0, 0, 0.05);
1147
+ color: #666666;
1148
+ line-height: 13px;
1149
+ margin: 2px 0;
1150
+ padding: 2px 5px 2px 5px;
1151
+ width: 132px;
1152
  }
1153
 
1154
  .tags_div {
1155
+ overflow-y: auto;
1156
+ height: 65px;
1157
  }
1158
 
1159
  .tag_name {
1160
+ width: 118px;
1161
  }
1162
 
1163
  .edit_thumb {
1164
+ cursor: pointer;
1165
  }
1166
 
1167
  .wdi_spider_rotate {
1168
+ border-radius: 2px;
1169
+ border: 1px solid #FFFFFF;
1170
+ height: 30px;
1171
  }
1172
 
1173
  .wdi_spider_search_value {
1174
+ height: 2em;
1175
+ margin: 0 0 4px;
1176
  }
1177
 
1178
  #th_order,
1179
  .wdi_spider_order {
1180
+ display: none;
1181
  }
1182
 
1183
  .wds_add_video,
1184
  .wds_resize_image,
1185
  .wds_import,
1186
  .wds_exports {
1187
+ display: none;
1188
+ padding: 10px;
1189
+ height: 60px;
1190
+ background-color: #FFFFFF;
1191
+ border: 1px solid #999999;
1192
+ top: 50%;
1193
+ position: fixed;
1194
+ left: 50%;
1195
+ text-align: left;
1196
+ z-index: 100000;
1197
+ border-radius: 3px;
1198
+ margin-top: -45px;
1199
  }
1200
 
1201
  .wds_add_video,
1202
  .wds_resize_image {
1203
+ margin-left: -340px;
1204
  }
1205
 
1206
  .wds_exports {
1207
+ margin-left: -240px;
1208
  }
1209
 
1210
  .wds_import {
1211
+ margin-left: -185px;
1212
  }
1213
 
1214
  .wds_add_video input[type="text"],
1215
  .wds_resize_image input[type="text"] {
1216
+ width: 500px;
1217
  }
1218
 
1219
 
1220
  .wds_opacity_video,
1221
  .wds_opacity_import,
1222
  .wds_opacity_export {
1223
+ background-color: #000000;
1224
+ display: none;
1225
+ opacity: 0.75;
1226
+ filter: Alpha(opacity=75);
1227
+ position: fixed;
1228
+ top: 0;
1229
+ left: 0;
1230
+ width: 100%;
1231
+ height: 100%;
1232
+ z-index: 99998;
1233
  }
1234
 
1235
 
1236
+
1237
  .wds_tabs {
1238
+ clear: both;
1239
+ display: none;
1240
+ position: relative;
1241
+ z-index: 1;
1242
  }
1243
 
1244
  .wds_tabs a.wds_sub_active,
1245
  .wds_tabs a.wds_active {
1246
+ background-color: #F5F5F5;
1247
+ border-bottom: 1px solid #F5F5F5;
1248
+ color: #333;
1249
  }
1250
 
1251
  .wds_tabs a {
1252
+ background-color: #f9f9f9;
1253
+ border: 1px solid #dfdfdf;
1254
+ border-top-left-radius: 3px;
1255
+ border-top-right-radius: 3px;
1256
+ color: #c7c7c7;
1257
+ display: block !important;
1258
+ float: left;
1259
+ font: bold 17px/32px Arial,serif;
1260
+ height: 30px;
1261
+ margin: 3px 3px 0 0;
1262
+ padding: 0 10px;
1263
+ position: relative;
1264
+ text-decoration: none;
1265
+ width: 130px;
1266
  }
1267
 
1268
  .wbs_subtab a {
1269
+ font: bold 14px/26px Arial,serif;
1270
+ height: 26px;
1271
+ padding: 0 5px;
1272
+ width: 105px;
1273
  }
1274
 
1275
  .wds_add_layer {
1276
+ font: normal 20px/28px Arial,serif !important;
1277
+ width: initial !important;
1278
+ padding: 0 9px !important;
1279
  }
1280
 
1281
  .wds_tab_title {
1282
+ background: none repeat scroll 0 0 transparent !important;
1283
+ border: none !important;
1284
+ cursor: pointer;
1285
+ opacity: 0.5;
1286
+ filter: Alpha(opacity=50);
1287
+ padding: 1px;
1288
+ vertical-align: middle;
1289
+ width: 50px;
1290
  }
1291
 
1292
  .wds_sub_active .wds_tab_title,
1293
  .wds_layer_title {
1294
+ background-color: #FFFFFF !important;
1295
+ border-color: #DFDFDF !important;
1296
+ border-radius: 3px !important;
1297
+ border-style: solid !important;
1298
+ border-width: 1px !important;
1299
+ cursor: pointer;
1300
+ opacity: 1;
1301
+ filter: Alpha(opacity=100);
1302
  }
1303
 
1304
  .wds_tab_remove {
1305
+ background-image: url("../images/close.png");
1306
+ background-repeat: no-repeat;
1307
+ background-size: 100% 100%;
1308
+ display: inline-block;
1309
+ width: 9px;
1310
+ height: 9px;
1311
+ opacity: 0.5;
1312
+ filter: Alpha(opacity=50);
1313
+ vertical-align: middle;
1314
+ }
1315
 
1316
  .wds_layer_remove {
1317
+ background-image: url("../images/close.png");
1318
+ background-repeat: no-repeat;
1319
+ background-size: 100% 100%;
1320
+ display: inline-block;
1321
+ width: 15px;
1322
+ height: 15px;
1323
+ margin: 5px;
1324
+ float: right;
1325
  }
1326
 
1327
  .wds_layer_dublicate {
1328
+ background-image: url("../images/duplicate.png");
1329
+ background-repeat: no-repeat;
1330
+ background-size: 100% 100%;
1331
+ display: inline-block;
1332
+ width: 15px;
1333
+ height: 15px;
1334
+ margin: 5px;
1335
+ float: right;
1336
  }
1337
 
1338
  .wds_slide_dublicate {
1339
+ background-image: url("../images/duplicate.png");
1340
+ background-repeat: no-repeat;
1341
+ background-size: 100% 100%;
1342
+ display: inline-block;
1343
+ width: 12px;
1344
+ height: 12px;
1345
+ vertical-align: middle;
1346
  }
1347
 
1348
  .wds_layer_depth {
1349
+ float: right;
1350
+ font-size: 13px;
1351
+ line-height: 15px;
1352
+ margin: 1px 5px;
1353
+ text-align: left;
1354
+ width: 40px;
1355
  }
1356
 
1357
  .wds_layer_label {
1358
+ display: inline-block;
1359
+ font-size: 13px;
1360
+ width: 80%;
1361
  }
1362
 
1363
  .wds_sub_active .wds_tab_remove {
1364
+ cursor: pointer !important;
1365
+ opacity: 1;
1366
+ filter: Alpha(opacity=100);
1367
  }
1368
 
1369
  .wds_box.wds_sub_active,
1370
  .wds_box.wds_active {
1371
+ display: block;
1372
  }
1373
 
1374
  .wds_tab_label {
1375
+ display: block;
1376
+ width: inherit;
1377
  }
1378
 
1379
  .wds_box {
1380
+ display: none;
1381
+ margin-top: 0 !important;
1382
+ position: relative;
1383
+ top: -1px;
1384
  }
1385
 
1386
  .wds_box {
1387
+ border: 1px solid #dfdfdf;
1388
+ border-radius: 3px;
1389
+ box-shadow: 0 0 10px #f2f2f2;
1390
+ margin-top: 15px;
1391
+ position: relative;
1392
  }
1393
 
1394
  .wds_clear {
1395
+ clear: both;
1396
+ float: none !important;
1397
  }
1398
 
1399
  .wds_box thead td {
1400
+ border-bottom: 0 none !important;
1401
  }
1402
 
1403
  .wds_box tbody {
1404
+ background-color: #FFFFFF;
1405
+ border-top: 0 none;
1406
+ padding-left: 10px;
1407
  }
1408
 
1409
  .wds_box thead {
1410
+ background: -webkit-linear-gradient(#F5F5F5, #FFFFFF);
1411
+ background: -o-linear-gradient(#F5F5F5, #FFFFFF);
1412
+ background: -moz-linear-gradient(#F5F5F5, #FFFFFF);
1413
+ background: linear-gradient(#F5F5F5, #FFFFFF);
1414
+ border-top: 0 none;
1415
+ border-bottom: 0 none;
1416
+ color: #333;
1417
+ font: bold 12px/29px Arial,serif;
1418
+ height: 29px;
1419
+ margin: 0;
1420
+ padding: 0 10px;
1421
+ text-align: left;
1422
+ text-shadow: 0 1px 0 #fff;
1423
  }
1424
 
1425
  .wds_box table {
1426
+ border-collapse: collapse;
1427
+ border-spacing: 0;
1428
+ width: 100%;
1429
  }
1430
 
1431
  .wds_nav_tabs {
1432
+ background-color: #F5F5F5;
1433
+ border-right: 1px solid #DFDFDF;
1434
+ float: left;
1435
+ height: 640px;
1436
+ margin: 0;
1437
+ width: 150px;
1438
  }
1439
 
1440
  .wds_nav_tabs ul {
1441
+ list-style: none outside none;
1442
+ margin: 10px 0;
1443
+ padding: 0;
1444
  }
1445
 
1446
  .wds_nav_tabs .wds_sub_active,
1449
  .wds_nav_tabs .wds_active,
1450
  .wds_nav_tabs .wds_active a,
1451
  .wds_nav_tabs .wds_active a:hover {
1452
+ background: none repeat scroll 0 0 #fff;
1453
+ color: #333;
1454
  }
1455
 
1456
  .wds_nav_tabs .wds_active {
1457
+ border-color: #DFDFDF;
1458
+ border-width: 1px 0 1px 1px;
1459
+ border-style: solid;
1460
+ margin: 0 -1px 0 -4px;
1461
+ padding: 0;
1462
  }
1463
 
1464
  .wds_nav_tabs li {
1465
+ border-color: transparent;
1466
+ border-style: solid;
1467
+ border-width: 1px 0;
1468
+ list-style-type: none;
1469
+ margin-bottom: 0;
1470
  }
1471
 
1472
  .wds_nav_tabs a {
1473
+ display: block;
1474
+ line-height: 18px;
1475
+ padding: 5px 5px 5px 12px;
1476
+ text-decoration: none;
1477
  }
1478
 
1479
  .wds_nav_box {
1480
+ background: none repeat scroll 0 0 #fff;
1481
+ display: none;
1482
+ height: 610px;
1483
+ overflow: auto;
1484
+ padding: 15px;
1485
  }
1486
 
1487
  .wds_nav_box.wds_active {
1488
+ display: block;
1489
  }
1490
 
1491
  .wds_layer_head {
1492
+ background-color: #F5F5F5;
1493
+ border-bottom: 1px solid #DFDFDF;
1494
+ border-top: 1px solid #DFDFDF;
1495
+ cursor: pointer;
1496
+ padding: 5px;
1497
  }
1498
 
1499
  .wds_layer_head .handle {
1500
+ cursor: move;
1501
+ display: inline-block;
1502
+ margin: 5px;
1503
  }
1504
 
1505
  .wds_box td {
1506
+ padding: 10px !important;
1507
  }
1508
 
1509
  .wds_draggable {
1510
+ box-sizing: border-box;
1511
+ cursor: move;
1512
  }
1513
 
1514
  .wds_box .color {
1515
+ width: 60px;
1516
  }
1517
 
1518
  .wds_active_layer {
1519
+ box-shadow: rgb(44, 36, 36) 0px 0px 5px;
1520
+ border-radius: 3px;
1521
  }
1522
 
1523
  .wds_draggable a,
1524
  .wds_draggable a:hover {
1525
+ color: inherit !important;
1526
+ font-size: inherit !important;
1527
+ font-style: inherit !important;
1528
+ font-weight: inherit !important;
1529
+ text-decoration: none;
1530
  }
1531
 
1532
  #add_embed_help {
1533
+ height: 200px;
1534
+ width: 672px;
1535
+ top: 40%;
1536
  }
1537
 
1538
  #add_embed input[type="text"] {
1539
+ width: 500px;
1540
  }
1541
 
1542
  .wds_buttons {
1543
+ float: right;
1544
+ font-weight: normal;
1545
+ position: relative;
1546
  }
1547
 
1548
  .wds_reset_button {
1549
+ display: none;
1550
+ font-weight: normal;
1551
+ margin: 10px 0;
1552
+ position: absolute;
1553
+ right: 40px;
1554
+ z-index: 1;
1555
  }
1556
 
1557
+ .wdi_about_filed{
1558
+ font-size: 13px;
1559
+ font-style: italic;
1560
+ }
1561
+ .wdi_theme .section_col,
1562
  #wdi_save_feed .two .section_col {
1563
+ width: 47%;
1564
+ float: left;
1565
+ margin: 0 1.5% 18px;
1566
+ }
1567
+ .wdi_theme .section_col{
1568
+ margin-bottom:0;
1569
  }
1570
  #wdi_save_feed .wdi_element {
1571
+ margin: 0 0 18px;
1572
  }
1573
 
1574
+ .display_type_content {
1575
+ background: #fff;
1576
+ border: 1px solid #dedede;
1577
+ margin-bottom: 15px;
1578
+ }
1579
  #wdi_save_feed .half .wdi_element,
1580
  #wdi_save_feed .one .wdi_element {
1581
  width: 96%;
1587
  display: none !important;
1588
  }
1589
 
 
1590
  #wdi_save_feed .wdi_element p {
1591
+ margin: 2px 0 0;
1592
  }
1593
  .wdi_section_name {
1594
+ font-size: 19px;
1595
+ margin: 0 auto 15px;
1596
+ width: 100%;
1597
+ box-sizing: border-box;
1598
+ padding: 15px;
1599
+ border-bottom: 1px solid #f1f1f1;
1600
  color: #444;
1601
  cursor: pointer;
1602
  }
1603
  .wdi_section {
1604
+ border: 1px solid #dedede;
1605
  margin-bottom: 20px;
1606
  background:#fff;
1607
  }
1608
+ .wdwt_param .optioninput * ,
1609
  .wdi_section .optioninput * {
1610
+ text-align: left;
1611
  }
1612
  .wdi_section.half {
1613
+ width: 49%;
1614
+ float: left;
1615
  -webkit-box-sizing:border-box;
1616
  -moz-box-sizing:border-box;
1617
  box-sizing:border-box;
1620
  text-align:right;
1621
  margin-top: 7px;
1622
  }
1623
+
1624
  .wdi_tab .wdi_section.half:last-child{
1625
  margin-left:2%;
1626
  }
1627
 
1628
+ label[for=WDI_user_padding] {
1629
+ display: block;
1630
+ }
1631
+ .wdi_settings_notification{
1632
+ font-size: 13px;
1633
+ color: darkred;
1634
+ }
1635
+
1636
  /*wdi how to publish*/
1637
  #how_to_publish_tab .wdi_howto_container{
1638
  display: flex;
1658
  margin: 0;
1659
  padding: 11px 15px 4px 0;
1660
  }
1661
+ #how_to_publish_tab .wdi_howto_container .wdi_howto_content .wdi_howto_wrapper{
1662
+ max-width: 270px;
1663
+ margin: 0 auto;
1664
+ }
1665
+
1666
+ #how_to_publish_tab .wdi_howto_container .wdi_howto_content .wdi_howto_wrapper img{
1667
+ max-width: 100%;
1668
+ }
1669
 
1670
  #how_to_publish_tab .wdi_howto_container .wdi_howto_content input{
1671
  margin: 0 auto;
1672
  text-align: center;
1673
  width: 100%;
1674
  }
1675
+
1676
  .wdi_buttons button.button.preview-button {
1677
+ height: 28px;
1678
  }
1679
+
1680
  @media (max-width: 782px) {
1681
  .wdi_buttons button.button.preview-button {
1682
  height: auto;
1683
  }
1684
  }
1685
 
1686
+ @media (min-width: 820px) {
1687
+ #conditional_filters_tab .one .wdi_element {
1688
+ width: 70%;
1689
+ float: none;
1690
+ margin: 0 2% 20px;
1691
+ }
1692
+
1693
+ .wdi_border_wrapper .wdi_element_content {
1694
+ width: 100%;
1695
+ display: block;
1696
+ }
1697
+
1698
+ .wdi_border_wrapper .wdi_element_title {
1699
+ display: block;
1700
+ }
1701
+
1702
+ .wdi_border_wrapper .wdi_element_content input[type=text]:not(.wp-color-picker) {
1703
+ width: calc(100% - 30px);
1704
+ height: 28px;
1705
+ }
1706
+
1707
+ .wdi_element_content .wdi_filter_input input[type=text]:not(.wp-color-picker) {
1708
+ width: 270px;
1709
+ }
1710
+
1711
+ /*.wdi_element_content .wdi_filter_input #wdi_add_filter{
1712
+ width:150px;
1713
+ }*/
1714
+ .wdi_border_wrapper .wdi_element_content input#wdi_add_user_ajax_input {
1715
+ width: calc(100% - 78px);
1716
+ }
1717
+
1718
+ .wdi_border_wrapper .wdi_element_content input[type=number] {
1719
+ width: calc(100% - 30px);
1720
+ }
1721
+
1722
+ .wdi_border_wrapper .wdi_element_content select {
1723
+ width: calc(100% - 30px);
1724
+ }
1725
+
1726
+ .wdi_element_content .wdi_filter_input select {
1727
+ width: calc(100% - 413px);
1728
+ }
1729
+
1730
+ .wdi_filter_input input {
1731
+ height: 28px;
1732
+ line-height: 28px;
1733
+ }
1734
  }
1735
+
1736
  @media (max-width: 768px) {
1737
+
1738
+ .wdi_element_content .wdi_filter_input input[type=text] {
1739
+ width: 130px;
1740
+ }
1741
+
1742
+ .wdi_element_content .wdi_filter_input select {
1743
+ width: calc(100% - 144px);
1744
+ }
1745
+
1746
+ .wdi_theme .section_col,
1747
  #wdi_save_feed .two .section_col {
1748
  width: 96%;
1749
  float: none;
1750
  margin: 0 2% 18px;
1751
  }
1752
+
1753
  .wdi_section.half {
1754
  width: 100%;
1755
  float: none;
1756
+ margin:0 0 20px !important;
1757
+ }
1758
+ .wdi_theme .section_col{
1759
+ margin-bottom:0;
1760
  }
1761
  }
1762
 
1763
+
1764
+
1765
  .wdi_section_close::before{
1766
  content: "\f142";
1767
  display: inline-block;
1795
  margin: 0 0 3px;
1796
  background-color: #fff;
1797
  }
1798
+ .wdi_themes_list td{
1799
+ display: table-cell !important;
1800
+ }
1801
 
1802
 
1803
+ #wdi_feed_form .wd-page-title.wd-header {
1804
+ width: 100%;
1805
+ padding: 10px 0;
1806
+ }
1807
+ @media screen and (max-width: 782px){
1808
+ #wdi_feed_form p.search-box {
1809
+ margin-bottom: 0;
1810
+ }
1811
+ #wdi_feed_form p.search-box input[type="search"]{
1812
+ width:100%;
1813
+ height: auto !important;
1814
+ }
1815
+ #wdi_feed_form p.search-box input[type="button"]{
1816
+ margin-bottom: 10px;
1817
+ padding: 6px 14px;
1818
+ line-height: normal;
1819
+ font-size: 14px;
1820
+ height: auto;
1821
+ }
1822
+ .wdi-page-header .WDI_title_input {
1823
+ width: 60%;
1824
+ }
1825
+ .wdi-page-header .wdi_buttons {
1826
+ float: none;
1827
+ text-align: center;
1828
+ }
1829
  }
1830
 
1831
 
1832
+ .wdi_element_name_hashtag_top_recent{
1833
+ display: none;
1834
+ }
1835
 
1836
+ /*body.toplevel_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(3),*/
1837
+ body.toplevel_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(4),
1838
+ body.toplevel_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(5){
1839
+ display: none;
1840
+ }
1841
 
1842
+ body.instagram-feed_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(3){
1843
+ display: table-row !important;
 
1844
  }
1845
+ body.instagram-feed_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(4){
1846
+ display: table-row !important;
1847
+ }
1848
+ /* Settings Form */
1849
+ .wdi_settings_form .button {
1850
+ min-height: unset;
1851
+ padding: 9px 20px;
1852
+ background: rgba(255, 255, 255, 1) 0% 0% no-repeat;
1853
+ border: 1px solid #DEDEDE;
1854
+ border-radius: 4px;
1855
+ line-height: 19px;
1856
+ font-weight: 600;
1857
+ font-size: 14px;
1858
+ color: rgba(50, 55, 60, 1);
1859
+ height: auto !important;
1860
+ }
1861
+
1862
+ .wdi-page-title {
1863
+ margin-bottom: 30px;
1864
+ text-align: left;
1865
+ letter-spacing: 0px;
1866
+ font-size: 22px;
1867
+ color: rgba(50, 58, 69, 1);
1868
+ }
1869
+ .wdi-input-group {
1870
+ margin: 0 0 30px 0;
1871
+ }
1872
+ .wdi-input-group:last-child {
1873
+ margin: 0px;
1874
+ }
1875
+ .wdi-input-group label {
1876
+ display: block;
1877
+ margin-bottom: 15px;
1878
+ font-weight: bold;
1879
+ line-height: 20px;
1880
+ font-size: 15px;
1881
+ color: rgba(50, 58, 69, 1);
1882
+ }
1883
+ .wdi-input-group input[type='text'],
1884
+ .wdi-input-group input[readonly],
1885
+ .wdi-input-group textarea {
1886
+ width: 100%;
1887
+ max-height: 40px;
1888
+ margin: 0px;
1889
+ padding: 10px 12px;
1890
+ background: rgba(255, 255, 255, 1);
1891
+ border-radius: 4px;
1892
+ border: 1px solid rgba(221, 221, 221, 1);
1893
+ font-weight: 400;
1894
+ font-size: 15px;
1895
+ color: rgba(50, 58, 69, 1);
1896
+ }
1897
+ .wdi-input-group textarea {
1898
+ max-height: 100px;
1899
+ min-height: 100px;
1900
  }
1901
+ .wdi-input-group select {
1902
+ max-width: unset;
1903
+ width: 100%;
1904
+ margin: 0px;
1905
+ padding: 10px 12px;
1906
+ border-radius: 4px;
1907
+ border: 1px solid rgba(221, 221, 221, 1);
1908
+ font-weight: 400;
1909
+ font-size: 15px;
1910
+ color: rgba(50, 58, 69, 1);
1911
+ }
1912
+ .wdi-connect-instagram {
1913
+ background-image: url(../images/instagram-connect.png);
1914
+ background-size: cover;
1915
+ width: 330px;
1916
+ height: 50px;
1917
+ cursor: pointer;
1918
+ }
1919
+
1920
+ .wdi-access-token-missing {
1921
+ max-width: 778px;
1922
+ margin: 10px 0 50px 0;
1923
+ line-height: 17px;
1924
+ font-size: 13px;
1925
+ color: rgba(50, 58, 69, 1);
1926
+ }
1927
+ .wdi-access-token-missing p {
1928
+ margin: 0px;
1929
+ }
1930
+ .wdi-accounts-list li {
1931
+ margin-bottom: 20px;
1932
+ padding: 20px;
1933
+ background: rgba(249, 249, 249, 1);
1934
+ }
1935
+ .wdi-accounts-list .wdi-account-block {
1936
+ display: flex;
1937
+ flex-wrap: wrap;
1938
+ justify-content: space-between;
1939
+ }
1940
+ .wdi-accounts-list .wdi-account-user-info {
1941
+ float: left;
1942
+ min-width: 145px;
1943
+ margin-right: 15px;
1944
+ }
1945
+ .wdi-accounts-list .wdi-account-name {
1946
+ margin: 0px;
1947
+ font-weight: bold;
1948
+ line-height: 24px;
1949
+ font-size: 18px;
1950
+ color: rgba(50, 58, 69, 1);
1951
+ }
1952
+ .wdi-accounts-list .wdi-account-type {
1953
+ margin: 0px;
1954
+ line-height: 16px;
1955
+ text-transform: capitalize;
1956
+ font-size: 12px;
1957
+ color: rgba(50, 58, 69, 0.8);
1958
+ }
1959
+ .wdi-accounts-list .wdi-account-show-token {
1960
+ float:left;
1961
+ width: 27px;
1962
+ height: 27px;
1963
+ padding: 8px 0 0 8px;
1964
+ background: rgba(255, 255, 255, 1);
1965
+ border: 1px solid rgba(222, 222, 222, 1);
1966
+ border-radius: 4px;
1967
+ cursor: pointer;
1968
+ }
1969
+ .wdi-accounts-list .wdi-account-remove {
1970
+ display: block;
1971
+ padding: 9px 20px;
1972
+ background: rgba(255, 255, 255, 1) 0% 0% no-repeat padding-box;
1973
+ border: 1px solid rgba(222, 222, 222, 1);
1974
+ border-radius: 4px;
1975
+ font-weight: 500;
1976
+ font-size: 14px;
1977
+ color: rgba(50, 55, 60, 1);
1978
+ cursor: pointer;
1979
  height: auto !important;
1980
  }
1981
+ .wdi-accounts-list .wdi-account-accesstoken {
1982
+ margin-top: 25px;
1983
+ display: none;
1984
+ clear: both;
1985
+ }
1986
+ .wdi-account-accesstoken .wdi-account-remove {
1987
+ display: none;
1988
  }
1989
+ .wdi-advanced-options {
1990
+ max-width: 752px;
1991
+ padding: 20px;
1992
+ margin-top: 30px;
1993
+ background: rgba(249, 249, 249, 1);
1994
  }
1995
+ .wdi-advanced-options .wdi-advanced-headline {
1996
+ margin-bottom: 25px;
1997
+ padding-bottom: 16px;
1998
+ border-bottom: 1px solid rgba(229, 229, 229, 1);
1999
  }
2000
+ .wdi-advanced-options .wdi-advanced-headline .wdi-page-title {
2001
+ float: left;
2002
+ margin: 0;
2003
+ font-size: 16px;
2004
  }
2005
+ .wdi-advanced-options .wdi-advanced-headline i {
2006
  float: right;
2007
+ cursor: pointer;
2008
  }
2009
+ .wdi-advanced-options .wdi-advanced-body {
2010
+ display: none;
2011
  }
2012
 
2013
+ .wdi_settings_form .submit {
2014
+ margin: 30px 0 0 0;
2015
+ padding: 0px;
2016
+ }
2017
+ .wdi_settings_form .button-primary {
2018
+ background: #007cba;
2019
+ border-color: #007cba;
2020
+ color: #fff;
2021
+ height: auto !important;
2022
+ }
2023
+ .wdi-popup {
2024
  display: none;
2025
+ position: fixed;
2026
+ height: 100%;
2027
+ width: 100%;
2028
+ top: 0;
2029
+ left: 0;
2030
+ background: rgba(0, 0, 0, 0.3);
2031
+ z-index: 1000000;
2032
+ }
2033
+ .wdi-popup .wdi-popup-container {
2034
+ top: 50%;
2035
+ transform: translate(0,-50%);
2036
+ width: 800px;
2037
+ position: relative;
2038
+ margin: 0 auto;
2039
+ padding: 30px 30px 25px 30px;
2040
+ background: #fff;
2041
+ border-radius: 4px;
2042
  }
2043
+ .wdi-popup .wdi-popup-container .wdi-popup-close {
2044
+ display: block;
2045
+ position: absolute;
2046
+ top: 12px;
2047
+ right: 11px;
2048
+ width: 10px;
2049
+ height: 10px;
2050
+ background-image: url(../images/close.svg);
2051
+ background-position: center;
2052
+ background-repeat: no-repeat;
2053
+ cursor: pointer;
2054
  }
2055
+ .wdi-popup .wdi-popup-container h3 {
2056
+ margin:0px 0 30px 0;
2057
+ line-height: 30px;
2058
+ font-weight: 700;
2059
+ font-size: 20px;
2060
+ }
2061
+ #wdi-personal-business-popup .wdi-popup-container {
2062
+ width: 570px;
2063
+ height: auto;
2064
+ text-align: center;
2065
+ }
2066
+ .wdi_paid{
2067
+ pointer-events: none !important;
2068
+ font-size: 12px;
2069
+ text-decoration: none;
2070
+ color: rgba(255, 255, 255, 1);
2071
+ background: transparent linear-gradient(262deg, rgba(0, 138, 98, 1) 0%, rgba(35, 181, 54, 1) 100%) 0% 0% no-repeat padding-box;
2072
+ border-radius: 4px;
2073
+ padding: 8px 12px;
2074
+ float: right;
2075
+ margin-top: 20px;
2076
+ }
2077
+ .wdi-label-business:after{
2078
+ clear: both;
2079
+ display: table;
2080
+ content: "";
2081
+ }
2082
+ .wdi-popup-container:after{
2083
+ clear: both;
2084
+ display: table;
2085
+ content: "";
2086
+ }
2087
+ #wdi-personal-business-popup .wdi-radio-button {
2088
+ margin: 0px;
2089
+ font-size: 14px;
2090
+ }
2091
+ #wdi-personal-business-popup .wdi-radio-button p {
2092
+ margin: 0;
2093
+ display: block;
2094
+ width: 100%;
2095
+ text-align: left;
2096
+ background: #FFFFFF 0% 0% no-repeat padding-box;
2097
+ box-shadow: 0px 0px 10px #00000026;
2098
+ margin-bottom: 20px;
2099
+ padding: 21px 20px 20px 42px;
2100
+ box-sizing: border-box;
2101
+ border-radius: 4px;
2102
+ }
2103
+ .wdi-radio-button .wdi-label-personal label input, .wdi-radio-button .wdi-label-personal label span, .wdi-radio-button .wdi-label-business label input, .wdi-radio-button .wdi-label-business label span{
2104
+ position: relative;
2105
+ left: -24px;
2106
  }
2107
 
2108
+ #wdi-personal-business-popup .wdi-radio-button p:first-child {
2109
+ margin-right: 50px;
2110
+ }
2111
+ #wdi-personal-business-popup .wdi-radio-button p label {
2112
+ font-size: 14px;
2113
+ display: block;
2114
+ }
2115
+ .wdi_info_text{
2116
+ font-size: 14px;
2117
+ line-height: 20px;
2118
+ font-weight: 400;
2119
+ color: rgba(50, 58, 69, 0.5);
2120
+ margin-top: 4px;
2121
+ display: block;
2122
+ }
2123
+ #wdi-personal-business-popup .dashicons-info {
2124
+ color: #ccc;
2125
+ }
2126
+ .wdi-radio-button .wdi-radio-info-text {
2127
  display: none;
2128
+ position: absolute;
2129
+ max-width: 220px;
2130
+ margin: 5px 0 0 78px;
2131
+ padding: 14px;
2132
+ background: rgba(255, 255, 255, 1);
2133
+ box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.14);
2134
+ border: 1px solid rgba(218, 220, 220, 1);
2135
+ border-radius: 4px;
2136
+ line-height: 20px;
2137
+ font-size: 14px;
2138
+ }
2139
+ .wdi-radio-button .wdi-label-business .wdi-radio-info-text {
2140
+ margin: 5px 0 0 -152px;
2141
+ }
2142
+ .wdi-radio-button .wdi-radio-info-text.active {
2143
+ display: block;
2144
+ }
2145
+ #wdi-personal-business-popup .wdi-connect {
2146
+ width: 140px;
2147
+ height: 37px;
2148
+ margin-top: 10px;
2149
+ padding: 0px;
2150
+ line-height: 37px;
2151
+ font-size: 14px;
2152
+ background-color: rgba(33, 96, 181, 1);
2153
+ float: right;
2154
+ }
2155
+ @media screen and (max-width: 1919px) {
2156
+ .wdi-advanced-options {
2157
+ max-width: unset;
2158
+ }
2159
+ }
2160
+ @media screen and (max-width: 767px) {
2161
+ br.wdi_desktop{
2162
+ display: none !important;
2163
+ }
2164
+ #wdi-personal-business-popup .wdi-connect {
2165
+ margin-top: 0px;
2166
+ }
2167
+ .wdi_paid{
2168
+ width: 229px;
2169
+ box-sizing: border-box;
2170
+ padding: 8px 7px;
2171
+ font-size: 11px;
2172
+ }
2173
+ .wdi-radio-button input[type="radio"]:checked:before {
2174
+ width: 6px;
2175
+ height: 6px;
2176
+ margin: 4px;
2177
+ }
2178
+ input[type="radio"], input[type="checkbox"] {
2179
+ height: 16px;
2180
+ width: 12px;
2181
+ }
2182
+ #wdi-personal-business-popup .wdi-radio-button p {
2183
+ padding: 19px 18px 18px 38px;
2184
+ }
2185
+ .wdi-radio-button .wdi-label-personal label input, .wdi-radio-button .wdi-label-personal label span, .wdi-radio-button .wdi-label-business label input, .wdi-radio-button .wdi-label-business label span {
2186
+ position: relative;
2187
+ left: -25px;
2188
+ }
2189
+ .wdi-popup .wdi-popup-container {
2190
+ padding: 30px 20px 20px 20px;
2191
+ }
2192
+ .wdi-settings-page .wdi_settings_form {
2193
+ margin-right: 10px;
2194
+ padding: 20px 15px;
2195
+ }
2196
+
2197
+ .wdi-connect-instagram {
2198
+ background-image: url(../images/instagram-connect-320.png);
2199
+ width: 272px;
2200
+ height: 40px;
2201
+ }
2202
+ .wdi-account-block > div {
2203
+ width: 100%;
2204
+ }
2205
+ .wdi-accounts-list li {
2206
+ margin-bottom: 15px;
2207
+ padding: 20px 15px;
2208
+ }
2209
+ .wdi-accounts-list .wdi-account-show-token {
2210
+ float: right;
2211
+ }
2212
+ .wdi-account-block .wdi-account-remove {
2213
+ display: none;
2214
+ }
2215
+ .wdi-account-accesstoken .wdi-account-remove {
2216
+ display: block;
2217
+ float: right;
2218
+ margin-top: 20px;
2219
+ }
2220
+ #wdi-personal-business-popup .wdi-popup-container {
2221
+ width: 300px;
2222
+ box-sizing: border-box;
2223
+ }
2224
+ .wdi-popup .wdi-popup-container h3 {
2225
+ max-width: 260px;
2226
+ margin: 0px auto 20px auto;
2227
+ font-size: 16px;
2228
+ line-height: 26px;
2229
+ }
2230
+ .wdi-radio-button .wdi-label-personal .wdi-radio-info-text {
2231
+ margin: 5px 0 0 12px;
2232
+ }
2233
+ .wdi-radio-button .wdi-label-business .wdi-radio-info-text {
2234
+ margin: 5px 0 0 -147px;
2235
+ }
2236
+ .wdi_settings_form .submit {
2237
+ margin-top: 25px;
2238
+ }
2239
  }
2240
+ .wdi_pro_only{
2241
+ font-style: italic;
2242
+ color: #4E4E4E !important;
2243
+ background-color: #cccccc !important;
2244
+ text-decoration: none;
2245
+ font-weight: bold;
2246
+ }
2247
+ .wdi-pro-overlay img {
2248
+ opacity: .7;
2249
+ }
2250
+ .wdi_pro_notice {
2251
+ text-align: right;
2252
+ color: #15699f;
2253
+ font-size: 20px !important;
2254
+ padding: 10px;
2255
+ }
2256
+ .wdi-radio-button .wdi_account_type{
2257
+ font-weight: 700;
2258
+ color: #323A4580;
2259
+ }
2260
+ .wdi_input_group{
2261
+ border: 1px solid transparent;
2262
+ }
2263
+ .wdi_active{
2264
+ border: 1px solid rgba(33, 96, 181, 1);
2265
+ }
2266
+ .wdi_active .wdi_account_type, .wdi_active .wdi_info_text{
2267
+ color: #323A45;
2268
+ }
2269
+ .wdi_free .wdi_info_text span{
2270
+ text-decoration: underline;
2271
+ }
2272
+ .wdi_pro .wdi_account_type, .wdi_pro .wdi_info_text{
2273
+ color: #323A45 !important;
2274
+ }
2275
+
css/wdi_backend.min.css CHANGED
@@ -1 +1 @@
1
- .wdi_clear{clear:both}.wdi_clear_tag:after{content:"";display:table;clear:both}#wdi_unistall{background-color:#d82121;border-color:#d31818;box-shadow:inset 0 1px 0 rgba(230,120,120,0.5),0 1px 0 rgba(0,0,0,.15)}#wdi_unistall:hover{background-color:#da1313}#wdi_unistall_table th{width:45%}.display_type_content{background:#fff;border:1px solid #dedede;margin-bottom:15px}.wdi_tooltip,.wdi_settings_link{display:block;font-size:14px !important;font-weight:bold;line-height:20px;margin-bottom:5px;color:#444;text-decoration:none}p.wdi_about_filed{font-size:13px;font-style:italic}.wdi_tooltip:hover,.wdi_settings_link:hover{color:#23282d;position:relative}.wdi_tooltip:hover:after{content:attr(wdi-tooltip);padding:4px 8px;color:#dbdbe0;position:absolute;left:0;top:100%;white-space:nowrap;z-index:20;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:2px;-moz-box-shadow:0 0 4px #222;-webkit-box-shadow:0 0 4px #222;box-shadow:0 0 4px rgba(0,0,0,0.5);background-color:rgba(0,0,0,0.75);font-size:12px}.wdi_pro_only{font-style:italic;color:#4e4e4e !important;background-color:#ccc !important;text-decoration:none}.wdi_pro_only_op{opacity:.6}.wdi_pro_notice{text-align:right;color:#15699f;font-size:20px !important;padding:10px}.wdi_pro_only_btn{background-color:#c5c0c0 !important;border-top-color:#c5c0c0 !important}.wdi-pro-overlay img{opacity:.7}#wdi_feed_users{width:100%;margin-top:2px}#wdi_feed_tabs .wdi_feed_tabs{border:1px solid #f1f1f1;color:#444;cursor:pointer;font-size:13px;font-weight:bold;padding:12px;background:#fff;text-decoration:none;display:inline-block}#wdi_feed_tabs{margin:16px 0}#wdi_feed_tabs .wdi_feed_tab_active,#wdi_feed_tabs .wdi_feed_tabs:hover{background:none repeat scroll 0 0 #fff;color:#9a2465}#how_to_publish_tab .wdi_howto_container .wdi_howto_content .wdi_howto_wrapper{max-width:270px;margin:0 auto}#how_to_publish_tab .wdi_howto_container .wdi_howto_content .wdi_howto_wrapper img{max-width:100%}#wdi_feed_tabs .wdi_feed_tab_title{margin-top:1px;display:inline-block}.wdi_border_wrapper [scope='row']+td,.wdi_border_wrapper [scope='row']{padding:8px}.display_type_container.wdi_clear_tag{display:table;margin:10px auto}.display_type_container>div{float:left;margin-right:15px}.wdi_user{border:1px solid #b9b9b9;background-color:rgba(0,0,0,.05);margin:0 4px 0 0;border-radius:5px;height:28px;position:relative;display:inline-block}.wdi_user:hover{background-color:rgba(0,0,0,.08)}.wdi_user a{text-decoration:none;color:black;line-height:28px;width:70%;margin-left:12%;margin-right:18%;height:100%;display:table-row;padding-right:3px}.wdi_user .wdi_profile_pic{width:20px;height:20px;top:4px;left:30px;padding:5px;vertical-align:middle;display:table-cell}.wdi_user span{display:table-cell;vertical-align:middle;left:55px;font-weight:bold;font-size:14px}.wdi_user .wdi_remove_user,.wdi_user .wdi_check_thumb_user{position:absolute;right:4px;width:15px;height:15px;top:6.5px;transition:all .1s ease}.wdi_user .wdi_remove_user:hover{cursor:pointer;transform:rotate(180deg)}.wdi_user .wdi_check_thumb_user:hover{cursor:pointer}.wdi_user .wdi_check_thumb_user{left:4px}.wdi_border_wrapper [scope='row']{padding:2px;font-size:13px;min-width:250px}.wdi_border_wrapper [scope='row']+td,.wdi_border_wrapper [scope='row']{padding:2px}.small_input{width:60px;text-align:center}.display_type{text-align:center}.wdi_access_token_missing{font-size:14px;color:#000;clear:both;max-width:720px}.instagram-feed_page_wdi_settings form{width:65%}.instagram-feed_page_wdi_settings table td{padding-left:0;padding-right:0}.instagram-feed_page_wdi_settings table th{padding-left:4px}.instagram-feed_page_wdi_settings table input{float:right}#login_with_instagram{height:43px}#login_with_instagram .wdi_sign_in_button{background-image:url('../images/sign_in_with_instagram.png');background-repeat:no-repeat;background-position:left top;width:234px;height:43px;display:inline-block;float:left}#login_with_instagram .wdi_default_feed_button,#login_with_instagram .wdi_edit_default_feed_button{width:234px;height:43px;background-repeat:no-repeat;background-position:center top;display:inline-block}#login_with_instagram .wdi_default_feed_button{background-image:url('../images/default_feed_button.png');float:left;margin-right:10px}#login_with_instagram .wdi_edit_default_feed_button{background-image:url('../images/edit_feed_button.png');float:left}#wdwt_wrap_wdi_authenticated_users_list{display:inline-block;width:100%}#wdwt_wrap_wdi_authenticated_users_list .wdi_sign_in_button{background-image:url(../images/multiple_accounts.png);background-repeat:no-repeat;background-position:left top;width:228px;height:36px;display:inline-block;float:right;margin-top:2px;padding-bottom:5px}.wdi_element_name_hashtag_top_recent{display:none}.wdi_advanced_option_open tr:nth-child(9),.wdi_advanced_option_open tr:nth-child(10),.wdi_advanced_option_open tr:nth-child(11){display:none}.instagram-feed_page_wdi_settings table #wdwt_wrap_wdi_fb_auth{margin-left:115px}#wdwt_wrap_wdi_fb_auth .block a{background-color:#4267b2;color:#fff}.wdi_advanced_option .optioninput,#wdwt_wrap_wdi_reset_cache .block,#wdwt_wrap_wdi_authenticated_users_list .block{display:inline-block}#wdi_options_page_buttons_wrapper .submit{display:inline;margin-left:15px}#wdi_reset_access_token{margin-top:0;float:left;width:232px;text-align:center}.wdi_advanced_option{width:100%;position:relative;font-weight:600}.wdi_advanced_option{background-color:#fff;cursor:pointer;border:1px solid #e3e3e3;border-radius:10px;border-collapse:separate;border-spacing:0}.wdi_advanced_option .wdi_advanced_option_head{border-bottom:1px solid #e3e3e3}.wdi_advanced_option .wdi_advanced_option_head th{padding-top:10px;padding-bottom:10px}.wdi_advanced_option.wdi_advanced_option_open .wdi_advanced_option_head th{border-bottom:1px solid #e3e3e3;border-bottom-left-radius:10px}.wdi_advanced_option.wdi_advanced_option_open .wdi_advanced_option_head td{border-bottom:1px solid #e3e3e3;border-bottom-right-radius:10px}.instagram-feed_page_wdi_settings table.wdi_advanced_option th{padding-left:12px}.instagram-feed_page_wdi_settings table.wdi_advanced_option td .wdwt_param{margin-left:15px}.instagram-feed_page_wdi_settings #wdwt_wrap_wdi_disable_fa .optioninput{display:inline-block}.wdi_advanced_option .wdi_advanced_option_icon{background-repeat:no-repeat;background-position:left top;width:20px;height:20px;display:inline-block;position:absolute;top:16px;right:10px}.wdi_advanced_option.wdi_advanced_option_close .wdi_advanced_option_icon{background-image:url('../images/arrow_1.png')}.wdi_advanced_option.wdi_advanced_option_open .wdi_advanced_option_icon{background-image:url('../images/arrow_2.png')}.wdi_advanced_option.wdi_advanced_option_close tbody tr:not(.wdi_advanced_option_head){display:none}.instagram-feed_page_wdi_settings form h2{display:none}#wdi_options_page_buttons_wrapper{margin-top:10px;width:700px}.wdi_hide{display:none}.wdi_hidden{display:none !important}.selectoff{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.wdi_filter_radio{margin:5px;display:inline-block}.wdi_filter_radio label{vertical-align:text-bottom}.wdi_filter_input{margin-top:10px}.wdi_filter_input input{height:28px;width:250px;margin-right:0;padding-right:0;line-height:28px}#wdi_filter_type{line-height:28px;margin:0;padding:0;position:relative;right:2px;top:-1px;font-weight:400}.wdi_filter_item{display:inline-block;padding:6px;margin-top:5px;border-radius:5px}.wdi_filter_by_username{background-color:#00a0d2;color:white}.wdi_filter_by_hashtag{background-color:#e08d11;color:white}.wdi_logic{display:inline-block;padding:5px;font-weight:bold}.wdi_filter_by_location{background-color:#509833;color:white}.wdi_filter_by_mention{background-color:#833888;color:white}.wdi_filter_by_description{background-color:#bd242b;color:white}.wdi_filter_by_url{background-color:#004eff;color:white}.wdi_remove_filter{padding-left:5px;color:white;font-size:13px}.wdi_remove_filter:hover{cursor:pointer}.wdi_source_user{display:inline-block;padding:5px}.wdi_source_img{display:inline-block}.wdi_source_img img{width:30px;height:30px;border-radius:15px;display:block}.wdi_source_username{display:inline-block;line-height:25px;font-size:15px !important;height:30px;vertical-align:bottom;padding:0 5px;font-weight:bold}#login_with_instagram>a:focus{-webkit-box-shadow:none;box-shadow:none}.wdi_help_bar_wrap{background-color:#fff;border:0;box-sizing:border-box;clear:both;color:#6e7990;font-size:14px;font-weight:bold;line-height:30px;padding:15px;vertical-align:middle;width:100%;margin:20px 0 0 0}.wdi_help_bar_text{float:left}.wdi_help_bar_text>a{color:#0073aa;text-decoration:none}.wdi_hb_buy_pro{float:right;padding:0}.wdi_hb_buy_pro a,.wdi_hb_buy_pro a:active,.wdi_hb_buy_pro a:visited,.wdi_hb_buy_pro a:hover{display:inline-block;font-weight:bold;font-size:14px;vertical-align:middle;border:0;box-shadow:none !important;text-decoration:none}.wdi_hb_buy_pro .wdi_support_link{color:#72777c !important;padding:0 10px}.wdi_hb_buy_pro .wdi_update_pro_link{background:#45a6b7;font-weight:bold;line-height:30px;padding:0 18px 0 18px;color:#fff !important}.wdi_hb_buy_pro img{border:0;display:inline-block;vertical-align:middle}#bullets_images_type,#bullets_images_color,#bull_style,#rl_butt_type,#rl_butt_color,#rl_butt_style{margin:0 10px 0 0;width:100px}.wds_ctrl_btn_upload{display:block !important;margin:5px 0 !important;text-align:center;vertical-align:middle;width:95%}.wds_reverse{margin:0 5px !important}.wds_free_button,.wds_free_button:hover{background:linear-gradient(to bottom,#e5e5e5,#e5e5e5) repeat scroll 0 0 #f3f3f3 !important;border-color:#bbb !important;color:#888 !important}.wdi_spider_free_version_label,.wdi_spider_free_version_label *{color:#808080 !important}.wdi_spider_free_version{background-color:#dfdfdf;border:1px solid #797979;border-radius:2px;padding:2px;width:210px}.wds_more{font-size:12px}.wrap .button{border-radius:3px !important;text-shadow:none !important}.wdi_spider_message_cont{display:none;width:99%}.wdi_spider_load{display:none}.wdi_spider_load_cont{background-color:rgba(0,0,0,0.2);left:0;height:100%;position:fixed;top:0;width:100%;z-index:99998}.wdi_spider_load_icon{left:0;height:100%;position:fixed;text-align:center;top:0;width:100%;z-index:99999}.wdi_spider_ajax_loading{border:none !important;margin-top:200px;width:50px;-webkit-animation:spin 2.5s infinite linear;-moz-animation:spin 2.5s infinite linear;-o-animation:spin 2.5s infinite linear;animation:spin 2.5s infinite linear}@-moz-keyframes spin{0{-moz-transform:rotate(0)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0{-webkit-transform:rotate(0)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0{-o-transform:rotate(0)}100%{-o-transform:rotate(359deg)}}@-ms-keyframes spin{0{-ms-transform:rotate(0)}100%{-ms-transform:rotate(359deg)}}@keyframes spin{0{transform:rotate(0)}100%{transform:rotate(359deg)}}#TB_window,#TB_iframeContent{width:800px !important;height:500px !important}#TB_window{margin-left:-400px !important}.input_th{margin-left:0 !important;width:160px !important;font-family:sans-serif}.input_th2{margin-left:0 !important;width:160px !important;margin-top:5px;height:19px}.edit_input{height:28px !important;padding-bottom:7px !important}.add_tag_th{padding-left:21px;font-size:12px;font-family:sans-serif}.pointer{cursor:pointer}.non_selectable{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.wds_position_table td,.wds_position_table input{border:1px solid #ccc;margin:2px}.wds_position_table .wds_position_td{background-color:#f4f4f4;display:inline-block;line-height:1;padding:0 !important}.wdi_spider_div_options{background:none repeat scroll 0 0 #f4f4f4;border:1px solid #8f8d8d;border-radius:8px 8px 8px 8px;display:none;margin:2px 0 0 190px;padding:13px;min-height:300px;min-width:600px;vertical-align:top}.table_medium_col{text-align:center !important;width:70px}.table_medium_col_uncenter{width:80px}.table_extra_large_col{padding:4px !important;width:150px !important}.first-page,.prev-page,.next-page,.last-page,.table_extra_large_col a,.table_medium_col a,.table_big_col a,.table_small_col a{cursor:pointer}.wdi_spider_word_wrap{word-wrap:normal}.wdi_spider_description{color:#666;font-size:.923em;line-height:1.231em}.handle{background:url("../images/draggable.png") no-repeat transparent;border:0;cursor:move;display:inline-block;height:15px;margin:0 auto;vertical-align:middle;width:15px}.slider-icon{background-image:url("../images/slider-icon.png");background-repeat:no-repeat;border:0;float:left;height:32px;margin:7px 8px 0 0;width:32px}.uninstall-icon{background-image:url("../images/uninstall-icon.png");background-repeat:no-repeat;border:0;float:left;height:32px;margin:7px 8px 0 0;width:32px}.wdi_spider_label{font-weight:bold;width:100px}.wdi_spider_label_top{font-weight:bold;padding-top:3px;vertical-align:top;width:100px}.wdi_spider_fieldset .wdi_spider_label{font-weight:bold;vertical-align:top;width:150px}.wdi_spider_label_options{font-weight:bold;vertical-align:top;width:150px}.wdi_spider_choose_option{display:table;box-shadow:0 0 1px 1px #d2d2d2;margin-bottom:5px;border-radius:2px;padding:2px;box-sizing:border-box;cursor:pointer;width:100%}.wdi_spider_options_cont,.wdi_spider_bull_options_cont,.wdi_spider_pp_options_cont,.wdi_spider_options_color_cont,.wdi_spider_bull_options_color_cont,.wdi_spider_pp_options_color_cont{display:none;width:180px;height:150px;overflow:scroll;overflow-x:hidden;overflow-y:scroll}.wdi_spider_option_cont{display:block;border-bottom:1px solid #d3d3d3;padding:3px 0 3px 0;box-sizing:content-box;width:98%;border-radius:0;cursor:pointer}.wdi_spider_option_cont_title{display:table-cell;vertical-align:middle;padding:0 0 0 4px}.wdi_spider_option_cont_img{display:table-cell;width:23%;height:15px;text-align:right;padding:5px 4px 0 0;box-sizing:border-box;background-color:#eee}.wdi_spider_option_main_title{display:table-cell;width:65%;vertical-align:middle;padding:0 0 0 4px;color:#555}.wdi_spider_sel_option_ic{display:table-cell;width:20%;height:15px;text-align:right;padding:0 6px 0 0;box-sizing:border-box}.wdi_spider_int_input{width:45px}.wdi_spider_char_input{width:115px}.wdi_spider_text_input{width:190px}.wdi_spider_slider_div{display:inline-block;vertical-align:middle;width:140px}.wdi_spider_slider_percentage,.wdi_spider_slider_percentage input,.wdi_spider_slider_percentage input :focus{background:transparent;border:0;color:#00aeef;display:inline;font-weight:bold;text-align:right;vertical-align:middle;width:30px}.updated,.error{margin:5px 0 2px !important}.buttons_div{clear:both;float:right;margin:5px 0}.buttons_div_left{float:left;margin:5px 0}.buttons_div_right{float:right;margin:5px 0}.wdi_spider_delete_img{background-image:url("../images/delete.png");border:0;cursor:pointer;display:inline-block;vertical-align:middle;height:14px;width:14px}.wdi_spider_delete_img_small{background-image:url("../images/delete.png");background-size:10px auto;border:medium none;cursor:pointer;display:inline-block;height:10px;margin-top:2px;vertical-align:middle;width:10px}.wdi_spider_fieldset{background:none repeat scroll 0 0 #f4f4f4;border:1px solid #8f8d8d;border-radius:8px 8px 8px 8px;display:none;float:left;margin:4px;padding:13px;width:97%}.wdi_spider_type_fieldset{background:none repeat scroll 0 0 #f4f4f4;border-radius:8px 8px 8px 8px;display:none;float:left;width:100%}.wdi_spider_child_fieldset{background:none repeat scroll 0 0 #f4f4f4;border:1px solid #8f8d8d;border-radius:8px 8px 8px 8px;float:left;margin:4px;width:30%;padding:13px;display:block}.wdi_spider_table td{padding:0;vertical-align:middle}.wdi_spider_ctrls{padding:4px;text-align:center;width:40px}.theme_type{background-color:#f4f4f4;border:1px solid #8f8d8d;border-radius:8px 8px 8px 8px;cursor:pointer;display:inline-block;font-size:16px;height:24px;padding-top:5px;text-align:center;vertical-align:middle;width:123px;margin:2px 0 2px 0}.ui-slider-handle{cursor:pointer !important}.thumb{border:1px solid #ccc;max-height:120px;max-width:120px}.fileDescription{color:#666;cursor:pointer;font-family:sans-serif;font-size:12px}.filename{font-size:13px}.tag_div{background-clip:padding-box;background-color:#f3f3f3;border:1px solid #aaa;border-radius:3px 3px 3px 3px;box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,0.05);color:#666;line-height:13px;margin:2px 0;padding:2px 5px 2px 5px;width:132px}.tags_div{overflow-y:auto;height:65px}.tag_name{width:118px}.edit_thumb{cursor:pointer}.wdi_spider_rotate{border-radius:2px;border:1px solid #fff;height:30px}.wdi_spider_search_value{height:2em;margin:0 0 4px}#th_order,.wdi_spider_order{display:none}.wds_add_video,.wds_resize_image,.wds_import,.wds_exports{display:none;padding:10px;height:60px;background-color:#fff;border:1px solid #999;top:50%;position:fixed;left:50%;text-align:left;z-index:100000;border-radius:3px;margin-top:-45px}.wds_add_video,.wds_resize_image{margin-left:-340px}.wds_exports{margin-left:-240px}.wds_import{margin-left:-185px}.wds_add_video input[type="text"],.wds_resize_image input[type="text"]{width:500px}.wds_opacity_video,.wds_opacity_import,.wds_opacity_export{background-color:#000;display:none;opacity:.75;filter:Alpha(opacity=75);position:fixed;top:0;left:0;width:100%;height:100%;z-index:99998}.wds_tabs{clear:both;display:none;position:relative;z-index:1}.wds_tabs a.wds_sub_active,.wds_tabs a.wds_active{background-color:#f5f5f5;border-bottom:1px solid #f5f5f5;color:#333}.wds_tabs a{background-color:#f9f9f9;border:1px solid #dfdfdf;border-top-left-radius:3px;border-top-right-radius:3px;color:#c7c7c7;display:block !important;float:left;font:bold 17px/32px Arial,serif;height:30px;margin:3px 3px 0 0;padding:0 10px;position:relative;text-decoration:none;width:130px}.wbs_subtab a{font:bold 14px/26px Arial,serif;height:26px;padding:0 5px;width:105px}.wds_add_layer{font:normal 20px/28px Arial,serif !important;width:initial !important;padding:0 9px !important}.wds_tab_title{background:none repeat scroll 0 0 transparent !important;border:none !important;cursor:pointer;opacity:.5;filter:Alpha(opacity=50);padding:1px;vertical-align:middle;width:50px}.wds_sub_active .wds_tab_title,.wds_layer_title{background-color:#fff !important;border-color:#dfdfdf !important;border-radius:3px !important;border-style:solid !important;border-width:1px !important;cursor:pointer;opacity:1;filter:Alpha(opacity=100)}.wds_tab_remove{background-image:url("../images/close.png");background-repeat:no-repeat;background-size:100% 100%;display:inline-block;width:9px;height:9px;opacity:.5;filter:Alpha(opacity=50);vertical-align:middle}.wds_layer_remove{background-image:url("../images/close.png");background-repeat:no-repeat;background-size:100% 100%;display:inline-block;width:15px;height:15px;margin:5px;float:right}.wds_layer_dublicate{background-image:url("../images/duplicate.png");background-repeat:no-repeat;background-size:100% 100%;display:inline-block;width:15px;height:15px;margin:5px;float:right}.wds_slide_dublicate{background-image:url("../images/duplicate.png");background-repeat:no-repeat;background-size:100% 100%;display:inline-block;width:12px;height:12px;vertical-align:middle}.wds_layer_depth{float:right;font-size:13px;line-height:15px;margin:1px 5px;text-align:left;width:40px}.wds_layer_label{display:inline-block;font-size:13px;width:80%}.wds_sub_active .wds_tab_remove{cursor:pointer !important;opacity:1;filter:Alpha(opacity=100)}.wds_box.wds_sub_active,.wds_box.wds_active{display:block}.wds_tab_label{display:block;width:inherit}.wds_box{display:none;margin-top:0 !important;position:relative;top:-1px}.wds_box{border:1px solid #dfdfdf;border-radius:3px;box-shadow:0 0 10px #f2f2f2;margin-top:15px;position:relative}.wds_clear{clear:both;float:none !important}.wds_box thead td{border-bottom:0 none !important}.wds_box tbody{background-color:#fff;border-top:0 none;padding-left:10px}.wds_box thead{background:-webkit-linear-gradient(#f5f5f5,#fff);background:-o-linear-gradient(#f5f5f5,#fff);background:-moz-linear-gradient(#f5f5f5,#fff);background:linear-gradient(#f5f5f5,#fff);border-top:0 none;border-bottom:0 none;color:#333;font:bold 12px/29px Arial,serif;height:29px;margin:0;padding:0 10px;text-align:left;text-shadow:0 1px 0 #fff}.wds_box table{border-collapse:collapse;border-spacing:0;width:100%}.wds_nav_tabs{background-color:#f5f5f5;border-right:1px solid #dfdfdf;float:left;height:640px;margin:0;width:150px}.wds_nav_tabs ul{list-style:none outside none;margin:10px 0;padding:0}.wds_nav_tabs .wds_sub_active,.wds_nav_tabs .wds_sub_active a,.wds_nav_tabs .wds_sub_active a:hover,.wds_nav_tabs .wds_active,.wds_nav_tabs .wds_active a,.wds_nav_tabs .wds_active a:hover{background:none repeat scroll 0 0 #fff;color:#333}.wds_nav_tabs .wds_active{border-color:#dfdfdf;border-width:1px 0 1px 1px;border-style:solid;margin:0 -1px 0 -4px;padding:0}.wds_nav_tabs li{border-color:transparent;border-style:solid;border-width:1px 0;list-style-type:none;margin-bottom:0}.wds_nav_tabs a{display:block;line-height:18px;padding:5px 5px 5px 12px;text-decoration:none}.wds_nav_box{background:none repeat scroll 0 0 #fff;display:none;height:610px;overflow:auto;padding:15px}.wds_nav_box.wds_active{display:block}.wds_layer_head{background-color:#f5f5f5;border-bottom:1px solid #dfdfdf;border-top:1px solid #dfdfdf;cursor:pointer;padding:5px}.wds_layer_head .handle{cursor:move;display:inline-block;margin:5px}.wds_box td{padding:10px !important}.wds_draggable{box-sizing:border-box;cursor:move}.wds_box .color{width:60px}.wds_active_layer{box-shadow:#2c2424 0 0 5px;border-radius:3px}.wds_draggable a,.wds_draggable a:hover{color:inherit !important;font-size:inherit !important;font-style:inherit !important;font-weight:inherit !important;text-decoration:none}#add_embed_help{height:200px;width:672px;top:40%}#add_embed input[type="text"]{width:500px}.wds_buttons{float:right;font-weight:normal;position:relative}.wds_reset_button{display:none;font-weight:normal;margin:10px 0;position:absolute;right:40px;z-index:1}#wdi_save_feed .two .section_col{width:47%;float:left;margin:0 1.5% 18px}#wdi_save_feed .wdi_element{margin:0 0 18px}#wdi_save_feed .half .wdi_element,#wdi_save_feed .one .wdi_element{width:96%;float:none;margin:0 2% 20px}.wdi_element_name_liked_feed{display:none !important}#wdi_save_feed .wdi_element p{margin:2px 0 0}.wdi_section_name{font-size:19px;margin:0 auto 15px;width:100%;box-sizing:border-box;padding:15px;border-bottom:1px solid #f1f1f1;color:#444;cursor:pointer}.wdi_section{border:1px solid #dedede;margin-bottom:20px;background:#fff}.wdi_section .optioninput *{text-align:left}.wdi_section.half{width:49%;float:left;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wdi_buttons{text-align:right;margin-top:7px}.wdi_tab .wdi_section.half:last-child{margin-left:2%}#how_to_publish_tab .wdi_howto_container{display:flex;flex-wrap:wrap}#how_to_publish_tab .wdi_howto_content{border:1px #ddd solid;display:flex;flex:1;flex-direction:column;margin:5px;min-width:250px;max-width:calc(25% - 20px);padding:20px 10px;text-align:center}#how_to_publish_tab .wdi_howto_container h2{font-size:23px;font-weight:normal;line-height:29px;margin:0;padding:11px 15px 4px 0}#how_to_publish_tab .wdi_howto_container .wdi_howto_content input{margin:0 auto;text-align:center;width:100%}.wdi_buttons button.button.preview-button{height:28px}@media(max-width:782px){.wdi_buttons button.button.preview-button{height:auto}}@media(min-width:768px){.wdi_border_wrapper .wdi_element_content{width:100%;display:block}.wdi_border_wrapper .wdi_element_title{display:block}.wdi_border_wrapper .wdi_element_content input[type=text]:not(.wp-color-picker){width:calc(100% - 30px);height:28px}.wdi_border_wrapper .wdi_element_content input#wdi_add_user_ajax_input{width:calc(100% - 78px)}.wdi_border_wrapper .wdi_element_content input[type=number]{width:calc(100% - 30px)}.wdi_border_wrapper .wdi_element_content select{width:calc(100% - 30px)}}@media(max-width:768px){#wdi_save_feed .two .section_col{width:96%;float:none;margin:0 2% 18px}.wdi_section.half{width:100%;float:none;margin:0 0 20px 0 !important}}.wdi_section_close::before{content:"\f142";display:inline-block;font:400 20px/1 dashicons;speak:none;float:right;cursor:pointer}.wdi_section_open::before{content:"\f140";display:inline-block;font:400 20px/1 dashicons;speak:none;float:right;cursor:pointer}.wdi-page-header{width:98%;padding:10px}.wdi-page-header .wdi_buttons{float:right}.wdi-page-header .WDI_title_input{padding:3px 8px;font-size:1.7em;line-height:100%;height:1.5em;width:30%;outline:0;margin:0 0 3px;background-color:#fff}.wdi_demo_img{margin-top:20px}#wdi_feed_form .wd-page-title.wd-header{width:100%;padding:10px 0}@media screen and (max-width:782px){#wdi_feed_form p.search-box{margin-bottom:0}#wdi_feed_form p.search-box input[type="search"]{width:100%;height:auto !important}#wdi_feed_form p.search-box input[type="button"]{margin-bottom:10px;padding:6px 14px;line-height:normal;font-size:14px;height:auto}.wdi-page-header .WDI_title_input{width:60%}.wdi-page-header .wdi_buttons{float:none;text-align:center}}.wdi_reset_cache_success{float:right}#wdi_reset_cache{float:right}body.toplevel_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(4),body.toplevel_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(5){display:none}body.instagram-feed_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(3){display:table-row !important}body.instagram-feed_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(4){display:table-row !important}#wpbody-content>div:not(.wrap):not(.wd_topic),.wrap .notice:not(.wd-notice),.notice:not(.wd-notice){display: none;}#wpbody-content .wrap #v2_tenweb_notice_cont{display: flex;}
1
+ .wdi_clear{display:block;height:0;clear:both}.wdi_clear_tag:after{content:"";display:table;clear:both}#wdi_unistall{background-color:#d82121;border-color:#d31818;box-shadow:inset 0 1px 0 rgba(230,120,120,.5),0 1px 0 rgba(0,0,0,.15)}#wdi_unistall:hover{background-color:#da1313}#wdi_unistall_table th{width:45%}.wdi_settings_link,.wdi_tooltip{display:block;font-size:14px!important;font-weight:700;line-height:20px;margin-bottom:5px;color:#444;text-decoration:none}.wdi_theme.wdi_border_wrapper{background:#fff;padding:5px 0}.wdi_settings_link:hover,.wdi_tooltip:hover{color:#23282d;position:relative}.wdi_tooltip:hover:after{content:attr(wdi-tooltip);padding:4px 8px;color:#dbdbe0;position:absolute;left:0;top:100%;white-space:nowrap;z-index:20;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:2px;-moz-box-shadow:0 0 4px #222;-webkit-box-shadow:0 0 4px #222;box-shadow:0 0 4px rgba(0,0,0,.5);background-color:rgba(0,0,0,.75);font-size:12px}.display_type_container>div{float:left;margin-right:15px}#wdi_feed_users_ajax{width:100%;margin-top:2px}#wdi_feed_tabs .wdi_feed_tabs{border:1px solid #f1f1f1;color:#444;cursor:pointer;font-size:13px;font-weight:700;padding:12px;background:#fff;text-decoration:none;display:inline-block}#wdi_feed_tabs{margin:16px 0}#wdi_feed_tabs .wdi_feed_tab_active,#wdi_feed_tabs .wdi_feed_tabs:hover{background:none repeat scroll 0 0 #fff;color:#9a2465}#wdi_feed_tabs .wdi_feed_tab_title{margin-top:1px;display:inline-block}.wdi_border_wrapper [scope=row],.wdi_border_wrapper [scope=row]+td{padding:8px}.wdi_user{border:1px solid #b9b9b9;background-color:rgba(0,0,0,.05);margin:0 4px 0 0;border-radius:5px;height:28px;position:relative;display:inline-block}.wdi_user:hover{background-color:rgba(0,0,0,.08)}.display_type_container.wdi_clear_tag{display:table;margin:10px auto}.wdi_user a{text-decoration:none;color:#000;line-height:28px;width:70%;margin-left:12%;margin-right:18%;height:100%;display:table-row;padding-right:3px}.wdi_user .wdi_profile_pic{width:20px;height:20px;top:4px;left:30px;padding:5px;vertical-align:middle;display:table-cell}.wdi_user span{display:table-cell;vertical-align:middle;left:55px;font-weight:700;font-size:14px}.wdi_user .wdi_check_thumb_user,.wdi_user .wdi_remove_user{position:absolute;right:4px;width:15px;height:15px;top:6.5px;transition:all .1s ease}.wdi_user .wdi_remove_user:hover{cursor:pointer;transform:rotate(180deg)}.wdi_user .wdi_check_thumb_user:hover{cursor:pointer}.wdi_user .wdi_check_thumb_user{left:4px}.wdi_border_wrapper [scope=row]{padding:2px;font-size:13px;min-width:250px}.wdi_border_wrapper [scope=row],.wdi_border_wrapper [scope=row]+td{padding:2px}.small_input{width:60px;text-align:center}.display_type{text-align:center}.instagram-feed_page_wdi_settings table td{padding-left:0;padding-right:0}.instagram-feed_page_wdi_settings table th{padding-left:4px}.instagram-feed_page_wdi_settings table input{float:right}.wdi-settings-page .wdi_help_bar_wrap{background-color:unset;padding:15px 15px 15px 0}.wdi-settings-page .wdi_settings_form{margin-right:20px;padding:30px 20px;background:#fff}.wdi_advanced_option_open tr:nth-child(10),.wdi_advanced_option_open tr:nth-child(11),.wdi_advanced_option_open tr:nth-child(9){display:none}.instagram-feed_page_wdi_settings table #wdwt_wrap_wdi_fb_auth{margin-left:115px}#wdwt_wrap_wdi_fb_auth .block a{background-color:#4267b2;color:#fff}#wdwt_wrap_wdi_authenticated_users_list .block,#wdwt_wrap_wdi_reset_cache .block,.wdi_advanced_option .optioninput{display:inline-block}#wdi_options_page_buttons_wrapper .submit{display:inline;margin-left:15px}.wdi_advanced_option{width:100%;position:relative;font-weight:600}.wdi_advanced_option{background-color:#fff;cursor:pointer;border:1px solid #e3e3e3;border-radius:10px;border-collapse:separate;border-spacing:0}.wdi_advanced_option .wdi_advanced_option_head{border-bottom:1px solid #e3e3e3}.wdi_advanced_option .wdi_advanced_option_head th{padding-top:10px;padding-bottom:10px}.wdi_advanced_option.wdi_advanced_option_open .wdi_advanced_option_head th{border-bottom:1px solid #e3e3e3;border-bottom-left-radius:10px}.wdi_advanced_option.wdi_advanced_option_open .wdi_advanced_option_head td{border-bottom:1px solid #e3e3e3;border-bottom-right-radius:10px}.instagram-feed_page_wdi_settings table.wdi_advanced_option th{padding-left:12px}.instagram-feed_page_wdi_settings table.wdi_advanced_option td .wdwt_param{margin-left:15px}.instagram-feed_page_wdi_settings #wdwt_wrap_wdi_disable_fa .optioninput{display:inline-block}.wdi_advanced_option .wdi_advanced_option_icon{background-repeat:no-repeat;background-position:left top;width:20px;height:20px;display:inline-block;position:absolute;top:16px;right:10px}.wdi_advanced_option.wdi_advanced_option_close .wdi_advanced_option_icon{background-image:url(../images/arrow_1.png)}.wdi_advanced_option.wdi_advanced_option_open .wdi_advanced_option_icon{background-image:url(../images/arrow_2.png)}.wdi_advanced_option.wdi_advanced_option_close tbody tr:not(.wdi_advanced_option_head){display:none}#wdi_options_page_buttons_wrapper{margin-top:10px;width:700px}.wdi_hidden{display:none!important}.selectoff{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.wdi_filter_radio{margin:5px;display:inline-block}.wdi_filter_radio label{vertical-align:text-bottom}.filters_description{font-size:13px;font-weight:700;margin-top:8px;display:inline-block}.wdi_filter_input input{width:250px;margin-right:0;padding-right:0}#wdi_filter_type{line-height:28px;margin:0;padding:0;position:relative;right:2px;top:-1px;font-weight:400}.wdi_filter_item{display:inline-block;padding:6px;margin-top:5px;border-radius:5px}.wdi_filter_by_username{background-color:#00a0d2;color:#fff}.wdi_filter_by_hashtag{background-color:#e08d11;color:#fff}.wdi_logic{display:inline-block;padding:5px;font-weight:700}.wdi_filter_by_location{background-color:#509833;color:#fff}.wdi_filter_by_mention{background-color:#833888;color:#fff}.wdi_filter_by_description{background-color:#bd242b;color:#fff}.wdi_filter_by_url{background-color:#004eff;color:#fff}.wdi_remove_filter{padding-left:5px;color:#fff;font-size:13px}.wdi_remove_filter:hover{cursor:pointer}.wdi_source_user{border:1px solid #d4d4d4;background-color:rgba(0,0,0,.03);margin:0 4px 0 0;border-radius:5px;height:29px;display:inline-block;padding:2px 0 0 4px}.wdi_source_img{display:inline-block}.wdi_source_img img{width:22px;height:22px;border-radius:15px;display:block;padding:0}.wdi_source_username{display:inline-block;line-height:25px;font-size:15px!important;height:30px;vertical-align:bottom;padding:0 5px;font-weight:700}#login_with_instagram>a:focus{-webkit-box-shadow:none;box-shadow:none}.wdi_help_bar_wrap{background-color:#fff;border:none;box-sizing:border-box;clear:both;color:#6e7990;font-size:14px;font-weight:700;line-height:30px;padding:15px;vertical-align:middle;width:100%;margin:20px 0 0 0}.wdi_help_bar_wrap a,.wdi_help_bar_wrap span{font-size:14px}.wdi_help_bar_text{float:left}.wdi_help_bar_text>a{color:#0073aa;text-decoration:none}.wdi_hb_buy_pro{float:right;padding:0}.wdi_hb_buy_pro a,.wdi_hb_buy_pro a:active,.wdi_hb_buy_pro a:hover,.wdi_hb_buy_pro a:visited{display:inline-block;font-weight:700;font-size:14px;vertical-align:middle;border:none;box-shadow:none!important;text-decoration:none}.wdi_hb_buy_pro .wdi_support_link{color:#72777c!important;padding:0 10px}.wdi_hb_buy_pro .wdi_update_pro_link{background:#45a6b7;font-weight:700;line-height:30px;padding:0 18px 0 18px;color:#fff!important}.wdi_hb_buy_pro img{border:none;display:inline-block;vertical-align:middle}#bull_style,#bullets_images_color,#bullets_images_type,#rl_butt_color,#rl_butt_style,#rl_butt_type{margin:0 10px 0 0;width:100px}.wds_ctrl_btn_upload{display:block!important;margin:5px 0!important;text-align:center;vertical-align:middle;width:95%}.wds_reverse{margin:0 5px!important}.wds_free_button,.wds_free_button:hover{background:linear-gradient(to bottom,#e5e5e5,#e5e5e5) repeat scroll 0 0 #f3f3f3!important;border-color:#bbb!important;color:#888!important}.wdi_spider_free_version_label,.wdi_spider_free_version_label *{color:grey!important}.wdi_spider_free_version{background-color:#dfdfdf;border:1px solid #797979;border-radius:2px;padding:2px;width:210px}.wds_more{font-size:12px}.wrap .button{border-radius:3px!important;text-shadow:none!important}.wdi_spider_message_cont{display:none;width:99%}.wdi_spider_load{display:none}.wdi_spider_load_cont{background-color:rgba(0,0,0,.2);left:0;height:100%;position:fixed;top:0;width:100%;z-index:99998}.wdi_spider_load_icon{left:0;height:100%;position:fixed;text-align:center;top:0;width:100%;z-index:99999}.wdi_spider_ajax_loading{border:none!important;margin-top:200px;width:50px;-webkit-animation:spin 2.5s infinite linear;-moz-animation:spin 2.5s infinite linear;-o-animation:spin 2.5s infinite linear;animation:spin 2.5s infinite linear}@-moz-keyframes spin{0%{-moz-transform:rotate(0)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0)}100%{-o-transform:rotate(359deg)}}@-ms-keyframes spin{0%{-ms-transform:rotate(0)}100%{-ms-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(359deg)}}#TB_iframeContent,#TB_window{width:800px!important;height:500px!important}#TB_window{margin-left:-400px!important}.input_th{margin-left:0!important;width:160px!important;font-family:sans-serif}.input_th2{margin-left:0!important;width:160px!important;margin-top:5px;height:19px}.edit_input{height:28px!important;padding-bottom:7px!important}.add_tag_th{padding-left:21px;font-size:12px;font-family:sans-serif}.pointer{cursor:pointer}.non_selectable{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.wds_position_table input,.wds_position_table td{border:1px solid #ccc;margin:2px}.wds_position_table .wds_position_td{background-color:#f4f4f4;display:inline-block;line-height:1;padding:0!important}.wdi_spider_div_options{background:none repeat scroll 0 0 #f4f4f4;border:1px solid #8f8d8d;border-radius:8px 8px 8px 8px;display:none;margin:2px 0 0 190px;padding:13px;min-height:300px;min-width:600px;vertical-align:top}.table_medium_col{text-align:center!important;width:70px}.table_medium_col_uncenter{width:80px}.table_extra_large_col{padding:4px!important;width:150px!important}.first-page,.last-page,.next-page,.prev-page,.table_big_col a,.table_extra_large_col a,.table_medium_col a,.table_small_col a{cursor:pointer}.wdi_spider_word_wrap{word-wrap:normal}.wdi_spider_description{color:#666;font-size:.923em;line-height:1.231em}.handle{background:url(../images/draggable.png) no-repeat transparent;border:none;cursor:move;display:inline-block;height:15px;margin:0 auto;vertical-align:middle;width:15px}.wdi_page_title{font-size:1.5em;font-weight:500}.slider-icon{background-image:url(../images/slider-icon.png);background-repeat:no-repeat;border:none;float:left;height:32px;margin:7px 8px 0 0;width:32px}.theme-icon{background-image:url(../images/theme-2.png);background-repeat:no-repeat;border:none;float:left;height:32px;margin:7px 8px 0 0;width:32px}.uninstall-icon{background-image:url(../images/uninstall-icon.png);background-repeat:no-repeat;border:none;float:left;height:32px;margin:7px 8px 0 0;width:32px}.wdi_spider_label{font-weight:700;width:100px}.wdi_spider_label_top{font-weight:700;padding-top:3px;vertical-align:top;width:100px}.wdi_spider_fieldset .wdi_spider_label{font-weight:700;vertical-align:top;width:150px}.wdi_spider_label_options{font-weight:700;vertical-align:top;width:150px}.wdi_spider_choose_option{display:table;box-shadow:0 0 1px 1px #d2d2d2;margin-bottom:5px;border-radius:2px;padding:2px;box-sizing:border-box;cursor:pointer;width:100%}.wdi_spider_bull_options_color_cont,.wdi_spider_bull_options_cont,.wdi_spider_options_color_cont,.wdi_spider_options_cont,.wdi_spider_pp_options_color_cont,.wdi_spider_pp_options_cont{display:none;width:180px;height:150px;overflow:scroll;overflow-x:hidden;overflow-y:scroll}.wdi_spider_option_cont{display:block;border-bottom:1px solid #d3d3d3;padding:3px 0 3px 0;box-sizing:content-box;width:98%;border-radius:0;cursor:pointer}.wdi_spider_option_cont_title{display:table-cell;vertical-align:middle;padding:0 0 0 4px}.wdi_spider_option_cont_img{display:table-cell;width:23%;height:15px;text-align:right;padding:5px 4px 0 0;box-sizing:border-box;background-color:#eee}.wdi_spider_option_main_title{display:table-cell;width:65%;vertical-align:middle;padding:0 0 0 4px;color:#555}.wdi_spider_sel_option_ic{display:table-cell;width:20%;height:15px;text-align:right;padding:0 6px 0 0;box-sizing:border-box}.wdi_spider_int_input{width:45px}.wdi_spider_char_input{width:115px}.wdi_spider_text_input{width:190px}.wdi_spider_slider_div{display:inline-block;vertical-align:middle;width:140px}.wdi_spider_slider_percentage,.wdi_spider_slider_percentage input,.wdi_spider_slider_percentage input :focus{background:0 0;border:none;color:#00aeef;display:inline;font-weight:700;text-align:right;vertical-align:middle;width:30px}.error,.updated{margin:5px 0 2px!important}.buttons_div{clear:both;float:right;margin:5px 0}.buttons_div_left{float:left;margin:5px 0;width:100%}.buttons_div_right{float:right;margin:5px 0}.wdi_spider_delete_img{background-image:url(../images/delete.png);border:none;cursor:pointer;display:inline-block;vertical-align:middle;height:14px;width:14px}.wdi_spider_delete_img_small{background-image:url(../images/delete.png);background-size:10px auto;border:medium none;cursor:pointer;display:inline-block;height:10px;margin-top:2px;vertical-align:middle;width:10px}.wdi_spider_fieldset{background:none repeat scroll 0 0 #f4f4f4;border:1px solid #8f8d8d;border-radius:8px 8px 8px 8px;display:none;float:left;margin:4px;padding:13px;width:97%}.wdi_spider_type_fieldset{background:none repeat scroll 0 0 #f4f4f4;border-radius:8px 8px 8px 8px;display:none;float:left;width:100%}.wdi_spider_child_fieldset{background:none repeat scroll 0 0 #f4f4f4;border:1px solid #8f8d8d;border-radius:8px 8px 8px 8px;float:left;margin:4px;width:30%;padding:13px;display:block}.wdi_spider_table td{padding:0;vertical-align:middle}.wdi_spider_ctrls{padding:4px;text-align:center;width:40px}.theme_type{background-color:#f4f4f4;border:1px solid #8f8d8d;border-radius:8px 8px 8px 8px;cursor:pointer;display:inline-block;font-size:16px;height:24px;padding-top:5px;text-align:center;vertical-align:middle;width:123px;margin:2px 0 2px 0}.ui-slider-handle{cursor:pointer!important}.thumb{border:1px solid #ccc;max-height:120px;max-width:120px}.fileDescription{color:#666;cursor:pointer;font-family:sans-serif;font-size:12px}.filename{font-size:13px}.tag_div{background-clip:padding-box;background-color:#f3f3f3;border:1px solid #aaa;border-radius:3px 3px 3px 3px;box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);color:#666;line-height:13px;margin:2px 0;padding:2px 5px 2px 5px;width:132px}.tags_div{overflow-y:auto;height:65px}.tag_name{width:118px}.edit_thumb{cursor:pointer}.wdi_spider_rotate{border-radius:2px;border:1px solid #fff;height:30px}.wdi_spider_search_value{height:2em;margin:0 0 4px}#th_order,.wdi_spider_order{display:none}.wds_add_video,.wds_exports,.wds_import,.wds_resize_image{display:none;padding:10px;height:60px;background-color:#fff;border:1px solid #999;top:50%;position:fixed;left:50%;text-align:left;z-index:100000;border-radius:3px;margin-top:-45px}.wds_add_video,.wds_resize_image{margin-left:-340px}.wds_exports{margin-left:-240px}.wds_import{margin-left:-185px}.wds_add_video input[type=text],.wds_resize_image input[type=text]{width:500px}.wds_opacity_export,.wds_opacity_import,.wds_opacity_video{background-color:#000;display:none;opacity:.75;filter:Alpha(opacity=75);position:fixed;top:0;left:0;width:100%;height:100%;z-index:99998}.wds_tabs{clear:both;display:none;position:relative;z-index:1}.wds_tabs a.wds_active,.wds_tabs a.wds_sub_active{background-color:#f5f5f5;border-bottom:1px solid #f5f5f5;color:#333}.wds_tabs a{background-color:#f9f9f9;border:1px solid #dfdfdf;border-top-left-radius:3px;border-top-right-radius:3px;color:#c7c7c7;display:block!important;float:left;font:bold 17px/32px Arial,serif;height:30px;margin:3px 3px 0 0;padding:0 10px;position:relative;text-decoration:none;width:130px}.wbs_subtab a{font:bold 14px/26px Arial,serif;height:26px;padding:0 5px;width:105px}.wds_add_layer{font:normal 20px/28px Arial,serif!important;width:initial!important;padding:0 9px!important}.wds_tab_title{background:none repeat scroll 0 0 transparent!important;border:none!important;cursor:pointer;opacity:.5;filter:Alpha(opacity=50);padding:1px;vertical-align:middle;width:50px}.wds_layer_title,.wds_sub_active .wds_tab_title{background-color:#fff!important;border-color:#dfdfdf!important;border-radius:3px!important;border-style:solid!important;border-width:1px!important;cursor:pointer;opacity:1;filter:Alpha(opacity=100)}.wds_tab_remove{background-image:url(../images/close.png);background-repeat:no-repeat;background-size:100% 100%;display:inline-block;width:9px;height:9px;opacity:.5;filter:Alpha(opacity=50);vertical-align:middle}.wds_layer_remove{background-image:url(../images/close.png);background-repeat:no-repeat;background-size:100% 100%;display:inline-block;width:15px;height:15px;margin:5px;float:right}.wds_layer_dublicate{background-image:url(../images/duplicate.png);background-repeat:no-repeat;background-size:100% 100%;display:inline-block;width:15px;height:15px;margin:5px;float:right}.wds_slide_dublicate{background-image:url(../images/duplicate.png);background-repeat:no-repeat;background-size:100% 100%;display:inline-block;width:12px;height:12px;vertical-align:middle}.wds_layer_depth{float:right;font-size:13px;line-height:15px;margin:1px 5px;text-align:left;width:40px}.wds_layer_label{display:inline-block;font-size:13px;width:80%}.wds_sub_active .wds_tab_remove{cursor:pointer!important;opacity:1;filter:Alpha(opacity=100)}.wds_box.wds_active,.wds_box.wds_sub_active{display:block}.wds_tab_label{display:block;width:inherit}.wds_box{display:none;margin-top:0!important;position:relative;top:-1px}.wds_box{border:1px solid #dfdfdf;border-radius:3px;box-shadow:0 0 10px #f2f2f2;margin-top:15px;position:relative}.wds_clear{clear:both;float:none!important}.wds_box thead td{border-bottom:0 none!important}.wds_box tbody{background-color:#fff;border-top:0 none;padding-left:10px}.wds_box thead{background:-webkit-linear-gradient(#f5f5f5,#fff);background:-o-linear-gradient(#f5f5f5,#fff);background:-moz-linear-gradient(#f5f5f5,#fff);background:linear-gradient(#f5f5f5,#fff);border-top:0 none;border-bottom:0 none;color:#333;font:bold 12px/29px Arial,serif;height:29px;margin:0;padding:0 10px;text-align:left;text-shadow:0 1px 0 #fff}.wds_box table{border-collapse:collapse;border-spacing:0;width:100%}.wds_nav_tabs{background-color:#f5f5f5;border-right:1px solid #dfdfdf;float:left;height:640px;margin:0;width:150px}.wds_nav_tabs ul{list-style:none outside none;margin:10px 0;padding:0}.wds_nav_tabs .wds_active,.wds_nav_tabs .wds_active a,.wds_nav_tabs .wds_active a:hover,.wds_nav_tabs .wds_sub_active,.wds_nav_tabs .wds_sub_active a,.wds_nav_tabs .wds_sub_active a:hover{background:none repeat scroll 0 0 #fff;color:#333}.wds_nav_tabs .wds_active{border-color:#dfdfdf;border-width:1px 0 1px 1px;border-style:solid;margin:0 -1px 0 -4px;padding:0}.wds_nav_tabs li{border-color:transparent;border-style:solid;border-width:1px 0;list-style-type:none;margin-bottom:0}.wds_nav_tabs a{display:block;line-height:18px;padding:5px 5px 5px 12px;text-decoration:none}.wds_nav_box{background:none repeat scroll 0 0 #fff;display:none;height:610px;overflow:auto;padding:15px}.wds_nav_box.wds_active{display:block}.wds_layer_head{background-color:#f5f5f5;border-bottom:1px solid #dfdfdf;border-top:1px solid #dfdfdf;cursor:pointer;padding:5px}.wds_layer_head .handle{cursor:move;display:inline-block;margin:5px}.wds_box td{padding:10px!important}.wds_draggable{box-sizing:border-box;cursor:move}.wds_box .color{width:60px}.wds_active_layer{box-shadow:#2c2424 0 0 5px;border-radius:3px}.wds_draggable a,.wds_draggable a:hover{color:inherit!important;font-size:inherit!important;font-style:inherit!important;font-weight:inherit!important;text-decoration:none}#add_embed_help{height:200px;width:672px;top:40%}#add_embed input[type=text]{width:500px}.wds_buttons{float:right;font-weight:400;position:relative}.wds_reset_button{display:none;font-weight:400;margin:10px 0;position:absolute;right:40px;z-index:1}.wdi_about_filed{font-size:13px;font-style:italic}#wdi_save_feed .two .section_col,.wdi_theme .section_col{width:47%;float:left;margin:0 1.5% 18px}.wdi_theme .section_col{margin-bottom:0}#wdi_save_feed .wdi_element{margin:0 0 18px}.display_type_content{background:#fff;border:1px solid #dedede;margin-bottom:15px}#wdi_save_feed .half .wdi_element,#wdi_save_feed .one .wdi_element{width:96%;float:none;margin:0 2% 20px}.wdi_element_name_liked_feed{display:none!important}#wdi_save_feed .wdi_element p{margin:2px 0 0}.wdi_section_name{font-size:19px;margin:0 auto 15px;width:100%;box-sizing:border-box;padding:15px;border-bottom:1px solid #f1f1f1;color:#444;cursor:pointer}.wdi_section{border:1px solid #dedede;margin-bottom:20px;background:#fff}.wdi_section .optioninput *,.wdwt_param .optioninput *{text-align:left}.wdi_section.half{width:49%;float:left;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wdi_buttons{text-align:right;margin-top:7px}.wdi_tab .wdi_section.half:last-child{margin-left:2%}label[for=WDI_user_padding]{display:block}.wdi_settings_notification{font-size:13px;color:#8b0000}#how_to_publish_tab .wdi_howto_container{display:flex;flex-wrap:wrap}#how_to_publish_tab .wdi_howto_content{border:1px #ddd solid;display:flex;flex:1;flex-direction:column;margin:5px;min-width:250px;max-width:calc(25% - 20px);padding:20px 10px;text-align:center}#how_to_publish_tab .wdi_howto_container h2{font-size:23px;font-weight:400;line-height:29px;margin:0;padding:11px 15px 4px 0}#how_to_publish_tab .wdi_howto_container .wdi_howto_content .wdi_howto_wrapper{max-width:270px;margin:0 auto}#how_to_publish_tab .wdi_howto_container .wdi_howto_content .wdi_howto_wrapper img{max-width:100%}#how_to_publish_tab .wdi_howto_container .wdi_howto_content input{margin:0 auto;text-align:center;width:100%}.wdi_buttons button.button.preview-button{height:28px}@media (max-width:782px){.wdi_buttons button.button.preview-button{height:auto}}@media (min-width:820px){#conditional_filters_tab .one .wdi_element{width:70%;float:none;margin:0 2% 20px}.wdi_border_wrapper .wdi_element_content{width:100%;display:block}.wdi_border_wrapper .wdi_element_title{display:block}.wdi_border_wrapper .wdi_element_content input[type=text]:not(.wp-color-picker){width:calc(100% - 30px);height:28px}.wdi_element_content .wdi_filter_input input[type=text]:not(.wp-color-picker){width:270px}.wdi_border_wrapper .wdi_element_content input#wdi_add_user_ajax_input{width:calc(100% - 78px)}.wdi_border_wrapper .wdi_element_content input[type=number]{width:calc(100% - 30px)}.wdi_border_wrapper .wdi_element_content select{width:calc(100% - 30px)}.wdi_element_content .wdi_filter_input select{width:calc(100% - 413px)}.wdi_filter_input input{height:28px;line-height:28px}}@media (max-width:768px){.wdi_element_content .wdi_filter_input input[type=text]{width:130px}.wdi_element_content .wdi_filter_input select{width:calc(100% - 144px)}#wdi_save_feed .two .section_col,.wdi_theme .section_col{width:96%;float:none;margin:0 2% 18px}.wdi_section.half{width:100%;float:none;margin:0 0 20px!important}.wdi_theme .section_col{margin-bottom:0}}.wdi_section_close::before{content:"\f142";display:inline-block;font:400 20px/1 dashicons;speak:none;float:right;cursor:pointer}.wdi_section_open::before{content:"\f140";display:inline-block;font:400 20px/1 dashicons;speak:none;float:right;cursor:pointer}.wdi-page-header{width:98%;padding:10px}.wdi-page-header .wdi_buttons{float:right}.wdi-page-header .WDI_title_input{padding:3px 8px;font-size:1.7em;line-height:100%;height:1.5em;width:30%;outline:0;margin:0 0 3px;background-color:#fff}.wdi_themes_list td{display:table-cell!important}#wdi_feed_form .wd-page-title.wd-header{width:100%;padding:10px 0}@media screen and (max-width:782px){#wdi_feed_form p.search-box{margin-bottom:0}#wdi_feed_form p.search-box input[type=search]{width:100%;height:auto!important}#wdi_feed_form p.search-box input[type=button]{margin-bottom:10px;padding:6px 14px;line-height:normal;font-size:14px;height:auto}.wdi-page-header .WDI_title_input{width:60%}.wdi-page-header .wdi_buttons{float:none;text-align:center}}.wdi_element_name_hashtag_top_recent{display:none}body.toplevel_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(4),body.toplevel_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(5){display:none}body.instagram-feed_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(3){display:table-row!important}body.instagram-feed_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(4){display:table-row!important}.wdi_settings_form .button{min-height:unset;padding:9px 20px;background:#fff 0 0 no-repeat;border:1px solid #dedede;border-radius:4px;line-height:19px;font-weight:600;font-size:14px;color:#32373c;height:auto!important}.wdi-page-title{margin-bottom:30px;text-align:left;letter-spacing:0;font-size:22px;color:#323a45}.wdi-input-group{margin:0 0 30px 0}.wdi-input-group:last-child{margin:0}.wdi-input-group label{display:block;margin-bottom:15px;font-weight:700;line-height:20px;font-size:15px;color:#323a45}.wdi-input-group input[readonly],.wdi-input-group input[type=text],.wdi-input-group textarea{width:100%;max-height:40px;margin:0;padding:10px 12px;background:#fff;border-radius:4px;border:1px solid #ddd;font-weight:400;font-size:15px;color:#323a45}.wdi-input-group textarea{max-height:100px;min-height:100px}.wdi-input-group select{max-width:unset;width:100%;margin:0;padding:10px 12px;border-radius:4px;border:1px solid #ddd;font-weight:400;font-size:15px;color:#323a45}.wdi-connect-instagram{background-image:url(../images/instagram-connect.png);background-size:cover;width:330px;height:50px;cursor:pointer}.wdi-access-token-missing{max-width:778px;margin:10px 0 50px 0;line-height:17px;font-size:13px;color:#323a45}.wdi-access-token-missing p{margin:0}.wdi-accounts-list li{margin-bottom:20px;padding:20px;background:#f9f9f9}.wdi-accounts-list .wdi-account-block{display:flex;flex-wrap:wrap;justify-content:space-between}.wdi-accounts-list .wdi-account-user-info{float:left;min-width:145px;margin-right:15px}.wdi-accounts-list .wdi-account-name{margin:0;font-weight:700;line-height:24px;font-size:18px;color:#323a45}.wdi-accounts-list .wdi-account-type{margin:0;line-height:16px;text-transform:capitalize;font-size:12px;color:rgba(50,58,69,.8)}.wdi-accounts-list .wdi-account-show-token{float:left;width:27px;height:27px;padding:8px 0 0 8px;background:#fff;border:1px solid #dedede;border-radius:4px;cursor:pointer}.wdi-accounts-list .wdi-account-remove{display:block;padding:9px 20px;background:#fff 0 0 no-repeat padding-box;border:1px solid #dedede;border-radius:4px;font-weight:500;font-size:14px;color:#32373c;cursor:pointer;height:auto!important}.wdi-accounts-list .wdi-account-accesstoken{margin-top:25px;display:none;clear:both}.wdi-account-accesstoken .wdi-account-remove{display:none}.wdi-advanced-options{max-width:752px;padding:20px;margin-top:30px;background:#f9f9f9}.wdi-advanced-options .wdi-advanced-headline{margin-bottom:25px;padding-bottom:16px;border-bottom:1px solid #e5e5e5}.wdi-advanced-options .wdi-advanced-headline .wdi-page-title{float:left;margin:0;font-size:16px}.wdi-advanced-options .wdi-advanced-headline i{float:right;cursor:pointer}.wdi-advanced-options .wdi-advanced-body{display:none}.wdi_settings_form .submit{margin:30px 0 0 0;padding:0}.wdi_settings_form .button-primary{background:#007cba;border-color:#007cba;color:#fff;height:auto!important}.wdi-popup{display:none;position:fixed;height:100%;width:100%;top:0;left:0;background:rgba(0,0,0,.3);z-index:1000000}.wdi-popup .wdi-popup-container{top:50%;transform:translate(0,-50%);width:800px;position:relative;margin:0 auto;padding:30px 30px 25px 30px;background:#fff;border-radius:4px}.wdi-popup .wdi-popup-container .wdi-popup-close{display:block;position:absolute;top:12px;right:11px;width:10px;height:10px;background-image:url(../images/close.svg);background-position:center;background-repeat:no-repeat;cursor:pointer}.wdi-popup .wdi-popup-container h3{margin:0 0 30px 0;line-height:30px;font-weight:700;font-size:20px}#wdi-personal-business-popup .wdi-popup-container{width:570px;height:auto;text-align:center}.wdi_paid{pointer-events:none!important;font-size:12px;text-decoration:none;color:#fff;background:transparent linear-gradient(262deg,#008a62 0,#23b536 100%) 0 0 no-repeat padding-box;border-radius:4px;padding:8px 12px;float:right;margin-top:20px}.wdi-label-business:after{clear:both;display:table;content:""}.wdi-popup-container:after{clear:both;display:table;content:""}#wdi-personal-business-popup .wdi-radio-button{margin:0;font-size:14px}#wdi-personal-business-popup .wdi-radio-button p{margin:0;display:block;width:100%;text-align:left;background:#fff 0 0 no-repeat padding-box;box-shadow:0 0 10px #00000026;margin-bottom:20px;padding:21px 20px 20px 42px;box-sizing:border-box;border-radius:4px}.wdi-radio-button .wdi-label-business label input,.wdi-radio-button .wdi-label-business label span,.wdi-radio-button .wdi-label-personal label input,.wdi-radio-button .wdi-label-personal label span{position:relative;left:-24px}#wdi-personal-business-popup .wdi-radio-button p:first-child{margin-right:50px}#wdi-personal-business-popup .wdi-radio-button p label{font-size:14px;display:block}.wdi_info_text{font-size:14px;line-height:20px;font-weight:400;color:rgba(50,58,69,.5);margin-top:4px;display:block}#wdi-personal-business-popup .dashicons-info{color:#ccc}.wdi-radio-button .wdi-radio-info-text{display:none;position:absolute;max-width:220px;margin:5px 0 0 78px;padding:14px;background:#fff;box-shadow:0 0 8px rgba(0,0,0,.14);border:1px solid #dadcdc;border-radius:4px;line-height:20px;font-size:14px}.wdi-radio-button .wdi-label-business .wdi-radio-info-text{margin:5px 0 0 -152px}.wdi-radio-button .wdi-radio-info-text.active{display:block}#wdi-personal-business-popup .wdi-connect{width:140px;height:37px;margin-top:10px;padding:0;line-height:37px;font-size:14px;background-color:#2160b5;float:right}@media screen and (max-width:1919px){.wdi-advanced-options{max-width:unset}}@media screen and (max-width:767px){br.wdi_desktop{display:none!important}#wdi-personal-business-popup .wdi-connect{margin-top:0}.wdi_paid{width:229px;box-sizing:border-box;padding:8px 7px;font-size:11px}.wdi-radio-button input[type=radio]:checked:before{width:6px;height:6px;margin:4px}input[type=checkbox],input[type=radio]{height:16px;width:12px}#wdi-personal-business-popup .wdi-radio-button p{padding:19px 18px 18px 38px}.wdi-radio-button .wdi-label-business label input,.wdi-radio-button .wdi-label-business label span,.wdi-radio-button .wdi-label-personal label input,.wdi-radio-button .wdi-label-personal label span{position:relative;left:-25px}.wdi-popup .wdi-popup-container{padding:30px 20px 20px 20px}.wdi-settings-page .wdi_settings_form{margin-right:10px;padding:20px 15px}.wdi-connect-instagram{background-image:url(../images/instagram-connect-320.png);width:272px;height:40px}.wdi-account-block>div{width:100%}.wdi-accounts-list li{margin-bottom:15px;padding:20px 15px}.wdi-accounts-list .wdi-account-show-token{float:right}.wdi-account-block .wdi-account-remove{display:none}.wdi-account-accesstoken .wdi-account-remove{display:block;float:right;margin-top:20px}#wdi-personal-business-popup .wdi-popup-container{width:300px;box-sizing:border-box}.wdi-popup .wdi-popup-container h3{max-width:260px;margin:0 auto 20px auto;font-size:16px;line-height:26px}.wdi-radio-button .wdi-label-personal .wdi-radio-info-text{margin:5px 0 0 12px}.wdi-radio-button .wdi-label-business .wdi-radio-info-text{margin:5px 0 0 -147px}.wdi_settings_form .submit{margin-top:25px}}.wdi_pro_only{font-style:italic;color:#4e4e4e!important;background-color:#ccc!important;text-decoration:none;font-weight:700}.wdi-pro-overlay img{opacity:.7}.wdi_pro_notice{text-align:right;color:#15699f;font-size:20px!important;padding:10px}.wdi-radio-button .wdi_account_type{font-weight:700;color:#323A4580}.wdi_input_group{border:1px solid transparent}.wdi_active{border:1px solid #2160b5}.wdi_active .wdi_account_type,.wdi_active .wdi_info_text{color:#323a45}.wdi_free .wdi_info_text span{text-decoration:underline}.wdi_pro .wdi_account_type,.wdi_pro .wdi_info_text{color:#323a45!important}
css/wdi_frontend.css CHANGED
@@ -56,7 +56,7 @@
56
  height: 50px;
57
  left: 0;
58
  right: 0;
59
- bottom: -50px;
60
  margin: auto;
61
  z-index: 100;
62
 
@@ -141,11 +141,6 @@
141
  transition: all 0.1s ease;
142
  }
143
 
144
- .wdi_thumb_icon i {
145
- display: none;
146
- transition: all 0.1s ease;
147
- }
148
-
149
  .wdi_photo_overlay:hover .wdi_thumb_icon i {
150
  display: block;
151
  }
@@ -165,10 +160,8 @@
165
  -moz-osx-font-smoothing: grayscale;
166
  }
167
  .wdi_media_info .tenweb-i:before {
168
- margin-right: 6px;
169
  }
170
-
171
-
172
  /**************************************************************/
173
 
174
  /**
@@ -444,7 +437,7 @@ div[id^="wdi_container"] p {
444
  display: inline-table;
445
  }
446
 
447
- .wdi_layout_th .wdi_header_img_wrap, .wdi_users_img_wrap {
448
  overflow: hidden;
449
  }
450
 
@@ -479,7 +472,7 @@ div[id^="wdi_container"] p {
479
 
480
  .wdi_layout_th .wdi_feed_container .wdi_feed_info .wdi_header_user_text h3 {
481
  display: inline-block;
482
- text-transform: none;
483
  }
484
 
485
  .wdi_layout_th .wdi_header_user_text h3:hover {
@@ -657,10 +650,11 @@ div[id^="wdi_container"] p {
657
  }
658
  }
659
 
660
- .wdi_layout_th .wdi_load_more_spinner {
 
 
661
  display: table-cell;
662
  vertical-align: middle;
663
-
664
  -webkit-animation: wdi_rotate 1.5s infinite;
665
  -moz-animation: wdi_rotate 1.5s infinite;
666
  -o-animation: wdi_rotate 1.5s infinite;
@@ -698,21 +692,245 @@ div[id^="wdi_container"] p {
698
  cursor: pointer;
699
  }
700
 
 
 
 
 
701
  .wdi_layout_th .wdi_photo_overlay:hover {
702
  cursor: pointer;
703
  }
704
 
705
  .wdi_layout_th .wdi_photo_overlay i {
706
- opacity: 1;
 
 
 
 
 
707
  }
708
 
709
  .wdi_layout_th .wdi_load_more_container {
710
  display: inline-block;
711
  }
712
 
 
 
 
 
 
 
 
 
 
 
 
713
  /* masonry */
714
  /* .wdi_layout_ms */
715
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
716
  /* image browser */
717
  /* .wdi_layout_ib */
718
 
@@ -784,7 +1002,7 @@ div[id^="wdi_container"] p {
784
  padding: 0;
785
  }
786
 
787
- .wdi_layout_ib .wdi_feed_container .wdi_feed_info .wdi_media_info p {
788
  margin-top: 0px;
789
  margin-bottom: 0px;
790
  }
@@ -896,16 +1114,195 @@ div[id^="wdi_container"] p {
896
  /* blog style*/
897
  /* .wdi_layout_bs */
898
 
899
- .wdi_embed_frame video{
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
900
  display: inline-block;
 
 
 
 
 
 
 
 
901
  }
902
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
903
  /*reset style */
904
  .wdi_image_container img{
905
  display:inline;
906
  }
907
 
908
-
909
  /*Carousel*/
910
  .wdi_carousel_btn_container {
911
  height: 20px;
@@ -955,9 +1352,9 @@ div[id^="wdi_container"] p {
955
  display:none;
956
  }
957
  .wdi_website{
958
- width: 100%;
959
- display: block;
960
- float: left;
961
  }
962
  .wdi_website a{
963
  box-shadow:none !important;
@@ -972,4 +1369,4 @@ div[id^="wdi_container"] p {
972
  width: 100%;
973
  height: 100%;
974
  background-color: rgba(0,0,0,0.2);
975
- }
56
  height: 50px;
57
  left: 0;
58
  right: 0;
59
+ bottom: -60px;
60
  margin: auto;
61
  z-index: 100;
62
 
141
  transition: all 0.1s ease;
142
  }
143
 
 
 
 
 
 
144
  .wdi_photo_overlay:hover .wdi_thumb_icon i {
145
  display: block;
146
  }
160
  -moz-osx-font-smoothing: grayscale;
161
  }
162
  .wdi_media_info .tenweb-i:before {
163
+ margin-right: 6px;
164
  }
 
 
165
  /**************************************************************/
166
 
167
  /**
437
  display: inline-table;
438
  }
439
 
440
+ .wdi_layout_th .wdi_header_img_wrap {
441
  overflow: hidden;
442
  }
443
 
472
 
473
  .wdi_layout_th .wdi_feed_container .wdi_feed_info .wdi_header_user_text h3 {
474
  display: inline-block;
475
+ text-transform: none;
476
  }
477
 
478
  .wdi_layout_th .wdi_header_user_text h3:hover {
650
  }
651
  }
652
 
653
+ .wdi_layout_th .wdi_load_more_spinner,
654
+ .wdi_layout_ms .wdi_load_more_spinner,
655
+ .wdi_layout_bs .wdi_load_more_spinner {
656
  display: table-cell;
657
  vertical-align: middle;
 
658
  -webkit-animation: wdi_rotate 1.5s infinite;
659
  -moz-animation: wdi_rotate 1.5s infinite;
660
  -o-animation: wdi_rotate 1.5s infinite;
692
  cursor: pointer;
693
  }
694
 
695
+ .wdi_layout_th .wdi_photo_overlay {
696
+ transition: all 0.5s ease;
697
+ }
698
+
699
  .wdi_layout_th .wdi_photo_overlay:hover {
700
  cursor: pointer;
701
  }
702
 
703
  .wdi_layout_th .wdi_photo_overlay i {
704
+ color: transparent;
705
+ transition: all 0.5s ease;
706
+ }
707
+
708
+ .wdi_layout_th .wdi_photo_img img {
709
+ transition: all 0.5s ease;
710
  }
711
 
712
  .wdi_layout_th .wdi_load_more_container {
713
  display: inline-block;
714
  }
715
 
716
+ .wdi_layout_th .wdi_media_user {
717
+ position: absolute;
718
+ bottom: 0;
719
+ right: 0;
720
+ font-size: 16px;
721
+ border-radius: 100px 0 0 0;
722
+ padding-left: 10px;
723
+ padding-right: 5px;
724
+ line-height: 1.5;
725
+ }
726
+
727
  /* masonry */
728
  /* .wdi_layout_ms */
729
 
730
+ .wdi_layout_ms .wdi_feed_container {
731
+ min-width: 160px;
732
+ margin: 0 auto;
733
+ }
734
+
735
+ .wdi_layout_ms .wdi_feed_wrapper {
736
+ position: relative;
737
+ margin: 0 auto;
738
+ }
739
+
740
+ .wdi_layout_ms .wdi_header_wrapper {
741
+ display: inline-table;
742
+ }
743
+
744
+ .wdi_layout_ms .wdi_header_img_wrap,
745
+ .wdi_layout_ms .wdi_users_img_wrap {
746
+ overflow: hidden;
747
+ }
748
+
749
+ .wdi_layout_ms .wdi_header_text {
750
+ display: table-cell;
751
+ vertical-align: middle;
752
+ }
753
+
754
+ .wdi_layout_ms .wdi_single_user {
755
+ display: inline-block;
756
+ float: left;
757
+ }
758
+
759
+ .wdi_layout_ms .wdi_user_img_wrap {
760
+ display: inline-block;
761
+ float: left;
762
+ /*margin: 0 0 0 -100% !important;*/
763
+ position: relative;
764
+ }
765
+
766
+ .wdi_layout_ms .wdi_header_user_text {
767
+ display: inline-block;
768
+ float: left;
769
+ width: 100%;
770
+
771
+ }
772
+
773
+ .wdi_layout_ms .wdi_followers,
774
+ .wdi_layout_ms .wdi_posts {
775
+ display: inline-block;
776
+ }
777
+
778
+ .wdi_layout_ms .wdi_header_user_text h3 {
779
+ display: inline-block;
780
+ text-transform: none;
781
+ }
782
+
783
+ .wdi_layout_ms .wdi_header_user_text h3:hover {
784
+ cursor: pointer;
785
+ }
786
+
787
+ .wdi_layout_ms .wdi_user_img_wrap img {
788
+ overflow: hidden;
789
+ display: block;
790
+ margin:0;
791
+ }
792
+
793
+ .wdi_layout_ms .wdi_feed_container .wdi_feed_info .wdi_header_user_text h3 {
794
+ margin-left: 10px;
795
+ margin-bottom: 0;
796
+ }
797
+
798
+ .wdi_layout_ms .wdi_feed_container .wdi_feed_info .wdi_media_info p {
799
+ margin-top: 0px;
800
+ margin-bottom: 0px;
801
+ }
802
+
803
+ .wdi_layout_ms .wdi_user_controls {
804
+ margin-left: 0;
805
+ display: inline-block;
806
+ vertical-align: middle;
807
+ }
808
+
809
+ .wdi_layout_ms .wdi_bio {
810
+ float: left;
811
+ }
812
+
813
+ .wdi_layout_ms .wdi_feed_container .wdi_feed_info .wdi_header_user_text .wdi_followers {
814
+ margin-left: 10px;
815
+ }
816
+
817
+ .wdi_layout_ms .wdi_filter_overlay {
818
+ position: absolute;
819
+ z-index: 2;
820
+ top: 0;
821
+ left: 0;
822
+ opacity: 0;
823
+ transition: opacity 0.1s ease;
824
+ }
825
+
826
+ .wdi_layout_ms .wdi_filter_overlay:hover {
827
+ opacity: 0.9;
828
+ cursor: pointer;
829
+ }
830
+
831
+ .wdi_layout_ms .wdi_photo_wrap {
832
+
833
+ overflow: hidden;
834
+ box-sizing: content-box;
835
+ }
836
+
837
+ .wdi_layout_ms .wdi_img {
838
+ width: 100%;
839
+ display: block;
840
+ }
841
+
842
+ .wdi_layout_ms .wdi_masonry_column {
843
+ display: block;
844
+ overflow: hidden;
845
+ float: left;
846
+ }
847
+
848
+ .wdi_layout_ms .wdi_photo_meta {
849
+ text-align: center;
850
+ padding-bottom: 10px;
851
+ }
852
+
853
+ .wdi_layout_ms .wdi_thumb_comments i,
854
+ .wdi_layout_ms .wdi_likes i {
855
+ width: 100%;
856
+ }
857
+
858
+ .wdi_layout_ms .wdi_photo_title {
859
+ text-overflow: ellipsis;
860
+ overflow: hidden;
861
+ width: 90%;
862
+ margin-left: 5%;
863
+ margin-right: 5%;
864
+ text-align: center;
865
+ }
866
+
867
+ .wdi_layout_ms .wdi_photo_title:hover {
868
+ cursor: pointer;
869
+
870
+ }
871
+
872
+ .wdi_layout_ms .wdi_load_more,
873
+ .wdi_layout_ms .wdi_spinner {
874
+ padding: 10px;
875
+ transition: all 0.2s ease;
876
+ }
877
+
878
+ .wdi_layout_ms .wdi_load_more_wrap,
879
+ .wdi_layout_ms .wdi_spinner_wrap {
880
+ display: inline-table;
881
+ box-sizing: border-box;
882
+ }
883
+
884
+ .wdi_layout_ms .wdi_load_more_wrap_inner,
885
+ .wdi_layout_ms .wdi_spinner_wrap_inner {
886
+ display: table-row;
887
+ text-align: center;
888
+ }
889
+
890
+ .wdi_layout_ms .wdi_load_more_text {
891
+ display: table-cell;
892
+ vertical-align: middle;
893
+ }
894
+
895
+ .wdi_layout_ms .wdi_load_more_text img {
896
+ float: left;
897
+ }
898
+
899
+ .wdi_layout_ms .wdi_load_more_wrap:hover {
900
+ cursor: pointer;
901
+ }
902
+
903
+ .wdi_layout_ms .wdi_photo_overlay {
904
+ transition: all 0.5s ease;
905
+ }
906
+
907
+ .wdi_layout_ms .wdi_photo_overlay:hover {
908
+ cursor: pointer;
909
+ }
910
+
911
+ .wdi_layout_ms .wdi_photo_overlay i {
912
+ color: transparent;
913
+ transition: all 0.5s ease;
914
+ }
915
+
916
+ .wdi_layout_ms .wdi_photo_img img {
917
+ transition: all 0.5s ease;
918
+ }
919
+
920
+ .wdi_layout_ms .wdi_load_more_container {
921
+ display: inline-block;
922
+ }
923
+
924
+ .wdi_layout_ms .wdi_media_user {
925
+ position: absolute;
926
+ bottom: 0;
927
+ right: 0;
928
+ font-size: 16px;
929
+ border-radius: 100px 0 0 0;
930
+ padding-left: 10px;
931
+ padding-right: 5px;
932
+ }
933
+
934
  /* image browser */
935
  /* .wdi_layout_ib */
936
 
1002
  padding: 0;
1003
  }
1004
 
1005
+ .wdi_layout_ib .wdi_feed_container .wdi_feed_info .wdi_media_info p {
1006
  margin-top: 0px;
1007
  margin-bottom: 0px;
1008
  }
1114
  /* blog style*/
1115
  /* .wdi_layout_bs */
1116
 
1117
+ .wdi_layout_bs .wdi_feed_container {
1118
+ min-width: 160px;
1119
+ margin: 0 auto;
1120
+ }
1121
+
1122
+ .wdi_layout_bs .wdi_feed_wrapper {
1123
+ margin: 0 auto;
1124
+ }
1125
+
1126
+ .wdi_layout_bs .wdi_header_wrapper {
1127
+ display: inline-table;
1128
+ }
1129
+
1130
+ .wdi_layout_bs .wdi_header_img_wrap,
1131
+ .wdi_layout_bs .wdi_users_img_wrap {
1132
+ overflow: hidden;
1133
+ }
1134
+
1135
+ .wdi_layout_bs .wdi_header_text {
1136
+ display: table-cell;
1137
+ vertical-align: middle;
1138
+ }
1139
+
1140
+ .wdi_layout_bs .wdi_single_user {
1141
  display: inline-block;
1142
+ float: left;
1143
+ }
1144
+
1145
+ .wdi_layout_bs .wdi_user_img_wrap {
1146
+ display: inline-block;
1147
+ float: left;
1148
+ /*margin: 0 0 0 -100% !important;*/
1149
+ position: relative;
1150
  }
1151
 
1152
+ .wdi_layout_bs .wdi_header_user_text {
1153
+ display: inline-block;
1154
+ float: left;
1155
+ width: 100%;
1156
+
1157
+ }
1158
+
1159
+ .wdi_layout_bs .wdi_followers,
1160
+ .wdi_layout_bs .wdi_posts {
1161
+ display: inline-block;
1162
+ }
1163
+
1164
+ .wdi_layout_bs .wdi_header_user_text h3 {
1165
+ display: inline-block;
1166
+ text-transform: none;
1167
+ }
1168
+
1169
+ .wdi_layout_bs .wdi_header_user_text h3:hover {
1170
+ cursor: pointer;
1171
+ }
1172
+
1173
+ .wdi_layout_bs .wdi_user_img_wrap img {
1174
+ overflow: hidden;
1175
+ display: block;
1176
+ margin:0;
1177
+ }
1178
+
1179
+ .wdi_layout_bs .wdi_feed_container .wdi_feed_info .wdi_header_user_text h3 {
1180
+ margin-left: 10px;
1181
+ margin-bottom: 0;
1182
+ }
1183
+ .wdi_feed_info .wdi_header_user_text h3 {
1184
+ padding-top: 0px;
1185
+ }
1186
+
1187
+ .wdi_layout_bs .wdi_feed_container .wdi_feed_info .wdi_media_info p {
1188
+ margin-top: 0px;
1189
+ margin-bottom: 0px;
1190
+ }
1191
+
1192
+ .wdi_layout_bs .wdi_user_controls {
1193
+ margin-left: 0;
1194
+ display: inline-block;
1195
+ vertical-align: middle;
1196
+ }
1197
+
1198
+ .wdi_layout_bs .wdi_bio {
1199
+ float: left;
1200
+ }
1201
+
1202
+ .wdi_layout_bs .wdi_feed_container .wdi_feed_info .wdi_header_user_text .wdi_followers {
1203
+ margin-left: 10px;
1204
+ }
1205
+
1206
+ .wdi_layout_bs .wdi_filter_overlay {
1207
+ position: absolute;
1208
+ z-index: 2;
1209
+ top: 0;
1210
+ left: 0;
1211
+ opacity: 0;
1212
+ transition: opacity 0.1s ease;
1213
+ }
1214
+
1215
+ .wdi_layout_bs .wdi_filter_overlay:hover {
1216
+ opacity: 0.9;
1217
+ cursor: pointer;
1218
+ }
1219
+
1220
+ .wdi_layout_bs .wdi_photo_wrap {
1221
+
1222
+ overflow: hidden;
1223
+ box-sizing: content-box;
1224
+ }
1225
+
1226
+ .wdi_layout_bs .wdi_img {
1227
+ width: 100%;
1228
+ display: block;
1229
+ }
1230
+
1231
+ .wdi_layout_bs .wdi_feed_item {
1232
+ display: inline-block;
1233
+ overflow: hidden;
1234
+ }
1235
+
1236
+ .wdi_layout_bs .wdi_photo_meta {
1237
+ text-align: center;
1238
+ padding-bottom: 10px;
1239
+ }
1240
+
1241
+ .wdi_layout_bs .wdi_thumb_comments i,
1242
+ .wdi_layout_bs .wdi_thumb_likes i {
1243
+ width: 100%;
1244
+ }
1245
+
1246
+ .wdi_layout_bs .wdi_photo_title {
1247
+ text-overflow: ellipsis;
1248
+ overflow: hidden;
1249
+ white-space: normal;
1250
+ width: 90%;
1251
+ margin-left: 5%;
1252
+ margin-right: 5%;
1253
+ text-align: center;
1254
+ }
1255
+
1256
+ .wdi_layout_bs .wdi_photo_title:hover {
1257
+ }
1258
+
1259
+ .wdi_layout_bs .wdi_load_more,
1260
+ .wdi_layout_bs .wdi_spinner {
1261
+ padding: 10px;
1262
+ transition: all 0.2s ease;
1263
+ }
1264
+
1265
+ .wdi_layout_bs .wdi_load_more_wrap,
1266
+ .wdi_layout_bs .wdi_spinner_wrap {
1267
+ display: inline-table;
1268
+ box-sizing: border-box;
1269
+ }
1270
+
1271
+ .wdi_layout_bs .wdi_load_more_wrap_inner,
1272
+ .wdi_layout_bs .wdi_spinner_wrap_inner {
1273
+ display: table-row;
1274
+ text-align: center;
1275
+ }
1276
+
1277
+ .wdi_layout_bs .wdi_load_more_text {
1278
+ display: table-cell;
1279
+ vertical-align: middle;
1280
+ }
1281
+
1282
+ .wdi_layout_bs .wdi_load_more_text img {
1283
+ float: left;
1284
+ }
1285
+
1286
+ .wdi_layout_bs .wdi_load_more_wrap:hover {
1287
+ cursor: pointer;
1288
+ }
1289
+
1290
+ .wdi_layout_bs .wdi_photo_overlay:hover {
1291
+ cursor: pointer;
1292
+ }
1293
+
1294
+ .wdi_layout_bs .wdi_load_more_container {
1295
+ display: inline-block;
1296
+ }
1297
+
1298
+ .wdi_embed_frame video{
1299
+ display: inline-block;
1300
+ }
1301
  /*reset style */
1302
  .wdi_image_container img{
1303
  display:inline;
1304
  }
1305
 
 
1306
  /*Carousel*/
1307
  .wdi_carousel_btn_container {
1308
  height: 20px;
1352
  display:none;
1353
  }
1354
  .wdi_website{
1355
+ width: 100%;
1356
+ display: block;
1357
+ float: left;
1358
  }
1359
  .wdi_website a{
1360
  box-shadow:none !important;
1369
  width: 100%;
1370
  height: 100%;
1371
  background-color: rgba(0,0,0,0.2);
1372
+ }
css/wdi_frontend.min.css CHANGED
@@ -1 +1 @@
1
- .wdi_clear{clear:both}.wdi_feed_main_container .table{display:table}.wdi_feed_main_container .table-cell{display:table-cell}.wdi_feed_main_container .table-row{display:table-row}.wdi_feed_main_container{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.wdi_follow_button:hover{cursor:pointer}.wdi_hidden{display:none!important}.wdi_hover_off:hover{background-color:transparent!important}.wdi_cursor_off:hover{cursor:auto!important}.wdi_filter_active span{color:#fff}.wdi_disabled{visibility:hidden}.wdi_ajax_loading{position:absolute;width:50px;height:50px;left:0;right:0;bottom:-50px;margin:auto;z-index:100}.wdi_feed_main_container{width:100%;position:relative}.wdi_feed_main_container .wdi_img{margin:0}.wdi_feed_main_container .wdi_follow_btn{display:inline-block;background:0 0;border-style:solid;border-width:1px;font-weight:500;outline:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-appearance:none;vertical-align:text-bottom}.wdi_feed_main_container .wdi_follow_btn:hover{cursor:pointer}.wdi_feed_main_container .wdi_pagination{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.wdi_feed_main_container .wdi_pagination_ctrl{display:inline-block}.wdi_feed_main_container .wdi_pagination_ctrl:hover{cursor:pointer}.wdi_feed_main_container .wdi_filter_icon span{display:block;font-size:25px;color:#fff}.wdi_feed_main_container .wdi_filter_icon span::before{width:20px;height:20px;position:absolute;opacity:1;right:0;left:0;top:0;bottom:0;margin:auto}.wdi_photo_img{position:relative;overflow:hidden}.wdi_photo_overlay{width:100%;height:100%;position:absolute;top:0;left:0;background-color:transparent;transition:all .1s ease}.wdi_thumb_icon i{display:none;transition:all .1s ease}.wdi_photo_overlay:hover .wdi_thumb_icon i{display:block}.wdi_feed_main_container .tenweb{font-family:tenweb!important;font-style:normal;width:auto;speak:none;display:inline-block;line-height:1;font-weight:400;font-variant:normal;text-transform:none;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.wdi_media_info .tenweb-i:before{margin-right:6px}.wdi_spider_popup_loading{background-image:url(../images/ajax_loader.png);background-color:rgba(0,0,0,0);background-repeat:no-repeat;background-position:0 0;background-size:50px 50px;border:none!important;display:none;height:50px;left:50%;margin-left:-20px;margin-top:-20px;overflow:hidden;position:fixed;top:50%;width:50px;z-index:10102;-moz-animation:spin 2.5s infinite linear;-o-animation:spin 2.5s infinite linear;-webkit-animation:spin 2.5s infinite linear;animation:spin 2.5s infinite linear}.wdi_spider_popup_overlay{cursor:pointer;background-color:rgba(0,0,0,.5);display:none;height:100%;left:0;position:fixed;top:0;width:100%;z-index:10100}div[id^=wdi_container] p{padding:0!important;margin:0!important}.footer-list-block .bwp_gallery .wdi_spider_popup_loading,.footer-list-block .bwp_gallery_tags .wdi_spider_popup_loading,.wdi_spider_popup_loading{background-image:url(../images/ajax_loader.png);background-color:rgba(0,0,0,0);background-repeat:no-repeat;background-position:0 0;background-size:50px 50px;border:none!important;display:none;height:50px;left:50%;margin-left:-20px;margin-top:-20px;overflow:hidden;position:fixed;top:50%;width:50px;z-index:10102;-moz-animation:spin 2.5s infinite linear;-o-animation:spin 2.5s infinite linear;-webkit-animation:spin 2.5s infinite linear;animation:spin 2.5s infinite linear}.wdi_spider_ajax_loading{border:none!important;-moz-animation:spin 2.5s infinite linear;-o-animation:spin 2.5s infinite linear;-webkit-animation:spin 2.5s infinite linear;animation:spin 2.5s infinite linear}.footer-list-block .bwp_gallery .wdi_spider_popup_overlay,.footer-list-block .bwp_gallery_tags .wdi_spider_popup_overlay,.wdi_spider_popup_overlay{cursor:pointer;display:none;height:100%;left:0;position:fixed;top:0;width:100%;z-index:10100}.wdi_spider_popup_close,.wdi_spider_popup_close_fullscreen{-moz-box-sizing:content-box!important;box-sizing:content-box!important;cursor:pointer;display:table;line-height:0;position:absolute;z-index:11100}#wdi_spider_popup_left{left:0}#wdi_spider_popup_right{right:0}#wdi_spider_popup_left:hover,#wdi_spider_popup_right:hover{visibility:visible}#wdi_spider_popup_left:hover span{left:20px}#wdi_spider_popup_right:hover span{left:auto;right:20px}#wdi_spider_popup_left,#wdi_spider_popup_right{background:transparent url(../images/blank.gif) repeat scroll 0 0;bottom:35%;cursor:pointer;display:inline;height:30%;outline:medium none;position:absolute;width:35%;z-index:10130}#wdi_spider_popup_left-ico,#wdi_spider_popup_right-ico{-moz-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:table;left:-9999px;line-height:0;margin-top:-15px;position:absolute;top:50%;z-index:10135}.wdi_image_info_container1{height:100%;margin:0 auto;position:absolute;width:100%}.wdi_image_info_container2{display:table;height:100%;margin:0 auto;position:absolute;width:100%}.wdi_image_info_spun{display:table-cell;height:100%;left:0;top:0;width:100%;overflow:hidden;position:relative}.wdi_image_info{display:inline-block;position:relative;text-decoration:none;word-wrap:break-word;z-index:11}.wdi_photo_wrap_inner{text-align:center}.wdi_feed_item[wdi_type=slideshow] .tenweb-i-clone{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-o-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.wdi_js_error_no_animate,.wdi_token_error{text-align:center;font-size:14px}.wdi_js_error{text-align:center;-webkit-animation-name:wdi_js_error;-moz-animation-name:wdi_js_error;-o-animation-name:wdi_js_error;animation-name:wdi_js_error;-webkit-animation-duration:.5s;-moz-animation-duration:.5s;-o-animation-duration:.5s;animation-duration:.5s;-webkit-animation-delay:20s;-moz-animation-delay:20s;-o-animation-delay:20s;animation-delay:20s;-webkit-animation-fill-mode:forwards;-moz-animation-fill-mode:forwards;-o-animation-fill-mode:forwards;animation-fill-mode:forwards;color:#c00;-webkit-transform:scale(0);-moz-transform:scale(0);-ms-transform:scale(0);-o-transform:scale(0);transform:scale(0);font-size:12px}@keyframes wdi_js_error{from{visibility:hidden;-webkit-transform:scale(0);-moz-transform:scale(0);-ms-transform:scale(0);-o-transform:scale(0);transform:scale(0)}to{visibility:visible;-webkit-transform:scale(1);-moz-transform:scale(1);-ms-transform:scale(1);-o-transform:scale(1);transform:scale(1)}}.wdi_layout_th .wdi_feed_container{min-width:160px;margin:0 auto}.wdi_layout_th .wdi_feed_wrapper{margin:0 auto}.wdi_layout_th .wdi_header_wrapper{display:inline-table}.wdi_layout_th .wdi_header_img_wrap,.wdi_users_img_wrap{overflow:hidden}.wdi_layout_th .wdi_header_text{display:table-cell;vertical-align:middle}.wdi_layout_th .wdi_single_user{display:inline-block;float:left}.wdi_layout_th .wdi_user_img_wrap{display:inline-block;float:left;position:relative}.wdi_layout_th .wdi_header_user_text{display:inline-block;float:left;width:100%}.wdi_layout_th .wdi_followers,.wdi_layout_th .wdi_posts{display:inline-block}.wdi_layout_th .wdi_feed_container .wdi_feed_info .wdi_header_user_text h3{display:inline-block;text-transform:none}.wdi_layout_th .wdi_header_user_text h3:hover{cursor:pointer}.wdi_layout_th .wdi_user_img_wrap img{overflow:hidden;display:block;margin:0}.wdi_layout_th .wdi_feed_container .wdi_feed_info .wdi_header_user_text h3{margin-left:10px;margin-bottom:0;padding:0}.wdi_layout_th .wdi_feed_container .wdi_feed_info .wdi_media_info p{margin-top:0;margin-bottom:0}.wdi_layout_th .wdi_user_controls{margin-left:0;display:inline-block;vertical-align:middle}.wdi_layout_th .wdi_bio{float:left}.wdi_layout_th .wdi_feed_container .wdi_feed_info .wdi_header_user_text .wdi_followers{margin-left:10px}.wdi_layout_th .wdi_filter_overlay{position:absolute;z-index:2;top:0;left:0;opacity:0;transition:opacity .1s ease}.wdi_layout_th .wdi_filter_overlay:hover{opacity:.9;cursor:pointer}.wdi_layout_th .wdi_photo_wrap{position:relative;display:inline-block;overflow:hidden;box-sizing:content-box}.wdi_layout_th .wdi_photo_wrap:after{padding-top:100%;display:block;content:""}.wdi_layout_th .wdi_photo_wrap_inner{position:absolute;top:0;bottom:0;left:0;right:0}.wdi_layout_th .wdi_photo_img{width:100%;height:100%}.wdi_layout_th .wdi_img{display:block;position:absolute;top:50%;left:50%;max-width:none;-webkit-transform:translateX(-50%) translateY(-50%);-moz-transform:translateX(-50%) translateY(-50%);-ms-transform:translateX(-50%) translateY(-50%);-o-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%)}.wdi_layout_th .wdi_shape_portrait .wdi_img,.wdi_layout_th .wdi_shape_square .wdi_img{width:100%;height:auto}.wdi_layout_th .wdi_shape_landscape .wdi_img{height:100%!important;width:auto}.wdi_layout_th .wdi_feed_item{display:inline-block;vertical-align:top;overflow:hidden}.wdi_layout_th .wdi_photo_meta{text-align:center;padding-bottom:10px;line-height:1.4}.wdi_layout_th .wdi_thumb_comments i,.wdi_layout_th .wdi_thumb_likes i{width:100%}.wdi_layout_th .wdi_photo_title{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:90%;margin-left:5%;margin-right:5%;text-align:center}.wdi_layout_th .wdi_photo_title:hover{cursor:pointer}@-moz-keyframes wdi_rotate{from{transform:rotate(0)}to{transform:rotate(360deg)}}@-o-keyframes wdi_rotate{from{transform:rotate(0)}to{transform:rotate(360deg)}}@-ms-keyframes wdi_rotate{from{transform:rotate(0)}to{transform:rotate(360deg)}}@-webkit-keyframes wdi_rotate{from{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes wdi_rotate{from{transform:rotate(0)}to{transform:rotate(360deg)}}.wdi_layout_th .wdi_load_more_spinner{display:table-cell;vertical-align:middle;-webkit-animation:wdi_rotate 1.5s infinite;-moz-animation:wdi_rotate 1.5s infinite;-o-animation:wdi_rotate 1.5s infinite;animation:wdi_rotate 1.5s infinite}.wdi_layout_th .wdi_load_more,.wdi_layout_th .wdi_spinner{padding:10px;transition:all .2s ease}.wdi_layout_th .wdi_load_more_wrap,.wdi_layout_th .wdi_spinner_wrap{display:inline-table;box-sizing:border-box}.wdi_layout_th .wdi_load_more_wrap_inner,.wdi_layout_th .wdi_spinner_wrap_inner{display:table-row;text-align:center}.wdi_layout_th .wdi_load_more_text{display:table-cell;vertical-align:middle}.wdi_layout_th .wdi_load_more_text img{float:left}.wdi_layout_th .wdi_load_more_wrap:hover{cursor:pointer}.wdi_layout_th .wdi_photo_overlay:hover{cursor:pointer}.wdi_layout_th .wdi_photo_overlay i{opacity:1}.wdi_layout_th .wdi_load_more_container{display:inline-block}.wdi_layout_ib .wdi_feed_container{min-width:160px;margin:0 auto}.wdi_layout_ib .wdi_feed_wrapper{margin:0 auto}.wdi_layout_ib .wdi_header_wrapper{display:inline-table}.wdi_layout_ib .wdi_header_img_wrap,.wdi_layout_ib .wdi_users_img_wrap{overflow:hidden}.wdi_layout_ib .wdi_header_text{display:table-cell;vertical-align:middle}.wdi_layout_ib .wdi_single_user{display:inline-block;float:left}.wdi_layout_ib .wdi_user_img_wrap{display:inline-block;float:left;position:relative}.wdi_layout_ib .wdi_header_user_text{display:inline-block;float:left;width:100%}.wdi_layout_ib .wdi_followers,.wdi_layout_ib .wdi_posts{display:inline-block}.wdi_layout_ib .wdi_feed_container .wdi_feed_info .wdi_header_user_text h3{display:inline-block;text-transform:none}.wdi_layout_ib .wdi_header_user_text h3:hover{cursor:pointer}.wdi_layout_ib .wdi_user_img_wrap img{overflow:hidden;display:block;margin:0}.wdi_layout_ib .wdi_feed_container .wdi_feed_info .wdi_header_user_text h3{margin-left:10px;margin-bottom:0;padding:0}.wdi_layout_ib .wdi_feed_container .wdi_feed_info .wdi_media_info p{margin-top:0;margin-bottom:0}.wdi_layout_ib .wdi_user_controls{margin-left:0;display:inline-block;vertical-align:middle}.wdi_layout_ib .wdi_bio{float:left}.wdi_layout_ib .wdi_feed_container .wdi_feed_info .wdi_header_user_text .wdi_followers{margin-left:10px}.wdi_layout_ib .wdi_filter_overlay{position:absolute;z-index:2;top:0;left:0;opacity:0;transition:opacity .1s ease}.wdi_layout_ib .wdi_filter_overlay:hover{opacity:.9;cursor:pointer}.wdi_layout_ib .wdi_photo_wrap{overflow:hidden;box-sizing:content-box}.wdi_layout_ib .wdi_img{width:100%;display:block}.wdi_layout_ib .wdi_feed_item{display:inline-block;overflow:hidden}.wdi_layout_ib .wdi_photo_meta{text-align:center;padding-bottom:10px}.wdi_layout_ib .wdi_thumb_comments i,.wdi_layout_ib .wdi_thumb_likes i{width:100%}.wdi_layout_ib .wdi_photo_title{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:90%;margin-left:5%;margin-right:5%;text-align:center}.wdi_layout_ib .wdi_photo_title:hover{cursor:pointer}.wdi_layout_ib .wdi_load_more{padding:10px;transition:all .2s ease}.wdi_layout_ib .wdi_load_more_wrap{display:inline-table;box-sizing:border-box}.wdi_layout_ib .wdi_load_more_wrap_inner{display:table-row;text-align:center}.wdi_layout_ib .wdi_load_more_text{display:table-cell;vertical-align:middle}.wdi_layout_ib .wdi_load_more_text img{float:left}.wdi_layout_ib .wdi_load_more_wrap:hover{cursor:pointer}.wdi_layout_ib .wdi_photo_overlay:hover{cursor:pointer}.wdi_layout_ib .wdi_load_more_container{display:inline-block}.wdi_embed_frame video{display:inline-block}.wdi_image_container img{display:inline}.wdi_carousel_btn_container{height:20px;position:absolute;width:100%;bottom:65px;z-index:10150;font-size:0}.wdi_carousel_btn_container span{background:rgba(255,255,255,.5);width:10px;height:10px;display:inline-block;border-radius:5px;cursor:pointer;margin-right:9px;position:relative;left:0;transition:left .3s;-webkit-transition:left .3s;-moz-transition:left .3s}.wdi_carousel_btn_container span:last-child{margin-right:0}.wdi_carousel_btn_container span.active{background:#fff}.wdi_carousel_btn_container span.small{width:7px;height:7px;margin-right:12px;top:-2px}.wdi_carousel_btn_content{display:inline-block;overflow:hidden;white-space:nowrap;position:relative;padding:8px 9px;background:rgba(0,0,0,.17);border-radius:21px}.wdi_image_container .carousel_media:not(.active){display:none}.wdi_website{width:100%;display:block;float:left}.wdi_website a{box-shadow:none!important;color:#003569;text-decoration:none}.elementor-editor-active .wdi_front_overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.2)}
1
+ .wdi_clear{clear:both}.wdi_feed_main_container .table{display:table}.wdi_feed_main_container .table-cell{display:table-cell}.wdi_feed_main_container .table-row{display:table-row}.wdi_feed_main_container{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.wdi_follow_button:hover{cursor:pointer}.wdi_hidden{display:none!important}.wdi_hover_off:hover{background-color:transparent!important}.wdi_cursor_off:hover{cursor:auto!important}.wdi_filter_active span{color:#fff}.wdi_disabled{visibility:hidden}.wdi_ajax_loading{position:absolute;width:50px;height:50px;left:0;right:0;bottom:-60px;margin:auto;z-index:100}.wdi_feed_main_container{width:100%;position:relative}.wdi_feed_main_container .wdi_img{margin:0}.wdi_feed_main_container .wdi_follow_btn{display:inline-block;background:0 0;border-style:solid;border-width:1px;font-weight:500;outline:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-appearance:none;vertical-align:text-bottom}.wdi_feed_main_container .wdi_follow_btn:hover{cursor:pointer}.wdi_feed_main_container .wdi_pagination{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.wdi_feed_main_container .wdi_pagination_ctrl{display:inline-block}.wdi_feed_main_container .wdi_pagination_ctrl:hover{cursor:pointer}.wdi_feed_main_container .wdi_filter_icon span{display:block;font-size:25px;color:#fff}.wdi_feed_main_container .wdi_filter_icon span::before{width:20px;height:20px;position:absolute;opacity:1;right:0;left:0;top:0;bottom:0;margin:auto}.wdi_photo_img{position:relative;overflow:hidden}.wdi_photo_overlay{width:100%;height:100%;position:absolute;top:0;left:0;background-color:transparent;transition:all .1s ease}.wdi_photo_overlay:hover .wdi_thumb_icon i{display:block}.wdi_feed_main_container .tenweb{font-family:tenweb!important;font-style:normal;width:auto;speak:none;display:inline-block;line-height:1;font-weight:400;font-variant:normal;text-transform:none;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.wdi_media_info .tenweb-i:before{margin-right:6px}.wdi_spider_popup_loading{background-image:url(../images/ajax_loader.png);background-color:rgba(0,0,0,0);background-repeat:no-repeat;background-position:0 0;background-size:50px 50px;border:none!important;display:none;height:50px;left:50%;margin-left:-20px;margin-top:-20px;overflow:hidden;position:fixed;top:50%;width:50px;z-index:10102;-moz-animation:spin 2.5s infinite linear;-o-animation:spin 2.5s infinite linear;-webkit-animation:spin 2.5s infinite linear;animation:spin 2.5s infinite linear}.wdi_spider_popup_overlay{cursor:pointer;background-color:rgba(0,0,0,.5);display:none;height:100%;left:0;position:fixed;top:0;width:100%;z-index:10100}div[id^=wdi_container] p{padding:0!important;margin:0!important}.footer-list-block .bwp_gallery .wdi_spider_popup_loading,.footer-list-block .bwp_gallery_tags .wdi_spider_popup_loading,.wdi_spider_popup_loading{background-image:url(../images/ajax_loader.png);background-color:rgba(0,0,0,0);background-repeat:no-repeat;background-position:0 0;background-size:50px 50px;border:none!important;display:none;height:50px;left:50%;margin-left:-20px;margin-top:-20px;overflow:hidden;position:fixed;top:50%;width:50px;z-index:10102;-moz-animation:spin 2.5s infinite linear;-o-animation:spin 2.5s infinite linear;-webkit-animation:spin 2.5s infinite linear;animation:spin 2.5s infinite linear}.wdi_spider_ajax_loading{border:none!important;-moz-animation:spin 2.5s infinite linear;-o-animation:spin 2.5s infinite linear;-webkit-animation:spin 2.5s infinite linear;animation:spin 2.5s infinite linear}.footer-list-block .bwp_gallery .wdi_spider_popup_overlay,.footer-list-block .bwp_gallery_tags .wdi_spider_popup_overlay,.wdi_spider_popup_overlay{cursor:pointer;display:none;height:100%;left:0;position:fixed;top:0;width:100%;z-index:10100}.wdi_spider_popup_close,.wdi_spider_popup_close_fullscreen{-moz-box-sizing:content-box!important;box-sizing:content-box!important;cursor:pointer;display:table;line-height:0;position:absolute;z-index:11100}#wdi_spider_popup_left{left:0}#wdi_spider_popup_right{right:0}#wdi_spider_popup_left:hover,#wdi_spider_popup_right:hover{visibility:visible}#wdi_spider_popup_left:hover span{left:20px}#wdi_spider_popup_right:hover span{left:auto;right:20px}#wdi_spider_popup_left,#wdi_spider_popup_right{background:transparent url(../images/blank.gif) repeat scroll 0 0;bottom:35%;cursor:pointer;display:inline;height:30%;outline:medium none;position:absolute;width:35%;z-index:10130}#wdi_spider_popup_left-ico,#wdi_spider_popup_right-ico{-moz-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:table;left:-9999px;line-height:0;margin-top:-15px;position:absolute;top:50%;z-index:10135}.wdi_image_info_container1{height:100%;margin:0 auto;position:absolute;width:100%}.wdi_image_info_container2{display:table;height:100%;margin:0 auto;position:absolute;width:100%}.wdi_image_info_spun{display:table-cell;height:100%;left:0;top:0;width:100%;overflow:hidden;position:relative}.wdi_image_info{display:inline-block;position:relative;text-decoration:none;word-wrap:break-word;z-index:11}.wdi_photo_wrap_inner{text-align:center}.wdi_feed_item[wdi_type=slideshow] .tenweb-i-clone{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-o-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.wdi_js_error_no_animate,.wdi_token_error{text-align:center;font-size:14px}.wdi_js_error{text-align:center;-webkit-animation-name:wdi_js_error;-moz-animation-name:wdi_js_error;-o-animation-name:wdi_js_error;animation-name:wdi_js_error;-webkit-animation-duration:.5s;-moz-animation-duration:.5s;-o-animation-duration:.5s;animation-duration:.5s;-webkit-animation-delay:20s;-moz-animation-delay:20s;-o-animation-delay:20s;animation-delay:20s;-webkit-animation-fill-mode:forwards;-moz-animation-fill-mode:forwards;-o-animation-fill-mode:forwards;animation-fill-mode:forwards;color:#c00;-webkit-transform:scale(0);-moz-transform:scale(0);-ms-transform:scale(0);-o-transform:scale(0);transform:scale(0);font-size:12px}@keyframes wdi_js_error{from{visibility:hidden;-webkit-transform:scale(0);-moz-transform:scale(0);-ms-transform:scale(0);-o-transform:scale(0);transform:scale(0)}to{visibility:visible;-webkit-transform:scale(1);-moz-transform:scale(1);-ms-transform:scale(1);-o-transform:scale(1);transform:scale(1)}}.wdi_layout_th .wdi_feed_container{min-width:160px;margin:0 auto}.wdi_layout_th .wdi_feed_wrapper{margin:0 auto}.wdi_layout_th .wdi_header_wrapper{display:inline-table}.wdi_layout_th .wdi_header_img_wrap{overflow:hidden}.wdi_layout_th .wdi_header_text{display:table-cell;vertical-align:middle}.wdi_layout_th .wdi_single_user{display:inline-block;float:left}.wdi_layout_th .wdi_user_img_wrap{display:inline-block;float:left;position:relative}.wdi_layout_th .wdi_header_user_text{display:inline-block;float:left;width:100%}.wdi_layout_th .wdi_followers,.wdi_layout_th .wdi_posts{display:inline-block}.wdi_layout_th .wdi_feed_container .wdi_feed_info .wdi_header_user_text h3{display:inline-block;text-transform:none}.wdi_layout_th .wdi_header_user_text h3:hover{cursor:pointer}.wdi_layout_th .wdi_user_img_wrap img{overflow:hidden;display:block;margin:0}.wdi_layout_th .wdi_feed_container .wdi_feed_info .wdi_header_user_text h3{margin-left:10px;margin-bottom:0;padding:0}.wdi_layout_th .wdi_feed_container .wdi_feed_info .wdi_media_info p{margin-top:0;margin-bottom:0}.wdi_layout_th .wdi_user_controls{margin-left:0;display:inline-block;vertical-align:middle}.wdi_layout_th .wdi_bio{float:left}.wdi_layout_th .wdi_feed_container .wdi_feed_info .wdi_header_user_text .wdi_followers{margin-left:10px}.wdi_layout_th .wdi_filter_overlay{position:absolute;z-index:2;top:0;left:0;opacity:0;transition:opacity .1s ease}.wdi_layout_th .wdi_filter_overlay:hover{opacity:.9;cursor:pointer}.wdi_layout_th .wdi_photo_wrap{position:relative;display:inline-block;overflow:hidden;box-sizing:content-box}.wdi_layout_th .wdi_photo_wrap:after{padding-top:100%;display:block;content:""}.wdi_layout_th .wdi_photo_wrap_inner{position:absolute;top:0;bottom:0;left:0;right:0}.wdi_layout_th .wdi_photo_img{width:100%;height:100%}.wdi_layout_th .wdi_img{display:block;position:absolute;top:50%;left:50%;max-width:none;-webkit-transform:translateX(-50%) translateY(-50%);-moz-transform:translateX(-50%) translateY(-50%);-ms-transform:translateX(-50%) translateY(-50%);-o-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%)}.wdi_layout_th .wdi_shape_portrait .wdi_img,.wdi_layout_th .wdi_shape_square .wdi_img{width:100%;height:auto}.wdi_layout_th .wdi_shape_landscape .wdi_img{height:100%!important;width:auto}.wdi_layout_th .wdi_feed_item{display:inline-block;vertical-align:top;overflow:hidden}.wdi_layout_th .wdi_photo_meta{text-align:center;padding-bottom:10px;line-height:1.4}.wdi_layout_th .wdi_thumb_comments i,.wdi_layout_th .wdi_thumb_likes i{width:100%}.wdi_layout_th .wdi_photo_title{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:90%;margin-left:5%;margin-right:5%;text-align:center}.wdi_layout_th .wdi_photo_title:hover{cursor:pointer}@-moz-keyframes wdi_rotate{from{transform:rotate(0)}to{transform:rotate(360deg)}}@-o-keyframes wdi_rotate{from{transform:rotate(0)}to{transform:rotate(360deg)}}@-ms-keyframes wdi_rotate{from{transform:rotate(0)}to{transform:rotate(360deg)}}@-webkit-keyframes wdi_rotate{from{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes wdi_rotate{from{transform:rotate(0)}to{transform:rotate(360deg)}}.wdi_layout_bs .wdi_load_more_spinner,.wdi_layout_ms .wdi_load_more_spinner,.wdi_layout_th .wdi_load_more_spinner{display:table-cell;vertical-align:middle;-webkit-animation:wdi_rotate 1.5s infinite;-moz-animation:wdi_rotate 1.5s infinite;-o-animation:wdi_rotate 1.5s infinite;animation:wdi_rotate 1.5s infinite}.wdi_layout_th .wdi_load_more,.wdi_layout_th .wdi_spinner{padding:10px;transition:all .2s ease}.wdi_layout_th .wdi_load_more_wrap,.wdi_layout_th .wdi_spinner_wrap{display:inline-table;box-sizing:border-box}.wdi_layout_th .wdi_load_more_wrap_inner,.wdi_layout_th .wdi_spinner_wrap_inner{display:table-row;text-align:center}.wdi_layout_th .wdi_load_more_text{display:table-cell;vertical-align:middle}.wdi_layout_th .wdi_load_more_text img{float:left}.wdi_layout_th .wdi_load_more_wrap:hover{cursor:pointer}.wdi_layout_th .wdi_photo_overlay{transition:all .5s ease}.wdi_layout_th .wdi_photo_overlay:hover{cursor:pointer}.wdi_layout_th .wdi_photo_overlay i{color:transparent;transition:all .5s ease}.wdi_layout_th .wdi_photo_img img{transition:all .5s ease}.wdi_layout_th .wdi_load_more_container{display:inline-block}.wdi_layout_th .wdi_media_user{position:absolute;bottom:0;right:0;font-size:16px;border-radius:100px 0 0 0;padding-left:10px;padding-right:5px;line-height:1.5}.wdi_layout_ms .wdi_feed_container{min-width:160px;margin:0 auto}.wdi_layout_ms .wdi_feed_wrapper{position:relative;margin:0 auto}.wdi_layout_ms .wdi_header_wrapper{display:inline-table}.wdi_layout_ms .wdi_header_img_wrap,.wdi_layout_ms .wdi_users_img_wrap{overflow:hidden}.wdi_layout_ms .wdi_header_text{display:table-cell;vertical-align:middle}.wdi_layout_ms .wdi_single_user{display:inline-block;float:left}.wdi_layout_ms .wdi_user_img_wrap{display:inline-block;float:left;position:relative}.wdi_layout_ms .wdi_header_user_text{display:inline-block;float:left;width:100%}.wdi_layout_ms .wdi_followers,.wdi_layout_ms .wdi_posts{display:inline-block}.wdi_layout_ms .wdi_header_user_text h3{display:inline-block;text-transform:none}.wdi_layout_ms .wdi_header_user_text h3:hover{cursor:pointer}.wdi_layout_ms .wdi_user_img_wrap img{overflow:hidden;display:block;margin:0}.wdi_layout_ms .wdi_feed_container .wdi_feed_info .wdi_header_user_text h3{margin-left:10px;margin-bottom:0}.wdi_layout_ms .wdi_feed_container .wdi_feed_info .wdi_media_info p{margin-top:0;margin-bottom:0}.wdi_layout_ms .wdi_user_controls{margin-left:0;display:inline-block;vertical-align:middle}.wdi_layout_ms .wdi_bio{float:left}.wdi_layout_ms .wdi_feed_container .wdi_feed_info .wdi_header_user_text .wdi_followers{margin-left:10px}.wdi_layout_ms .wdi_filter_overlay{position:absolute;z-index:2;top:0;left:0;opacity:0;transition:opacity .1s ease}.wdi_layout_ms .wdi_filter_overlay:hover{opacity:.9;cursor:pointer}.wdi_layout_ms .wdi_photo_wrap{overflow:hidden;box-sizing:content-box}.wdi_layout_ms .wdi_img{width:100%;display:block}.wdi_layout_ms .wdi_masonry_column{display:block;overflow:hidden;float:left}.wdi_layout_ms .wdi_photo_meta{text-align:center;padding-bottom:10px}.wdi_layout_ms .wdi_likes i,.wdi_layout_ms .wdi_thumb_comments i{width:100%}.wdi_layout_ms .wdi_photo_title{text-overflow:ellipsis;overflow:hidden;width:90%;margin-left:5%;margin-right:5%;text-align:center}.wdi_layout_ms .wdi_photo_title:hover{cursor:pointer}.wdi_layout_ms .wdi_load_more,.wdi_layout_ms .wdi_spinner{padding:10px;transition:all .2s ease}.wdi_layout_ms .wdi_load_more_wrap,.wdi_layout_ms .wdi_spinner_wrap{display:inline-table;box-sizing:border-box}.wdi_layout_ms .wdi_load_more_wrap_inner,.wdi_layout_ms .wdi_spinner_wrap_inner{display:table-row;text-align:center}.wdi_layout_ms .wdi_load_more_text{display:table-cell;vertical-align:middle}.wdi_layout_ms .wdi_load_more_text img{float:left}.wdi_layout_ms .wdi_load_more_wrap:hover{cursor:pointer}.wdi_layout_ms .wdi_photo_overlay{transition:all .5s ease}.wdi_layout_ms .wdi_photo_overlay:hover{cursor:pointer}.wdi_layout_ms .wdi_photo_overlay i{color:transparent;transition:all .5s ease}.wdi_layout_ms .wdi_photo_img img{transition:all .5s ease}.wdi_layout_ms .wdi_load_more_container{display:inline-block}.wdi_layout_ms .wdi_media_user{position:absolute;bottom:0;right:0;font-size:16px;border-radius:100px 0 0 0;padding-left:10px;padding-right:5px}.wdi_layout_ib .wdi_feed_container{min-width:160px;margin:0 auto}.wdi_layout_ib .wdi_feed_wrapper{margin:0 auto}.wdi_layout_ib .wdi_header_wrapper{display:inline-table}.wdi_layout_ib .wdi_header_img_wrap,.wdi_layout_ib .wdi_users_img_wrap{overflow:hidden}.wdi_layout_ib .wdi_header_text{display:table-cell;vertical-align:middle}.wdi_layout_ib .wdi_single_user{display:inline-block;float:left}.wdi_layout_ib .wdi_user_img_wrap{display:inline-block;float:left;position:relative}.wdi_layout_ib .wdi_header_user_text{display:inline-block;float:left;width:100%}.wdi_layout_ib .wdi_followers,.wdi_layout_ib .wdi_posts{display:inline-block}.wdi_layout_ib .wdi_feed_container .wdi_feed_info .wdi_header_user_text h3{display:inline-block;text-transform:none}.wdi_layout_ib .wdi_header_user_text h3:hover{cursor:pointer}.wdi_layout_ib .wdi_user_img_wrap img{overflow:hidden;display:block;margin:0}.wdi_layout_ib .wdi_feed_container .wdi_feed_info .wdi_header_user_text h3{margin-left:10px;margin-bottom:0;padding:0}.wdi_layout_ib .wdi_feed_container .wdi_feed_info .wdi_media_info p{margin-top:0;margin-bottom:0}.wdi_layout_ib .wdi_user_controls{margin-left:0;display:inline-block;vertical-align:middle}.wdi_layout_ib .wdi_bio{float:left}.wdi_layout_ib .wdi_feed_container .wdi_feed_info .wdi_header_user_text .wdi_followers{margin-left:10px}.wdi_layout_ib .wdi_filter_overlay{position:absolute;z-index:2;top:0;left:0;opacity:0;transition:opacity .1s ease}.wdi_layout_ib .wdi_filter_overlay:hover{opacity:.9;cursor:pointer}.wdi_layout_ib .wdi_photo_wrap{overflow:hidden;box-sizing:content-box}.wdi_layout_ib .wdi_img{width:100%;display:block}.wdi_layout_ib .wdi_feed_item{display:inline-block;overflow:hidden}.wdi_layout_ib .wdi_photo_meta{text-align:center;padding-bottom:10px}.wdi_layout_ib .wdi_thumb_comments i,.wdi_layout_ib .wdi_thumb_likes i{width:100%}.wdi_layout_ib .wdi_photo_title{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:90%;margin-left:5%;margin-right:5%;text-align:center}.wdi_layout_ib .wdi_photo_title:hover{cursor:pointer}.wdi_layout_ib .wdi_load_more{padding:10px;transition:all .2s ease}.wdi_layout_ib .wdi_load_more_wrap{display:inline-table;box-sizing:border-box}.wdi_layout_ib .wdi_load_more_wrap_inner{display:table-row;text-align:center}.wdi_layout_ib .wdi_load_more_text{display:table-cell;vertical-align:middle}.wdi_layout_ib .wdi_load_more_text img{float:left}.wdi_layout_ib .wdi_load_more_wrap:hover{cursor:pointer}.wdi_layout_ib .wdi_photo_overlay:hover{cursor:pointer}.wdi_layout_ib .wdi_load_more_container{display:inline-block}.wdi_layout_bs .wdi_feed_container{min-width:160px;margin:0 auto}.wdi_layout_bs .wdi_feed_wrapper{margin:0 auto}.wdi_layout_bs .wdi_header_wrapper{display:inline-table}.wdi_layout_bs .wdi_header_img_wrap,.wdi_layout_bs .wdi_users_img_wrap{overflow:hidden}.wdi_layout_bs .wdi_header_text{display:table-cell;vertical-align:middle}.wdi_layout_bs .wdi_single_user{display:inline-block;float:left}.wdi_layout_bs .wdi_user_img_wrap{display:inline-block;float:left;position:relative}.wdi_layout_bs .wdi_header_user_text{display:inline-block;float:left;width:100%}.wdi_layout_bs .wdi_followers,.wdi_layout_bs .wdi_posts{display:inline-block}.wdi_layout_bs .wdi_header_user_text h3{display:inline-block;text-transform:none}.wdi_layout_bs .wdi_header_user_text h3:hover{cursor:pointer}.wdi_layout_bs .wdi_user_img_wrap img{overflow:hidden;display:block;margin:0}.wdi_layout_bs .wdi_feed_container .wdi_feed_info .wdi_header_user_text h3{margin-left:10px;margin-bottom:0}.wdi_feed_info .wdi_header_user_text h3{padding-top:0}.wdi_layout_bs .wdi_feed_container .wdi_feed_info .wdi_media_info p{margin-top:0;margin-bottom:0}.wdi_layout_bs .wdi_user_controls{margin-left:0;display:inline-block;vertical-align:middle}.wdi_layout_bs .wdi_bio{float:left}.wdi_layout_bs .wdi_feed_container .wdi_feed_info .wdi_header_user_text .wdi_followers{margin-left:10px}.wdi_layout_bs .wdi_filter_overlay{position:absolute;z-index:2;top:0;left:0;opacity:0;transition:opacity .1s ease}.wdi_layout_bs .wdi_filter_overlay:hover{opacity:.9;cursor:pointer}.wdi_layout_bs .wdi_photo_wrap{overflow:hidden;box-sizing:content-box}.wdi_layout_bs .wdi_img{width:100%;display:block}.wdi_layout_bs .wdi_feed_item{display:inline-block;overflow:hidden}.wdi_layout_bs .wdi_photo_meta{text-align:center;padding-bottom:10px}.wdi_layout_bs .wdi_thumb_comments i,.wdi_layout_bs .wdi_thumb_likes i{width:100%}.wdi_layout_bs .wdi_photo_title{text-overflow:ellipsis;overflow:hidden;white-space:normal;width:90%;margin-left:5%;margin-right:5%;text-align:center}.wdi_layout_bs .wdi_load_more,.wdi_layout_bs .wdi_spinner{padding:10px;transition:all .2s ease}.wdi_layout_bs .wdi_load_more_wrap,.wdi_layout_bs .wdi_spinner_wrap{display:inline-table;box-sizing:border-box}.wdi_layout_bs .wdi_load_more_wrap_inner,.wdi_layout_bs .wdi_spinner_wrap_inner{display:table-row;text-align:center}.wdi_layout_bs .wdi_load_more_text{display:table-cell;vertical-align:middle}.wdi_layout_bs .wdi_load_more_text img{float:left}.wdi_layout_bs .wdi_load_more_wrap:hover{cursor:pointer}.wdi_layout_bs .wdi_photo_overlay:hover{cursor:pointer}.wdi_layout_bs .wdi_load_more_container{display:inline-block}.wdi_embed_frame video{display:inline-block}.wdi_image_container img{display:inline}.wdi_carousel_btn_container{height:20px;position:absolute;width:100%;bottom:65px;z-index:10150;font-size:0}.wdi_carousel_btn_container span{background:rgba(255,255,255,.5);width:10px;height:10px;display:inline-block;border-radius:5px;cursor:pointer;margin-right:9px;position:relative;left:0;transition:left .3s;-webkit-transition:left .3s;-moz-transition:left .3s}.wdi_carousel_btn_container span:last-child{margin-right:0}.wdi_carousel_btn_container span.active{background:#fff}.wdi_carousel_btn_container span.small{width:7px;height:7px;margin-right:12px;top:-2px}.wdi_carousel_btn_content{display:inline-block;overflow:hidden;white-space:nowrap;position:relative;padding:8px 9px;background:rgba(0,0,0,.17);border-radius:21px}.wdi_image_container .carousel_media:not(.active){display:none}.wdi_website{width:100%;display:block;float:left}.wdi_website a{box-shadow:none!important;color:#003569;text-decoration:none}.elementor-editor-active .wdi_front_overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.2)}
elementor/elementor.php CHANGED
@@ -40,7 +40,6 @@ class WDIElementor {
40
  public function enqueue_elementor_widget_scripts(){
41
  wp_enqueue_script('twbb_editor_widget_js', plugin_dir_url(__FILE__) . 'js/wdi_elementor_widget.js', array('jquery'));
42
  }
43
-
44
  public function register_widget_category($elements_manager){
45
  $elements_manager->add_category('tenweb-plugins-widgets', array(
46
  'title' => __('10WEB', 'tenweb-builder'),
40
  public function enqueue_elementor_widget_scripts(){
41
  wp_enqueue_script('twbb_editor_widget_js', plugin_dir_url(__FILE__) . 'js/wdi_elementor_widget.js', array('jquery'));
42
  }
 
43
  public function register_widget_category($elements_manager){
44
  $elements_manager->add_category('tenweb-plugins-widgets', array(
45
  'title' => __('10WEB', 'tenweb-builder'),
elementor/widget.php CHANGED
@@ -9,7 +9,6 @@
9
  class WDIElementorWidget extends \Elementor\Widget_Base {
10
  private $feed_options = array();
11
  private $default_feed = '0';
12
-
13
  /**
14
  * Get widget name.
15
  *
@@ -58,6 +57,10 @@ class WDIElementorWidget extends \Elementor\Widget_Base {
58
  ]
59
  );
60
 
 
 
 
 
61
  $wdi_feed_id = $this->default_feed;
62
  if(isset($settings) && isset($settings["wdi_feeds"]) && intval($settings["wdi_feeds"])>0){
63
  $wdi_feed_id = intval($settings["wdi_feeds"]);
@@ -67,16 +70,16 @@ class WDIElementorWidget extends \Elementor\Widget_Base {
67
  }else{
68
  $wdi_edit_link = add_query_arg(array( 'page' => 'wdi_feeds'), admin_url('admin.php'));
69
  }
 
70
  $this->add_control(
71
  'wdi_feeds',
72
  [
73
  'label' => __('Select Feed', 'wd-instagram-feed'),
74
  'label_block' => true,
75
- 'description' => __('', 'wd-instagram-feed'),
76
  'type' => \Elementor\Controls_Manager::SELECT,
77
  'default' => $this->default_feed,
78
- 'options' => $this->feed_options,
79
- 'description' => __('Select the feed to display.', 'wd-instagram-feed') .' <a target="_blank" " href="' . $wdi_edit_link . '">' . __('Edit feed', 'wd-instagram-feed') . '</a>',
80
  ]
81
  );
82
 
@@ -112,4 +115,4 @@ class WDIElementorWidget extends \Elementor\Widget_Base {
112
  }
113
  }
114
 
115
- \Elementor\Plugin::instance()->widgets_manager->register_widget_type(new WDIElementorWidget());
9
  class WDIElementorWidget extends \Elementor\Widget_Base {
10
  private $feed_options = array();
11
  private $default_feed = '0';
 
12
  /**
13
  * Get widget name.
14
  *
57
  ]
58
  );
59
 
60
+ if($this->get_id() !== null){
61
+ $settings = $this->get_init_settings();
62
+ }
63
+
64
  $wdi_feed_id = $this->default_feed;
65
  if(isset($settings) && isset($settings["wdi_feeds"]) && intval($settings["wdi_feeds"])>0){
66
  $wdi_feed_id = intval($settings["wdi_feeds"]);
70
  }else{
71
  $wdi_edit_link = add_query_arg(array( 'page' => 'wdi_feeds'), admin_url('admin.php'));
72
  }
73
+
74
  $this->add_control(
75
  'wdi_feeds',
76
  [
77
  'label' => __('Select Feed', 'wd-instagram-feed'),
78
  'label_block' => true,
79
+ 'description' => __('Select the feed to display.', 'wd-instagram-feed') .' <a target="_blank" " href="' . $wdi_edit_link . '">' . __('Edit feed', 'wd-instagram-feed') . '</a>',
80
  'type' => \Elementor\Controls_Manager::SELECT,
81
  'default' => $this->default_feed,
82
+ 'options' => $this->feed_options
 
83
  ]
84
  );
85
 
115
  }
116
  }
117
 
118
+ \Elementor\Plugin::instance()->widgets_manager->register_widget_type(new WDIElementorWidget());
framework/IsFree.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ $free_messages = array(
3
+ "wdi-business" => "Business connecting are available only in Premium version"
4
+ );
framework/WDICache.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: arshaluys
5
+ * Date: 8/26/20
6
+ * Time: 3:54 PM
7
+ */
8
+
9
+ class WDICache{
10
+ private $wdi_options = NULL;
11
+
12
+ function __construct() {
13
+ global $wdi_options;
14
+ $this->wdi_options = $wdi_options;
15
+ }
16
+
17
+ public function get_cache_data($name, $debug = FALSE){
18
+ $transient_key = "wdi_cache_" . md5($name);
19
+ $cache_data = get_transient($transient_key);
20
+ if ( isset($cache_data) && $cache_data != FALSE && isset($cache_data["cache_response"]) ) {
21
+
22
+ $wdi_debugging = FALSE;
23
+ $wdi_debugging_data = array();
24
+ if ( $debug ) {
25
+ $wdi_debugging = TRUE;
26
+ $current_date = (date('Y-m-d H:i:s'));
27
+ $cache_date = $cache_data["wdi_debugging_data"]["cache_date"];
28
+ $wdi_transient_time = $cache_data["wdi_debugging_data"]["wdi_transient_time"];
29
+ $current_date_strtotime = strtotime($current_date);
30
+ $cache_date_strtotime = strtotime($cache_date);
31
+ $seconds_diff = $current_date_strtotime - $cache_date_strtotime;
32
+ $date_diff_min = $seconds_diff / 60;
33
+ $wdi_debugging_data = array(
34
+ 'current_date' => $current_date,
35
+ 'cache_date' => $cache_date,
36
+ 'date_diff_min' => $date_diff_min,
37
+ 'transient_key' => WDILibrary::get('wdi_cache_name'),
38
+ 'wdi_transient_time' => $wdi_transient_time,
39
+ );
40
+ }
41
+ $cache_data = stripslashes($cache_data["cache_response"]);
42
+ $return_data = array(
43
+ "success" => TRUE,
44
+ "wdi_debugging" => $wdi_debugging,
45
+ "wdi_debugging_data" => $wdi_debugging_data,
46
+ "cache_data" => $cache_data,
47
+ );
48
+ return $return_data;
49
+ }
50
+ return array("success" => FALSE);
51
+ }
52
+ public function set_cache_data($name, $response){
53
+ //$response = json_decode(stripslashes($response), TRUE);
54
+ //$response["cache"]=TRUE;
55
+ //$response = json_encode($response, true);
56
+ if ( isset($this->wdi_options["wdi_transient_time"]) ) {
57
+ $wdi_transient_time = intval($this->wdi_options["wdi_transient_time"]);
58
+ }
59
+ else {
60
+ $wdi_transient_time = 60;
61
+ }
62
+ $cache_date = (date('Y-m-d H:i:s'));
63
+ $wdi_cache_response = $response;
64
+ $transient_key = "wdi_cache_" . md5($name);
65
+ $expiration_time = $wdi_transient_time * 60;
66
+ if ( !seems_utf8($wdi_cache_response) ) {
67
+ $wdi_cache_response = utf8_encode($wdi_cache_response);
68
+ }
69
+ $data = array(
70
+ 'cache_response' => $wdi_cache_response,
71
+ 'wdi_debugging_data' => array(
72
+ 'cache_date' => $cache_date,
73
+ 'wdi_transient_time' => $wdi_transient_time,
74
+ ),
75
+ );
76
+ $data = set_transient($transient_key, $data, $expiration_time);
77
+ return $data;
78
+ }
79
+ public function reset_cache(){
80
+ global $wpdb;
81
+ $data = $wpdb->query('DELETE FROM ' . $wpdb->prefix . 'options WHERE option_name LIKE "%wdi_cache_%"');
82
+ return $data;
83
+ }
84
+ }
framework/WDIInstagram.php ADDED
@@ -0,0 +1,473 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WDIInstagram {
4
+ private $wdi_options = NULL;
5
+ private $cache = NULL;
6
+ private $wdi_authenticated_users_list = NULL;
7
+ private $account_data = NULL;
8
+
9
+ function __construct() {
10
+ require_once("WDICache.php");
11
+ $this->cache = new WDICache();
12
+ $this->wdi_options = get_option("wdi_instagram_options");
13
+ if ( isset($this->wdi_options["wdi_authenticated_users_list"]) ) {
14
+ $this->wdi_authenticated_users_list = json_decode($this->wdi_options["wdi_authenticated_users_list"], TRUE);
15
+ }
16
+ }
17
+
18
+ public function getUserMedia( $user_name ) {
19
+ if ( isset($this->wdi_authenticated_users_list) && is_array($this->wdi_authenticated_users_list) && isset($this->wdi_authenticated_users_list[$user_name]) ) {
20
+
21
+
22
+ $this->account_data = $this->wdi_authenticated_users_list[$user_name];
23
+ $user_id = $this->account_data["user_id"];
24
+ $access_token = $this->account_data["access_token"];
25
+ $api_url = 'https://graph.instagram.com/v1.0/';
26
+ $media_fields = 'id,media_type,media_url,permalink,thumbnail_url,username,caption,timestamp';
27
+ if ( $this->account_data["type"] === "business" ) {
28
+ $api_url = 'https://graph.facebook.com/v8.0/';
29
+ $media_fields = 'id,media_type,media_url,permalink,thumbnail_url,username,caption,timestamp,ig_id,is_comment_enabled,like_count,owner,shortcode';
30
+ }
31
+ $baseUrl = $api_url . $user_id . '/media?access_token=' . $access_token;
32
+ $media = array();
33
+ $cache_data = $this->cache->get_cache_data($baseUrl);
34
+ if ( isset($cache_data) && $cache_data["success"] && isset($cache_data["cache_data"]) ) {
35
+ return base64_decode($cache_data["cache_data"]);
36
+ }
37
+ $args = array();
38
+ $response = wp_remote_get($baseUrl, $args);
39
+ if ( !isset($response->errors) && isset($response["body"]) ) {
40
+ if ( isset($response["body"]) ) {
41
+ $data = json_decode($response["body"], TRUE);
42
+ $return_data = $data;
43
+ if ( isset($data["data"]) ) {
44
+ $media_ids = $data["data"];
45
+ foreach ( $media_ids as $id ) {
46
+ if ( isset($id["id"]) ) {
47
+ $media_url = $api_url . $id["id"] . '/?fields=' . $media_fields . '&access_token=' . $access_token;
48
+ $media_response = wp_remote_get($media_url, array());
49
+ if ( isset($media_response["body"]) ) {
50
+ $media_data = json_decode($media_response["body"], TRUE);
51
+ array_push($media, $media_data);
52
+ }
53
+ }
54
+ }
55
+ }
56
+ }
57
+ if ( isset($return_data) ) {
58
+ $return_data["data"] = $media;
59
+ $return_data = $this->convertPersonalData($return_data);
60
+ $return_data = json_encode($return_data);
61
+ $this->cache->set_cache_data($baseUrl, base64_encode($return_data));
62
+ return $return_data;
63
+ }
64
+ }
65
+ $return_data = '{"error":{"message":"cURL error","type":"http_request_failed"}}';
66
+ return $return_data;
67
+
68
+ }
69
+ }
70
+
71
+ public function getTagRecentMedia( $tagname, $endpoint, $next_url = NULL, $wdiTagId = FALSE, $user_name = NULL ) {
72
+ $this->account_data = $this->wdi_authenticated_users_list[$user_name];
73
+ $return_data = array();
74
+ if ( isset($next_url) ) {
75
+ $baseUrl = $next_url;
76
+ }
77
+ else {
78
+ if ( $endpoint == 0 ) {
79
+ $endpoint = "top_media";
80
+ }
81
+ else {
82
+ $endpoint = "recent_media";
83
+ }
84
+ $baseUrl = 'https://graph.facebook.com/{tagid}/' . $endpoint . '/?fields=media_url,caption,id,media_type,comments_count,like_count,permalink,children{media_url,id,media_type,permalink}&access_token=' . $this->account_data["access_token"] . '&user_id=' . $this->account_data["user_id"];
85
+ if ( $wdiTagId !== FALSE ) {
86
+ $baseUrl = str_replace("{tagid}", $wdiTagId, $baseUrl);
87
+ }
88
+ else {
89
+ $data = $this->getHastagDataUrl($tagname, $baseUrl);
90
+ if ( isset($data["id"]) && isset($data["url"]) ) {
91
+ $baseUrl = $data["url"];
92
+ $return_data["tag_data"] = array(
93
+ 'id' => "#" . $tagname,
94
+ 'username' => "#" . $tagname,
95
+ 'tag_id' => $data["id"],
96
+ );
97
+ }
98
+ }
99
+ }
100
+ /**********************************************************8*/
101
+ $args = array();
102
+ //$return_data = '{"error":{"message":"cURL error","type":"http_request_failed"}}';
103
+ $cache_data = $this->cache->get_cache_data($baseUrl);
104
+ if ( isset($cache_data) && $cache_data["success"] && isset($cache_data["cache_data"]) ) {
105
+ $cache_data_json = base64_decode($cache_data["cache_data"]);
106
+ if ( isset($cache_data_json) && $cache_data_json !== "null" ) {
107
+ return $cache_data_json;
108
+ }
109
+ }
110
+ $response = wp_remote_get($baseUrl, $args);
111
+ if ( !isset($response->errors) && isset($response["body"]) ) {
112
+ $response_arr = json_decode($response["body"]);
113
+ $return_data["response"] = $response_arr;
114
+ $this->cache->set_cache_data($baseUrl, base64_encode(json_encode($return_data)));
115
+ return json_encode($return_data);
116
+ }
117
+ $return_data = '{"error":{"message":"cURL error","type":"http_request_failed"}}';
118
+ return $return_data;
119
+ }
120
+
121
+ private function getHastagDataUrl( $tagname, $baseUrl ) {
122
+ $url = 'https://graph.facebook.com/ig_hashtag_search/?user_id=' . $this->account_data["user_id"] . '&q=' . $tagname . '&access_token=' . $this->account_data["access_token"];
123
+ $return_data = array();
124
+ $args = array();
125
+ $cache_data = $this->cache->get_cache_data($url);
126
+ if ( isset($cache_data) && $cache_data["success"] && isset($cache_data["cache_data"]) ) {
127
+ return json_decode($cache_data["cache_data"], TRUE);
128
+ }
129
+ $response = wp_remote_get($url, $args);
130
+ if ( !isset($response->errors) && isset($response["body"]) ) {
131
+ $response = json_decode($response["body"]);
132
+ if ( isset($response->data) && isset($response->data[0]) && isset($response->data[0]->id) ) {
133
+ $hashtag_id = $response->data[0]->id;
134
+ $baseUrl = str_replace("{tagid}", $hashtag_id, $baseUrl);
135
+ $return_data["id"] = $hashtag_id;
136
+ $return_data["url"] = $baseUrl;
137
+ $this->cache->set_cache_data($url, json_encode($return_data, TRUE));
138
+ }
139
+ }
140
+
141
+ return $return_data;
142
+ }
143
+
144
+ private function convertPersonalData( $data ) {
145
+ $carousel_media_ids = array();
146
+ $converted_data = array(
147
+ "data" => array(),
148
+ "pagination" => array(),
149
+ );
150
+ if ( is_array($data) ) {
151
+ if ( isset($data["paging"]) ) {
152
+ $converted_data["pagination"] = array(
153
+ "cursors" => array(
154
+ "after" => $data["paging"]["cursors"]["after"],
155
+ ),
156
+ "next_url" => (isset($data["paging"]["next"]) ? $data["paging"]["next"] : ""),
157
+ );
158
+ }
159
+ if ( isset($data["data"]) ) {
160
+ foreach ( $data["data"] as $key => $media ) {
161
+
162
+
163
+ if ( $media["media_type"] == "IMAGE" ) {
164
+ $media_type = "image";
165
+ }
166
+ elseif ( $media["media_type"] == "VIDEO" ) {
167
+ $media_type = "video";
168
+ }
169
+ else {
170
+ $media_type = "carousel";
171
+ }
172
+ if ( isset($media["like_count"]) ) {
173
+ $like_count = intval($media["like_count"]);
174
+ }
175
+ else {
176
+ $like_count = 0;
177
+ }
178
+ $converted = array(
179
+ "id" => (isset($media["id"]) ? $media["id"] : ""),
180
+ "user" => array(
181
+ "id" => "",
182
+ "full_name" => "",
183
+ "profile_picture" => "",
184
+ "username" => "",
185
+ ),
186
+ "images" => array(
187
+ "thumbnail" => array(
188
+ "width" => 150,
189
+ "height" => 150,
190
+ "url" => (isset($media["permalink"]) ? $media["permalink"] . "media?size=t" : ""),
191
+ ),
192
+ "low_resolution" => array(
193
+ "width" => 320,
194
+ "height" => 320,
195
+ "url" => (isset($media["permalink"]) ? $media["permalink"] . "media?size=m" : ""),
196
+ ),
197
+ "standard_resolution" => array(
198
+ "width" => 1080,
199
+ "height" => 1080,
200
+ "url" => (isset($media["permalink"]) ? $media["permalink"] . "media?size=l" : ""),
201
+ ),
202
+ ),
203
+ "created_time" => (isset($media["timestamp"]) ? $media["timestamp"] : ""),
204
+ "caption" => array(
205
+ "id" => "",
206
+ "text" => (isset($media["caption"]) ? $media["caption"] : ""),
207
+ "created_time" => "",
208
+ "from" => array(
209
+ "id" => "",
210
+ "full_name" => "",
211
+ "profile_picture" => "",
212
+ "username" => "",
213
+ ),
214
+ ),
215
+ "user_has_liked" => ($like_count > 0),
216
+ "likes" => array(
217
+ "count" => 0, // media.like_count
218
+ ),
219
+ "tags" => array(),
220
+ "filter" => "Normal",
221
+ "comments" => array(
222
+ "count" => 0, // media.comments_count
223
+ ),
224
+ "media_type" => $media["media_type"],
225
+ "type" => $media_type,
226
+ "link" => (isset($media["permalink"]) ? $media["permalink"] : ""),
227
+ "location" => NULL,
228
+ "attribution" => NULL,
229
+ "users_in_photo" => array(),
230
+ );
231
+ if ( $media["media_type"] === "VIDEO" ) {
232
+ $converted["videos"] = array(
233
+ "standard_resolution" => array(
234
+ "width" => 640,
235
+ "height" => 800,
236
+ "url" => $media["media_url"],
237
+ ),
238
+ "low_bandwidth" => array(
239
+ "width" => 480,
240
+ "height" => 600,
241
+ "url" => $media["media_url"],
242
+ ),
243
+ "low_resolution" => array(
244
+ "width" => 480,
245
+ "height" => 600,
246
+ "url" => $media["media_url"],
247
+ ),
248
+ );
249
+ }
250
+
251
+ /**
252
+ * Set to global media object the carousel media data as key carousel-media.
253
+ *
254
+ * @param response => Global media object
255
+ * @param carusel_media_ids => Child ids
256
+ * @param ind => index counter
257
+ *
258
+ */
259
+ if ( $media["media_type"] === "CAROUSEL_ALBUM" ) {
260
+ $carousel_media = $this->getMediaChildren($media["id"]);
261
+ $converted["carousel_media"] = $carousel_media;
262
+ array_push($carousel_media_ids, array( 'index' => $key, "media_id" => $media["id"] ));
263
+ }
264
+ array_push($converted_data["data"], $converted);
265
+ }
266
+ }
267
+ }
268
+
269
+ return $converted_data;
270
+ }
271
+
272
+ /**
273
+ * Get media children id by gallery id.
274
+ *
275
+ * @param media_id => Media id
276
+ *
277
+ * @return object of founded media only child media ids
278
+ */
279
+ private function getMediaChildren( $media_id ) {
280
+ $carousel_media = array();
281
+ $api_url = 'https://graph.instagram.com/v1.0/';
282
+ if ( $this->account_data["type"] === "business" ) {
283
+ $api_url = 'https://graph.facebook.com/v8.0/';
284
+ }
285
+ $api_url .= $media_id . '/children?access_token=' . $this->account_data["access_token"];
286
+ $response = wp_remote_get($api_url, array());
287
+ if ( isset($response["body"]) && $this->isJson($response["body"]) ) {
288
+ $media_ids = json_decode($response["body"], TRUE);
289
+ if ( is_array($media_ids) && isset($media_ids["data"]) ) {
290
+ foreach ( $media_ids["data"] as $id ) {
291
+ if ( isset($id["id"]) ) {
292
+ $media = $this->getChildMediaById($id["id"]);
293
+ if(isset($media) && is_array($media)){
294
+ array_push($carousel_media, $media);
295
+ }
296
+ }
297
+ }
298
+ }
299
+ }
300
+ return $carousel_media;
301
+ }
302
+
303
+
304
+ /**
305
+ * Get media info by id.
306
+ *
307
+ * @param media_id => Media id
308
+ * @param ind => index for object
309
+ *
310
+ *
311
+ * @return object of founded media
312
+ */
313
+ private function getChildMediaById( $media_id ) {
314
+ $api_url = 'https://graph.instagram.com/v1.0/';
315
+ $fields = 'id,media_type,media_url,permalink,thumbnail_url,username,timestamp';
316
+ if ( $this->account_data["type"] === "business" ) {
317
+ $api_url = 'https://graph.facebook.com/v8.0/';
318
+ $fields = 'id,ig_id,media_type,media_url,permalink,thumbnail_url,username,timestamp,shortcode';
319
+ }
320
+ $api_url = $api_url . $media_id . '/?fields=' . $fields . '&access_token=' . $this->account_data["access_token"];
321
+ $response = wp_remote_get($api_url, array());
322
+ if ( isset($response["body"]) && $this->isJson($response["body"]) ) {
323
+ $media_data = json_decode($response["body"], TRUE);
324
+ if ( $media_data["media_type"] == "IMAGE" ) {
325
+ $return_data = array(
326
+ "images" => array(
327
+ "thumbnail" => array(
328
+ "width" => 150,
329
+ "height" => 150,
330
+ "url" => $media_data["permalink"] . "media?size=t",
331
+ ),
332
+ "low_resolution" => array(
333
+ "width" => 320,
334
+ "height" => 320,
335
+ "url" => $media_data["permalink"] . "media?size=m",
336
+ ),
337
+ "standard_resolution" => array(
338
+ "width" => 640,
339
+ "height" => 640,
340
+ "url" => $media_data["media_url"],
341
+ ),
342
+ ),
343
+ "users_in_photo" => array(),
344
+ "type" => "image",
345
+ );
346
+ }
347
+ else {
348
+ $return_data = array(
349
+ "videos" => array(
350
+ "standard_resolution" => array(
351
+ "width" => 640,
352
+ "height" => 800,
353
+ "url" => $media_data["media_url"],
354
+ "id" => $media_data["id"],
355
+ ),
356
+ "low_bandwidth" => array(
357
+ "width" => 480,
358
+ "height" => 600,
359
+ "url" => $media_data["media_url"],
360
+ "id" => $media_data["id"],
361
+ ),
362
+ "low_resolution" => array(
363
+ "width" => 640,
364
+ "height" => 800,
365
+ "url" => $media_data["media_url"],
366
+ "id" => $media_data["id"],
367
+ ),
368
+ ),
369
+ "users_in_photo" => array(),
370
+ "type" => "video",
371
+ );
372
+ }
373
+ return $return_data;
374
+ }
375
+
376
+ return FALSE;
377
+ }
378
+
379
+ public function wdi_preload_cache($data=NULL) {
380
+ if(isset($data)){
381
+ $feed_list = $this->get_feed_list($data, FALSE);
382
+ }else{
383
+ $this->cache->reset_cache();
384
+ global $wpdb;
385
+ $row = $wpdb->get_results("SELECT id, feed_users ,hashtag_top_recent FROM " . $wpdb->prefix . WDI_FEED_TABLE . " WHERE published=1 ORDER BY `feed_name` ASC");
386
+ $feed_list = $this->get_feed_list($row, TRUE);
387
+ }
388
+ if(isset($feed_list)){
389
+ foreach ($feed_list as $user_feed){
390
+ if(isset($user_feed["feed_list"])){
391
+ foreach ($user_feed["feed_list"] as $data){
392
+ if($data["type"] === "user"){
393
+ $this->getUserMedia($data["tag_name"]);
394
+ }else{
395
+ $this->getTagRecentMedia($data["tag_name"], 1, NULL, FALSE, $user_feed["user_name"]);
396
+ }
397
+ }
398
+ }
399
+ }
400
+ }
401
+ }
402
+
403
+
404
+ private function get_feed_list($data, $cron = TRUE){
405
+ $feed_list = array();
406
+ if($cron){
407
+ if ( isset($data) && is_array($data) ) {
408
+ foreach ( $data as $feed ) {
409
+ if ( isset($feed->feed_users) ) {
410
+ $endpoint = $feed->hashtag_top_recent;
411
+ $feed_users = json_decode($feed->feed_users);
412
+ $feed_data = array(
413
+ "feed_list"=>array(),
414
+ );
415
+ if ( is_array($feed_users)) {
416
+ foreach ( $feed_users as $user ) {
417
+ if ( $user->username[0] === "#" ) {
418
+ $tag_name = str_replace("#", "", $user->username);
419
+ $feed_arr = array(
420
+ "tag_name" =>$tag_name,
421
+ "type" =>"tag",
422
+ "endpoint" =>$endpoint,
423
+ );
424
+ }else{
425
+ $feed_arr = array(
426
+ "tag_name" =>$user->username,
427
+ "type" =>"user",
428
+ "endpoint" =>$endpoint,
429
+ );
430
+ $feed_data["user_name"] = $user->username;
431
+ }
432
+ array_push($feed_data["feed_list"], $feed_arr);
433
+ }
434
+ }
435
+ array_push($feed_list, $feed_data);
436
+ }
437
+ }
438
+ }
439
+ }else{
440
+ $feed_data = array(
441
+ "feed_list"=>array(),
442
+ );
443
+ if ( is_array($data)) {
444
+ foreach ( $data as $user ) {
445
+ if ( $user["username"][0] === "#" ) {
446
+ $tag_name = str_replace("#", "", $user["username"]);
447
+ $feed_arr = array(
448
+ "tag_name" =>$tag_name,
449
+ "type" =>"tag",
450
+ "endpoint" =>1,
451
+ );
452
+ }else{
453
+ $feed_arr = array(
454
+ "tag_name" =>$user["username"],
455
+ "type" =>"user",
456
+ "endpoint" =>1,
457
+ );
458
+ $feed_data["user_name"] = $user["username"];
459
+ }
460
+ array_push($feed_data["feed_list"], $feed_arr);
461
+ }
462
+ }
463
+ array_push($feed_list, $feed_data);
464
+ }
465
+ return $feed_list;
466
+ }
467
+
468
+ private function isJson( $string ) {
469
+ json_decode($string);
470
+
471
+ return (json_last_error() == JSON_ERROR_NONE);
472
+ }
473
+ }
framework/WDILibrary.php CHANGED
@@ -5,7 +5,7 @@ class WDILibrary {
5
  public function __construct() {
6
  }
7
 
8
- public static function get($key, $default_value = '') {
9
  if (isset($_GET[$key])) {
10
  $value = sanitize_text_field($_GET[$key]);
11
  }
@@ -18,9 +18,75 @@ class WDILibrary {
18
  if (!$value) {
19
  $value = $default_value;
20
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  return $value;
22
  }
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  public static function message_id( $message_id, $type = 'updated' ) {
25
  if ( $message_id ) {
26
  switch ( $message_id ) {
@@ -185,7 +251,12 @@ class WDILibrary {
185
  break;
186
  }
187
  case 28: {
188
- $message = __('Facebook Graph API Connect successfully done.', 'wd-instagram-feed');
 
 
 
 
 
189
  $type = 'updated';
190
  break;
191
  }
@@ -246,7 +317,7 @@ class WDILibrary {
246
  </script>
247
  <p class="search-box">
248
  <input type="search" id="search_value" name="search_value" class="wdi_spider_search_value" onkeypress="return check_search_key(event, this);" value="<?php echo esc_html($search_value); ?>" style="<?php echo (get_bloginfo('version') > '3.7') ? ' height: 28px;' : ''; ?>" />
249
- <input type="button" value="<?php _e('Search',"wd-instagram-feed");?>" onclick="wdi_spider_search()" class="button-secondary action">
250
  </p>
251
  <?php
252
  }
@@ -328,7 +399,6 @@ class WDILibrary {
328
  var wdi_form = jQuery('#<?php echo $form_id; ?>');
329
  /*Enter keycode*/
330
  var to_page = jQuery(_this).val();
331
- //console.log(to_page);
332
  var wdi_new_url = wdiChangeParamByName(window.location.href, "paged", to_page);
333
  wdi_form.attr("action", wdi_new_url);
334
  wdi_form.submit();
@@ -410,8 +480,8 @@ class WDILibrary {
410
  ?>
411
  </span>
412
  </div>
413
- <input type="hidden" id="page_number" name="page_number" value="<?php echo (int) WDILibrary::get('page_number',1); ?>" />
414
- <input type="hidden" id="search_or_not" name="search_or_not" value="<?php echo WDILibrary::get('search_or_not', ''); ?>"/>
415
  <?php
416
  }
417
 
@@ -447,22 +517,20 @@ class WDILibrary {
447
  "paged" => $page_number
448
  );
449
 
450
- $search = WDILibrary::get('search', '');
451
- if( !empty($search) ){
452
- $page_link_data['search'] = $search;
 
 
453
  }
454
-
455
- $order_by = WDILibrary::get('order_by', '');
456
- if( !empty($order_by) ) {
457
- $page_link_data['order_by'] = $order_by;
458
  }
459
-
460
- $order = WDILibrary::get('order', '');
461
- if( !empty($order) ) {
462
- $page_link_data['order'] = $order;
463
  }
464
-
465
  return self::get_page_link(array($page_link_data));
 
466
  }
467
 
468
  public static function ajax_search($search_by, $search_value, $form_id) {
@@ -610,15 +678,15 @@ class WDILibrary {
610
  </span>
611
  </div>
612
  <?php if (!$pager) { ?>
613
- <input type="hidden" id="page_number" name="page_number" value="<?php echo (int) WDILibrary::get('page_number', 1); ?>" />
614
- <input type="hidden" id="search_or_not" name="search_or_not" value="<?php echo WDILibrary::get('search_or_not', ''); ?>"/>
615
  <?php
616
  }
617
  }
618
 
619
  public static function ajax_html_frontend_page_nav($theme_row, $count_items, $page_number, $form_id, $limit = 20, $current_view, $id, $cur_alb_gal_id = 0, $type = 'album', $enable_seo = false, $pagination = 1) {
620
- $type = WDILibrary::get('type_' . $current_view, $type);
621
- $album_gallery_id = WDILibrary::get('album_gallery_id_' . $current_view, $cur_alb_gal_id);
622
  if ($count_items) {
623
  if ($count_items % $limit) {
624
  $items_county = ($count_items - $count_items % $limit) / $limit + 1;
@@ -714,7 +782,7 @@ class WDILibrary {
714
  }
715
  }
716
  ?>
717
- <input type="hidden" id="page_number_<?php echo $current_view; ?>" name="page_number_<?php echo $current_view; ?>" value="<?php echo (int) WDILibrary::get('page_number_' . $current_view, 1); ?>" />
718
  <script type="text/javascript">
719
  function wdi_spider_page_<?php echo $current_view; ?>(cur, x, y, load_more) {
720
  if (typeof load_more == "undefined") {
@@ -779,9 +847,9 @@ class WDILibrary {
779
  }
780
 
781
  public static function ajax_html_frontend_search_box($form_id, $current_view, $cur_gal_id, $images_count, $search_box_width = 180) {
782
- $wdi_search = WDILibrary::get('wdi_search_' . $current_view, '');
783
- $type = WDILibrary::get('type_' . $current_view, 'album');
784
- $album_gallery_id = (int) WDILibrary::get('album_gallery_id_' . $current_view, 0);
785
  ?>
786
  <style>
787
  .wdi_search_container_1 {
@@ -868,9 +936,10 @@ class WDILibrary {
868
  }
869
 
870
  public static function ajax_html_frontend_sort_box($form_id, $current_view, $cur_gal_id, $sort_by = '', $search_box_width = 180) {
871
- $wdi_search = WDILibrary::get('wdi_search_' . $current_view, '');
872
- $type = WDILibrary::get('type_' . $current_view, 'album');
873
- $album_gallery_id = (int) WDILibrary::get('album_gallery_id_' . $current_view, 'album');
 
874
  ?>
875
  <style>
876
  .wdi_order_cont_<?php echo $current_view; ?> {
@@ -967,15 +1036,14 @@ class WDILibrary {
967
  public static function verify_nonce($page){
968
 
969
  $nonce_verified = false;
970
- $wdi_nonce = WDILibrary::get('wdi_nonce', '');
971
- $_wpnonce = WDILibrary::get('_wpnonce', '');
972
- if ( isset( $wdi_nonce ) && wp_verify_nonce( $wdi_nonce, $page )) {
973
- $nonce_verified = true;
974
- }
975
- elseif ( isset( $_wpnonce ) && wp_verify_nonce( $_wpnonce, $page )) {
976
- $nonce_verified = true;
977
- }
978
 
 
 
 
 
 
979
  return $nonce_verified;
980
  }
981
 
@@ -1122,11 +1190,53 @@ class WDILibrary {
1122
  }
1123
 
1124
  public static function get_page_link( $data ){
1125
- $page = WDILibrary::get('page');
1126
  $url = add_query_arg(array( 'page' => $page, $data ), admin_url('admin.php'));
1127
  return $url;
1128
  }
1129
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1130
  public static function get_shortcode_data() {
1131
  global $wpdb;
1132
  require_once WDI_DIR . "/admin/models/WDIModelEditorShortcode.php";
@@ -1159,21 +1269,22 @@ class WDILibrary {
1159
  */
1160
  public static function add_auth_button( $text = "" ) {
1161
  $app_config = WDILibrary::instagram_app_config();
1162
- $href = $app_config['authorize'] . '?app_id=' . $app_config['app_id'] . '&redirect_uri=' . $app_config['redirect_uri'] . '&response_type=code&scope=user_profile,user_media&state=' . admin_url('admin.php?wdi_settings');
1163
  ?>
1164
- <a href="<?php echo $href; ?>" onclick="document.cookie='wdi_autofill=true'" class="wdi_sign_in_button"><?php echo $text; ?></a>
1165
  <?php
1166
  }
1167
 
1168
- public static function get_users_list(){
1169
  global $wdi_options;
1170
  $users_list = array();
1171
- if(!empty($wdi_options['wdi_authenticated_users_list'])){
1172
- $users_list = json_decode($wdi_options['wdi_authenticated_users_list'], true);
1173
- if(!is_array($users_list)){
1174
  $users_list = array();
1175
  }
1176
  }
 
1177
  return $users_list;
1178
  }
1179
 
@@ -1188,7 +1299,6 @@ class WDILibrary {
1188
  if(!empty($users_list[$user->username])) {
1189
  return $users_list[$user->username]['access_token'];
1190
  }
1191
-
1192
  }
1193
 
1194
  return $wdi_options['wdi_access_token'];
@@ -1208,30 +1318,35 @@ class WDILibrary {
1208
  }
1209
 
1210
  public static function elementor_is_active(){
1211
-
1212
- if((isset($_REQUEST['action']) && in_array($_REQUEST['action'], array('elementor', 'elementor_ajax'))) || (isset($_REQUEST['elementor-preview']))) {
 
1213
  return true;
1214
  }
1215
 
1216
  return false;
1217
  }
1218
 
1219
- public static function is_ajax(){
1220
-
1221
- //todo add themes
1222
- if(defined('DOING_AJAX') && DOING_AJAX) {
1223
- return true;
1224
  }
1225
 
1226
- return false;
1227
  }
1228
 
1229
  public static function instagram_app_config() {
1230
  $config = array(
1231
- 'code' => '',
1232
- 'app_id' => '734781953985462',
1233
- 'redirect_uri' => 'https://instagram-api.10web.io/instagram/personal/',
1234
- 'authorize' => 'https://api.instagram.com/oauth/authorize/',
 
 
 
 
 
 
1235
  'access_token' => 'https://api.instagram.com/oauth/access_token/',
1236
  'refresh_access_token' => 'https://graph.instagram.com/refresh_access_token/',
1237
  );
@@ -1239,22 +1354,6 @@ class WDILibrary {
1239
  return $config;
1240
  }
1241
 
1242
- /**
1243
- * Get instagram access token.
1244
- *
1245
- * @param array $args
1246
- *
1247
- * @return array|mixed
1248
- */
1249
-
1250
- public static function get_instagram_access( $access_token ) {
1251
- $config = self::instagram_app_config();
1252
- $response = wp_remote_get( $config['refresh_access_token'] . '?grant_type=ig_refresh_token&access_token=' . $access_token );
1253
- $response = json_decode( wp_remote_retrieve_body( $response ), true );
1254
-
1255
- return $response;
1256
- }
1257
-
1258
  /**
1259
  * Refresh access token.
1260
  *
@@ -1280,19 +1379,57 @@ class WDILibrary {
1280
  }
1281
 
1282
  /**
1283
- * Get instagram user.
1284
- *
1285
- * @param $access_token
1286
  *
1287
- * @return array|mixed|WP_Error
1288
  */
1289
- public static function get_instagram_user( $access_token ) {
1290
- $response = wp_remote_get( 'https://graph.instagram.com/me/?fields=id,username&access_token=' . $access_token );
1291
- $response = json_decode( wp_remote_retrieve_body( $response ), true );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1292
 
1293
- return $response;
1294
  }
1295
-
1296
  /**
1297
  * Generate top bar.
1298
  *
@@ -1335,7 +1472,7 @@ class WDILibrary {
1335
  <h1 class="head-notice">&nbsp;</h1>
1336
  <div class="topbar-container">
1337
  <?php
1338
- if ( !WDI_IS_PRO ) {
1339
  ?>
1340
  <div class="topbar topbar-content">
1341
  <div class="topbar-content-container">
@@ -1368,7 +1505,7 @@ class WDILibrary {
1368
  </div>
1369
  <?php
1370
  }
1371
- if ( !WDI_IS_PRO ) {
1372
  ?>
1373
  <div class="topbar topbar-links topbar_support_forum">
1374
  <div class="topbar-links-container">
@@ -1389,35 +1526,4 @@ class WDILibrary {
1389
  <?php
1390
  echo ob_get_clean();
1391
  }
1392
-
1393
- /**
1394
- * User feed info.
1395
- * @param array $args
1396
- *
1397
- * @return false|string
1398
- */
1399
- public static function user_feed_header_info( $args = array() ) {
1400
- $user = $args['user'];
1401
- $settings = $args['settings'];
1402
- ob_start();
1403
- if ( !empty($settings['show_usernames']) && $settings['show_usernames'] == 1 ) {
1404
- ?>
1405
- <div class="wdi_single_user">
1406
- <div class="wdi_header_user_text">
1407
- <h3 onclick="window.open('//instagram.com/<?php echo $user['username']; ?>','_blank')"><?php echo $user['username']; ?></h3>
1408
- <?php if ( !empty($settings['show_follow']) && $settings['show_follow'] == 1 ) { ?>
1409
- <div class="wdi_user_controls">
1410
- <div class="wdi_follow_btn" onclick="window.open('//instagram.com/<?php echo $user['username']; ?>','_blank')">
1411
- <span><?php _e('Follow', 'wd-instagram-feed'); ?></span>
1412
- </div>
1413
- </div>
1414
- <?php } ?>
1415
- </div>
1416
- </div>
1417
- <div class="wdi_clear"></div>
1418
- <?php
1419
- }
1420
-
1421
- return ob_get_clean();
1422
- }
1423
  }
5
  public function __construct() {
6
  }
7
 
8
+ /* public static function get($key, $default_value = '') {
9
  if (isset($_GET[$key])) {
10
  $value = sanitize_text_field($_GET[$key]);
11
  }
18
  if (!$value) {
19
  $value = $default_value;
20
  }
21
+ return $value;
22
+ }*/
23
+
24
+ /**
25
+ * Get request value.
26
+ *
27
+ * @param string $key
28
+ * @param string $default_value
29
+ * @param string $callback
30
+ *
31
+ * @return string|array
32
+ */
33
+ public static function get($key, $default_value = '', $callback = 'sanitize_text_field', $type = 'DEFAULT') {
34
+ switch ($type) {
35
+ case 'REQUEST' :
36
+ if (isset($_REQUEST[$key])) {
37
+ $value = $_REQUEST[$key];
38
+ }
39
+ break;
40
+ case 'DEFAULT' :
41
+ case 'POST' :
42
+ if (isset($_POST[$key])) {
43
+ $value = $_POST[$key];
44
+ }
45
+ if ( 'POST' === $type ) break;
46
+ case 'GET' :
47
+ if (isset($_GET[$key])) {
48
+ $value = $_GET[$key];
49
+ }
50
+ break;
51
+ }
52
+ if ( !isset($value) ) {
53
+ if( $default_value === NULL ) {
54
+ return NULL;
55
+ } else {
56
+ $value = $default_value;
57
+ }
58
+ }
59
+
60
+ if( is_bool($value) ) {
61
+ return $value;
62
+ }
63
+
64
+ if (is_array($value)) {
65
+ // $callback should be third parameter of the validate_data function, so there is need to add unused second parameter to validate_data function.
66
+ array_walk_recursive($value, array('self', 'validate_data'), $callback);
67
+ }
68
+ else {
69
+ self::validate_data($value, 0, $callback);
70
+ }
71
+
72
  return $value;
73
  }
74
 
75
+ /**
76
+ * Validate data.
77
+ *
78
+ * @param $value
79
+ * @param $key
80
+ * @param $callback
81
+ */
82
+ private static function validate_data(&$value, $key, $callback) {
83
+ $value = stripslashes($value);
84
+ if ( $callback && function_exists($callback) ) {
85
+ $value = $callback($value);
86
+ }
87
+ }
88
+
89
+
90
  public static function message_id( $message_id, $type = 'updated' ) {
91
  if ( $message_id ) {
92
  switch ( $message_id ) {
251
  break;
252
  }
253
  case 28: {
254
+ $message = __('Connected successfully.', 'wd-instagram-feed');
255
+ $type = 'updated';
256
+ break;
257
+ }
258
+ case 29: {
259
+ $message = __('Connected successfully.', 'wd-instagram-feed');
260
  $type = 'updated';
261
  break;
262
  }
317
  </script>
318
  <p class="search-box">
319
  <input type="search" id="search_value" name="search_value" class="wdi_spider_search_value" onkeypress="return check_search_key(event, this);" value="<?php echo esc_html($search_value); ?>" style="<?php echo (get_bloginfo('version') > '3.7') ? ' height: 28px;' : ''; ?>" />
320
+ <input type="button" value="<?php _e('Search','wd-instagram-feed');?>" onclick="wdi_spider_search()" class="button-secondary action">
321
  </p>
322
  <?php
323
  }
399
  var wdi_form = jQuery('#<?php echo $form_id; ?>');
400
  /*Enter keycode*/
401
  var to_page = jQuery(_this).val();
 
402
  var wdi_new_url = wdiChangeParamByName(window.location.href, "paged", to_page);
403
  wdi_form.attr("action", wdi_new_url);
404
  wdi_form.submit();
480
  ?>
481
  </span>
482
  </div>
483
+ <input type="hidden" id="page_number" name="page_number" value="<?php echo self::get('page_number', 1); ?>" />
484
+ <input type="hidden" id="search_or_not" name="search_or_not" value="<?php echo self::get('search_or_not'); ?>"/>
485
  <?php
486
  }
487
 
517
  "paged" => $page_number
518
  );
519
 
520
+ $search = self::get('search');
521
+ $order_by = self::get('order_by');
522
+ $order = self::get('order');
523
+ if ( !empty($search) ) {
524
+ $page_link_data['search'] = $_GET["search"];
525
  }
526
+ if ( !empty($order_by) ) {
527
+ $page_link_data['order_by'] = $_GET["order_by"];
 
 
528
  }
529
+ if ( !empty($order) ) {
530
+ $page_link_data['order'] = $_GET["order"];
 
 
531
  }
 
532
  return self::get_page_link(array($page_link_data));
533
+
534
  }
535
 
536
  public static function ajax_search($search_by, $search_value, $form_id) {
678
  </span>
679
  </div>
680
  <?php if (!$pager) { ?>
681
+ <input type="hidden" id="page_number" name="page_number" value="<?php echo self::get('page_number', 1); ?>" />
682
+ <input type="hidden" id="search_or_not" name="search_or_not" value="<?php echo self::get('search_or_not'); ?>"/>
683
  <?php
684
  }
685
  }
686
 
687
  public static function ajax_html_frontend_page_nav($theme_row, $count_items, $page_number, $form_id, $limit = 20, $current_view, $id, $cur_alb_gal_id = 0, $type = 'album', $enable_seo = false, $pagination = 1) {
688
+ $type = self::get('type_' . $current_view, $type);
689
+ $album_gallery_id = self::get('album_gallery_id_' . $current_view, $cur_alb_gal_id);
690
  if ($count_items) {
691
  if ($count_items % $limit) {
692
  $items_county = ($count_items - $count_items % $limit) / $limit + 1;
782
  }
783
  }
784
  ?>
785
+ <input type="hidden" id="page_number_<?php echo $current_view; ?>" name="page_number_<?php echo $current_view; ?>" value="<?php echo self::get('page_number_' . $current_view, 1, 'intval'); ?>" />
786
  <script type="text/javascript">
787
  function wdi_spider_page_<?php echo $current_view; ?>(cur, x, y, load_more) {
788
  if (typeof load_more == "undefined") {
847
  }
848
 
849
  public static function ajax_html_frontend_search_box($form_id, $current_view, $cur_gal_id, $images_count, $search_box_width = 180) {
850
+ $wdi_search = self::get('wdi_search_' . $current_view, '');
851
+ $type = self::get('type_' . $current_view, 'album');
852
+ $album_gallery_id = self::get('album_gallery_id_' . $current_view, 0, 'intval' );
853
  ?>
854
  <style>
855
  .wdi_search_container_1 {
936
  }
937
 
938
  public static function ajax_html_frontend_sort_box($form_id, $current_view, $cur_gal_id, $sort_by = '', $search_box_width = 180) {
939
+ $wdi_search = self::get('wdi_search_' . $current_view, '');
940
+ $type = self::get('type_' . $current_view, 'album');
941
+ $album_gallery_id = self::get('album_gallery_id_' . $current_view, 0, 'intval' );
942
+
943
  ?>
944
  <style>
945
  .wdi_order_cont_<?php echo $current_view; ?> {
1036
  public static function verify_nonce($page){
1037
 
1038
  $nonce_verified = false;
1039
+ $wdi_nonce = self::get('wdi_nonce');
1040
+ $wp_nonce = self::get('_wpnonce');
 
 
 
 
 
 
1041
 
1042
+ if ( wp_verify_nonce( $wdi_nonce, $page ) ) {
1043
+ $nonce_verified = true;
1044
+ } elseif ( wp_verify_nonce( $wp_nonce, $page )) {
1045
+ $nonce_verified = true;
1046
+ }
1047
  return $nonce_verified;
1048
  }
1049
 
1190
  }
1191
 
1192
  public static function get_page_link( $data ){
1193
+ $page = self::get('page');
1194
  $url = add_query_arg(array( 'page' => $page, $data ), admin_url('admin.php'));
1195
  return $url;
1196
  }
1197
 
1198
+ public static function minify_styles($string){
1199
+ // comments
1200
+ $string = preg_replace('!/\*.*?\*/!s', '', $string);
1201
+ $string = preg_replace('/\n\s*\n/', "\n", $string);
1202
+
1203
+ // space
1204
+ $string = preg_replace('/[\n\r \t]/', ' ', $string);
1205
+ $string = preg_replace('/ +/', ' ', $string);
1206
+ $string = preg_replace('/ ?([,:;{}]) ?/', '$1', $string);
1207
+
1208
+ // trailing;
1209
+ $string = preg_replace('/;}/', '}', $string);
1210
+ return $string;
1211
+ }
1212
+
1213
+ /**
1214
+ * @param $dir directory name
1215
+ * @return null|boolean return null when directory not exists,
1216
+ * true when directory recursively removed and false in failed
1217
+ * */
1218
+ public static function remove_folder($dir){
1219
+
1220
+ if(!is_dir($dir)) {
1221
+ return null;
1222
+ }
1223
+
1224
+ $files = scandir($dir);
1225
+
1226
+ if(is_array($files) && !empty($files)) {
1227
+
1228
+ foreach($files as $file) {
1229
+ if($file === "." || $file === "..") {
1230
+ continue;
1231
+ }
1232
+ unlink($dir . '/' . $file);
1233
+ }
1234
+
1235
+ }
1236
+
1237
+ return rmdir($dir);
1238
+ }
1239
+
1240
  public static function get_shortcode_data() {
1241
  global $wpdb;
1242
  require_once WDI_DIR . "/admin/models/WDIModelEditorShortcode.php";
1269
  */
1270
  public static function add_auth_button( $text = "" ) {
1271
  $app_config = WDILibrary::instagram_app_config();
1272
+ $href = $app_config['basic_authorize_url'] . '?app_id=' . $app_config['basic_app_id'] . '&redirect_uri=' . $app_config['basic_redirect_uri'] . '&response_type=code&scope=user_profile,user_media&state=' . admin_url('admin.php?wdi_settings');
1273
  ?>
1274
+ <a href="<?php echo $href; ?>" onclick="document.cookie='wdi_autofill=true'" class="wdi_sign_in_button"><i class="wdi-instagram-icon"></i><?php echo $text; ?></a>
1275
  <?php
1276
  }
1277
 
1278
+ public static function get_users_list() {
1279
  global $wdi_options;
1280
  $users_list = array();
1281
+ if ( !empty($wdi_options['wdi_authenticated_users_list']) ) {
1282
+ $users_list = json_decode($wdi_options['wdi_authenticated_users_list'], TRUE);
1283
+ if ( !is_array($users_list) ) {
1284
  $users_list = array();
1285
  }
1286
  }
1287
+
1288
  return $users_list;
1289
  }
1290
 
1299
  if(!empty($users_list[$user->username])) {
1300
  return $users_list[$user->username]['access_token'];
1301
  }
 
1302
  }
1303
 
1304
  return $wdi_options['wdi_access_token'];
1318
  }
1319
 
1320
  public static function elementor_is_active(){
1321
+ $action = self::get('action', '', 'sanitize_text_field', 'REQUEST');
1322
+ $elementor_preview = self::get('elementor-preview', '', 'sanitize_text_field', 'REQUEST');
1323
+ if ( in_array($action, array('elementor', 'elementor_ajax')) || ($elementor_preview != '') ) {
1324
  return true;
1325
  }
1326
 
1327
  return false;
1328
  }
1329
 
1330
+ public static function is_ajax() {
1331
+ if ( defined('DOING_AJAX') && DOING_AJAX ) {
1332
+ return TRUE;
 
 
1333
  }
1334
 
1335
+ return FALSE;
1336
  }
1337
 
1338
  public static function instagram_app_config() {
1339
  $config = array(
1340
+ 'graph_app_id' => '356432828483035',
1341
+ 'basic_app_id' => '734781953985462',
1342
+ 'graph_authorize_url' => 'https://www.facebook.com/dialog/oauth/',
1343
+ 'basic_authorize_url' => 'https://api.instagram.com/oauth/authorize/',
1344
+ 'graph_scope' => 'manage_pages,instagram_basic',
1345
+ 'basic_scope' => 'user_profile,user_media',
1346
+ 'basic_response_type' => 'code',
1347
+
1348
+ 'graph_redirect_uri' => 'https://api.web-dorado.com/instagram/business/',
1349
+ 'basic_redirect_uri' => 'https://instagram-api.10web.io/instagram/personal/',
1350
  'access_token' => 'https://api.instagram.com/oauth/access_token/',
1351
  'refresh_access_token' => 'https://graph.instagram.com/refresh_access_token/',
1352
  );
1354
  return $config;
1355
  }
1356
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1357
  /**
1358
  * Refresh access token.
1359
  *
1379
  }
1380
 
1381
  /**
1382
+ * User feed info.
1383
+ * @param array $args
 
1384
  *
1385
+ * @return false|string
1386
  */
1387
+ public static function user_feed_header_info( $args = array() ) {
1388
+ if ( !empty($args['user']) ) {
1389
+ $user = $args['user'];
1390
+ $settings = $args['settings'];
1391
+ $business = $user['type'] === 'business';
1392
+ ob_start();
1393
+ ?>
1394
+ <div class="wdi_single_user">
1395
+ <div class="wdi_header_user_text ">
1396
+ <?php if ( !empty($settings['show_follow']) && $settings['show_follow'] == 1 ) { ?>
1397
+ <div class="wdi_user_controls">
1398
+ <div class="wdi_follow_btn"
1399
+ onclick="window.open('//instagram.com/<?php echo $user['user_name']; ?>','_blank')">
1400
+ <span><?php _e('Follow', 'wd-instagram-feed'); ?></span>
1401
+ </div>
1402
+ </div>
1403
+ <?php } ?>
1404
+ <?php if ( $business && !empty($settings['show_usernames']) && !empty($settings['media_followers']) && $settings['media_followers'] == 1 ) { ?>
1405
+ <div class="wdi_media_info">
1406
+ <p class="wdi_posts">
1407
+ <span class="tenweb-i tenweb-i-camera-retro"></span><?php echo $user['media_count']; ?>
1408
+ </p>
1409
+ <p class="wdi_followers">
1410
+ <span class="tenweb-i tenweb-i-user"></span><?php echo $user['followers_count']; ?>
1411
+ </p>
1412
+ </div>
1413
+ <?php } ?>
1414
+ <?php if ( $business && !empty($settings['show_usernames']) && !empty($settings['biography_website']) && $settings['biography_website'] == 1 ) { ?>
1415
+ <div class="wdi_clear"></div>
1416
+ <div class="wdi_bio"><?php echo $user['biography']; ?></div>
1417
+ <div class="wdi_website">
1418
+ <a target="_blank" href="<?php echo $user['website']; ?>"><?php echo $user['website']; ?></a>
1419
+ </div>
1420
+ <?php } ?>
1421
+ </div>
1422
+ </div>
1423
+ <div class="wdi_clear"></div>
1424
+ <?php
1425
+ return ob_get_clean();
1426
+ }
1427
+ }
1428
+
1429
+ public static function get_user_info( $user_name ) {
1430
 
 
1431
  }
1432
+
1433
  /**
1434
  * Generate top bar.
1435
  *
1472
  <h1 class="head-notice">&nbsp;</h1>
1473
  <div class="topbar-container">
1474
  <?php
1475
+ if ( IS_FREE ) {
1476
  ?>
1477
  <div class="topbar topbar-content">
1478
  <div class="topbar-content-container">
1505
  </div>
1506
  <?php
1507
  }
1508
+ if ( IS_FREE ) {
1509
  ?>
1510
  <div class="topbar topbar-links topbar_support_forum">
1511
  <div class="topbar-links-container">
1526
  <?php
1527
  echo ob_get_clean();
1528
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1529
  }
framework/WDILibraryEmbed.php CHANGED
@@ -449,31 +449,19 @@ class WDILibraryEmbed {
449
  if ( !is_null($carousel_media) && count($carousel_media) ) {
450
  foreach ( $carousel_media as $key => $media ) {
451
  if ( $media["type"] == "image" ) {
452
- $oembed_instagram_html .= '<img src="'.$media["images"]["standard_resolution"]["url"].'"'.
453
- ' style="'.
454
- 'max-width:'.'100%'." !important".
455
- '; max-height:'.'100%'." !important".
456
- '; width:'.'auto !important'.
457
- '; height:'. 'auto !important' .
458
- ';" data-id="' . $key . '" class="carousel_media ' . ($key == 0 ? "active" : "") . '">';
459
- } elseif($media["type"] == "video"){
460
- $oembed_instagram_html .= '<video onclick="wdi_play_pause(jQuery(this));" style="width:auto !important; height:auto !important; max-width:100% !important; max-height:100% !important; margin:0 !important;" controls data-id="' . $key . '" class="carousel_media ' . ($key == 0 ? "active" : "") . '">'.
461
- '<source src="'. $media["videos"]["standard_resolution"]["url"] .
462
- '" type="video/mp4"> Your browser does not support the video tag. </video>';
463
- }
464
- }
465
- } else {
466
- if($embed_id!=''){
467
- $oembed_instagram_html .= '<img src="//instagram.com/p/'.$embed_id.'/media/?size=l"'.
468
- ' style="'.
469
- 'max-width:'.'100%'." !important".
470
- '; max-height:'.'100%'." !important".
471
- '; width:'.'auto !important'.
472
- '; height:'. 'auto !important' .
473
- ';">';
474
- }
475
- }
476
- $oembed_instagram_html .="</div>";
477
  $html_to_insert .= $oembed_instagram_html;
478
  break;
479
  case 'EMBED_OEMBED_INSTAGRAM_POST':
449
  if ( !is_null($carousel_media) && count($carousel_media) ) {
450
  foreach ( $carousel_media as $key => $media ) {
451
  if ( $media["type"] == "image" ) {
452
+ $oembed_instagram_html .= '<img src="' . $media["images"]["standard_resolution"]["url"] . '"' . ' style="' . 'max-width:' . '100%' . " !important" . '; max-height:' . '100%' . " !important" . '; width:' . 'auto !important' . '; height:' . 'auto !important' . ';" data-id="' . $key . '" class="carousel_media ' . ($key == 0 ? "active" : "") . '">';
453
+ }
454
+ elseif ( $media["type"] == "video" ) {
455
+ $oembed_instagram_html .= '<video onclick="wdi_play_pause(jQuery(this));" style="width:auto !important; height:auto !important; max-width:100% !important; max-height:100% !important; margin:0 !important;" controls data-id="' . $key . '" class="carousel_media ' . ($key == 0 ? "active" : "") . '">' . '<source src="' . $media["videos"]["standard_resolution"]["url"] . '" type="video/mp4"> Your browser does not support the video tag. </video>';
456
+ }
457
+ }
458
+ }
459
+ else {
460
+ if ( $embed_id != '' ) {
461
+ $oembed_instagram_html .= '<img src="//instagram.com/p/' . $embed_id . '/media/?size=l"' . ' style="' . 'max-width:' . '100%' . " !important" . '; max-height:' . '100%' . " !important" . '; width:' . 'auto !important' . '; height:' . 'auto !important' . ';">';
462
+ }
463
+ }
464
+ $oembed_instagram_html .= "</div>";
 
 
 
 
 
 
 
 
 
 
 
 
465
  $html_to_insert .= $oembed_instagram_html;
466
  break;
467
  case 'EMBED_OEMBED_INSTAGRAM_POST':
framework/WDI_admin_view.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- class WDI_admin_view{
4
 
5
  private $params;
6
 
@@ -104,8 +104,6 @@ class WDI_admin_view{
104
  $opt_val = $opt_val ? 'true' : '';
105
  }
106
  $opt_val = trim($opt_val);
107
-
108
-
109
  ?>
110
  <div class="wdwt_param" id="wdwt_wrap_<?php echo $element['name']; ?>">
111
  <div class="block margin">
@@ -190,7 +188,7 @@ class WDI_admin_view{
190
  $optionname = WDI_META.'[' .$element['name']. ']';
191
  }
192
  else{
193
- $wdi_options = get_option(WDI_OPT );
194
  $optionname = WDI_OPT.'[' .$element['name']. ']';
195
  $opt_val = $wdi_options[$element['name']];
196
  }
@@ -210,28 +208,25 @@ class WDI_admin_view{
210
  <?php
211
  }
212
 
213
-
214
- public function users_list($element){
215
  global $wdi_options;
216
-
217
  $readonly = isset($element['readonly']) ? 'readonly="' . esc_attr($element['readonly']) . '"' : '';
218
  $input_size = isset($element["input_size"]) ? $element["input_size"] : $this->params["input_size"];
219
- $optionname = WDI_OPT.'[' .$element['name']. ']';
220
-
221
  ?>
222
- <div class="wdwt_param" id="wdwt_wrap_<?php echo $element['name']; ?>">
223
- <div class="block">
224
- <?php WDILibrary::add_auth_button(''); ?>
225
- <div class="wdi_more_token_template" style="display: none;">
226
- <input type="text" name="<?php echo $optionname . '[access_token][]'; ?>" class="wdi_more_access_token" disabled/>
227
- <input type="text" name="<?php echo $optionname . '[user_name][]'; ?>" class="wdi_more_user_name" disabled/>
228
- <input type="text" name="<?php echo $optionname . '[user_id][]'; ?>" class="wdi_more_user_id" disabled/>
229
- </div>
230
- </div>
231
- </div>
232
- <div style="margin-left: 15px;font-style: italic;">
233
- <p>Log out from current Instagram account(same browser)<br> before signing in to the another account.</p>
234
  </div>
 
 
 
 
235
  <?php
236
  }
237
 
@@ -1206,7 +1201,6 @@ class WDI_admin_view{
1206
  });
1207
  /*add new percent*/
1208
  jQuery("#<?php echo $element['name']; ?>_add-button").on('click', function(){
1209
- console.log('call');
1210
  after = element_<?php echo $element["name"]; ?>.number_percents-1;
1211
  wdwt_elements.diagram.insert(element_<?php echo $element["name"]; ?>, after, '');
1212
  });
@@ -1238,7 +1232,7 @@ class WDI_admin_view{
1238
  ?>
1239
  <script type="text/javascript">
1240
  var items_county = <?php echo $items_county; ?>;
1241
- function wdi_spider_page(x, y) {
1242
  switch (y) {
1243
  case 1:
1244
  if (x >= items_county) {
@@ -1326,7 +1320,7 @@ class WDI_admin_view{
1326
  ?>
1327
  </span>
1328
  </div>
1329
- <input type="hidden" id="page_number" name="page_number" value="<?php echo (int) WDILibrary::get('page_number', 1); ?>" />
1330
  <input type="hidden" id="search_or_not" name="search_or_not" value="<?php echo WDILibrary::get('search_or_not', ''); ?>"/>
1331
  <?php
1332
  }
1
  <?php
2
 
3
+ class WDI_admin_view {
4
 
5
  private $params;
6
 
104
  $opt_val = $opt_val ? 'true' : '';
105
  }
106
  $opt_val = trim($opt_val);
 
 
107
  ?>
108
  <div class="wdwt_param" id="wdwt_wrap_<?php echo $element['name']; ?>">
109
  <div class="block margin">
188
  $optionname = WDI_META.'[' .$element['name']. ']';
189
  }
190
  else{
191
+ $wdi_options = get_option(WDI_OPT);
192
  $optionname = WDI_OPT.'[' .$element['name']. ']';
193
  $opt_val = $wdi_options[$element['name']];
194
  }
208
  <?php
209
  }
210
 
211
+ public function users_list( $element ) {
 
212
  global $wdi_options;
 
213
  $readonly = isset($element['readonly']) ? 'readonly="' . esc_attr($element['readonly']) . '"' : '';
214
  $input_size = isset($element["input_size"]) ? $element["input_size"] : $this->params["input_size"];
215
+ $optionname = WDI_OPT . '[' . $element['name'] . ']';
 
216
  ?>
217
+ <div class="wdwt_param" id="wdwt_wrap_<?php echo $element['name']; ?>">
218
+ <div class="block">
219
+ <?php WDILibrary::add_auth_button(''); ?>
220
+ <div class="wdi_more_token_template" style="display: none;">
221
+ <input type="text" name="<?php echo $optionname . '[access_token][]'; ?>" class="wdi_more_access_token" disabled/>
222
+ <input type="text" name="<?php echo $optionname . '[user_name][]'; ?>" class="wdi_more_user_name" disabled/>
223
+ <input type="text" name="<?php echo $optionname . '[user_id][]'; ?>" class="wdi_more_user_id" disabled/>
224
+ </div>
 
 
 
 
225
  </div>
226
+ </div>
227
+ <div style="margin-left: 15px;font-style: italic;">
228
+ <p>Log out from current Instagram account(same browser)<br> before signing in to the another account.</p>
229
+ </div>
230
  <?php
231
  }
232
 
1201
  });
1202
  /*add new percent*/
1203
  jQuery("#<?php echo $element['name']; ?>_add-button").on('click', function(){
 
1204
  after = element_<?php echo $element["name"]; ?>.number_percents-1;
1205
  wdwt_elements.diagram.insert(element_<?php echo $element["name"]; ?>, after, '');
1206
  });
1232
  ?>
1233
  <script type="text/javascript">
1234
  var items_county = <?php echo $items_county; ?>;
1235
+ function wdi_spider_page(x, y) {
1236
  switch (y) {
1237
  case 1:
1238
  if (x >= items_county) {
1320
  ?>
1321
  </span>
1322
  </div>
1323
+ <input type="hidden" id="page_number" name="page_number" value="<?php echo WDILibrary::get('page_number', 1, 'intval'); ?>" />
1324
  <input type="hidden" id="search_or_not" name="search_or_not" value="<?php echo WDILibrary::get('search_or_not', ''); ?>"/>
1325
  <?php
1326
  }
framework/WDI_form_builder.php CHANGED
@@ -1,19 +1,10 @@
1
  <?php
2
-
3
  class WDI_form_builder {
4
 
5
-
6
-
7
-
8
-
9
  public function __construct() {
10
-
11
  }
12
- /*
13
-
14
-
15
-
16
 
 
17
  * $element['name']
18
  * $element['id'] //default is WDI_.$element_name
19
  * $element['type'] //text,number ...
@@ -22,15 +13,12 @@ public function __construct() {
22
  * $element['label'] // array('text','place')
23
  * $element['defaults'] //array of default vlaues
24
  * $element['CONST'] //variable to store data in array
25
- * $element['disabled'] //text to be displayed if option is disabled
26
  */
27
  public function input($element,$feed_row=''){
28
  $name = $element['CONST'].'['.(isset($element['name']) ? $element['name'] : 'NOT_SET') . ']';
29
  $id = isset($element['id']) ? $element['id'] : 'WDI_'.$element['name'];
30
  $type = isset($element['input_type']) ? $element['input_type'] : 'text';
31
  //$attrText = $element['attr']['name'] . '=' . $element['attr']['value'];
32
- $disabled_text = (isset($element['disabled']) && isset($element['disabled']['text'])) ? $element['disabled']['text'] : '';
33
- $switched = (isset($element['switched']) && $element['switched'] === 'off') ? 'disabled' : '';
34
  $attrs = ' ';
35
  foreach ($element['attr'] as $attr) {
36
  $attrs .= $attr['name'] . '="' . $attr['value'] . '" ';
@@ -61,7 +49,7 @@ public function __construct() {
61
  }
62
  ?>
63
 
64
- <input type="<?php echo $type; ?>" id="<?php echo $id; ?>" <?php echo $switched; ?> name="<?php echo $name; ?>" value="<?php echo esc_attr($value); ?>"
65
  <?php echo $attr; ?> size="<?php echo $input_size; ?>">
66
  <?php
67
  if($label!='' && $label['place']=='after'){
@@ -70,9 +58,7 @@ public function __construct() {
70
  <label for="<?php echo $id; ?>"><?php echo $label['text']; ?></label>
71
  <?php
72
  }
73
- if($disabled_text != ''){
74
- ?><span class="wdi_pro_only"><?php echo $disabled_text?></span> <?php
75
- }
76
  ?>
77
  </div>
78
  </div>
@@ -91,8 +77,6 @@ public function __construct() {
91
  * $element['selected'] //one of valid options
92
  * $element['defaults'] //array of default vlaues
93
  * $element['CONST'] //variable to store data in array
94
- * $element['switched'] //if set to 'off' will make field disabled
95
- * $element['disabled'] //disabled text label
96
  */
97
  public function select($element,$feed_row=''){
98
  $name = $element['CONST'].'['.(isset($element['name']) ? $element['name'] : 'NOT_SET') . ']';
@@ -102,8 +86,9 @@ public function __construct() {
102
  $label = isset($element['label']) ? $element['label'] : '';
103
  $width = isset($element['width']) ? ($element['width']) : '';
104
  $options = isset($element['valid_options']) ? $element['valid_options'] : '';
105
- $switched = (isset($element['switched']) && $element['switched'] === 'off') ? 'disabled' : '';
106
  $hide_ids = isset($element['hide_ids']) ? $element['hide_ids'] : '';
 
107
  $disabled_text = (isset($element['disabled']) && isset($element['disabled']['text'])) ? $element['disabled']['text'] : '';
108
  $disabled_options = isset($element['disabled_options']) ? $element['disabled_options'] : array();
109
  $defaults = $element['defaults'];
@@ -112,48 +97,44 @@ public function __construct() {
112
  if($current_settings !=''){
113
  $opt_value = isset($current_settings[$element['name']]) ? $current_settings[$element['name']] : '';
114
  }
115
-
116
-
117
  $attrs = ' ';
118
  foreach ($element['attr'] as $attr) {
119
  $attrs .= $attr['name'] . '="' . $attr['value'] . '" ';
120
  }
121
  $attr = $attrs;
122
- ?>
123
-
124
  <div class="wdwt_param" id="WDI_wrap_<?php echo $element['name']; ?>">
125
  <div class="block">
126
  <div class="optioninput">
127
  <?php
128
  if($label!='' && $label['place']=='before'){
129
  ?>
130
- <label class="<?php echo isset($label['class']) ? $label['class'] : '';?>" for="<?php echo $id; ?>"><?php echo $label['text']; ?></label>
131
- <?php echo isset($label['br'])? '<br/>' : ''?>
132
  <?php
133
  }
134
- ?>
135
-
136
- <select name="<?php echo $name; ?>" id="<?php echo $id; ?>" <?php echo $type; ?> <?php echo $switched; ?> style="<?php if($width!='') echo 'width:' .$width . ';';?> resize:vertical;" <?php echo $attr; ?>>
137
  <?php foreach($options as $key => $value){ ?>
138
  <option <?php echo (in_array($key, $disabled_options)) ? 'disabled' : '' ?> value="<?php echo esc_attr($key) ?>" <?php if($key==$opt_value){echo 'selected';}?>>
139
  <?php echo esc_html($value); ?>
140
  </option>
141
  <?php } ?>
142
  </select>
 
143
 
144
- <?php
145
- if($label!='' && $label['place']=='after'){
146
  ?>
147
  <?php echo isset($label['br'])? '<br/>' : ''?>
148
  <label class="<?php echo isset($label['class']) ? $label['class'] : '';?>" for="<?php echo $id; ?>"><?php echo $label['text']; ?></label>
149
  <?php
150
  }
151
- if($disabled_text != ''){
152
  ?><span class="wdi_pro_only"><?php echo $disabled_text?></span> <?php
153
  }
154
- //echo disable text if need label & disable text
155
-
156
- ?>
157
 
158
  </div>
159
  </div>
@@ -195,6 +176,148 @@ public function __construct() {
195
 
196
  }
197
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
 
199
  /*
200
  * $element['name']
@@ -218,7 +341,7 @@ public function __construct() {
218
  $break = isset($element['break']) ? '<br/>' : '';
219
  $hide_ids = isset($element['hide_ids']) ? $element['hide_ids'] : '';
220
  $show_ids = isset($element['show_ids']) ? $element['show_ids'] : '';
221
- $disabled_options = isset($element['disabled_options']) ? $element['disabled_options'] : array();
222
  $attrs = ' ';
223
  foreach ($element['attr'] as $attr) {
224
  $attrs .= $attr['name'] . '="' . $attr['value'] . '" ';
@@ -239,10 +362,11 @@ public function __construct() {
239
 
240
  if($label!='' && $label['place']=='before'){
241
  ?>
242
- <label class="<?php echo isset($label['class']) ? $label['class'] : '';?>" for="<?php $id; ?>"><?php echo $label['text']; ?></label>
243
  <?php echo isset($label['br']) ? '<br/>' : ''?>
244
  <?php
245
  }
 
246
  foreach ( $options as $key => $option ) {
247
  $disable = '';
248
  $disable_text = '';
@@ -253,8 +377,7 @@ public function __construct() {
253
  }
254
  }
255
  ?>
256
- <input <?php echo $disable;?> style="margin:2px;" type="radio" name="<?php echo $name ?>" value="<?php echo esc_attr($key); ?>" <?php checked($key,$opt_value); ?> <?php echo $attr; ?> id="<?php echo $option_name . "_" . $key;?>" /><label for="<?php echo $option_name . "_" . $key;?>"> <?php echo esc_html($option); ?></label>
257
-
258
  <?php if($disable_text != '') : ?>
259
  <?php if(isset($disabled_options['br'])) : ?>
260
  <br>
@@ -268,7 +391,7 @@ public function __construct() {
268
  if($label!='' && $label['place']=='after'){
269
  ?>
270
  <?php echo isset($label['br'])? '<br/>' : ''?>
271
- <label for="<?php $id; ?>" class="<?php echo isset($label['class']) ? $label['class'] : '';?>"><?php echo $label['text']; ?></label>
272
  <?php
273
  }
274
  echo '</div></div></div>';
@@ -345,7 +468,6 @@ public function __construct() {
345
 
346
  }
347
 
348
-
349
  /*
350
  * $element['name']
351
  * $element['id'] //default is WDI_.$element_name
@@ -378,18 +500,14 @@ public function __construct() {
378
  }
379
 
380
  $hide_ids = isset($element['hide_ids']) ? $element['hide_ids'] : '';
381
-
382
- ?>
383
  <div class="wdwt_param" id="WDI_wrap_<?php echo $element['name'];?>">
384
-
385
-
386
-
387
  <div class="block margin">
388
  <div class="optioninput checkbox">
389
  <?php
390
  if($label!='' && $label['place']=='before'){
391
  ?>
392
- <label class="<?php echo isset($label['class']) ? $label['class'] : '' ?>" for="<?php $id; ?>"><?php echo $label['text']; ?></label>
393
  <?php echo isset($label['br'])? '<br/>' : ''?>
394
  <?php
395
  }
@@ -399,7 +517,7 @@ public function __construct() {
399
  if($label!='' && $label['place']=='after'){
400
  ?>
401
  <?php echo isset($label['br'])? '<br/>' : ''?>
402
- <label class="<?php echo isset($label['class']) ? $label['class'] : '' ?>" for="<?php $id; ?>"><?php echo $label['text']; ?></label>
403
  <?php
404
  }
405
  ?>
@@ -413,58 +531,51 @@ public function __construct() {
413
  ?>
414
  </style>
415
  <script>
416
-
417
  jQuery(document).ready(function(){
418
 
419
  var el = jQuery('#<?php echo ''.$id?>');
420
  var hide_ids = <?php echo json_encode($hide_ids); ?>;
421
  var hide_class = '<?php echo $id.'_hide_ids_hidden'; ?>';
422
 
423
-
424
- if(el.prop('checked') != true ){
425
  el.after('<input type=\"hidden\" name=\"' + jQuery("#<?php echo ''.$id?>").attr("name") + '\" value="0">');
426
  }
427
 
428
  el.on('click',function(){
429
 
430
- if (jQuery(this).prop("checked") != true ) {
431
- jQuery(this).after("<input type=\"hidden\" name=\"" + jQuery(this).attr("name") + "\" value=0>");
432
  if(Array.isArray(hide_ids) && hide_ids.length > 0){
433
  iterator(false);
434
  }
435
- } else {
436
- jQuery(this).next().remove();
437
- if(Array.isArray(hide_ids) && hide_ids.length > 0){
438
- iterator(true);
439
- }
440
  }
441
-
442
  });
443
 
444
  if(Array.isArray(hide_ids) && hide_ids.length > 0){
445
- if( el.prop('checked') != true ){
446
  iterator(false);
447
  }else{
448
  iterator(true);
449
  }
450
  }
451
 
452
-
453
  function iterator(show) {
454
  for (var i=0;i<hide_ids.length;i++){
455
  var el = jQuery("#WDI_"+hide_ids[i]).closest('.wdi_element');
456
  if(el.length == 0){
457
  continue;
458
  }
459
-
460
  (show === true) ? el.removeClass(hide_class) : el.addClass(hide_class);
461
  }
462
  }
463
-
464
  });
465
  </script>
466
-
467
- <?php
468
  }
469
 
470
 
@@ -473,24 +584,33 @@ public function __construct() {
473
  ?>
474
  <div class="wdi_howto_container">
475
  <div class="wdi_howto_content">
476
- <h2>Shortcode</h2>
477
- <h4>Copy and paste this shortcode into your posts or pages:</h4>
478
- <input type="text" class="wdi_howto_shortcode" value='[wdi_feed id="<?php echo $feed_id; ?>"]' onclick="wdi_select_focus_element(this)" size="11" readonly="readonly" />
 
 
479
  </div>
480
  <div class="wdi_howto_content">
 
481
  <h2>Page or Post editor</h2>
482
  <h4>Insert it into an existing post with the button:</h4>
483
  <img src="<?php echo WDI_URL.'/images/how_to_publish_shortcode.png'; ?>">
 
484
  </div>
485
  <div class="wdi_howto_content">
 
486
  <h2>PHP code</h2>
487
  <h4>Copy and paste the PHP code into your template file:</h4>
488
  <input type="text" class="wdi_howto_phpcode" value="&#60;?php echo wdi_feed(array('id'=>'<?php echo $feed_id; ?>')); ?&#62;" onclick="wdi_select_focus_element(this)" size="17" readonly="readonly" />
 
489
  </div>
490
  <div class="wdi_howto_content">
 
491
  <h2>Widget</h2>
492
  <h4>Add Instagram Feed Widget to your site:</h4>
493
  <img src="<?php echo WDI_URL.'/images/how_to_publish_widget.png'; ?>">
 
 
494
  </div>
495
  <script>function wdi_select_focus_element(obj) {obj.focus();obj.select();}</script>
496
  <?php
1
  <?php
 
2
  class WDI_form_builder {
3
 
 
 
 
 
4
  public function __construct() {
 
5
  }
 
 
 
 
6
 
7
+ /*
8
  * $element['name']
9
  * $element['id'] //default is WDI_.$element_name
10
  * $element['type'] //text,number ...
13
  * $element['label'] // array('text','place')
14
  * $element['defaults'] //array of default vlaues
15
  * $element['CONST'] //variable to store data in array
 
16
  */
17
  public function input($element,$feed_row=''){
18
  $name = $element['CONST'].'['.(isset($element['name']) ? $element['name'] : 'NOT_SET') . ']';
19
  $id = isset($element['id']) ? $element['id'] : 'WDI_'.$element['name'];
20
  $type = isset($element['input_type']) ? $element['input_type'] : 'text';
21
  //$attrText = $element['attr']['name'] . '=' . $element['attr']['value'];
 
 
22
  $attrs = ' ';
23
  foreach ($element['attr'] as $attr) {
24
  $attrs .= $attr['name'] . '="' . $attr['value'] . '" ';
49
  }
50
  ?>
51
 
52
+ <input type="<?php echo $type; ?>" id="<?php echo $id; ?>" name="<?php echo $name; ?>" value="<?php echo esc_attr($value); ?>"
53
  <?php echo $attr; ?> size="<?php echo $input_size; ?>">
54
  <?php
55
  if($label!='' && $label['place']=='after'){
58
  <label for="<?php echo $id; ?>"><?php echo $label['text']; ?></label>
59
  <?php
60
  }
61
+
 
 
62
  ?>
63
  </div>
64
  </div>
77
  * $element['selected'] //one of valid options
78
  * $element['defaults'] //array of default vlaues
79
  * $element['CONST'] //variable to store data in array
 
 
80
  */
81
  public function select($element,$feed_row=''){
82
  $name = $element['CONST'].'['.(isset($element['name']) ? $element['name'] : 'NOT_SET') . ']';
86
  $label = isset($element['label']) ? $element['label'] : '';
87
  $width = isset($element['width']) ? ($element['width']) : '';
88
  $options = isset($element['valid_options']) ? $element['valid_options'] : '';
89
+
90
  $hide_ids = isset($element['hide_ids']) ? $element['hide_ids'] : '';
91
+ $switched = (isset($element['switched']) && $element['switched'] === 'off') ? 'disabled' : '';
92
  $disabled_text = (isset($element['disabled']) && isset($element['disabled']['text'])) ? $element['disabled']['text'] : '';
93
  $disabled_options = isset($element['disabled_options']) ? $element['disabled_options'] : array();
94
  $defaults = $element['defaults'];
97
  if($current_settings !=''){
98
  $opt_value = isset($current_settings[$element['name']]) ? $current_settings[$element['name']] : '';
99
  }
 
 
100
  $attrs = ' ';
101
  foreach ($element['attr'] as $attr) {
102
  $attrs .= $attr['name'] . '="' . $attr['value'] . '" ';
103
  }
104
  $attr = $attrs;
105
+ ?>
 
106
  <div class="wdwt_param" id="WDI_wrap_<?php echo $element['name']; ?>">
107
  <div class="block">
108
  <div class="optioninput">
109
  <?php
110
  if($label!='' && $label['place']=='before'){
111
  ?>
112
+ <label for="<?php echo $id; ?>"><?php echo $label['text']; ?></label>
113
+ <?php echo isset($label['br']) ? '<br/>' : ''?>
114
  <?php
115
  }
116
+ ?>
117
+ <select name="<?php echo $name; ?>" id="<?php echo $id; ?>" <?php echo $switched; ?> <?php echo $type; ?> style="<?php if($width!='') echo 'width:' .$width . ';';?> resize:vertical;" <?php echo $attr; ?>>
118
+
119
  <?php foreach($options as $key => $value){ ?>
120
  <option <?php echo (in_array($key, $disabled_options)) ? 'disabled' : '' ?> value="<?php echo esc_attr($key) ?>" <?php if($key==$opt_value){echo 'selected';}?>>
121
  <?php echo esc_html($value); ?>
122
  </option>
123
  <?php } ?>
124
  </select>
125
+ <?php
126
 
127
+ if($label!='' && $label['place']=='after'){
128
+
129
  ?>
130
  <?php echo isset($label['br'])? '<br/>' : ''?>
131
  <label class="<?php echo isset($label['class']) ? $label['class'] : '';?>" for="<?php echo $id; ?>"><?php echo $label['text']; ?></label>
132
  <?php
133
  }
134
+ if($disabled_text != ''){
135
  ?><span class="wdi_pro_only"><?php echo $disabled_text?></span> <?php
136
  }
137
+ ?>
 
 
138
 
139
  </div>
140
  </div>
176
 
177
  }
178
 
179
+ /*
180
+ * $element['name']
181
+ * $element['id'] //default is WDI_.$element_name
182
+ * $element['type'] //multiple
183
+ * $element['attr'] //custom attribute array(array('name'=>'attr_name','value'=>'attr_value'),...)
184
+ * $element['label'] // array('text','place')
185
+ * $element['valid_options'] //array('option_value1'=>'option_name1','option_value2'=>'option_name2');
186
+ * $element['width']
187
+ * $element['selected'] //one of valid options
188
+ * $element['defaults'] //array of default vlaues
189
+ * $element['CONST'] //variable to store data in array
190
+ */
191
+ public function selectgroup( $element, $feed_row='' ) {
192
+ $name = $element['CONST'].'['.(isset($element['name']) ? $element['name'] : 'NOT_SET') . ']';
193
+ $id = isset($element['id']) ? $element['id'] : 'WDI_'.$element['name'];
194
+ $type = isset($element['type']) ? $element['type'] : '';
195
+ $label = isset($element['label']) ? $element['label'] : '';
196
+ $width = isset($element['width']) ? ($element['width']) : '';
197
+ $options = isset($element['valid_options']) ? $element['valid_options'] : '';
198
+ $hide_ids = isset($element['hide_ids']) ? $element['hide_ids'] : '';
199
+ $defaults = $element['defaults'];
200
+ $current_settings = isset($feed_row) ? $feed_row : '';
201
+ $opt_value = isset($defaults[$element['name']]) ? $defaults[$element['name']] : '';
202
+ if($current_settings !=''){
203
+ $opt_value = isset($current_settings[$element['name']]) ? $current_settings[$element['name']] : '';
204
+ }
205
+ $attrs = ' ';
206
+ foreach ($element['attr'] as $attr) {
207
+ $attrs .= $attr['name'] . '="' . $attr['value'] . '" ';
208
+ }
209
+ $attr = $attrs;
210
+ ?>
211
+ <div class="wdwt_param" id="WDI_wrap_<?php echo $element['name']; ?>">
212
+ <div class="block">
213
+ <div class="optioninput">
214
+ <?php if ( !empty($label['place']) && $label['place'] == 'before' ) { ?>
215
+ <label for="<?php echo $id; ?>"><?php echo $label['text']; ?></label>
216
+ <?php echo isset($label['br']) ? '<br/>' : ''; ?>
217
+ <?php } ?>
218
+ <select name="<?php echo $name; ?>" id="<?php echo $id; ?>" <?php echo $type; ?> style="<?php if($width!='') echo 'width:' .$width . ';';?> resize:vertical;" <?php echo $attr; ?>>
219
+ <option value=""><?php _e('Select', 'wd-instagram-feed'); ?></option>
220
+ <?php foreach($options as $label => $values) { ?>
221
+ <optgroup label="<?php echo ucfirst($label) ?>">
222
+ <?php foreach ( $values as $key => $value ) {
223
+ $selected = ( $key == $opt_value ) ? 'selected' : '';
224
+ $data_type = 'data-type="' . $label . '"';
225
+ $data_id = !empty($value['id']) ? 'data-id="' . $value['id'] . '"': '';
226
+ ?>
227
+ <option value="<?php echo esc_attr($key) ?>" <?php echo $selected; ?> <?php echo $data_id; echo $data_type;?>>
228
+ <?php echo esc_html($value['name']); ?>
229
+ </option>
230
+ <?php } ?>
231
+ </optgroup>
232
+ <?php } ?>
233
+ </select>
234
+ <?php
235
+ if ( !empty($label['place']) && $label['place']=='after' ) { ?>
236
+ <?php echo isset($label['br'])? '<br/>' : ''?>
237
+ <label for="<?php echo $id; ?>"><?php echo $label['text']; ?></label>
238
+ <?php
239
+ }
240
+ ?>
241
+ </div>
242
+ </div>
243
+ </div>
244
+ <?php if($hide_ids != ''){ ?>
245
+ <style>
246
+ .<?php echo $id.'_hide_ids_hidden';?>{
247
+ display: none !important;
248
+ }
249
+ </style>
250
+ <script>
251
+ jQuery(document).ready(function(){
252
+ var <?php echo $id.'_hide_ids';?> = <?php echo json_encode($hide_ids);?>;
253
+ var hide_ids = <?php echo json_encode($hide_ids); ?>;
254
+ var hide_class = '<?php echo $id.'_hide_ids_hidden'; ?>';
255
+
256
+ function iterator(show) {
257
+ for ( var i=0; i < hide_ids.length; i++ ) {
258
+ var el = jQuery('#WDI_' + hide_ids[i]).closest('.wdi_element');
259
+ if ( hide_ids[i] == 'hashtag_top_recent' ) {
260
+ el = jQuery('#WDI_wrap_' + hide_ids[i]).closest('.wdi_element');
261
+ }
262
+
263
+ if( el.length == 0 ) {
264
+ continue;
265
+ }
266
+ (show === true) ? el.removeClass(hide_class) : el.addClass(hide_class);
267
+ }
268
+ }
269
+
270
+ function wdi_show_personal_block() {
271
+ iterator(false);
272
+ }
273
+
274
+ function wdi_show_business_block() {
275
+ iterator(true);
276
+ jQuery('.wdi_element_name_hashtag_top_recent').hide();
277
+ if ( jQuery('#wdi_feed_users_ajax .wdi_user').length > 0 ) {
278
+ jQuery('.wdi_element_name_hashtag_top_recent').show();
279
+ }
280
+ }
281
+
282
+ jQuery(document).on('change', '#WDI_wrap_<?php echo $element['name'];?> select', function() {
283
+ var element = jQuery(this).find('option:selected');
284
+ var type = element.data('type');
285
+ if ( typeof type != 'undefined' ) {
286
+ switch (type) {
287
+ case 'personal': {
288
+ wdi_show_personal_block();
289
+ break
290
+ }
291
+ default: {
292
+ wdi_show_business_block();
293
+ break
294
+ }
295
+ }
296
+ }
297
+ else {
298
+ iterator(false);
299
+ }
300
+ var selected = jQuery(this).val();
301
+ for ( var opt in <?php echo $id.'_hide_ids'?> ) {
302
+ if(opt == selected){
303
+ var ids = <?php echo $id.'_hide_ids'?>[opt].split(',');
304
+ for (var i in ids){
305
+ jQuery('#WDI_wrap_'+ids[i]).parent().parent().addClass("<?php echo $id.'_hide_ids_hidden';?>");
306
+ }
307
+ }
308
+ }
309
+ });
310
+
311
+ jQuery("#WDI_wrap_<?php echo $element['name'];?> select").each(function(){
312
+ var currentOption = "<?php echo $opt_value?>";
313
+ if(jQuery(this).val() == currentOption){
314
+ jQuery(this).trigger('change');
315
+ }
316
+ });
317
+ });
318
+ </script>
319
+ <?php }
320
+ }
321
 
322
  /*
323
  * $element['name']
341
  $break = isset($element['break']) ? '<br/>' : '';
342
  $hide_ids = isset($element['hide_ids']) ? $element['hide_ids'] : '';
343
  $show_ids = isset($element['show_ids']) ? $element['show_ids'] : '';
344
+ $disabled_options = isset($element['disabled_options']) ? $element['disabled_options'] : array();
345
  $attrs = ' ';
346
  foreach ($element['attr'] as $attr) {
347
  $attrs .= $attr['name'] . '="' . $attr['value'] . '" ';
362
 
363
  if($label!='' && $label['place']=='before'){
364
  ?>
365
+ <label for="<?php echo $id; ?>"><?php echo $label['text']; ?></label>
366
  <?php echo isset($label['br']) ? '<br/>' : ''?>
367
  <?php
368
  }
369
+
370
  foreach ( $options as $key => $option ) {
371
  $disable = '';
372
  $disable_text = '';
377
  }
378
  }
379
  ?>
380
+ <input <?php echo $disable;?> style="margin:2px;" type="radio" name="<?php echo $name ?>" value="<?php echo esc_attr($key); ?>" <?php checked($key,$opt_value); ?> <?php echo $attr; ?> id="<?php echo $option_name . "_" . $key;?>"/> <label for="<?php echo $option_name . "_" . $key;?>"><?php echo esc_html($option); ?></label>
 
381
  <?php if($disable_text != '') : ?>
382
  <?php if(isset($disabled_options['br'])) : ?>
383
  <br>
391
  if($label!='' && $label['place']=='after'){
392
  ?>
393
  <?php echo isset($label['br'])? '<br/>' : ''?>
394
+ <label class="<?php echo isset($label['class']) ? $label['class'] : '';?>" for="<?php echo $id; ?>"><?php echo $label['text']; ?></label>
395
  <?php
396
  }
397
  echo '</div></div></div>';
468
 
469
  }
470
 
 
471
  /*
472
  * $element['name']
473
  * $element['id'] //default is WDI_.$element_name
500
  }
501
 
502
  $hide_ids = isset($element['hide_ids']) ? $element['hide_ids'] : '';
503
+ ?>
 
504
  <div class="wdwt_param" id="WDI_wrap_<?php echo $element['name'];?>">
 
 
 
505
  <div class="block margin">
506
  <div class="optioninput checkbox">
507
  <?php
508
  if($label!='' && $label['place']=='before'){
509
  ?>
510
+ <label class="<?php echo isset($label['class']) ? $label['class'] : '' ?>" for="<?php echo $id; ?>"><?php echo $label['text']; ?></label>
511
  <?php echo isset($label['br'])? '<br/>' : ''?>
512
  <?php
513
  }
517
  if($label!='' && $label['place']=='after'){
518
  ?>
519
  <?php echo isset($label['br'])? '<br/>' : ''?>
520
+ <label class="<?php echo isset($label['class']) ? $label['class'] : '' ?>" for="<?php echo $id; ?>"><?php echo $label['text']; ?></label>
521
  <?php
522
  }
523
  ?>
531
  ?>
532
  </style>
533
  <script>
 
534
  jQuery(document).ready(function(){
535
 
536
  var el = jQuery('#<?php echo ''.$id?>');
537
  var hide_ids = <?php echo json_encode($hide_ids); ?>;
538
  var hide_class = '<?php echo $id.'_hide_ids_hidden'; ?>';
539
 
540
+ if(el.prop('checked') != true){
 
541
  el.after('<input type=\"hidden\" name=\"' + jQuery("#<?php echo ''.$id?>").attr("name") + '\" value="0">');
542
  }
543
 
544
  el.on('click',function(){
545
 
546
+ if (jQuery(this).prop("checked") != true) {
547
+ jQuery(this).after("<input type=\"hidden\" name=\"" + jQuery(this).attr("name") + "\" value=0>");
548
  if(Array.isArray(hide_ids) && hide_ids.length > 0){
549
  iterator(false);
550
  }
551
+ } else {
552
+ jQuery(this).next().remove();
553
+ if(Array.isArray(hide_ids) && hide_ids.length > 0){
554
+ iterator(true);
555
+ }
556
  }
 
557
  });
558
 
559
  if(Array.isArray(hide_ids) && hide_ids.length > 0){
560
+ if(el.prop('checked') != true){
561
  iterator(false);
562
  }else{
563
  iterator(true);
564
  }
565
  }
566
 
 
567
  function iterator(show) {
568
  for (var i=0;i<hide_ids.length;i++){
569
  var el = jQuery("#WDI_"+hide_ids[i]).closest('.wdi_element');
570
  if(el.length == 0){
571
  continue;
572
  }
 
573
  (show === true) ? el.removeClass(hide_class) : el.addClass(hide_class);
574
  }
575
  }
 
576
  });
577
  </script>
578
+ <?php
 
579
  }
580
 
581
 
584
  ?>
585
  <div class="wdi_howto_container">
586
  <div class="wdi_howto_content">
587
+ <div class="wdi_howto_wrapper">
588
+ <h2>Shortcode</h2>
589
+ <h4>Copy and paste this shortcode into your posts or pages:</h4>
590
+ <input type="text" class="wdi_howto_shortcode" value='[wdi_feed id="<?php echo $feed_id; ?>"]' onclick="wdi_select_focus_element(this)" size="11" readonly="readonly" />
591
+ </div>
592
  </div>
593
  <div class="wdi_howto_content">
594
+ <div class="wdi_howto_wrapper">
595
  <h2>Page or Post editor</h2>
596
  <h4>Insert it into an existing post with the button:</h4>
597
  <img src="<?php echo WDI_URL.'/images/how_to_publish_shortcode.png'; ?>">
598
+ </div>
599
  </div>
600
  <div class="wdi_howto_content">
601
+ <div class="wdi_howto_wrapper">
602
  <h2>PHP code</h2>
603
  <h4>Copy and paste the PHP code into your template file:</h4>
604
  <input type="text" class="wdi_howto_phpcode" value="&#60;?php echo wdi_feed(array('id'=>'<?php echo $feed_id; ?>')); ?&#62;" onclick="wdi_select_focus_element(this)" size="17" readonly="readonly" />
605
+ </div>
606
  </div>
607
  <div class="wdi_howto_content">
608
+ <div class="wdi_howto_wrapper">
609
  <h2>Widget</h2>
610
  <h4>Add Instagram Feed Widget to your site:</h4>
611
  <img src="<?php echo WDI_URL.'/images/how_to_publish_widget.png'; ?>">
612
+ </div>
613
+ </div>
614
  </div>
615
  <script>function wdi_select_focus_element(obj) {obj.focus();obj.select();}</script>
616
  <?php
framework/WDI_generate_styles.php ADDED
@@ -0,0 +1,1421 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: mher
5
+ * Date: 12/6/17
6
+ * Time: 6:08 PM
7
+ */
8
+
9
+ class WDI_generate_styles {
10
+
11
+ private $theme_id;
12
+ private $theme_options;
13
+ private $folder_name = 'wd-instagram-feed';
14
+ private $file_name_format = "wdi_theme_%s.css";//theme_id
15
+ private $css = "";
16
+ private $file_key = null;
17
+
18
+ public function __construct($theme_id, $theme_options){
19
+ $this->theme_id = $theme_id;
20
+ $this->theme_options = $theme_options;
21
+ }
22
+
23
+ public function all_views_styles($write_in_file = true, $minify = true){
24
+ $css = "";
25
+ $css .= $this->common_styles();
26
+ $css .= $this->thumbnail_view_styles();
27
+ $css .= $this->masonry_view_styles();
28
+ $css .= $this->blog_view_styles();
29
+ $css .= $this->browser_view_styles();
30
+ $css .= $this->lightbox_styles();
31
+
32
+ if($minify == true) {
33
+ require_once(WDI_DIR . '/framework/WDILibrary.php');
34
+ $css = WDILibrary::minify_styles($css);
35
+ }
36
+
37
+ $this->css = $css;
38
+
39
+ if($write_in_file === true) {
40
+ return $this->update_file($css);
41
+ }
42
+
43
+ return $css;
44
+ }
45
+
46
+ public function common_styles(){
47
+
48
+ $style = $this->theme_options;
49
+ $theme_id = $this->theme_id;
50
+
51
+ ob_start();
52
+ ?>
53
+ <style>
54
+
55
+ .wdi_feed_theme_<?php echo $theme_id; ?> .wdi_feed_wrapper {
56
+ width: <?php echo $style['feed_wrapper_width']?>; /*feed_wrapper_width,column number * image size*/
57
+ background-color: <?php echo $style['feed_wrapper_bg_color']?>; /*feed_wrapper_bg_color*/
58
+ text-align: <?php echo $style['header_position']?>; /*header_position*/
59
+ }
60
+
61
+ .wdi_feed_theme_<?php echo $theme_id; ?> .wdi_feed_header {
62
+ margin: <?php echo $style['header_margin']?>; /*header_margin*/
63
+ padding: <?php echo $style['header_padding']?>; /*header_padding*/
64
+ border: <?php echo $style['header_border_size']?> solid <?php echo $style['header_border_color']?>; /*header_border_size, header_border_color*/
65
+ text-align: <?php echo $style['header_position']?>; /*header_position*/
66
+ }
67
+
68
+ .wdi_feed_theme_<?php echo $theme_id; ?> .wdi_header_text {
69
+ font-size: <?php echo $style['header_text_font_size']?>;
70
+ font-style: <?php echo $style['header_text_font_style']?>;
71
+ padding: <?php echo $style['header_text_padding']?>; /*header_text_padding*/
72
+ color: <?php echo $style['header_text_color']?>; /*header_text_color*/
73
+ font-weight: <?php echo $style['header_font_weight']?>; /*header_font_weight*/
74
+ line-height: <?php echo $style['header_img_width']?>px; /*header_img_width*/
75
+ }
76
+
77
+ .wdi_feed_theme_<?php echo $theme_id; ?> .wdi_single_user {
78
+ padding-top: <?php echo $style['user_padding']?>; /*user_padding*/
79
+ padding-bottom: <?php echo $style['user_padding']?>; /*user_padding*/
80
+ padding-left: <?php echo $style['user_padding']?>; /*user_padding*/
81
+ padding-right: <?php echo $style['user_padding']?>; /*user_padding*/
82
+ }
83
+
84
+ .wdi_feed_theme_<?php echo $theme_id; ?> .wdi_header_hashtag h3 {
85
+ margin-top: <?php echo (intval($style['user_img_width']) - intval($style['users_text_font_size']))/2?>px;
86
+ }
87
+
88
+ .wdi_feed_theme_<?php echo $theme_id; ?> .wdi_header_user_text h3 {
89
+ font-size: <?php echo $style['users_text_font_size']?>;
90
+ font-style: <?php echo $style['users_text_font_style']?>;
91
+ line-height: <?php echo $style['users_text_font_size']?>;
92
+ color: <?php echo $style['users_text_color']?>; /*header_text_color*/;
93
+ }
94
+
95
+ .wdi_feed_theme_<?php echo $theme_id; ?> .wdi_user_img_wrap img {
96
+ height: <?php echo $style['user_img_width']?>px;
97
+ width: <?php echo $style['user_img_width']?>px;
98
+ border-radius: <?php echo $style['user_border_radius']?>px;
99
+ }
100
+
101
+ .wdi_feed_theme_<?php echo $theme_id; ?> .wdi_media_info {
102
+ /*display: inline-block;*/
103
+ margin-left: <?php echo intval($style['user_img_width']) + 10;?>px;
104
+ line-height: <?php echo $style['users_text_font_size']?>;
105
+ color: <?php echo $style['users_text_color']?>; /*header_text_color !mmm/ seperate*/
106
+ }
107
+
108
+ .wdi_feed_theme_<?php echo $theme_id; ?> .wdi_bio {
109
+ color: <?php echo $style['users_text_color']?>; /*header_text_color*/
110
+ font-size: <?php echo $style['user_description_font_size']?>; /*header_text_color*/
111
+ }
112
+
113
+ .wdi_feed_theme_<?php echo $theme_id; ?> .wdi_follow_btn {
114
+ border-radius: <?php echo $style['follow_btn_border_radius']?>px;
115
+ font-size: <?php echo $style['follow_btn_font_size']?>px;
116
+ background-color: <?php echo $style['follow_btn_bg_color']?>;
117
+ border-color: <?php echo $style['follow_btn_border_color']?>;
118
+ color: <?php echo $style['follow_btn_text_color']?>;
119
+ margin-left: <?php echo $style['follow_btn_margin']?>px;
120
+ padding: 0 <?php echo $style['follow_btn_padding']?>px;
121
+ }
122
+
123
+ .wdi_feed_theme_<?php echo $theme_id; ?> .wdi_follow_btn:hover {
124
+ border-color: <?php echo $style['follow_btn_border_hover_color']?>;
125
+ color: <?php echo $style['follow_btn_text_hover_color']?>;
126
+ background-color: <?php echo $style['follow_btn_background_hover_color']?>;
127
+ }
128
+
129
+ .wdi_feed_theme_<?php echo $theme_id; ?> .wdi_filter_overlay {
130
+ width: <?php echo $style['user_img_width'];?>px; /*user_img_width*/
131
+ height: <?php echo $style['user_img_width'];?>px; /*user_img_width*/
132
+ border-radius: <?php echo $style['user_border_radius']?>px; /*user_img_width*/
133
+ background-color: <?php echo $style['th_overlay_hover_color'];?>;
134
+ }
135
+
136
+ .wdi_feed_theme_<?php echo $theme_id; ?> .wdi_filter_icon span {
137
+ width: <?php echo $style['user_img_width'];?>px; /*header_img_width*/
138
+ height: <?php echo $style['user_img_width'];?>px; /*header_img_width*/
139
+ }
140
+
141
+ .wdi_feed_theme_<?php echo $theme_id; ?> .wdi_load_more_text {
142
+ color: <?php echo $style['load_more_text_color']?>; /*load_more_text_color*/
143
+ font-size: <?php echo $style['load_more_text_font_size']?>; /*load_more_text_font_size*/
144
+ }
145
+
146
+ .wdi_feed_theme_<?php echo $theme_id; ?> .wdi_load_more_text img {
147
+ height: <?php echo $style['load_more_height']?>; /*load_more_height*/
148
+ width: <?php echo $style['load_more_height']?>; /*load_more_height*/
149
+ }
150
+
151
+ .wdi_feed_theme_<?php echo $theme_id; ?> .wdi_load_more_wrap:hover {
152
+ background-color: <?php echo $style['load_more_wrap_hover_color']?>; /*load_more_wrap_hover_color*/
153
+ }
154
+
155
+ .wdi_feed_theme_<?php echo $theme_id; ?> .wdi_pagination {
156
+
157
+ text-align: <?php echo $style['pagination_position']?>; /*load_more_position*/
158
+ color: <?php echo $style['pagination_ctrl_color']?>; /*pagination_ctrl_color*/
159
+ font-size: <?php echo $style['pagination_size']?>; /*pagination_size*/
160
+ }
161
+
162
+ .wdi_feed_theme_<?php echo $theme_id; ?> .wdi_pagination_ctrl {
163
+ margin: <?php echo $style['pagination_ctrl_margin']?>;
164
+ }
165
+
166
+ .wdi_feed_theme_<?php echo $theme_id; ?> .wdi_pagination_ctrl:hover {
167
+ color: <?php echo $style['pagination_ctrl_hover_color']?>;
168
+ }
169
+
170
+ .wdi_feed_theme_<?php echo $theme_id; ?> .wdi_filter_active_col {
171
+ color: <?php echo $style['active_filter_bg_color'];?>;
172
+ border-color: <?php echo $style['active_filter_bg_color'];?>;
173
+ }
174
+
175
+ </style>
176
+ <?php
177
+ $css = ob_get_contents();
178
+ ob_end_clean();
179
+
180
+ $css = strip_tags($css);
181
+
182
+ return $css;
183
+ }
184
+
185
+ public function thumbnail_view_styles(){
186
+ $style = $this->theme_options;
187
+ $theme_id = $this->theme_id;
188
+ ob_start();
189
+ ?>
190
+ <style>
191
+ .wdi_feed_<?php echo 'thumbnail_' . $theme_id; ?> .wdi_feed_container {
192
+ width: <?php echo $style['feed_container_width']?>;
193
+ background-color: <?php echo $style['feed_container_bg_color']?>; /*feed_container_bg_color*/
194
+ border-bottom: 5px solid <?php echo $style['feed_container_bg_color']?>; /*feed_container_bg_color*/;
195
+ }
196
+
197
+ .wdi_feed_<?php echo 'thumbnail_' . $theme_id; ?> .wdi_header_img_wrap {
198
+ height: <?php echo $style['header_img_width']?>px; /*header_img_width*/
199
+ width: <?php echo $style['header_img_width']?>px; /*header_img_width*/
200
+ border-radius: <?php echo $style['header_border_radius']?>px; /*header_img_width*/
201
+ }
202
+
203
+ .wdi_feed_<?php echo 'thumbnail_' . $theme_id; ?> .wdi_photo_wrap {
204
+ padding: <?php echo $style['th_photo_wrap_padding']?>; /*photo_wrap_padding*/
205
+ width: calc(100% - 2 *<?php echo $style['th_photo_wrap_padding']?>);
206
+ }
207
+
208
+ .wdi_feed_<?php echo 'thumbnail_' . $theme_id; ?> .wdi_photo_wrap_inner {
209
+ border: <?php echo $style['th_photo_wrap_border_size']?> solid <?php echo $style['th_photo_wrap_border_color']?>; /*photo_wrap_border_size,photo_wrap_border_color*/
210
+ background-color: <?php echo $style['th_photo_wrap_bg_color']?>; /*photo_wrap_bg_color*/
211
+ }
212
+
213
+ .wdi_feed_<?php echo 'thumbnail_' . $theme_id; ?> .wdi_photo_img {
214
+ border-radius: <?php echo $style['th_photo_img_border_radius']?>; /*photo_img_border_radius*/
215
+ }
216
+
217
+ .wdi_feed_<?php echo 'thumbnail_' . $theme_id; ?> .wdi_photo_meta {
218
+ background-color: <?php echo $style['th_photo_meta_bg_color']?>; /*photo_meta_bg_color*/
219
+ }
220
+
221
+ .wdi_feed_<?php echo 'thumbnail_' . $theme_id; ?> .wdi_thumb_likes {
222
+ width: <?php echo ($style['th_photo_meta_one_line']=='1')? '50%' : '100%' ?>; /*photo_meta_one_line==false else 100%*/
223
+ float: <?php echo ($style['th_photo_meta_one_line']=='1')? 'left' : 'none'?>; /*photo_meta_one_line==true else float none*/
224
+ font-size: <?php echo $style['th_like_comm_font_size']?>; /*photo_caption_font_size*/;
225
+ color: <?php echo $style['th_like_text_color']?>; /*like_text_color*/
226
+
227
+ }
228
+
229
+ .wdi_feed_<?php echo 'thumbnail_' . $theme_id; ?> .wdi_thumb_comments {
230
+ width: <?php echo ($style['th_photo_meta_one_line']=='1')? '50%' : '100%' ?>; /*photo_meta_one_line==false else 100%*/
231
+ float: <?php echo ($style['th_photo_meta_one_line']=='1')? 'left' : 'none'?>; /*photo_meta_one_line==true else float none*/
232
+ font-size: <?php echo $style['th_like_comm_font_size']?>; /*photo_caption_font_size*/;
233
+ color: <?php echo $style['th_comment_text_color']?>; /*comment_text_color*/
234
+
235
+ }
236
+
237
+ .wdi_feed_<?php echo 'thumbnail_' . $theme_id; ?> .wdi_photo_title {
238
+ font-size: <?php echo $style['th_photo_caption_font_size']?>; /*photo_caption_font_size*/
239
+ color: <?php echo $style['th_photo_caption_color']?>; /*photo_caption_color*/
240
+ }
241
+
242
+ .wdi_feed_<?php echo 'thumbnail_' . $theme_id; ?> .wdi_photo_title:hover {
243
+ color: <?php echo $style['th_photo_caption_hover_color']?>;
244
+ }
245
+
246
+ .wdi_feed_<?php echo 'thumbnail_' . $theme_id; ?> .wdi_load_more_spinner {
247
+ color: <?php echo $style['load_more_text_color']?>; /*load_more_text_color*/
248
+ font-size: <?php echo intval($style['load_more_text_font_size'])*1.3?>px; /*load_more_text_font_size*/
249
+ }
250
+
251
+ .wdi_feed_<?php echo 'thumbnail_' . $theme_id; ?> .wdi_load_more,
252
+ .wdi_feed_<?php echo 'thumbnail_' . $theme_id; ?> .wdi_spinner {
253
+ background-color: <?php echo $style['feed_container_bg_color']?>; /*feed_container_bg_color*/
254
+ text-align: <?php echo $style['load_more_position']?>; /*load_more_position*/
255
+ }
256
+
257
+ .wdi_feed_<?php echo 'thumbnail_' . $theme_id; ?> .wdi_load_more_wrap,
258
+ .wdi_feed_<?php echo 'thumbnail_' . $theme_id; ?> .wdi_spinner_wrap {
259
+ padding: <?php echo $style['load_more_padding']?>; /*load_more_padding*/
260
+ background-color: <?php echo $style['load_more_bg_color']?>; /*load_more_bg_color*/
261
+ border-radius: <?php echo $style['load_more_border_radius']?>; /*load_more_border_radius*/
262
+ height: <?php echo $style['load_more_height']?>; /*load_more_height*/
263
+ width: <?php echo $style['load_more_width']?>; /*load_more_width*/
264
+ border: <?php echo $style['load_more_border_size']?> solid <?php echo $style['load_more_border_color']?>; /*load_more_border_size, load_more_border_color*/;
265
+ }
266
+
267
+ <?php
268
+ require_once(WDI_DIR . '/framework/WDILibrary.php');
269
+ $rgb_overlay = WDILibrary::wdi_spider_hex2rgb($style['th_overlay_hover_color']);
270
+ $rgba_overlay = 'rgba('. $rgb_overlay['red'] .',' . $rgb_overlay['green'] . ',' . $rgb_overlay['blue'] . ','.((100 - intval($style['th_overlay_hover_transparent']))/100).')';
271
+ ?>
272
+ .wdi_feed_<?php echo 'thumbnail_' . $theme_id; ?> .wdi_photo_overlay:hover {
273
+ background-color: <?php echo $rgba_overlay;?>
274
+ }
275
+
276
+ .wdi_feed_<?php echo 'thumbnail_' . $theme_id; ?> .wdi_photo_overlay i {
277
+ font-size: <?php echo $style['th_overlay_hover_icon_font_size'];?>;
278
+ }
279
+
280
+ .wdi_feed_<?php echo 'thumbnail_' . $theme_id; ?> .wdi_photo_overlay:hover i {
281
+ color: <?php echo $style['th_overlay_hover_icon_color'];?>
282
+ }
283
+
284
+ <?php
285
+ switch($style['th_photo_img_hover_effect']){
286
+ case 'rotate': {
287
+ $effect = 'rotate(5deg)';
288
+ break;
289
+ }
290
+ case 'scale':{
291
+ $effect = 'scale(1.2)';
292
+ break;
293
+ }
294
+ case 'rotate_and_scale':{
295
+ $effect = 'scale(1.2) rotate(5deg)';
296
+ break;
297
+ }
298
+ default:{
299
+ $effect = 'none';
300
+ break;
301
+ }
302
+ }
303
+ ?>
304
+ .wdi_feed_<?php echo 'thumbnail_' . $theme_id; ?> .wdi_photo_img:hover img {
305
+ -webkit-transform: translateX(-50%) translateY(-50%) <?php echo $effect?>;
306
+ -moz-transform: translateX(-50%) translateY(-50%) <?php echo $effect?>;
307
+ -ms-transform: translateX(-50%) translateY(-50%) <?php echo $effect?>;
308
+ -o-transform: translateX(-50%) translateY(-50%) <?php echo $effect?>;
309
+ transform: translateX(-50%) translateY(-50%) <?php echo $effect?>;
310
+ }
311
+
312
+ .wdi_feed_<?php echo 'thumbnail_' . $theme_id; ?> .wdi_filter_active_bg {
313
+ background-color: <?php echo $style['active_filter_bg_color'];?>;
314
+ }
315
+
316
+ .wdi_feed_<?php echo 'thumbnail_' . $theme_id; ?> .wdi_media_user {
317
+ color: <?php echo $style['th_thumb_user_color'];?>;;
318
+ background-color: <?php echo $style['th_thumb_user_bg_color'];?>;;
319
+ }
320
+
321
+ </style>
322
+ <?php
323
+ $css = ob_get_contents();
324
+ ob_end_clean();
325
+
326
+ $css = strip_tags($css);
327
+
328
+ return $css;
329
+ }
330
+
331
+ public function masonry_view_styles(){
332
+ $style = $this->theme_options;
333
+ $theme_id = $this->theme_id;
334
+ ob_start();
335
+ ?>
336
+ <style>
337
+ .wdi_feed_<?php echo 'masonry_' . $theme_id; ?> .wdi_feed_container {
338
+ width: <?php echo $style['feed_container_width']?>;
339
+ background-color: <?php echo $style['feed_container_bg_color']?>; /*feed_container_bg_color*/
340
+ border-bottom: 5px solid <?php echo $style['feed_container_bg_color']?>; /*feed_container_bg_color*/;
341
+ }
342
+
343
+ .wdi_feed_<?php echo 'masonry_' . $theme_id; ?> .wdi_header_img_wrap,
344
+ .wdi_feed_<?php echo 'masonry_' . $theme_id; ?> .wdi_users_img_wrap {
345
+ height: <?php echo $style['header_img_width']?>px; /*header_img_width*/
346
+ width: <?php echo $style['header_img_width']?>px; /*header_img_width*/
347
+ border-radius: <?php echo $style['header_border_radius']?>px; /*header_img_width*/
348
+ }
349
+
350
+ .wdi_feed_<?php echo 'masonry_' . $theme_id; ?> .wdi_photo_wrap {
351
+ padding: <?php echo $style['mas_photo_wrap_padding']?>; /*photo_wrap_padding*/
352
+ }
353
+
354
+ .wdi_feed_<?php echo 'masonry_' . $theme_id; ?> .wdi_photo_wrap_inner {
355
+ border: <?php echo $style['mas_photo_wrap_border_size']?> solid <?php echo $style['mas_photo_wrap_border_color']?>; /*photo_wrap_border_size,photo_wrap_border_color*/
356
+ background-color: <?php echo $style['mas_photo_wrap_bg_color']?>; /*photo_wrap_bg_color*/
357
+ }
358
+
359
+ .wdi_feed_<?php echo 'masonry_' . $theme_id; ?> .wdi_photo_img {
360
+ border-radius: <?php echo $style['mas_photo_img_border_radius']?>; /*photo_img_border_radius*/
361
+ }
362
+
363
+ .wdi_feed_<?php echo 'masonry_' . $theme_id; ?> .wdi_photo_meta {
364
+ background-color: <?php echo $style['mas_photo_meta_bg_color']?>; /*photo_meta_bg_color*/
365
+ }
366
+
367
+ .wdi_feed_<?php echo 'masonry_' . $theme_id; ?> .wdi_thumb_likes {
368
+ width: <?php echo ($style['mas_photo_meta_one_line']=='1')? '50%' : '100%' ?>; /*photo_meta_one_line==false else 100%*/
369
+ float: <?php echo ($style['mas_photo_meta_one_line']=='1')? 'left' : 'none'?>; /*photo_meta_one_line==true else float none*/
370
+ font-size: <?php echo $style['mas_like_comm_font_size']?>; /*photo_caption_font_size*/;
371
+ color: <?php echo $style['mas_like_text_color']?>; /*like_text_color*/
372
+
373
+ }
374
+
375
+ .wdi_feed_<?php echo 'masonry_' . $theme_id; ?> .wdi_thumb_comments {
376
+ width: <?php echo ($style['mas_photo_meta_one_line']=='1')? '50%' : '100%' ?>; /*photo_meta_one_line==false else 100%*/
377
+ float: <?php echo ($style['mas_photo_meta_one_line']=='1')? 'left' : 'none'?>; /*photo_meta_one_line==true else float none*/
378
+ font-size: <?php echo $style['mas_like_comm_font_size']?>; /*photo_caption_font_size*/;
379
+ color: <?php echo $style['mas_comment_text_color']?>; /*comment_text_color*/
380
+
381
+ }
382
+
383
+ .wdi_feed_<?php echo 'masonry_' . $theme_id; ?> .wdi_photo_title {
384
+ font-size: <?php echo $style['mas_photo_caption_font_size']?>; /*photo_caption_font_size*/
385
+ color: <?php echo $style['mas_photo_caption_color']?>; /*photo_caption_color*/
386
+ }
387
+
388
+ .wdi_feed_<?php echo 'masonry_' . $theme_id; ?> .wdi_photo_title:hover {
389
+ color: <?php echo $style['mas_photo_caption_hover_color']?>;
390
+ }
391
+
392
+ .wdi_feed_<?php echo 'masonry_' . $theme_id; ?> .wdi_load_more_spinner {
393
+ color: <?php echo $style['load_more_text_color']?>; /*load_more_text_color*/
394
+ font-size: <?php echo intval($style['load_more_text_font_size'])*1.5?>px; /*load_more_text_font_size*/
395
+ }
396
+
397
+ .wdi_feed_<?php echo 'masonry_' . $theme_id; ?> .wdi_load_more,
398
+ .wdi_feed_<?php echo 'masonry_' . $theme_id; ?> .wdi_spinner {
399
+ background-color: <?php echo $style['feed_container_bg_color']?>; /*feed_container_bg_color*/
400
+ text-align: <?php echo $style['load_more_position']?>; /*load_more_position*/
401
+ }
402
+
403
+ .wdi_feed_<?php echo 'masonry_' . $theme_id; ?> .wdi_load_more_wrap,
404
+ .wdi_feed_<?php echo 'masonry_' . $theme_id; ?> .wdi_spinner_wrap {
405
+ padding: <?php echo $style['load_more_padding']?>; /*load_more_padding*/
406
+ background-color: <?php echo $style['load_more_bg_color']?>; /*load_more_bg_color*/
407
+ border-radius: <?php echo $style['load_more_border_radius']?>; /*load_more_border_radius*/
408
+ height: <?php echo $style['load_more_height']?>; /*load_more_height*/
409
+ width: <?php echo $style['load_more_width']?>; /*load_more_width*/
410
+ border: <?php echo $style['load_more_border_size']?> solid <?php echo $style['load_more_border_color']?>; /*load_more_border_size, load_more_border_color*/;
411
+ }
412
+
413
+ <?php
414
+ require_once(WDI_DIR . '/framework/WDILibrary.php');
415
+ $rgb_overlay = WDILibrary::wdi_spider_hex2rgb($style['mas_overlay_hover_color']);
416
+ $rgba_overlay = 'rgba('. $rgb_overlay['red'] .',' . $rgb_overlay['green'] . ',' . $rgb_overlay['blue'] . ','.((100 - intval($style['mas_overlay_hover_transparent']))/100).')';
417
+ ?>
418
+
419
+ .wdi_feed_<?php echo 'masonry_' . $theme_id; ?> .wdi_photo_overlay:hover {
420
+ background-color: <?php echo $rgba_overlay;?>
421
+ }
422
+
423
+ .wdi_feed_<?php echo 'masonry_' . $theme_id; ?> .wdi_photo_overlay i {
424
+ font-size: <?php echo $style['th_overlay_hover_icon_font_size'];?>;
425
+ }
426
+
427
+ .wdi_feed_<?php echo 'masonry_' . $theme_id; ?> .wdi_photo_overlay:hover i {
428
+ color: <?php echo $style['th_overlay_hover_icon_color'];?>
429
+ }
430
+
431
+ <?php
432
+ switch($style['mas_photo_img_hover_effect']){
433
+ case 'rotate': {
434
+ $effect = 'rotate(5deg)';
435
+ break;
436
+ }
437
+ case 'scale':{
438
+ $effect = 'scale(1.2)';
439
+ break;
440
+ }
441
+ case 'rotate_and_scale':{
442
+ $effect = 'scale(1.2) rotate(5deg)';
443
+ break;
444
+ }
445
+ default:{
446
+ $effect = 'none';
447
+ break;
448
+ }
449
+ }
450
+ ?>
451
+ .wdi_feed_<?php echo 'masonry_' . $theme_id; ?> .wdi_photo_img:hover img {
452
+ transform: <?php echo $effect?>
453
+ }
454
+
455
+ .wdi_feed_<?php echo 'masonry_' . $theme_id; ?> .wdi_filter_active_bg {
456
+ background-color: <?php echo $style['active_filter_bg_color'];?>;
457
+ }
458
+
459
+ .wdi_feed_<?php echo 'masonry_' . $theme_id; ?> .wdi_media_user {
460
+ color: <?php echo $style['mas_thumb_user_color'];?>;
461
+ background-color: <?php echo $style['mas_thumb_user_bg_color'];?>;
462
+ }
463
+
464
+ </style>
465
+ <?php
466
+
467
+ $css = ob_get_contents();
468
+ ob_end_clean();
469
+
470
+ $css = strip_tags($css);
471
+
472
+ return $css;
473
+ }
474
+
475
+ public function blog_view_styles(){
476
+ $style = $this->theme_options;
477
+ $theme_id = $this->theme_id;
478
+ ob_start();
479
+ ?>
480
+ <style>
481
+ .wdi_feed_<?php echo 'blog_' . $theme_id; ?> .wdi_feed_container {
482
+ width: <?php echo $style['feed_container_width']?>;
483
+ background-color: <?php echo $style['feed_container_bg_color']?>; /*feed_container_bg_color*/
484
+ }
485
+
486
+ .wdi_feed_<?php echo 'blog_' . $theme_id; ?> .wdi_header_img_wrap,
487
+ .wdi_feed_<?php echo 'blog_' . $theme_id; ?> .wdi_users_img_wrap {
488
+ height: <?php echo $style['header_img_width']?>px; /*header_img_width*/
489
+ width: <?php echo $style['header_img_width']?>px; /*header_img_width*/
490
+ border-radius: <?php echo $style['header_border_radius']?>px; /*header_img_width*/
491
+ }
492
+
493
+ .wdi_feed_<?php echo 'blog_' . $theme_id; ?> .wdi_photo_wrap {
494
+ padding: <?php echo $style['blog_style_photo_wrap_padding']?>; /*photo_wrap_padding*/
495
+ }
496
+
497
+ .wdi_feed_<?php echo 'blog_' . $theme_id; ?> .wdi_photo_wrap_inner {
498
+ border: <?php echo $style['blog_style_photo_wrap_border_size']?> solid <?php echo $style['blog_style_photo_wrap_border_color']?>; /*photo_wrap_border_size,photo_wrap_border_color*/
499
+ background-color: <?php echo $style['blog_style_photo_wrap_bg_color']?>; /*photo_wrap_bg_color*/
500
+ }
501
+
502
+ .wdi_feed_<?php echo 'blog_' . $theme_id; ?> .wdi_photo_img {
503
+ border-radius: <?php echo $style['blog_style_photo_img_border_radius']?>; /*photo_img_border_radius*/
504
+ }
505
+
506
+ .wdi_feed_<?php echo 'blog_' . $theme_id; ?> .wdi_photo_meta {
507
+ background-color: <?php echo $style['blog_style_photo_meta_bg_color']?>; /*photo_meta_bg_color*/
508
+ }
509
+
510
+ .wdi_feed_<?php echo 'blog_' . $theme_id; ?> .wdi_thumb_likes {
511
+ width: <?php echo ($style['blog_style_photo_meta_one_line']=='1')? '50%' : '100%' ?>; /*photo_meta_one_line==false else 100%*/
512
+ float: <?php echo ($style['blog_style_photo_meta_one_line']=='1')? 'left' : 'none'?>; /*photo_meta_one_line==true else float none*/
513
+ font-size: <?php echo $style['blog_style_like_comm_font_size']?>; /*photo_caption_font_size*/;
514
+ color: <?php echo $style['blog_style_like_text_color']?>; /*like_text_color*/
515
+
516
+ }
517
+
518
+ .wdi_feed_<?php echo 'blog_' . $theme_id; ?> .wdi_thumb_comments {
519
+ width: <?php echo ($style['blog_style_photo_meta_one_line']=='1')? '50%' : '100%' ?>; /*photo_meta_one_line==false else 100%*/
520
+ float: <?php echo ($style['blog_style_photo_meta_one_line']=='1')? 'left' : 'none'?>; /*photo_meta_one_line==true else float none*/
521
+ font-size: <?php echo $style['blog_style_like_comm_font_size']?>; /*photo_caption_font_size*/;
522
+ color: <?php echo $style['blog_style_comment_text_color']?>; /*comment_text_color*/
523
+
524
+ }
525
+
526
+ .wdi_feed_<?php echo 'blog_' . $theme_id; ?> .wdi_photo_title {
527
+ font-size: <?php echo $style['blog_style_photo_caption_font_size']?>; /*photo_caption_font_size*/
528
+ color: <?php echo $style['blog_style_photo_caption_color']?>; /*photo_caption_color*/
529
+ }
530
+
531
+ .wdi_feed_<?php echo 'blog_' . $theme_id; ?> .wdi_photo_title:hover {
532
+ color: <?php echo $style['blog_style_photo_caption_hover_color']?>;
533
+ }
534
+
535
+ .wdi_feed_<?php echo 'blog_' . $theme_id; ?> .wdi_load_more_spinner {
536
+ color: <?php echo $style['load_more_text_color']?>; /*load_more_text_color*/
537
+ font-size: <?php echo intval($style['load_more_text_font_size'])*1.5?>px; /*load_more_text_font_size*/
538
+ }
539
+
540
+ .wdi_feed_<?php echo 'blog_' . $theme_id; ?> .wdi_load_more,
541
+ .wdi_feed_<?php echo 'blog_' . $theme_id; ?> .wdi_spinner {
542
+ background-color: <?php echo $style['feed_container_bg_color']?>; /*feed_container_bg_color*/
543
+ text-align: <?php echo $style['load_more_position']?>; /*load_more_position*/
544
+ }
545
+
546
+ .wdi_feed_<?php echo 'blog_' . $theme_id; ?> .wdi_load_more_wrap,
547
+ .wdi_feed_<?php echo 'blog_' . $theme_id; ?> .wdi_spinner_wrap {
548
+ padding: <?php echo $style['load_more_padding']?>; /*load_more_padding*/
549
+ background-color: <?php echo $style['load_more_bg_color']?>; /*load_more_bg_color*/
550
+ border-radius: <?php echo $style['load_more_border_radius']?>; /*load_more_border_radius*/
551
+ height: <?php echo $style['load_more_height']?>; /*load_more_height*/
552
+ width: <?php echo $style['load_more_width']?>; /*load_more_width*/
553
+ border: <?php echo $style['load_more_border_size']?> solid <?php echo $style['load_more_border_color']?>; /*load_more_border_size, load_more_border_color*/;
554
+ }
555
+
556
+ </style>
557
+ <?php
558
+ $css = ob_get_contents();
559
+ ob_end_clean();
560
+
561
+ $css = strip_tags($css);
562
+
563
+ return $css;
564
+ }
565
+
566
+ public function browser_view_styles(){
567
+ $style = $this->theme_options;
568
+ $theme_id = $this->theme_id;
569
+ ob_start();
570
+ ?>
571
+ <style>
572
+ .wdi_feed_<?php echo 'browser_' . $theme_id; ?> .wdi_feed_container {
573
+ width: <?php echo $style['feed_container_width']?>;
574
+ background-color: <?php echo $style['feed_container_bg_color']?>; /*feed_container_bg_color*/
575
+ border-bottom: 5px solid <?php echo $style['feed_container_bg_color']?>; /*feed_container_bg_color*/;
576
+ }
577
+
578
+ .wdi_feed_<?php echo 'browser_' . $theme_id; ?> .wdi_header_img_wrap,
579
+ .wdi_feed_<?php echo 'browser_' . $theme_id; ?> .wdi_users_img_wrap {
580
+ height: <?php echo $style['header_img_width']?>px; /*header_img_width*/
581
+ width: <?php echo $style['header_img_width']?>px; /*header_img_width*/
582
+ border-radius: <?php echo $style['header_border_radius']?>px; /*header_img_width*/
583
+ }
584
+
585
+ .wdi_feed_<?php echo 'browser_' . $theme_id; ?> .wdi_photo_wrap {
586
+ padding: <?php echo $style['image_browser_photo_wrap_padding']?>; /*photo_wrap_padding*/
587
+
588
+ }
589
+
590
+ .wdi_feed_<?php echo 'browser_' . $theme_id; ?> .wdi_photo_wrap_inner {
591
+ border: <?php echo $style['image_browser_photo_wrap_border_size']?> solid <?php echo $style['image_browser_photo_wrap_border_color']?>; /*photo_wrap_border_size,photo_wrap_border_color*/
592
+ background-color: <?php echo $style['image_browser_photo_wrap_bg_color']?>; /*photo_wrap_bg_color*/
593
+ }
594
+
595
+ .wdi_feed_<?php echo 'browser_' . $theme_id; ?> .wdi_photo_img {
596
+ border-radius: <?php echo $style['image_browser_photo_img_border_radius']?>; /*photo_img_border_radius*/
597
+ }
598
+
599
+ .wdi_feed_<?php echo 'browser_' . $theme_id; ?> .wdi_photo_meta {
600
+ background-color: <?php echo $style['image_browser_photo_meta_bg_color']?>; /*photo_meta_bg_color*/
601
+ }
602
+
603
+ .wdi_feed_<?php echo 'browser_' . $theme_id; ?> .wdi_thumb_likes {
604
+ width: <?php echo ($style['image_browser_photo_meta_one_line']=='1')? '50%' : '100%' ?>; /*photo_meta_one_line==false else 100%*/
605
+ float: <?php echo ($style['image_browser_photo_meta_one_line']=='1')? 'left' : 'none'?>; /*photo_meta_one_line==true else float none*/
606
+ font-size: <?php echo $style['image_browser_like_comm_font_size']?>; /*photo_caption_font_size*/;
607
+ color: <?php echo $style['image_browser_like_text_color']?>; /*like_text_color*/
608
+
609
+ }
610
+
611
+ .wdi_feed_<?php echo 'browser_' . $theme_id; ?> .wdi_thumb_comments {
612
+ width: <?php echo ($style['image_browser_photo_meta_one_line']=='1')? '50%' : '100%' ?>; /*photo_meta_one_line==false else 100%*/
613
+ float: <?php echo ($style['image_browser_photo_meta_one_line']=='1')? 'left' : 'none'?>; /*photo_meta_one_line==true else float none*/
614
+ font-size: <?php echo $style['image_browser_like_comm_font_size']?>; /*photo_caption_font_size*/;
615
+ color: <?php echo $style['image_browser_comment_text_color']?>; /*comment_text_color*/
616
+
617
+ }
618
+
619
+ .wdi_feed_<?php echo 'browser_' . $theme_id; ?> .wdi_photo_title {
620
+ font-size: <?php echo $style['image_browser_photo_caption_font_size']?>; /*photo_caption_font_size*/
621
+ color: <?php echo $style['image_browser_photo_caption_color']?>; /*photo_caption_color*/
622
+ }
623
+
624
+ .wdi_feed_<?php echo 'browser_' . $theme_id; ?> .wdi_photo_title:hover {
625
+ color: <?php echo $style['image_browser_photo_caption_hover_color']?>;
626
+ }
627
+
628
+ .wdi_feed_<?php echo 'browser_' . $theme_id; ?> .wdi_load_more {
629
+ background-color: <?php echo $style['feed_container_bg_color']?>; /*feed_container_bg_color*/
630
+ text-align: <?php echo $style['load_more_position']?>; /*load_more_position*/
631
+ }
632
+
633
+ .wdi_feed_<?php echo 'browser_' . $theme_id; ?> .wdi_load_more_wrap {
634
+ padding: <?php echo $style['load_more_padding']?>; /*load_more_padding*/
635
+ background-color: <?php echo $style['load_more_bg_color']?>; /*load_more_bg_color*/
636
+ border-radius: <?php echo $style['load_more_border_radius']?>; /*load_more_border_radius*/
637
+ height: <?php echo $style['load_more_height']?>; /*load_more_height*/
638
+ width: <?php echo $style['load_more_width']?>; /*load_more_width*/
639
+ border: <?php echo $style['load_more_border_size']?> solid <?php echo $style['load_more_border_color']?>; /*load_more_border_size, load_more_border_color*/;
640
+ }
641
+
642
+ </style>
643
+ <?php
644
+ $css = ob_get_contents();
645
+ ob_end_clean();
646
+
647
+ $css = strip_tags($css);
648
+
649
+ return $css;
650
+ }
651
+
652
+ public function lightbox_styles(){
653
+ $style = $this->theme_options;
654
+ $theme_id = $this->theme_id;
655
+
656
+ require_once(WDI_DIR . '/framework/WDILibraryEmbed.php');
657
+ $rgb_lightbox_ctrl_cont_bg_color = WDILibrary::wdi_spider_hex2rgb($style['lightbox_ctrl_cont_bg_color']);
658
+ $rgb_wdi_image_info_bg_color = WDILibrary::wdi_spider_hex2rgb($style['lightbox_info_bg_color']);
659
+
660
+ $filmstrip_direction = 'horizontal';
661
+ if ($style['lightbox_filmstrip_pos'] == 'right' || $style['lightbox_filmstrip_pos'] == 'left') {
662
+ $filmstrip_direction = 'vertical';
663
+ }
664
+
665
+ $lb_container = '.wdi_lightbox_theme_' . $theme_id;
666
+ $feed_conatiner = '.wdi_feed_theme_' . $theme_id;
667
+ ob_start();
668
+ ?>
669
+ <style>
670
+ /*@import url(https://fonts.googleapis.com/css?family=Maven+Pro:400,500);*/
671
+ .wdi_spider_popup_wrap * {
672
+ -moz-box-sizing: border-box;
673
+ -webkit-box-sizing: border-box;
674
+ box-sizing: border-box;
675
+ }
676
+
677
+ <?php echo $feed_conatiner; ?> .wdi_spider_popup_overlay {
678
+ background-color: <?php echo $style['lightbox_overlay_bg_color']; ?>;
679
+ opacity: <?php echo (intval($style['lightbox_overlay_bg_transparent'])/100); ?>;
680
+ }
681
+
682
+ <?php echo $lb_container; ?>.wdi_spider_popup_wrap {
683
+ background-color: <?php echo $style['lightbox_bg_color']; ?>;
684
+ display: inline-block;
685
+ left: 50%;
686
+ outline: medium none;
687
+ position: fixed;
688
+ text-align: center;
689
+ top: 50%;
690
+ z-index: 100000;
691
+ }
692
+
693
+ <?php echo $lb_container; ?> .wdi_ctrl_btn {
694
+ color: <?php echo $style['lightbox_ctrl_btn_color']; ?>;
695
+ font-size: <?php echo $style['lightbox_ctrl_btn_height']; ?>px;
696
+ margin: <?php echo $style['lightbox_ctrl_btn_margin_top']; ?>px <?php echo $style['lightbox_ctrl_btn_margin_left']; ?>px;
697
+ opacity: <?php echo number_format($style['lightbox_ctrl_btn_transparent'] / 100, 2, ".", ""); ?>;
698
+ filter: Alpha(opacity=<?php echo $style['lightbox_ctrl_btn_transparent']; ?>);
699
+ }
700
+
701
+ <?php echo $lb_container; ?> .wdi_toggle_btn {
702
+ color: <?php echo $style['lightbox_ctrl_btn_color']; ?>;
703
+ font-size: <?php echo $style['lightbox_toggle_btn_height']; ?>px;
704
+ margin: 0;
705
+ opacity: <?php echo number_format($style['lightbox_ctrl_btn_transparent'] / 100, 2, ".", ""); ?>;
706
+ filter: Alpha(opacity=<?php echo $style['lightbox_ctrl_btn_transparent']; ?>);
707
+ padding: 0;
708
+ }
709
+
710
+ .wdi_btn_container {
711
+ bottom: 0;
712
+ left: 0;
713
+ overflow: hidden;
714
+ position: absolute;
715
+ right: 0;
716
+ top: 0;
717
+ }
718
+
719
+ <?php echo $lb_container; ?> .wdi_ctrl_btn_container {
720
+ background-color: rgba(<?php echo $rgb_lightbox_ctrl_cont_bg_color['red']; ?>, <?php echo $rgb_lightbox_ctrl_cont_bg_color['green']; ?>, <?php echo $rgb_lightbox_ctrl_cont_bg_color['blue']; ?>, <?php echo number_format($style['lightbox_ctrl_cont_transparent'] / 100, 2, ".", ""); ?>);
721
+ /*background: none repeat scroll 0 0 #
722
+ <?php echo $style['lightbox_ctrl_cont_bg_color']; ?> ;*/
723
+ <?php
724
+ if ($style['lightbox_ctrl_btn_pos'] == 'top') { ?> border-bottom-left-radius: <?php echo $style['lightbox_ctrl_cont_border_radius']; ?>px;
725
+ border-bottom-right-radius: <?php echo $style['lightbox_ctrl_cont_border_radius']; ?>px;
726
+ <?php } else { ?> bottom: 0;
727
+ border-top-left-radius: <?php echo $style['lightbox_ctrl_cont_border_radius']; ?>px;
728
+ border-top-right-radius: <?php echo $style['lightbox_ctrl_cont_border_radius']; ?>px;
729
+ <?php } ?> height: <?php echo $style['lightbox_ctrl_btn_height'] + 2 * $style['lightbox_ctrl_btn_margin_top']; ?>px;
730
+ /*opacity:
731
+ <?php echo number_format($style['lightbox_ctrl_cont_transparent'] / 100, 2, ".", ""); ?> ;
732
+ filter: Alpha(opacity=
733
+ <?php echo $style['lightbox_ctrl_cont_transparent']; ?> );*/
734
+ position: absolute;
735
+ text-align: <?php echo $style['lightbox_ctrl_btn_align']; ?>;
736
+ width: 100%;
737
+ z-index: 10150;
738
+ padding: 8px;
739
+ }
740
+
741
+ <?php echo $lb_container; ?> .wdi_toggle_container {
742
+ background: none repeat scroll 0 0 <?php echo $style['lightbox_ctrl_cont_bg_color']; ?>;
743
+ <?php if ($style['lightbox_ctrl_btn_pos'] == 'top') { ?>
744
+ border-bottom-left-radius: <?php echo $style['lightbox_ctrl_cont_border_radius']; ?>px;
745
+ border-bottom-right-radius: <?php echo $style['lightbox_ctrl_cont_border_radius']; ?>px;
746
+ border-radius: <?php echo $style['lightbox_ctrl_cont_border_radius']; ?>px;
747
+ top: <?php echo $style['lightbox_ctrl_btn_height'] + 2 * $style['lightbox_ctrl_btn_margin_top']; ?>px;
748
+ <?php } else { ?>
749
+ border-top-left-radius: <?php echo $style['lightbox_ctrl_cont_border_radius']; ?>px;
750
+ border-top-right-radius: <?php echo $style['lightbox_ctrl_cont_border_radius']; ?>px;
751
+ border-radius: <?php echo $style['lightbox_ctrl_cont_border_radius']; ?>px;
752
+ bottom: <?php echo $style['lightbox_ctrl_btn_height'] + 2 * $style['lightbox_ctrl_btn_margin_top']; ?>px;
753
+ <?php }?>
754
+ cursor: pointer;
755
+ left: 50%;
756
+ line-height: 0;
757
+ margin-left: -<?php echo $style['lightbox_toggle_btn_width'] / 2; ?>px;
758
+ opacity: <?php echo number_format($style['lightbox_ctrl_cont_transparent'] / 100, 2, ".", ""); ?>;
759
+ filter: Alpha(opacity=<?php echo $style['lightbox_ctrl_cont_transparent']; ?>);
760
+ position: absolute;
761
+ text-align: center;
762
+ width: <?php echo $style['lightbox_toggle_btn_width']; ?>px;
763
+ z-index: 10149;
764
+ }
765
+
766
+ <?php echo $lb_container; ?> .wdi_close_btn {
767
+ opacity: <?php echo number_format($style['lightbox_close_btn_transparent'] / 100, 2, ".", ""); ?>;
768
+ filter: Alpha(opacity=<?php echo $style['lightbox_close_btn_transparent']; ?>);
769
+ }
770
+
771
+ <?php echo $lb_container; ?> .wdi_spider_popup_close {
772
+ background-color: <?php echo $style['lightbox_close_btn_bg_color']; ?>;
773
+ border-radius: <?php echo $style['lightbox_close_btn_border_radius']; ?>px;
774
+ border: <?php echo $style['lightbox_close_btn_border_width']; ?>px <?php echo $style['lightbox_close_btn_border_style']; ?> <?php echo $style['lightbox_close_btn_border_color']; ?>;
775
+ box-shadow: <?php echo $style['lightbox_close_btn_box_shadow']; ?>;
776
+ color: <?php echo $style['lightbox_close_btn_color']; ?>;
777
+ height: <?php echo $style['lightbox_close_btn_height']; ?>px;
778
+ font-size: <?php echo $style['lightbox_close_btn_size']; ?>px;
779
+ right: <?php echo $style['lightbox_close_btn_right']; ?>px;
780
+ top: <?php echo $style['lightbox_close_btn_top']; ?>px;
781
+ width: <?php echo $style['lightbox_close_btn_width']; ?>px;
782
+ }
783
+
784
+ <?php echo $lb_container; ?> .wdi_spider_popup_close_fullscreen {
785
+ color: <?php echo $style['lightbox_close_btn_full_color']; ?>;
786
+ font-size: <?php echo $style['lightbox_close_btn_size']; ?>px;
787
+ right: 15px;
788
+ }
789
+
790
+ .wdi_spider_popup_close span,
791
+ #wdi_spider_popup_left-ico span,
792
+ #wdi_spider_popup_right-ico span {
793
+ display: table-cell;
794
+ text-align: center;
795
+ vertical-align: middle;
796
+ }
797
+
798
+ <?php echo $lb_container; ?> #wdi_spider_popup_left-ico,
799
+ <?php echo $lb_container; ?> #wdi_spider_popup_right-ico {
800
+ background-color: <?php echo $style['lightbox_rl_btn_bg_color']; ?>;
801
+ /***/
802
+ border-radius: <?php echo $style['lightbox_rl_btn_border_radius']; ?>px;
803
+ /***/
804
+ border: <?php echo $style['lightbox_rl_btn_border_width']; ?>px <?php echo $style['lightbox_rl_btn_border_style']; ?> <?php echo $style['lightbox_rl_btn_border_color']; ?>;
805
+ box-shadow: <?php echo $style['lightbox_rl_btn_box_shadow']; ?>;
806
+ color: <?php echo $style['lightbox_rl_btn_color']; ?>;
807
+ height: <?php echo $style['lightbox_rl_btn_height']; ?>px;
808
+ font-size: <?php echo $style['lightbox_rl_btn_size']; ?>px;
809
+ width: <?php echo $style['lightbox_rl_btn_width']; ?>px;
810
+ opacity: <?php echo number_format($style['lightbox_rl_btn_transparent'] / 100, 2, ".", ""); ?>;
811
+ filter: Alpha(opacity=<?php echo $style['lightbox_rl_btn_transparent']; ?>);
812
+ }
813
+
814
+ <?php echo $lb_container; ?> .wdi_ctrl_btn:hover,
815
+ <?php echo $lb_container; ?> .wdi_toggle_btn:hover,
816
+ <?php echo $lb_container; ?> #wdi_spider_popup_left-ico:hover,
817
+ <?php echo $lb_container; ?> #wdi_spider_popup_right-ico:hover {
818
+ color: <?php echo $style['lightbox_close_rl_btn_hover_color']; ?>;
819
+ cursor: pointer;
820
+ }
821
+
822
+ <?php echo $lb_container; ?> .wdi_spider_popup_close:hover,
823
+ <?php echo $lb_container; ?> .wdi_spider_popup_close_fullscreen:hover{
824
+ color: <?php echo $style['lightbox_close_btn_hover_color'];?>;
825
+ cursor: pointer;
826
+ }
827
+
828
+ .wdi_image_wrap {
829
+ height: inherit;
830
+ display: table;
831
+ position: absolute;
832
+ text-align: center;
833
+ width: inherit;
834
+ }
835
+ .wdi_image_wrap * {
836
+ -moz-user-select: none;
837
+ -khtml-user-select: none;
838
+ -webkit-user-select: none;
839
+ -ms-user-select: none;
840
+ user-select: none;
841
+ }
842
+ .wdi_embed_frame{
843
+ text-align:center;
844
+ }
845
+ .wdi_comment_wrap {
846
+ bottom: 0;
847
+ left: 0;
848
+ overflow: hidden;
849
+ position: absolute;
850
+ right: 0;
851
+ top: 0;
852
+ z-index: -1;
853
+ }
854
+
855
+ <?php echo $lb_container; ?> .wdi_comment_container {
856
+ -moz-box-sizing: border-box;
857
+ background-color: <?php echo $style['lightbox_comment_bg_color']; ?>;
858
+ color: <?php echo $style['lightbox_comment_font_color']; ?>;
859
+ font-size: <?php echo $style['lightbox_comment_font_size']; ?>px;
860
+ font-family: <?php echo $style['lightbox_comment_font_style']; ?>;
861
+ height: 100%;
862
+ overflow: hidden;
863
+ position: absolute;
864
+ <?php echo $style['lightbox_comment_pos']; ?>: -<?php echo $style['lightbox_comment_width']; ?>px;
865
+ top: 0;
866
+ width: <?php echo $style['lightbox_comment_width']; ?>px;
867
+ z-index: 10103;
868
+ }
869
+
870
+ <?php echo $lb_container; ?> .wdi_comments {
871
+ bottom: 0;
872
+ font-size: <?php echo $style['lightbox_comment_font_size']; ?>px;
873
+ font-family: <?php echo $style['lightbox_comment_font_style']; ?>;
874
+ height: 100%;
875
+ left: 0;
876
+ overflow-x: hidden;
877
+ overflow-y: auto;
878
+ position: absolute;
879
+ top: 0;
880
+ width: 100%;
881
+ z-index: 10101;
882
+ }
883
+
884
+ .wdi_comments p,
885
+ .wdi_comment_body_p {
886
+ margin: 5px !important;
887
+ text-align: left;
888
+ word-wrap: break-word;
889
+ word-break: break-word;
890
+ }
891
+ .wdi_no_comment{
892
+ text-align: center !important;
893
+ }
894
+
895
+ <?php echo $lb_container; ?> .wdi_comments input[type="submit"] {
896
+ background: none repeat scroll 0 0 <?php echo $style['lightbox_comment_button_bg_color']; ?>;
897
+ border: <?php echo $style['lightbox_comment_button_border_width']; ?>px <?php echo $style['lightbox_comment_button_border_style']; ?> <?php echo $style['lightbox_comment_button_border_color']; ?>;
898
+ border-radius: <?php echo $style['lightbox_comment_button_border_radius']; ?>px;
899
+ color: <?php echo $style['lightbox_comment_font_color']; ?>;
900
+ cursor: pointer;
901
+ padding: <?php echo $style['lightbox_comment_button_padding']; ?>;
902
+ }
903
+
904
+
905
+ <?php echo $lb_container; ?> .wdi_comments input[type="text"],
906
+ <?php echo $lb_container; ?> .wdi_comments textarea {
907
+ background: none repeat scroll 0 0 <?php echo $style['lightbox_comment_input_bg_color']; ?>;
908
+ border: <?php echo $style['lightbox_comment_input_border_width']; ?>px <?php echo $style['lightbox_comment_input_border_style']; ?> <?php echo $style['lightbox_comment_input_border_color']; ?>;
909
+ /***/
910
+ border-radius: <?php echo $style['lightbox_comment_input_border_radius']; ?>px;
911
+ /***/
912
+ color: <?php echo $style['lightbox_comment_font_color']; ?>;
913
+ padding: <?php echo $style['lightbox_comment_input_padding']; ?>;
914
+ width: 100%;
915
+ }
916
+
917
+ .wdi_comments textarea {
918
+ resize: vertical;
919
+ }
920
+ <?php echo $lb_container; ?> .wdi_comment_header_p {
921
+ border-top: <?php echo $style['lightbox_comment_separator_width']; ?>px <?php echo $style['lightbox_comment_separator_style']; ?> <?php echo $style['lightbox_comment_separator_color']; ?>;
922
+ }
923
+
924
+ <?php echo $lb_container; ?> .wdi_comment_header {
925
+ margin-top: 2px;
926
+ display: inline-block;
927
+ color: <?php echo $style['lightbox_comment_font_color']; ?>;
928
+ font-size: <?php echo $style['lightbox_comment_author_font_size']; ?>px;
929
+ }
930
+
931
+ <?php echo $lb_container; ?> .wdi_comment_date {
932
+ color: <?php echo $style['lightbox_comment_font_color']; ?>;
933
+ float: right;
934
+ font-size: <?php echo $style['lightbox_comment_date_font_size']; ?>px;
935
+ }
936
+
937
+ <?php echo $lb_container; ?> .wdi_comment_body {
938
+ color: <?php echo $style['lightbox_comment_font_color']; ?>;
939
+ font-size: <?php echo $style['lightbox_comment_body_font_size']; ?>px;
940
+ }
941
+ .wdi_comment_delete_btn {
942
+ color: #FFFFFF;
943
+ cursor: pointer;
944
+ float: right;
945
+ font-size: 14px;
946
+ margin: 2px;
947
+ }
948
+
949
+ <?php echo $lb_container; ?> .wdi_comments_close {
950
+ cursor: pointer;
951
+ line-height: 0;
952
+ position: absolute;
953
+ font-size: 13px;
954
+ text-align: <?php echo (($style['lightbox_comment_pos'] == 'left') ? 'right' : 'left'); ?>;
955
+ margin: 5px;
956
+ <?php echo (($style['lightbox_comment_pos'] == 'left') ? 'right' : 'left'); ?> : 0;
957
+ top: 0;
958
+ background-color: <?php echo $style['lightbox_comment_bg_color']; ?>;
959
+ z-index: 10202;
960
+ }
961
+
962
+ .wdi_comments_close i{
963
+ z-index: 10201;
964
+ }
965
+ .wdi_comment_textarea::-webkit-scrollbar {
966
+ width: 4px;
967
+ }
968
+ .wdi_comment_textarea::-webkit-scrollbar-track {
969
+ }
970
+ .wdi_comment_textarea::-webkit-scrollbar-thumb {
971
+ background-color: rgba(255, 255, 255, 0.55);
972
+ border-radius: 2px;
973
+ }
974
+ .wdi_comment_textarea::-webkit-scrollbar-thumb:hover {
975
+ background-color: #D9D9D9;
976
+ }
977
+ .wdi_ctrl_btn_container a,
978
+ .wdi_ctrl_btn_container a:hover {
979
+ text-decoration: none;
980
+ }
981
+
982
+ .wdi_facebook:hover {
983
+ color: #3B5998 !important;
984
+ cursor: pointer;
985
+ }
986
+ .wdi_twitter:hover {
987
+ color: #4099FB !important;
988
+ cursor: pointer;
989
+ }
990
+ .wdi_google:hover {
991
+ color: #DD4B39 !important;
992
+ cursor: pointer;
993
+ }
994
+ .wdi_pinterest:hover {
995
+ color: #cb2027 !important;
996
+ cursor: pointer;
997
+ }
998
+ .wdi_tumblr:hover {
999
+ color: #2F5070 !important;
1000
+ cursor: pointer;
1001
+ }
1002
+ .wdi_linkedin:hover {
1003
+ color: #0077B5 !important;
1004
+ cursor: pointer;
1005
+ }
1006
+
1007
+ <?php echo $lb_container; ?> .wdi_facebook,
1008
+ <?php echo $lb_container; ?> .wdi_twitter,
1009
+ <?php echo $lb_container; ?> .wdi_google,
1010
+ <?php echo $lb_container; ?> .wdi_pinterest,
1011
+ <?php echo $lb_container; ?> .wdi_tumblr,
1012
+ <?php echo $lb_container; ?> .wdi_linkedin {
1013
+ color: <?php echo $style['lightbox_comment_share_button_color']; ?> !important;
1014
+ }
1015
+
1016
+ <?php echo $lb_container; ?> .wdi_thumb_active {
1017
+ opacity: 1;
1018
+ filter: Alpha(opacity=100);
1019
+ border: <?php echo $style['lightbox_filmstrip_thumb_active_border_width']; ?>px solid <?php echo $style['lightbox_filmstrip_thumb_active_border_color']; ?>;
1020
+ }
1021
+
1022
+ <?php echo $lb_container; ?> .wdi_thumb_deactive {
1023
+ opacity: <?php echo number_format($style['lightbox_filmstrip_thumb_deactive_transparent'] / 100, 2, ".", ""); ?>;
1024
+ filter: Alpha(opacity=<?php echo $style['lightbox_filmstrip_thumb_deactive_transparent']; ?>);
1025
+ }
1026
+ <?php echo $lb_container; ?> .wdi_filmstrip_thumbnail_img {
1027
+ display: block;
1028
+ opacity: 1;
1029
+ filter: Alpha(opacity=100);
1030
+ }
1031
+
1032
+ <?php echo $lb_container; ?> .wdi_filmstrip_left i,
1033
+ <?php echo $lb_container; ?> .wdi_filmstrip_right i {
1034
+ color: <?php echo $style['lightbox_filmstrip_rl_btn_color']; ?>;
1035
+ font-size: <?php echo $style['lightbox_filmstrip_rl_btn_size']; ?>px;
1036
+ }
1037
+
1038
+ .wdi_none_selectable {
1039
+ -webkit-touch-callout: none;
1040
+ -webkit-user-select: none;
1041
+ -khtml-user-select: none;
1042
+ -moz-user-select: none;
1043
+ -ms-user-select: none;
1044
+ user-select: none;
1045
+ }
1046
+ .wdi_slide_container {
1047
+ display: table-cell;
1048
+ position: absolute;
1049
+ vertical-align: middle;
1050
+ width: 100%;
1051
+ height: 100%;
1052
+ }
1053
+ .wdi_slide_bg {
1054
+ margin: 0 auto;
1055
+ width: inherit;
1056
+ height: inherit;
1057
+ }
1058
+ .wdi_slider {
1059
+ height: inherit;
1060
+ width: inherit;
1061
+ }
1062
+ .wdi_popup_image_spun {
1063
+ height: inherit;
1064
+ display: table-cell;
1065
+ filter: Alpha(opacity=100);
1066
+ opacity: 1;
1067
+ position: absolute;
1068
+ vertical-align: middle;
1069
+ width: inherit;
1070
+ z-index: 2;
1071
+ }
1072
+ .wdi_popup_image_second_spun {
1073
+ width: inherit;
1074
+ height: inherit;
1075
+ display: table-cell;
1076
+ filter: Alpha(opacity=0);
1077
+ opacity: 0;
1078
+ position: absolute;
1079
+ vertical-align: middle;
1080
+ z-index: 1;
1081
+ }
1082
+ .wdi_grid {
1083
+ display: none;
1084
+ height: 100%;
1085
+ overflow: hidden;
1086
+ position: absolute;
1087
+ width: 100%;
1088
+ }
1089
+ .wdi_gridlet {
1090
+ opacity: 1;
1091
+ filter: Alpha(opacity=100);
1092
+ position: absolute;
1093
+ }
1094
+
1095
+ <?php echo $lb_container; ?> .wdi_image_info_spun {
1096
+ text-align: <?php echo $style['lightbox_info_align']; ?>;
1097
+ vertical-align: <?php echo $style['lightbox_info_pos']; ?>;
1098
+ }
1099
+
1100
+ <?php echo $lb_container; ?> .wdi_image_title,
1101
+ <?php echo $lb_container; ?> .wdi_image_title * {
1102
+ color: <?php echo $style['lightbox_title_color']; ?> !important;
1103
+ font-family: <?php echo $style['lightbox_title_font_style']; ?>;
1104
+ font-size: <?php echo $style['lightbox_title_font_size']; ?>px;
1105
+ font-weight: <?php echo $style['lightbox_title_font_weight']; ?>;
1106
+ }
1107
+
1108
+ <?php echo $lb_container; ?> .wdi_image_description,
1109
+ <?php echo $lb_container; ?> .wdi_image_description * {
1110
+ color: <?php echo $style['lightbox_description_color']; ?> !important;
1111
+ font-family: <?php echo $style['lightbox_description_font_style']; ?>;
1112
+ font-size: <?php echo $style['lightbox_description_font_size']; ?>px;
1113
+ font-weight: <?php echo $style['lightbox_description_font_weight']; ?>;
1114
+ }
1115
+
1116
+ .wdi_title{
1117
+ display: inline-table;
1118
+ }
1119
+ .wdi_title:hover{
1120
+ cursor: pointer;
1121
+ }
1122
+ .wdi_title .wdi_users_img_wrap{
1123
+ width: 50px;
1124
+ display: table-cell;
1125
+ vertical-align: middle;
1126
+ float: right;
1127
+ padding-left: 10px;
1128
+ overflow: hidden;
1129
+ }
1130
+ .wdi_title .wdi_users_img_wrap img{
1131
+ width: 100%;
1132
+ }
1133
+ .wdi_title .wdi_header_text{
1134
+ display: table-cell;
1135
+ vertical-align: middle;
1136
+ word-break: break-all;
1137
+ }
1138
+
1139
+ <?php echo $lb_container ; ?> .wdi_share_btns{
1140
+ position: absolute;
1141
+ <?php $shareBtn = $style['lightbox_ctrl_btn_height'] + $style['lightbox_ctrl_btn_margin_top'] + 8; ?>
1142
+ <?php echo ($style['lightbox_ctrl_btn_pos'] == 'top') ? 'bottom' : 'top';?>: <?php echo -$shareBtn;?>px;
1143
+ height: <?php echo $style['lightbox_ctrl_btn_height'] + $style['lightbox_ctrl_btn_margin_top'];?>px;
1144
+ width: <?php echo $style['lightbox_ctrl_btn_height']*7.5;?>px;
1145
+ border-radius: 3px;
1146
+ right: -145px;
1147
+ margin: 0;
1148
+ z-index: 200000;
1149
+ background-color: rgba(<?php echo $rgb_lightbox_ctrl_cont_bg_color['red']; ?>, <?php echo $rgb_lightbox_ctrl_cont_bg_color['green']; ?>, <?php echo $rgb_lightbox_ctrl_cont_bg_color['blue']; ?>, <?php echo number_format($style['lightbox_ctrl_cont_transparent'] / 100, 2, ".", ""); ?>);
1150
+ padding-top: 5px;
1151
+ }
1152
+
1153
+ .wdi_share_btns_container{
1154
+ position: relative;
1155
+ display: inline-block;
1156
+ }
1157
+
1158
+ <?php echo $lb_container ; ?> .wdi_share_popup_btn{
1159
+ color: <?php echo $style['lightbox_ctrl_btn_color']; ?>;
1160
+ padding: 3px;
1161
+ opacity: <?php echo number_format($style['lightbox_ctrl_btn_transparent'] / 100, 2, ".", ""); ?>;
1162
+ filter: Alpha(opacity=<?php echo $style['lightbox_ctrl_btn_transparent']; ?>);
1163
+ font-size: <?php echo $style['lightbox_ctrl_btn_height'];?>px;
1164
+ }
1165
+
1166
+ <?php echo $lb_container ; ?> .wdi_share_caret{
1167
+ font-size: 15px;
1168
+ color: <?php echo $style['lightbox_ctrl_cont_bg_color']; ?>;
1169
+ opacity: <?php echo number_format($style['lightbox_ctrl_cont_transparent'] / 100, 2, ".", ""); ?>;
1170
+ position: absolute;
1171
+ top: -25px;
1172
+ left: 13px;
1173
+ }
1174
+
1175
+ .wdi_share_toggler{
1176
+ display: block !important;
1177
+ }
1178
+ .wdi_facebook_btn:hover{
1179
+ color: #45619D;
1180
+ }
1181
+ .wdi_facebook_btn:hover{
1182
+ color: #4099FB;
1183
+ }
1184
+
1185
+ <?php echo $lb_container;?> .wdi_comment_header a,
1186
+ <?php echo $lb_container;?> .wdi_comment_header a:visited{
1187
+ color: <?php echo $style['lightbox_comment_author_font_color']; ?> !important;
1188
+ }
1189
+
1190
+ <?php echo $lb_container;?> .wdi_comm_text_link,
1191
+ <?php echo $lb_container;?> a.wdi_comm_text_link:visited{
1192
+ color: <?php echo $style['lightbox_comment_author_font_color']; ?>!important;
1193
+ }
1194
+ <?php echo $lb_container;?> .wdi_comment_header a:hover,
1195
+ <?php echo $lb_container;?> a.wdi_comm_text_link:hover{
1196
+ text-decoration: none;
1197
+ color: <?php echo $style['lightbox_comment_author_font_color_hover']; ?>!important;
1198
+ }
1199
+
1200
+ <?php echo $lb_container;?> .wdi_load_more_comments{
1201
+ display: inline-block;
1202
+ color: <?php echo $style['lightbox_comment_load_more_color']; ?>;
1203
+ background-color: <?php echo $style['lightbox_comment_bg_color']; ?>;
1204
+ -webkit-user-select: none; /* Chrome/Safari */
1205
+ -moz-user-select: none; /* Firefox */
1206
+ -ms-user-select: none; /* IE10+ */
1207
+ /* Rules below not implemented in browsers yet */
1208
+ -o-user-select: none;
1209
+ user-select: none;
1210
+ font-family: 'Verdana', sans-serif;
1211
+ text-transform: capitalize;
1212
+ font-size: 17px;
1213
+ }
1214
+
1215
+ <?php echo $lb_container;?> .wdi_load_more_comments:hover{
1216
+ color: <?php echo $style['lightbox_comment_load_more_color_hover'];?>;
1217
+ cursor: pointer;
1218
+ }
1219
+
1220
+
1221
+ /*partly*/
1222
+
1223
+ .wdi_popup_image {
1224
+ vertical-align: middle;
1225
+ display: inline-block;
1226
+ }
1227
+
1228
+
1229
+ .wdi_popup_embed {
1230
+ vertical-align: middle;
1231
+ text-align: center;
1232
+ display: inline-block;
1233
+ }
1234
+
1235
+ .wdi_image_container{
1236
+ display: table;
1237
+ position: absolute;
1238
+ text-align: center;
1239
+ vertical-align: middle;
1240
+ width: 100%;
1241
+ }
1242
+
1243
+ <?php echo $lb_container; ?> .wdi_filmstrip_container {
1244
+ display: <?php echo ($filmstrip_direction == 'horizontal'? 'table' : 'block'); ?>;
1245
+ position: absolute;
1246
+ z-index: 10105;
1247
+ <?php echo $style['lightbox_filmstrip_pos']; ?>: 0;
1248
+ }
1249
+
1250
+ .wdi_filmstrip {
1251
+ overflow: hidden;
1252
+ position: absolute;
1253
+ z-index: 10106;
1254
+ }
1255
+
1256
+ .wdi_filmstrip_thumbnails {
1257
+ margin: 0 auto;
1258
+ overflow: hidden;
1259
+ position: relative;
1260
+ }
1261
+
1262
+ <?php echo $lb_container; ?> .wdi_filmstrip_thumbnail {
1263
+ position: relative;
1264
+ background: none;
1265
+ border: <?php echo $style['lightbox_filmstrip_thumb_border_width']; ?>px <?php echo $style['lightbox_filmstrip_thumb_border_style']; ?> <?php echo $style['lightbox_filmstrip_thumb_border_color']; ?>;
1266
+ border-radius: <?php echo $style['lightbox_filmstrip_thumb_border_radius']; ?>px;
1267
+ cursor: pointer;
1268
+ float: left;
1269
+ margin: <?php echo $style['lightbox_filmstrip_thumb_margin']; ?>;
1270
+ overflow: hidden;
1271
+ }
1272
+
1273
+ <?php echo $lb_container; ?> .wdi_filmstrip_left {
1274
+ background-color: <?php echo $style['lightbox_filmstrip_rl_bg_color']; ?>;
1275
+ cursor: pointer;
1276
+ display: <?php echo ($filmstrip_direction == 'horizontal' ? 'table-cell' : 'block') ?>;
1277
+ vertical-align: middle;
1278
+ z-index: 10106;
1279
+ <?php echo ($filmstrip_direction == 'horizontal' ? '' : 'position: absolute;'); ?>
1280
+ <?php echo ($filmstrip_direction == 'horizontal' ? '' : 'width: 100%;'); ?>
1281
+ }
1282
+
1283
+ <?php echo $lb_container; ?> .wdi_filmstrip_right {
1284
+ background-color: <?php echo $style['lightbox_filmstrip_rl_bg_color']; ?>;
1285
+ cursor: pointer;
1286
+ <?php echo($filmstrip_direction == 'horizontal' ? 'right' : 'bottom') ?>: 0;
1287
+ display: <?php echo ($filmstrip_direction == 'horizontal' ? 'table-cell' : 'block') ?>;
1288
+ vertical-align: middle;
1289
+ z-index: 10106;
1290
+ <?php echo ($filmstrip_direction == 'horizontal' ? '' : 'position: absolute;') ?>
1291
+ <?php echo ($filmstrip_direction == 'horizontal' ? '' : 'width: 100%;') ?>
1292
+ }
1293
+
1294
+ <?php echo $lb_container; ?> .wdi_image_info{
1295
+ background: rgba(<?php echo $rgb_wdi_image_info_bg_color['red']; ?>, <?php echo $rgb_wdi_image_info_bg_color['green']; ?>, <?php echo $rgb_wdi_image_info_bg_color['blue']; ?>, <?php echo number_format($style['lightbox_info_bg_transparent'] / 100, 2, ".", ""); ?>);
1296
+ border: <?php echo $style['lightbox_info_border_width']; ?>px <?php echo $style['lightbox_info_border_style']; ?> <?php echo $style['lightbox_info_border_color']; ?>;
1297
+ border-radius: <?php echo $style['lightbox_info_border_radius']; ?>px;
1298
+ padding: <?php echo $style['lightbox_info_padding']; ?>;
1299
+ overflow: auto;
1300
+ }
1301
+
1302
+ @media (max-width: 480px) {
1303
+ .wdi_image_count_container {
1304
+ display: none;
1305
+ }
1306
+
1307
+ .wdi_image_title,
1308
+ .wdi_image_title * {
1309
+ font-size: 12px;
1310
+ }
1311
+
1312
+ .wdi_image_description,
1313
+ .wdi_image_description * {
1314
+ font-size: 10px;
1315
+ }
1316
+ }
1317
+
1318
+ .wdi_image_count_container {
1319
+ left: 0;
1320
+ line-height: 1;
1321
+ position: absolute;
1322
+ vertical-align: middle;
1323
+ }
1324
+ </style>
1325
+ <?php
1326
+ $css = ob_get_contents();
1327
+ ob_end_clean();
1328
+
1329
+ $css = strip_tags($css);
1330
+
1331
+ return $css;
1332
+ }
1333
+
1334
+ /**
1335
+ * @param string $file_name
1336
+ * @param string $file_content
1337
+ * @return WP_Error|boolean
1338
+ * */
1339
+ public function update_file($file_content){
1340
+
1341
+ $file_name = sprintf($this->file_name_format, $this->theme_id);
1342
+
1343
+ $wp_upload_dir = wp_upload_dir();
1344
+ $wp_upload_dir = $wp_upload_dir['basedir'];
1345
+
1346
+ $folder = $wp_upload_dir . '/' . $this->folder_name;
1347
+
1348
+ if(!is_dir($folder)) {
1349
+ if(mkdir($folder, 0777, true) === false) {
1350
+ return new WP_Error('wdi_failed_create_folder');
1351
+ }
1352
+
1353
+ if(file_put_contents($folder . '/index.html', "Index file.") === false) {
1354
+ return new WP_Error('wdi_failed_create_index_file');
1355
+ }
1356
+
1357
+ }
1358
+
1359
+ if(file_put_contents($folder . '/' . $file_name, $file_content) === false) {
1360
+ return new WP_Error('wdi_failed_create_css_file');
1361
+ }
1362
+
1363
+ $this->refresh_file_key();
1364
+ return true;
1365
+ }
1366
+
1367
+
1368
+ /**
1369
+ * @param $view_type string
1370
+ * @return string empty if file dose not exists or file url
1371
+ * */
1372
+ public function get_file_url(){
1373
+ $file_name = sprintf($this->file_name_format, $this->theme_id);
1374
+
1375
+ $wp_upload_dir = wp_upload_dir();
1376
+ $basedir = $wp_upload_dir['basedir'];
1377
+ $baseurl = $wp_upload_dir['baseurl'];
1378
+
1379
+ if(is_ssl()) {
1380
+ $baseurl = str_replace('http://', 'https://', $baseurl);
1381
+ }
1382
+
1383
+ $dir = $basedir . '/' . $this->folder_name . '/' . $file_name;
1384
+ if(file_exists($dir)) {
1385
+ return $baseurl . '/' . $this->folder_name . '/' . $file_name;
1386
+ } else {
1387
+ return "";
1388
+ }
1389
+ }
1390
+
1391
+ public function get_css(){
1392
+ return $this->css;
1393
+ }
1394
+
1395
+ public function refresh_file_key(){
1396
+ $option = get_option('wdi_theme_keys');
1397
+
1398
+ if(!is_array($option)) {
1399
+ $option = array();
1400
+ }
1401
+
1402
+ $this->file_key = uniqid();
1403
+ $option[$this->theme_id] = $this->file_key;
1404
+ update_option('wdi_theme_keys', $option);
1405
+ return $option;
1406
+ }
1407
+
1408
+ public function get_file_key(){
1409
+ if($this->file_key !== null) {
1410
+ $this->file_key;
1411
+ }
1412
+
1413
+ $option = get_option('wdi_theme_keys');
1414
+ if(!isset($option[$this->theme_id])) {
1415
+ $option = $this->refresh_file_key();
1416
+ }
1417
+
1418
+ return $option[$this->theme_id];
1419
+ }
1420
+
1421
+ }
frontend/controllers/WDIControllerGalleryBox.php CHANGED
@@ -6,7 +6,7 @@ class WDIControllerGalleryBox {
6
  }
7
 
8
  public function execute() {
9
- $ajax_task = WDILibrary::get('ajax_task', '');
10
  if (method_exists($this, $ajax_task)) {
11
  $this->$ajax_task();
12
  }
6
  }
7
 
8
  public function execute() {
9
+ $ajax_task = WDILibrary::get('ajax_task', '', 'sanitize_text_field', 'POST');
10
  if (method_exists($this, $ajax_task)) {
11
  $this->$ajax_task();
12
  }
frontend/controllers/imagebrowser.php CHANGED
@@ -1,22 +1,17 @@
1
  <?php
2
- class WDI_ImageBrowser_controller {
3
-
4
- public function __construct() {
5
- }
6
-
7
- public function execute($feed_row,$wdi_feed_counter){
8
- //including model
9
- require_once(WDI_DIR .'/frontend/models/imagebrowser.php');
10
- $model = new WDI_ImageBrowser_model($feed_row,$wdi_feed_counter);
11
- //including view
12
- require_once(WDI_DIR .'/frontend/views/imagebrowser.php');
13
- $view = new WDI_ImageBrowser_view($model);
14
- $view->display();
15
- }
16
-
17
-
18
-
19
-
20
 
 
21
 
22
- }
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
+ class WDI_ImageBrowser_controller {
4
 
5
+ public function __construct() {
6
+ }
7
+
8
+ public function execute( $feed_row, $wdi_feed_counter ) {
9
+ //including model
10
+ require_once(WDI_DIR . '/frontend/models/imagebrowser.php');
11
+ $model = new WDI_ImageBrowser_model($feed_row, $wdi_feed_counter);
12
+ //including view
13
+ require_once(WDI_DIR . '/frontend/views/imagebrowser.php');
14
+ $view = new WDI_ImageBrowser_view($model);
15
+ $view->display();
16
+ }
17
+ }
frontend/models/WDIModelGalleryBox.php CHANGED
@@ -1,10 +1,23 @@
1
  <?php
2
 
3
  class WDIModelGalleryBox {
4
-
 
 
 
 
 
 
 
 
 
 
 
5
  public function __construct() {
6
  }
7
-
 
 
8
  public function get_theme_row_data($id) {
9
  global $wpdb;
10
  if ($id) {
@@ -13,17 +26,14 @@ class WDIModelGalleryBox {
13
  else {
14
  $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . WDI_THEME_TABLE .' WHERE default_theme="%d"', 1));
15
  }
16
- // Replaces old DB value with new one.
17
- $row->lightbox_rl_btn_style = 'tenweb-i-chevron';
18
- return WDILibrary::objectToArray($row);
19
- }
20
 
21
- public function get_feed_row_data($id) {
22
- global $wpdb;
23
- $row = $this->check_settings($wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . WDI_FEED_TABLE . ' WHERE id="%d"', $id)));
24
- return WDILibrary::objectToArray($row);
25
  }
26
-
 
 
 
 
27
  public function get_option_row_data() {
28
  global $wpdb;
29
  $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'wdi_option WHERE id="%d"', 1));
@@ -67,57 +77,13 @@ class WDIModelGalleryBox {
67
  return $row;
68
  }
69
 
70
- private function check_settings($settings){
71
- $settings = WDILibrary::objectToArray($settings);
72
- if(isset($settings['feed_users']) && count(explode(',', $settings['feed_users']))>1){
73
- $settings['feed_users'] = explode(',', $settings['feed_users']);
74
- $settings['feed_users'] = $settings['feed_users'][0];
75
- };
76
- if(isset($settings['theme_id']) && intval($settings['theme_id']) > 1){
77
- $settings['theme_id'] = '1';
78
- };
79
- if(isset($settings['feed_display_view']) && $settings['feed_display_view'] === 'infinite_scroll'){
80
- $settings['feed_display_view'] = 'load_more_btn';
81
- }
82
- if(isset($settings['feed_type']) && $settings['feed_type'] === 'masonry' || $settings['feed_type'] === 'blog_style'){
83
- $settings['feed_type'] = 'thumbnails';
84
- }
85
- if(isset($settings['popup_enable_filmstrip']) && $settings['popup_enable_filmstrip'] == '1'){
86
- $settings['popup_enable_filmstrip'] = '0';
87
- }
88
- if(isset($settings['popup_filmstrip_height']) && $settings['popup_filmstrip_height'] != '70'){
89
- $settings['popup_filmstrip_height'] = '70';
90
- }
91
- if(isset($settings['popup_enable_comment']) && $settings['popup_enable_comment'] == '1'){
92
- $settings['popup_enable_comment'] = '0';
93
- }
94
- if(isset($settings['popup_enable_share_buttons']) && $settings['popup_enable_share_buttons'] == '1'){
95
- $settings['popup_enable_share_buttons'] = '0';
96
- }
97
- if(isset($settings['popup_info_always_show']) && $settings['popup_info_always_show'] == '1'){
98
- $settings['popup_info_always_show'] = '0';
99
- }
100
-
101
- if(isset($settings['popup_info_full_width']) && $settings['popup_info_full_width'] == '1'){
102
- $settings['popup_info_full_width'] = '0';
103
- }
104
-
105
- if(isset($settings['popup_enable_info']) && $settings['popup_enable_info'] == '1'){
106
- $settings['popup_enable_info'] = '0';
107
- }
108
-
109
- if(isset($settings['show_likes']) && $settings['show_likes'] == '1'){
110
- $settings['show_likes'] = '0';
111
- }
112
-
113
- if(isset($settings['show_description']) && $settings['show_description'] == '1'){
114
- $settings['show_description'] = '0';
115
- }
116
-
117
- if(isset($settings['show_comments']) && $settings['show_comments'] == '1'){
118
- $settings['show_comments'] = '0';
119
- }
120
- $settings = WDILibrary::arrayToObject($settings);
121
- return $settings;
122
- }
123
  }
1
  <?php
2
 
3
  class WDIModelGalleryBox {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
  public function __construct() {
17
  }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
  public function get_theme_row_data($id) {
22
  global $wpdb;
23
  if ($id) {
26
  else {
27
  $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . WDI_THEME_TABLE .' WHERE default_theme="%d"', 1));
28
  }
 
 
 
 
29
 
30
+ return WDILibrary::objectToArray($row);
 
 
 
31
  }
32
+ public function get_feed_row_data($id) {
33
+ global $wpdb;
34
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . WDI_FEED_TABLE . ' WHERE id="%d"', $id));
35
+ return WDILibrary::objectToArray($row);
36
+ }
37
  public function get_option_row_data() {
38
  global $wpdb;
39
  $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'wdi_option WHERE id="%d"', 1));
77
  return $row;
78
  }
79
 
80
+ ////////////////////////////////////////////////////////////////////////////////////////
81
+ // Getters & Setters //
82
+ ////////////////////////////////////////////////////////////////////////////////////////
83
+ ////////////////////////////////////////////////////////////////////////////////////////
84
+ // Private Methods //
85
+ ////////////////////////////////////////////////////////////////////////////////////////
86
+ ////////////////////////////////////////////////////////////////////////////////////////
87
+ // Listeners //
88
+ ////////////////////////////////////////////////////////////////////////////////////////
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  }
frontend/models/imagebrowser.php CHANGED
@@ -26,8 +26,8 @@ class WDI_ImageBrowser_model {
26
  }
27
 
28
  public function parseDefaults( $args ) {
29
- require_once(WDI_DIR . '/admin/models/WDIModelFeeds_wdi.php');
30
- $defaults = WDIModelFeeds_wdi::wdi_get_feed_defaults();
31
 
32
  return wp_parse_args($args, $defaults);
33
  }
26
  }
27
 
28
  public function parseDefaults( $args ) {
29
+ require_once(WDI_DIR . '/admin/models/feeds.php');
30
+ $defaults = Feeds_model_wdi::wdi_get_feed_defaults();
31
 
32
  return wp_parse_args($args, $defaults);
33
  }
frontend/models/thumbnails.php CHANGED
@@ -1,7 +1,6 @@
1
  <?php
2
 
3
  class WDI_Thumbnails_model {
4
-
5
  private $feed_row;
6
  public $theme_row;
7
  public $wdi_feed_counter;
@@ -21,8 +20,8 @@ class WDI_Thumbnails_model {
21
  }
22
 
23
  public function parseDefaults( $args ) {
24
- require_once(WDI_DIR . '/admin/models/WDIModelFeeds_wdi.php');
25
- $defaults = WDIModelFeeds_wdi::wdi_get_feed_defaults();
26
 
27
  return wp_parse_args($args, $defaults);
28
  }
@@ -41,4 +40,4 @@ class WDI_Thumbnails_model {
41
 
42
  return WDILibrary::objectToArray($theme_row);
43
  }
44
- }
1
  <?php
2
 
3
  class WDI_Thumbnails_model {
 
4
  private $feed_row;
5
  public $theme_row;
6
  public $wdi_feed_counter;
20
  }
21
 
22
  public function parseDefaults( $args ) {
23
+ require_once(WDI_DIR . '/admin/models/feeds.php');
24
+ $defaults = Feeds_model_wdi::wdi_get_feed_defaults();
25
 
26
  return wp_parse_args($args, $defaults);
27
  }
40
 
41
  return WDILibrary::objectToArray($theme_row);
42
  }
43
+ }
frontend/shortcode.php CHANGED
@@ -1,10 +1,9 @@
1
  <?php
2
  //global counter for webpage feeds
3
- /* This will not work in case of AJAX request, note that for future versions */
4
  $wdi_feed_counter = 0;
5
-
6
  add_action('init', 'wdi_frontend_init');
7
-
8
  function wdi_frontend_init() {
9
  global $wdi_options;
10
  $wdi_options = get_option(WDI_OPT);
@@ -49,8 +48,8 @@ function wdi_feed($atts, $widget_params = '') {
49
  }
50
  }
51
 
52
- $feed_id = WDILibrary::get('feed_id', '');
53
- if ( isset($feed_id) && $post->post_type === "wdi_instagram" && $widget_params === '' ) {
54
  if ( !is_array($atts) ) {
55
  $atts = array();
56
  }
@@ -72,11 +71,12 @@ function wdi_feed($atts, $widget_params = '') {
72
  }
73
  }
74
  //including feed model
75
- require_once(WDI_DIR . '/admin/models/WDIModelFeeds_wdi.php');
76
- $feed_model = new WDIModelFeeds_wdi();
77
  //getting all feed information from db
78
  $feed_row = WDILibrary::objectToArray( $feed_model->get_feed_row( $attributes['id'] ) );
79
  $feed_row = WDILibrary::keep_only_self_user($feed_row);
 
80
  if ( !isset($feed_row) || $feed_row == NULL ) {
81
  ob_get_clean();
82
 
@@ -93,6 +93,23 @@ function wdi_feed($atts, $widget_params = '') {
93
  return __('Cannot get other user media. API shut down by Instagram. Sorry. Display only your media.', "wd-instagram-feed");
94
  }
95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  wdi_register_frontend_scripts();
97
  if ( WDILibrary::is_ajax() || WDILibrary::elementor_is_active() ) {
98
  if ( $wdi_feed_counter == 0 ) {
@@ -105,18 +122,18 @@ function wdi_feed($atts, $widget_params = '') {
105
  else {
106
  wdi_load_frontend_scripts();
107
  }
 
108
  $feed_row['widget'] = false;
109
  if ($widget_params != '' && $widget_params['widget'] == true) {
110
  $feed_row['widget'] = true;
111
  $feed_row['number_of_photos'] = (string)$widget_params['widget_image_num'];
 
112
  $feed_row['show_likes'] = (string)$widget_params['widget_show_likes_and_comments'];
113
  $feed_row['show_comments'] = (string)$widget_params['widget_show_likes_and_comments'];
114
  $feed_row['show_usernames'] = '0';
115
  $feed_row['display_header'] = '0';
116
- $feed_row['show_description'] = '0';
117
  $feed_row['number_of_columns'] = (string)$widget_params['number_of_columns'];
118
-
119
- if ($widget_params['enable_loading_buttons'] == 0) {
120
  $feed_row['feed_display_view'] = 'none';
121
  }
122
  }
@@ -124,16 +141,28 @@ function wdi_feed($atts, $widget_params = '') {
124
  global $user_feed_header_args;
125
  $user_feed_header_args = array();
126
 
127
- if ( !empty($wdi_options['wdi_access_token']) && !empty($wdi_options['wdi_user_name']) ) {
128
- $user_feed_header_args['user'] = array(
129
- 'username' => $wdi_options['wdi_user_name']
130
- );
131
- $user_feed_header_args['settings'] = array(
132
- 'show_usernames' => $feed_row['show_usernames'],
133
- 'show_follow' => $feed_row['follow_on_instagram_btn'],
134
- );
 
 
 
135
  }
136
 
 
 
 
 
 
 
 
 
 
137
  // checking feed type and using proper MVC
138
  $feed_type = isset($feed_row['feed_type']) ? $feed_row['feed_type'] : '';
139
  switch ($feed_type) {
@@ -176,58 +205,55 @@ function wdi_feed($atts, $widget_params = '') {
176
 
177
  function wdi_register_frontend_scripts(){
178
 
179
- if(WDI_MINIFY === true) {
180
- wp_register_script('wdi_instagram', WDI_URL . '/js/wdi_instagram.min.js', array("jquery"), WDI_VERSION, true);
181
- wp_register_script('wdi_frontend', WDI_URL . '/js/wdi_frontend.min.js', array("jquery", 'wdi_instagram', 'underscore'), WDI_VERSION, true);
182
- wp_register_script('wdi_responsive', WDI_URL . '/js/wdi_responsive.min.js', array("jquery", "wdi_frontend"), WDI_VERSION, true);
 
183
  } else {
184
- wp_register_script('wdi_instagram', WDI_URL . '/js/wdi_instagram.js', array("jquery"), WDI_VERSION, true);
185
- wp_register_script('wdi_frontend', WDI_URL . '/js/wdi_frontend.js', array("jquery", 'wdi_instagram', 'underscore'), WDI_VERSION, true);
186
- wp_register_script('wdi_responsive', WDI_URL . '/js/wdi_responsive.js', array("jquery", "wdi_frontend"), WDI_VERSION, true);
187
  }
188
 
189
  ////////////////////////////GALLERY BOX//////////////////////////////
190
- // Styles/Scripts for popup.
191
- wp_register_script('jquery-mobile', WDI_FRONT_URL . '/js/gallerybox/jquery.mobile.js', array('jquery'), WDI_VERSION);
192
- //wp_enqueue_script('jquery-mCustomScrollbar', WDI_FRONT_URL . '/js/gallerybox/jquery.mCustomScrollbar.concat.min.js', array('jquery'), WDI_VERSION);
193
- wp_register_script('jquery-fullscreen', WDI_FRONT_URL . '/js/gallerybox/jquery.fullscreen-0.4.1.js', array('jquery'), WDI_VERSION);
194
-
195
  if(WDI_MINIFY === true) {
196
- //wp_enqueue_style('wdi_mCustomScrollbar', WDI_FRONT_URL . '/css/gallerybox/jquery.mCustomScrollbar.min.css', array(), WDI_VERSION);
197
- /*ttt!!! gallery fullscreeni het conflict chka ?? arje stugel ete fullscreen script ka, apa el chavelacnel*/
198
- wp_register_script('wdi_gallery_box', WDI_FRONT_URL . '/js/gallerybox/wdi_gallery_box.min.js', array('jquery'), WDI_VERSION);
 
 
199
  } else {
200
- //wp_enqueue_style('wdi_mCustomScrollbar', WDI_FRONT_URL . '/css/gallerybox/jquery.mCustomScrollbar.css', array(), WDI_VERSION);
201
- /*ttt!!! gallery fullscreeni het conflict chka ?? arje stugel ete fullscreen script ka, apa el chavelacnel*/
202
- wp_register_script('wdi_gallery_box', WDI_FRONT_URL . '/js/gallerybox/wdi_gallery_box.js', array('jquery'), WDI_VERSION);
 
 
203
  }
204
 
205
- wp_localize_script('wdi_gallery_box', 'wdi_objectL10n', array(
206
- 'wdi_field_required' => __('Field is required.', "wd-instagram-feed"),
207
- 'wdi_mail_validation' => __('This is not a valid email address.', "wd-instagram-feed"),
208
- 'wdi_search_result' => __('There are no images matching your search.', "wd-instagram-feed"),
209
- ));
 
210
 
 
 
211
  $wdi_token_error_flag = get_option("wdi_token_error_flag");
212
 
213
- $options = wdi_get_options();
214
-
215
- $business_account_id = (!empty($options['business_account_id'])) ? $options['business_account_id'] : "";
216
- $fb_token = (!empty($options['fb_token'])) ? $options['fb_token'] : "";
217
-
218
-
219
  wp_localize_script("wdi_frontend", 'wdi_ajax', array(
220
  'ajax_url' => admin_url('admin-ajax.php'),
221
  'wdi_nonce' => wp_create_nonce("wdi_cache"),
222
- 'WDI_MINIFY' => (WDI_MINIFY) ? 'true' : 'false',
223
- 'business_account_id' => $business_account_id,
224
- 'fb_token' => $fb_token,
225
  ));
226
 
227
- wp_localize_script("wdi_frontend", 'wdi_url', array('plugin_url' => WDI_URL . '/',
228
- 'ajax_url' => admin_url('admin-ajax.php')));
 
 
229
 
230
- $user_is_admin = current_user_can('manage_options');
231
  wp_localize_script("wdi_frontend", 'wdi_front_messages',
232
  array('connection_error' => __('Connection Error, try again later :(', 'wd-instagram-feed'),
233
  'user_not_found' => __('Username not found', 'wd-instagram-feed'),
@@ -236,49 +262,56 @@ function wdi_register_frontend_scripts(){
236
  'filter_title' => __('Click to filter images by this user', 'wd-instagram-feed'),
237
  'invalid_users_format' => __('Provided feed users are invalid or obsolete for this version of plugin', 'wd-instagram-feed'),
238
  'feed_nomedia' => __('There is no media in this feed', 'wd-instagram-feed'),
 
239
  'follow' => __('Follow', 'wd-instagram-feed'),
240
  'show_alerts' => $user_is_admin,
241
  'wdi_token_flag_nonce' => wp_create_nonce(''),
242
  'wdi_token_error_flag' => $wdi_token_error_flag
243
  ));
244
 
245
- //styles
246
- if(WDI_MINIFY === true) {
247
- wp_register_style('wdi_frontend_thumbnails', WDI_URL . '/css/wdi_frontend.min.css', array(), WDI_VERSION);
248
- } else {
249
- wp_register_style('wdi_frontend_thumbnails', WDI_URL . '/css/wdi_frontend.css', array(), WDI_VERSION);
250
- }
251
  wdi_load_frontend_styles();
252
  }
253
 
254
  function wdi_load_frontend_styles(){
 
255
  global $wdi_options;
 
256
  if(WDI_MINIFY === true) {
257
- wp_register_style('wdi_frontend_thumbnails', WDI_URL . '/css/wdi_frontend.min.css', array(), WDI_VERSION);
 
258
  } else {
259
- wp_register_style('wdi_frontend_thumbnails', WDI_URL . '/css/wdi_frontend.css', array(), WDI_VERSION);
 
260
  }
261
 
262
-
263
- wp_enqueue_style('wdi_frontend_thumbnails');
264
-
265
- wp_register_style('font-tenweb', WDI_URL . '/css/tenweb-fonts/fonts.css', array(), WDI_VERSION);
266
  wp_enqueue_style('font-tenweb');
267
 
268
-
 
269
  }
270
 
 
271
  function wdi_load_frontend_scripts(){
272
  wp_enqueue_script('underscore');
 
273
  wp_enqueue_script('wdi_instagram');
274
  wp_enqueue_script('wdi_frontend');
275
  wp_enqueue_script('wdi_responsive');
276
  wp_enqueue_script('wdi_gallery_box');
 
277
  wp_enqueue_script('jquery-mobile');
 
278
  wp_enqueue_script('jquery-fullscreen');
279
 
280
- wp_enqueue_style('wdi_frontend_thumbnails');
281
  wp_enqueue_style('font-tenweb');
 
282
  }
283
 
284
  /*load all scripts and styles directly without dependency on jquery*/
@@ -288,11 +321,14 @@ function wdi_load_frontend_scripts_ajax($additional_scripts = array(), $addition
288
 
289
  $scripts_handles = array(
290
  'underscore',
291
- 'wdi_instagram',
292
  'wdi_responsive',
 
293
  'wdi_frontend',
294
  'wdi_gallery_box',
 
295
  'jquery-mobile',
 
296
  'jquery-fullscreen'
297
  );
298
 
@@ -316,7 +352,8 @@ function wdi_load_frontend_scripts_ajax($additional_scripts = array(), $addition
316
  }
317
 
318
  $styles_handles = array(
319
- 'wdi_frontend_thumbnails'
 
320
  );
321
 
322
  $styles_handles = array_merge($styles_handles, $additional_styles);
@@ -341,7 +378,6 @@ function wdi_load_frontend_scripts_ajax($additional_scripts = array(), $addition
341
  }
342
 
343
 
344
-
345
  add_action('wp_ajax_wdi_token_flag', 'wdi_token_flag');
346
  add_action('wp_ajax_nopriv_wdi_token_flag', 'wdi_token_flag');
347
  function wdi_token_flag() {
@@ -359,16 +395,15 @@ function wdi_delete_token_flag() {
359
 
360
  function wdi_feed_frontend_messages(){
361
  $manage_options_user = current_user_can('manage_options');
362
- //$class = $manage_options_user ? '' : '';
363
  $js_error_message = __("Something is wrong.", "wd-instagram-feed");
364
 
365
  $token_error_message = __("Instagram token error.");
366
  $error_style = "";
367
- $private_feed_error = "";
368
  $private_feed_error_1 = "";
369
  $private_feed_error_2 = "";
370
  $private_feed_error_3 = "";
371
- if ( $manage_options_user ) {
372
  $js_error_message = __("Something is wrong. Response takes too long or there is JS error. Press Ctrl+Shift+J or Cmd+Shift+J on a Mac to see error in console or ask for <a class='wdi_error_link' href='https://wordpress.org/support/plugin/wd-instagram-feed' target='_blank'>free support</a>.", "wd-instagram-feed");
373
  $token_error_message = __("Instagram token is invalid or expired. Please <a href='".site_url()."/wp-admin/admin.php?page=wdi_settings' target='_blank'>reset token</a> and sign-in again to get new one.");
374
  $error_style = 'style="color: #cc0000; text-align: center;"';
1
  <?php
2
  //global counter for webpage feeds
3
+ /*This will not work in case of AJAX request, note that for future versions*/
4
  $wdi_feed_counter = 0;
5
+ $wdi_feed_item_onclick_type = false;
6
  add_action('init', 'wdi_frontend_init');
 
7
  function wdi_frontend_init() {
8
  global $wdi_options;
9
  $wdi_options = get_option(WDI_OPT);
48
  }
49
  }
50
 
51
+ $feed_id = WDILibrary::get('feed_id', 0, 'intval');
52
+ if ( $feed_id != 0 && $post->post_type === "wdi_instagram" && $widget_params === '' ) {
53
  if ( !is_array($atts) ) {
54
  $atts = array();
55
  }
71
  }
72
  }
73
  //including feed model
74
+ require_once(WDI_DIR . '/admin/models/feeds.php');
75
+ $feed_model = new Feeds_model_wdi();
76
  //getting all feed information from db
77
  $feed_row = WDILibrary::objectToArray( $feed_model->get_feed_row( $attributes['id'] ) );
78
  $feed_row = WDILibrary::keep_only_self_user($feed_row);
79
+
80
  if ( !isset($feed_row) || $feed_row == NULL ) {
81
  ob_get_clean();
82
 
93
  return __('Cannot get other user media. API shut down by Instagram. Sorry. Display only your media.', "wd-instagram-feed");
94
  }
95
 
96
+ if(isset($feed_row["feed_item_onclick"]) && $feed_row["feed_item_onclick"] === "lightbox"){
97
+ global $wdi_feed_item_onclick_type;
98
+ $wdi_feed_item_onclick_type = true;
99
+ }
100
+
101
+ if ( !empty($feed_row['feed_users']) ){
102
+ $feed_users = json_decode($feed_row['feed_users'], true);
103
+ if( !empty( $feed_users) ) {
104
+ foreach( $feed_users as $user) {
105
+ if ( empty($user['tag_id']) ) {
106
+ $feed_row['username'] = $user['username'];
107
+ break;
108
+ }
109
+ }
110
+ }
111
+ }
112
+
113
  wdi_register_frontend_scripts();
114
  if ( WDILibrary::is_ajax() || WDILibrary::elementor_is_active() ) {
115
  if ( $wdi_feed_counter == 0 ) {
122
  else {
123
  wdi_load_frontend_scripts();
124
  }
125
+
126
  $feed_row['widget'] = false;
127
  if ($widget_params != '' && $widget_params['widget'] == true) {
128
  $feed_row['widget'] = true;
129
  $feed_row['number_of_photos'] = (string)$widget_params['widget_image_num'];
130
+ $feed_row['show_description'] = (string)$widget_params['widget_show_description'];
131
  $feed_row['show_likes'] = (string)$widget_params['widget_show_likes_and_comments'];
132
  $feed_row['show_comments'] = (string)$widget_params['widget_show_likes_and_comments'];
133
  $feed_row['show_usernames'] = '0';
134
  $feed_row['display_header'] = '0';
 
135
  $feed_row['number_of_columns'] = (string)$widget_params['number_of_columns'];
136
+ if ( $widget_params['enable_loading_buttons'] == 0 ) {
 
137
  $feed_row['feed_display_view'] = 'none';
138
  }
139
  }
141
  global $user_feed_header_args;
142
  $user_feed_header_args = array();
143
 
144
+ if ( !empty($wdi_options['wdi_authenticated_users_list']) ) {
145
+ $authenticated_users = json_decode($wdi_options['wdi_authenticated_users_list'], true);
146
+ if ( !empty($authenticated_users[$feed_row['username']]) ) {
147
+ $ig_user = $authenticated_users[$feed_row['username']];
148
+ $user_feed_header_args['user'] = $ig_user;
149
+ }
150
+ else {
151
+ ob_get_clean();
152
+
153
+ return __('Please check your feed, the data was entered incorrectly.', "wd-instagram-feed");
154
+ }
155
  }
156
 
157
+ $user_feed_header_args['settings'] = array(
158
+ 'show_usernames' => $feed_row['show_usernames'],
159
+ 'show_follow' => $feed_row['follow_on_instagram_btn'],
160
+ 'media_followers' => $feed_row['display_user_post_follow_number'],
161
+ 'biography_website' => $feed_row['display_user_info'],
162
+ );
163
+ wp_localize_script("wdi_frontend", 'wdi_object', array(
164
+ 'user' => $user_feed_header_args['user']
165
+ ));
166
  // checking feed type and using proper MVC
167
  $feed_type = isset($feed_row['feed_type']) ? $feed_row['feed_type'] : '';
168
  switch ($feed_type) {
205
 
206
  function wdi_register_frontend_scripts(){
207
 
208
+ wp_register_script('wdi_lazy_load', WDI_URL . '/js/jquery.lazyload.min.js', array("jquery"), wdi_get_pro_version(), true);
209
+ if( WDI_MINIFY === true ) {
210
+ wp_register_script('wdi_instagram', WDI_URL . '/js/wdi_instagram.min.js', array("jquery"), wdi_get_pro_version(), true);
211
+ wp_register_script('wdi_frontend', WDI_URL . '/js/wdi_frontend.min.js', array("jquery", 'wdi_instagram', 'wdi_lazy_load', 'underscore'), wdi_get_pro_version(), true);
212
+ wp_register_script('wdi_responsive', WDI_URL . '/js/wdi_responsive.min.js', array("jquery", "wdi_frontend"), wdi_get_pro_version(), true);
213
  } else {
214
+ wp_register_script('wdi_instagram', WDI_URL . '/js/wdi_instagram.js', array("jquery"), wdi_get_pro_version(), true);
215
+ wp_register_script('wdi_frontend', WDI_URL . '/js/wdi_frontend.js', array("jquery", 'wdi_instagram', 'wdi_lazy_load', 'underscore'), wdi_get_pro_version(), true);
216
+ wp_register_script('wdi_responsive', WDI_URL . '/js/wdi_responsive.js', array("jquery", "wdi_frontend"), wdi_get_pro_version(), true);
217
  }
218
 
219
  ////////////////////////////GALLERY BOX//////////////////////////////
220
+ global $wdi_feed_item_onclick_type;
 
 
 
 
221
  if(WDI_MINIFY === true) {
222
+ /* gallery fullscreeni het conflict chka ?? arje stugel ete fullscreen script ka, apa el chavelacnel */
223
+ wp_register_script('wdi_gallery_box', WDI_FRONT_URL . '/js/gallerybox/wdi_gallery_box.min.js', array('jquery'), wdi_get_pro_version());
224
+ if($wdi_feed_item_onclick_type) {
225
+ wp_register_style('wdi_mCustomScrollbar', WDI_FRONT_URL . '/css/gallerybox/jquery.mCustomScrollbar.min.css', array(), wdi_get_pro_version());
226
+ }
227
  } else {
228
+ /* gallery fullscreeni het conflict chka ?? arje stugel ete fullscreen script ka, apa el chavelacnel */
229
+ wp_register_script('wdi_gallery_box', WDI_FRONT_URL . '/js/gallerybox/wdi_gallery_box.js', array('jquery'), wdi_get_pro_version());
230
+ if($wdi_feed_item_onclick_type) {
231
+ wp_register_style('wdi_mCustomScrollbar', WDI_FRONT_URL . '/css/gallerybox/jquery.mCustomScrollbar.css', array(), wdi_get_pro_version());
232
+ }
233
  }
234
 
235
+ // Styles/Scripts for popup.
236
+ wp_register_script('jquery-mobile', WDI_FRONT_URL . '/js/gallerybox/jquery.mobile.js', array('jquery'), wdi_get_pro_version());
237
+ if($wdi_feed_item_onclick_type) {
238
+ wp_register_script('jquery-mCustomScrollbar', WDI_FRONT_URL . '/js/gallerybox/jquery.mCustomScrollbar.concat.min.js', array('jquery'), wdi_get_pro_version());
239
+ }
240
+ wp_register_script('jquery-fullscreen', WDI_FRONT_URL . '/js/gallerybox/jquery.fullscreen-0.4.1.js', array('jquery'), wdi_get_pro_version());
241
 
242
+ //localize scrips
243
+ $user_is_admin = current_user_can('manage_options');
244
  $wdi_token_error_flag = get_option("wdi_token_error_flag");
245
 
 
 
 
 
 
 
246
  wp_localize_script("wdi_frontend", 'wdi_ajax', array(
247
  'ajax_url' => admin_url('admin-ajax.php'),
248
  'wdi_nonce' => wp_create_nonce("wdi_cache"),
249
+ 'WDI_MINIFY' => (WDI_MINIFY) ? 'true' : 'false'
 
 
250
  ));
251
 
252
+ wp_localize_script("wdi_frontend", 'wdi_url', array(
253
+ 'plugin_url' => WDI_URL . '/',
254
+ 'ajax_url' => admin_url('admin-ajax.php'))
255
+ );
256
 
 
257
  wp_localize_script("wdi_frontend", 'wdi_front_messages',
258
  array('connection_error' => __('Connection Error, try again later :(', 'wd-instagram-feed'),
259
  'user_not_found' => __('Username not found', 'wd-instagram-feed'),
262
  'filter_title' => __('Click to filter images by this user', 'wd-instagram-feed'),
263
  'invalid_users_format' => __('Provided feed users are invalid or obsolete for this version of plugin', 'wd-instagram-feed'),
264
  'feed_nomedia' => __('There is no media in this feed', 'wd-instagram-feed'),
265
+ 'expired_token' => __('Error: Access token session has expired, please reauthorize access token', 'wd-instagram-feed'),
266
  'follow' => __('Follow', 'wd-instagram-feed'),
267
  'show_alerts' => $user_is_admin,
268
  'wdi_token_flag_nonce' => wp_create_nonce(''),
269
  'wdi_token_error_flag' => $wdi_token_error_flag
270
  ));
271
 
272
+ wp_localize_script('wdi_gallery_box', 'wdi_objectL10n', array(
273
+ 'wdi_field_required' => __('Field is required.', "wd-instagram-feed"),
274
+ 'wdi_mail_validation' => __('This is not a valid email address.', "wd-instagram-feed"),
275
+ 'wdi_search_result' => __('There are no images matching your search.', "wd-instagram-feed"),
276
+ ));
 
277
  wdi_load_frontend_styles();
278
  }
279
 
280
  function wdi_load_frontend_styles(){
281
+
282
  global $wdi_options;
283
+
284
  if(WDI_MINIFY === true) {
285
+ wp_register_style('wdi_frontend_thumbnails', WDI_URL . '/css/wdi_frontend.min.css', array(), wdi_get_pro_version());
286
+ wp_register_style('mCustomScrollbar', WDI_URL . '/css/gallerybox/jquery.mCustomScrollbar.min.css', array(), wdi_get_pro_version());
287
  } else {
288
+ wp_register_style('wdi_frontend_thumbnails', WDI_URL . '/css/wdi_frontend.css', array(), wdi_get_pro_version());
289
+ wp_register_style('mCustomScrollbar', WDI_URL . '/css/gallerybox/jquery.mCustomScrollbar.min.css', array(), wdi_get_pro_version());
290
  }
291
 
292
+ wp_register_style('font-tenweb', WDI_URL . '/css/tenweb-fonts/fonts.css', array(), wdi_get_pro_version());
 
 
 
293
  wp_enqueue_style('font-tenweb');
294
 
295
+ wp_enqueue_style('wdi_frontend_thumbnails');
296
+ wp_enqueue_style('mCustomScrollbar');
297
  }
298
 
299
+
300
  function wdi_load_frontend_scripts(){
301
  wp_enqueue_script('underscore');
302
+ wp_enqueue_script('wdi_lazy_load');
303
  wp_enqueue_script('wdi_instagram');
304
  wp_enqueue_script('wdi_frontend');
305
  wp_enqueue_script('wdi_responsive');
306
  wp_enqueue_script('wdi_gallery_box');
307
+ wp_enqueue_script('wdi_mCustomScrollbar');
308
  wp_enqueue_script('jquery-mobile');
309
+ wp_enqueue_script('jquery-mCustomScrollbar');
310
  wp_enqueue_script('jquery-fullscreen');
311
 
312
+ //styles
313
  wp_enqueue_style('font-tenweb');
314
+ wp_enqueue_style('wdi_frontend_thumbnails');
315
  }
316
 
317
  /*load all scripts and styles directly without dependency on jquery*/
321
 
322
  $scripts_handles = array(
323
  'underscore',
324
+ 'wdi_lazy_load',
325
  'wdi_responsive',
326
+ 'wdi_instagram',
327
  'wdi_frontend',
328
  'wdi_gallery_box',
329
+ 'wdi_mCustomScrollbar',
330
  'jquery-mobile',
331
+ 'jquery-mCustomScrollbar',
332
  'jquery-fullscreen'
333
  );
334
 
352
  }
353
 
354
  $styles_handles = array(
355
+ 'wdi_frontend_thumbnails',
356
+ 'wdi_mCustomScrollbar',
357
  );
358
 
359
  $styles_handles = array_merge($styles_handles, $additional_styles);
378
  }
379
 
380
 
 
381
  add_action('wp_ajax_wdi_token_flag', 'wdi_token_flag');
382
  add_action('wp_ajax_nopriv_wdi_token_flag', 'wdi_token_flag');
383
  function wdi_token_flag() {
395
 
396
  function wdi_feed_frontend_messages(){
397
  $manage_options_user = current_user_can('manage_options');
398
+ //$class = $manage_options_user ? '' : 'wdi_hidden';
399
  $js_error_message = __("Something is wrong.", "wd-instagram-feed");
400
 
401
  $token_error_message = __("Instagram token error.");
402
  $error_style = "";
 
403
  $private_feed_error_1 = "";
404
  $private_feed_error_2 = "";
405
  $private_feed_error_3 = "";
406
+ if($manage_options_user){
407
  $js_error_message = __("Something is wrong. Response takes too long or there is JS error. Press Ctrl+Shift+J or Cmd+Shift+J on a Mac to see error in console or ask for <a class='wdi_error_link' href='https://wordpress.org/support/plugin/wd-instagram-feed' target='_blank'>free support</a>.", "wd-instagram-feed");
408
  $token_error_message = __("Instagram token is invalid or expired. Please <a href='".site_url()."/wp-admin/admin.php?page=wdi_settings' target='_blank'>reset token</a> and sign-in again to get new one.");
409
  $error_style = 'style="color: #cc0000; text-align: center;"';
frontend/views/WDIViewGalleryBox.php CHANGED
@@ -13,15 +13,11 @@ class WDIViewGalleryBox {
13
  global $wp;
14
  require_once(WDI_DIR . '/framework/WDILibraryEmbed.php');
15
 
16
- $feed_id = (int) WDILibrary::get('feed_id', 0);
17
- $current_feed = $this->model->get_feed_row_data($feed_id);
 
18
  $is_hashtag = false;
19
- if ( isset($current_feed["thumb_user"]) && !empty($current_feed["thumb_user"]) ) {
20
- $first_char = mb_substr($current_feed["thumb_user"], 0, 1);
21
- if ( $first_char === "#" ) {
22
- $is_hashtag = TRUE;
23
- }
24
- }
25
  $theme_row = WDILibrary::arrayToObject($this->model->get_theme_row_data($current_feed['theme_id']));
26
  $option_row = WDILibrary::arrayToObject($current_feed);
27
  $option_row->preload_images_count = 0;
@@ -29,21 +25,21 @@ class WDIViewGalleryBox {
29
  $option_row->popup_enable_email = 0;
30
 
31
  //////////////////////////////////////////////////////////////////
32
- $current_url = WDILibrary::get('current_url', '');
33
- $current_url = ( !empty($current_url) ? add_query_arg(esc_html($current_url), '', home_url($wp->request)) : '' );
34
- $tag_id = WDILibrary::get('tag_id', 0);
35
  $gallery_id = (isset($current_feed['id']) ? esc_html($current_feed['id']) : 0);
36
- $wdi = WDILibrary::get('feed_counter', 0);
37
- $current_image_id = WDILibrary::get('image_id', 0);
38
- $current_image_index = WDILibrary::get('current_image_index', 0);
39
  $theme_id = (isset($current_feed['theme_id']) ? esc_html($current_feed['theme_id']) : 1);
40
 
41
- $carousel_media_row = WDILibrary::get('carousel_media_row', '');
42
  $carousel_media = json_decode(stripslashes($carousel_media_row), true);
43
  $carousel_media = is_array($carousel_media) ? $carousel_media : array();
44
 
45
- $thumb_width = WDILibrary::get('thumb_width', 90); /*watch later*/
46
- $thumb_height = WDILibrary::get('thumb_height', 90); /*watch later*/
47
 
48
  $open_with_fullscreen = (isset($current_feed['popup_fullscreen']) ? esc_html($current_feed['popup_fullscreen']) : 0);
49
  $open_with_autoplay = (isset($current_feed['popup_autoplay']) ? esc_html($current_feed['popup_autoplay']) : 0);
@@ -52,8 +48,8 @@ class WDIViewGalleryBox {
52
 
53
  $image_effect = (isset($current_feed['popup_type']) && esc_html(isset($current_feed['popup_type'])) ? esc_html($current_feed['popup_type']) : 'fade');
54
 
55
- $sort_by = WDILibrary::get('wd_sor', 'order'); /*watch later*/
56
- $order_by = WDILibrary::get('wd_ord', 'asc'); /*watch later*/
57
 
58
  $enable_image_filmstrip = (isset($current_feed['popup_enable_filmstrip']) ? esc_html($current_feed['popup_enable_filmstrip']) : 0);
59
  $enable_image_fullscreen = (isset($current_feed['popup_enable_fullscreen']) ? esc_html($current_feed['popup_enable_fullscreen']) : 0);/*watch later*/
@@ -80,7 +76,6 @@ class WDIViewGalleryBox {
80
  $enable_image_google = (isset($current_feed['popup_enable_google']) ? esc_html($current_feed['popup_enable_google']) : 0);
81
  $enable_image_pinterest = (isset($current_feed['popup_enable_pinterest']) ? esc_html($current_feed['popup_enable_pinterest']) : 0);
82
  $enable_image_tumblr = (isset($current_feed['popup_enable_tumblr']) ? esc_html($current_feed['popup_enable_tumblr']) : 0);
83
- $enable_share_buttons = (isset($current_feed['popup_enable_share_buttons']) ? esc_html($current_feed['popup_enable_share_buttons']) : 1);
84
  $image_right_click = (isset($current_feed['popup_image_right_click']) ? esc_html($current_feed['popup_image_right_click']) : 1);
85
 
86
  //$option_row = $this->model->get_option_row_data();
@@ -109,11 +104,11 @@ class WDIViewGalleryBox {
109
  }
110
 
111
 
112
- $json = WDILibrary::get('image_rows');
113
  str_replace('"',"&quot;", $json);
114
 
115
  $image_rows = json_decode(stripslashes($json));
116
- $image_rows_count = (int) ( WDILibrary::get('image_rows_count') * 1 );
117
  $image_rows = WDILibrary::arrayToObject($image_rows);
118
 
119
  /////////////////////////////////Parametes for deprecated content////////////////////
@@ -121,7 +116,9 @@ class WDIViewGalleryBox {
121
  $theme_row->lightbox_rate_size = 0;
122
  /////////////////////////////////////////////////////////////////////////////////////
123
 
124
- $image_id = (int) WDILibrary::get('image_id', $current_image_id);
 
 
125
  $params_array = array(
126
  'action' => 'GalleryBox',
127
  'image_id' => $current_image_id,
@@ -196,7 +193,7 @@ class WDIViewGalleryBox {
196
 
197
  $current_filename = '';
198
  ?>
199
- <style>
200
  .wdi_popup_image {
201
  max-width: <?php echo $image_width - ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>px;
202
  max-height: <?php echo $image_height - ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>px;
@@ -266,12 +263,8 @@ class WDIViewGalleryBox {
266
 
267
  .wdi_image_info {
268
  <?php echo ((!$enable_image_filmstrip || $theme_row->lightbox_filmstrip_pos != 'bottom') && $theme_row->lightbox_ctrl_btn_pos == 'bottom' && $theme_row->lightbox_info_pos == 'bottom') ? 'bottom: ' . ($theme_row->lightbox_ctrl_btn_height + 2 * $theme_row->lightbox_ctrl_btn_margin_top) . 'px;' : '' ?>
269
- <?php if($params_array['popup_info_full_width']) { ?>
270
- width: 100%;
271
- <?php } else { ?>
272
- width: 33%;
273
- margin: <?php echo $theme_row->lightbox_info_margin; ?>;
274
- <?php } ?>
275
  <?php echo ((!$enable_image_filmstrip || $theme_row->lightbox_filmstrip_pos != 'top') && $theme_row->lightbox_ctrl_btn_pos == 'top' && $theme_row->lightbox_info_pos == 'top') ? 'top: ' . ($theme_row->lightbox_ctrl_btn_height + 2 * $theme_row->lightbox_ctrl_btn_margin_top) . 'px;' : '' ?>
276
  }
277
  </style>
@@ -280,31 +273,36 @@ class WDIViewGalleryBox {
280
  <?php
281
  $image_id_exist = FALSE;
282
  foreach ($image_rows as $key => $image_row) {
283
- if ($image_row->id == $image_id) {
284
- $current_avg_rating = $image_row->avg_rating;
285
- $current_rate = $image_row->rate;
286
- $current_rate_count = $image_row->rate_count;
287
- $current_image_key = $key;
288
  }
289
- if ($image_row->id == $current_image_id) {
290
- $current_image_alt = $image_row->alt;
291
- $current_image_user_name = $image_row->username;
292
- if(isset($image_row->profile_picture)){
 
 
 
 
 
 
293
  $current_image_user_pic = $image_row->profile_picture;
294
- }else{
295
  $current_image_user_pic = '';
296
  }
297
- $current_image_hit_count = $image_row->hit_count;
298
- $current_image_description = str_replace('#',' #',str_replace(array("\r\n", "\n", "\r"), esc_html('<br />'), $image_row->description));
299
- $current_image_url = $image_row->image_url;
300
- $current_thumb_url = $image_row->thumb_url;
301
- $current_filetype = $image_row->filetype;
302
  $current_filename = $image_row->filename;
303
  $image_id_exist = TRUE;
304
  }
305
- continue;
306
  //sanitizing image description
307
- $instaDesc = $image_row->description;
308
  $instaDesc = preg_replace('/\\\\/', esc_html('&#92;'), $instaDesc);
309
 
310
  /*last two are ZWSP and P-SEP*/
@@ -322,7 +320,7 @@ continue;
322
  }
323
  ?>
324
  <div class="wdi_image_wrap">
325
- <?php if ($enable_image_ctrl_btn || (!is_null($carousel_media) && count($carousel_media))) { ?>
326
  <div class="wdi_btn_container">
327
  <?php if(!is_null($carousel_media) && count($carousel_media)){ ?>
328
  <div class="wdi_carousel_btn_container">
@@ -336,134 +334,115 @@ continue;
336
  <?php
337
  }
338
 
339
- if ($enable_image_ctrl_btn) {
340
- $share_url = add_query_arg(array('action' => 'Share', 'curr_url' => $current_url, 'image_id' => $current_image_id), admin_url('admin-ajax.php')) . '#wdi' . $gallery_id . '/' . $current_image_id;
341
- ?>
342
- <div class="wdi_ctrl_btn_container">
343
- <?php
344
- if ($option_row->show_image_counts) {
345
- ?>
346
- <span class="wdi_image_count_container wdi_ctrl_btn">
347
- <span class="wdi_image_count"><?php echo $current_image_key + 1; ?></span> /
348
- <span><?php echo $image_rows_count; ?></span>
349
- </span>
350
- <?php
351
- }
352
- ?>
353
- <i title="<?php echo __('Play', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_play_pause tenweb-i tenweb-i-play"></i>
354
- <?php if ($enable_image_fullscreen) {
355
- if (!$open_with_fullscreen) {
356
- ?>
357
- <i title="<?php echo __('Maximize', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_resize-full tenweb-i tenweb-i-expand "></i>
358
- <?php
359
- }
360
- ?>
361
- <i title="<?php echo __('Fullscreen', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_fullscreen tenweb-i tenweb-i-arrows-out"></i>
362
- <?php } if ($popup_enable_info) { ?>
363
- <i title="<?php echo __('Show Caption', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_info tenweb-i tenweb-i-info"></i>
364
  <?php }
365
- /* @TODO API Changes 2020. */
366
- if ( $enable_comment_social && !$is_hashtag ) { ?>
367
- <i title="<?php echo __('Show comments', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_comment tenweb-i tenweb-i-comment"></i>
368
- <?php } if ($popup_enable_rate) { ?>
369
- <i title="<?php echo __('Show rating', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_rate tenweb-i tenweb-i-star"></i>
370
- <?php }
371
- $is_embed = preg_match('/EMBED/', $current_filetype) == 1 ? TRUE : FALSE;
372
- $share_image_url = urlencode( $is_embed ? $current_thumb_url : site_url() . '/' . $WD_WDI_UPLOAD_DIR . $current_image_url);
373
- if ($enable_image_facebook) {
374
- ?>
375
- <a id="wdi_facebook_a" href="https://www.facebook.com/sharer/sharer.php?u=<?php echo urlencode($share_url); ?>" target="_blank" title="<?php echo __('Share on Facebook', "wd-instagram-feed"); ?>">
376
- <i title="<?php echo __('Share on Facebook', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_facebook tenweb-i tenweb-i-facebook-square"></i>
377
- </a>
378
- <?php
379
- }
380
- if ($enable_image_twitter) {
381
- ?>
382
- <a id="wdi_twitter_a" href="https://twitter.com/share?url=<?php echo urlencode($share_url); ?>" target="_blank" title="<?php echo __('Share on Twitter', "wd-instagram-feed"); ?>">
383
- <i title="<?php echo __('Share on Twitter', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_twitter tenweb-i tenweb-i-twitter-square"></i>
384
- </a>
385
- <?php
386
- }
387
- if ($enable_image_pinterest) {
388
- ?>
389
- <a id="wdi_pinterest_a" href="http://pinterest.com/pin/create/button/?s=100&url=<?php echo urlencode($share_url); ?>&media=<?php echo $share_image_url; ?>&description=<?php echo $current_image_description; ?>" target="_blank" title="<?php echo __('Share on Pinterest', "wd-instagram-feed"); ?>">
390
- <i title="<?php echo __('Share on Pinterest', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_pinterest tenweb-i tenweb-i-pinterest-square"></i>
391
- </a>
392
- <?php
393
- }
394
- if ($enable_image_tumblr) {
395
- ?>
396
- <a id="wdi_tumblr_a" href="https://www.tumblr.com/share/photo?source=<?php echo $share_image_url; ?>&caption=<?php echo urlencode($current_image_alt); ?>&clickthru=<?php echo urlencode($share_url); ?>" target="_blank" title="<?php echo __('Share on Tumblr', "wd-instagram-feed"); ?>">
397
- <i title="<?php echo __('Share on Tumblr', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_tumblr tenweb-i tenweb-i-tumblr-square"></i>
398
- </a>
399
- <?php
400
- }
401
-
402
- if ($enable_share_buttons) {
403
- ?>
404
- <span class="wdi_share_btns_container">
405
- <i onclick="jQuery(this).parent().find('.wdi_share_btns').toggleClass('wdi_share_toggler');jQuery(this).parent().find('.wdi_share_caret').toggleClass('wdi_share_toggler')" title="<?php echo __('Share', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn tenweb-i tenweb-i-share"></i>
406
- <p class="wdi_share_btns" style="display:none">
407
- <a id="wdi_popup_fb" href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $current_image_url;?>" target="_blank" class='wdi_share_popup_btn wdi_facebook tenweb-i tenweb-i-facebook-square'></a>
408
- <a id="wdi_popup_tw" href="https://twitter.com/home?status=<?php echo $current_image_url;?>" target="_blank" class='wdi_share_popup_btn wdi_twitter tenweb-i tenweb-i-twitter-square'></a>
409
- <a id="wdi_popup_li" href="https://www.linkedin.com/shareArticle?mini=true&url=<?php echo $current_image_url;?>&title=<?php echo $current_image_description?>" target="_blank" class='wdi_share_popup_btn wdi_linkedin tenweb-i tenweb-i-linkedin-square'></a>
410
- <a id="wdi_popup_pt" href="https://pinterest.com/pin/create/button/?url=<?php echo $current_image_url;?>&media=<?php echo $current_image_url;?>media/?size=l&description=<?php echo $current_image_description?>" target="_blank" class='wdi_share_popup_btn wdi_pinterest tenweb-i tenweb-i-pinterest-square'></a>
411
- </p>
412
- <i class="wdi_share_caret " style="display:none;"></i>
413
- </span>
414
-
415
-
416
- <?php
417
- }
418
-
419
-
420
- if ($option_row->popup_enable_fullsize_image) {
421
- ?>
422
- <a id="wdi_fullsize_image" href="<?php echo !$is_embed ? site_url() . '/' . $WD_WDI_UPLOAD_DIR . $current_image_url : $current_image_url; ?>" target="_blank">
423
- <i title="<?php echo __('Open image in Instagram.', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn tenweb-i tenweb-i-instagram"></i>
424
- </a>
425
- <?php
426
- }
427
- if ($option_row->popup_enable_download) {
428
- $style = 'none';
429
- $current_image_arr = explode('/', $current_image_url);
430
- if (!$is_embed) {
431
- $download_href = site_url() . '/' . $WD_WDI_UPLOAD_DIR . $current_image_url;
432
- $style = 'inline-block';
433
- }
434
- elseif (preg_match('/FLICKR/', $current_filetype) == 1) {
435
- $download_href = $current_filename;
436
- $style = 'inline-block';
437
- }
438
- elseif (preg_match('/INSTAGRAM/', $current_filetype) == 1) {
439
- if(preg_match('/IMAGE/',$current_filetype) == 1){
440
- $download_href = substr_replace($current_thumb_url, 'l', -1);
441
- }
442
- if(preg_match('/VIDEO/',$current_filetype) == 1){
443
- $download_href = $current_filename;
444
- }
445
-
446
-
447
- $style = 'inline-block';
448
- }
449
- ?>
450
- <a id="wdi_download" href="<?php echo $download_href; ?>" target="_blank" download="<?php echo end($current_image_arr); ?>" style="display: <?php echo $style; ?>;">
451
- <i title="<?php echo __('Download original image', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn tenweb-i tenweb-i-download"></i>
452
- </a>
453
- <?php
454
- }
455
- ?>
456
- </div>
457
- <div class="wdi_toggle_container">
458
- <i class="wdi_toggle_btn tenweb-i <?php echo (($theme_row->lightbox_ctrl_btn_pos == 'top') ? 'tenweb-i-angle-up' : 'tenweb-i-angle-down'); ?>"></i>
459
- </div>
460
- <?php } ?>
461
- </div>
462
- <?php
463
- }
464
- $current_pos = 0;
465
 
466
- if ($enable_image_filmstrip) {
467
  $current_pos = $current_image_index * (($filmstrip_direction == 'horizontal' ? $image_filmstrip_width : $image_filmstrip_height) + $filmstrip_thumb_margin_hor);
468
  $current_key = $current_image_index;
469
  ?>
@@ -480,7 +459,7 @@ continue;
480
  <div class="wdi_title" onclick="window.open('//instagram.com/<?php echo $current_image_user_name; ?>','_blank')">
481
  <div class="wdi_header_text"><?php echo $current_image_user_name;?></div>
482
  <?php if(!empty($current_image_user_pic)): ?>
483
- <div class="wdi_users_img_wrap"><img src="<?php echo $current_image_user_pic;?>" alt=""></div>
484
  <?php endif;?>
485
  </div>
486
  </div>
@@ -489,170 +468,72 @@ continue;
489
  </span>
490
  </div>
491
  </div>
492
-
493
  <div class="wdi_slide_container">
494
  <div class="wdi_slide_bg">
495
  <div class="wdi_slider">
496
  <?php
497
  $current_key = -6;
498
  foreach ($image_rows as $key => $image_row) {
499
-
500
- $is_embed = preg_match('/EMBED/',$image_row->filetype)==1 ? true :false;
501
- $is_embed_instagram_post = preg_match('/INSTAGRAM_POST/',$image_row->filetype)==1 ? true :false;
502
- if ($image_row->id == $current_image_id) {
 
 
 
 
503
  $current_key = $current_image_index;
504
  ?>
505
- <span class="wdi_popup_image_spun" id="wdi_popup_image" image_id="<?php echo $image_row->id; ?>">
506
  <span class="wdi_popup_image_spun1" style="display: table; width: inherit; height: inherit;">
507
  <span class="wdi_popup_image_spun2" style="display: table-cell; vertical-align: middle; text-align: center;">
508
  <?php
509
- if (!$is_embed) {
510
  ?>
511
- <img class="wdi_popup_image wdi_popup_watermark" src="<?php echo site_url() . '/' . $WD_WDI_UPLOAD_DIR . $image_row->image_url; ?>" alt="<?php echo $image_row->alt; ?>" />
512
-
513
  <?php
514
- }
515
- else { /*$is_embed*/ ?>
516
- <span class="wdi_popup_embed wdi_popup_watermark" style="display:table; table-layout:fixed;">
517
- <?php
518
  if($is_embed_instagram_post){
519
  $post_width = $image_width - ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0);
520
  $post_height = $image_height - ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0);
521
  if($post_height <$post_width +88 ){
522
- $post_width =$post_height -88;
523
  }
524
  else{
525
- $post_height =$post_width +88;
526
  }
527
- WDILibraryEmbed::display_embed($image_row->filetype, $image_row->filename, array('class'=>"wdi_embed_frame", 'frameborder'=>"0", 'style'=>"width:".$post_width."px; height:".$post_height."px; vertical-align:middle; display:inline-block; position:relative;"), $carousel_media);
528
  }
529
  else{
530
- WDILibraryEmbed::display_embed($image_row->filetype, $image_row->filename, array('class'=>"wdi_embed_frame", 'frameborder'=>"0", 'allowfullscreen'=>"allowfullscreen", 'style'=>"width:inherit; height:inherit; vertical-align:middle; display:table-cell;"), $carousel_media);
531
  }
532
  ?>
533
  </span>
534
  <?php
535
- }
536
  ?>
537
  </span>
538
  </span>
539
  </span>
540
- <span class="wdi_popup_image_second_spun">
541
  </span>
542
- <input type="hidden" id="wdi_current_image_key" value="<?php echo $current_image_index; ?>" />
543
- <?php
544
- break;
545
- }
546
- }
547
- ?>
548
- </div>
549
- </div>
550
- </div>
551
- <a id="wdi_spider_popup_left" <?php echo ($option_row->enable_loop == 0 && $current_key == 0) ? 'style="display: none;"' : ''; ?>><span id="wdi_spider_popup_left-ico"><span><i class="wdi_prev_btn tenweb-i <?php echo $theme_row->lightbox_rl_btn_style; ?>-left-sm"></i></span></span></a>
552
- <a id="wdi_spider_popup_right" <?php echo ($option_row->enable_loop == 0 && $current_key == $image_rows_count - 1) ? 'style="display: none;"' : ''; ?>><span id="wdi_spider_popup_right-ico"><span><i class="wdi_next_btn tenweb-i <?php echo $theme_row->lightbox_rl_btn_style; ?>-right-sm"></i></span></span></a>
553
- </div>
554
- </div>
555
- <?php if ($enable_comment_social) { ?>
556
- <div class="wdi_comment_wrap">
557
- <div class="wdi_comment_container wdi_close">
558
- <div id="ajax_loading" style="position:absolute;">
559
- <div id="opacity_div" style="display:none; background-color:rgba(255, 255, 255, 0.2); position:absolute; z-index:10150;"></div>
560
- <span id="loading_div" style="display:none; text-align:center; position:relative; vertical-align:middle; z-index:10170">
561
- <img src="<?php echo WDI_URL . '/images/ajax_loader.png'; ?>" class="wdi_spider_ajax_loading" style="width:50px;">
562
- </span>
563
- </div>
564
- <div class="wdi_comments">
565
- <?php
566
- $captcha_error_message = '';
567
- $email_error_message = '';
568
- $wdi_name = '';
569
- $wdi_comment = '';
570
- $wdi_email = '';
571
- $ajax_task = WDILibrary::get('ajax_task', '');
572
- if ( isset($ajax_task) && $ajax_task === 'save' ) {
573
- if ($option_row->popup_enable_captcha) {
574
- $wdi_captcha_input = WDILibrary::get('wdi_captcha_input', '');
575
- @session_start();
576
- $wdi_captcha_code = (isset($_SESSION['wdi_captcha_code']) ? esc_html(stripslashes($_SESSION['wdi_captcha_code'])) : '');
577
- if ($wdi_captcha_input !== $wdi_captcha_code) {
578
- $captcha_error_message = __('Error. Incorrect Verification Code.', "wd-instagram-feed");
579
- $wdi_name = WDILibrary::get('wdi_name', '');
580
- $wdi_comment = WDILibrary::get('wdi_comment', '');
581
- $wdi_email = WDILibrary::get('wdi_email', '');
582
- }
583
- }
584
-
585
- $wdi_email = WDILibrary::get('wdi_email', '');
586
- if ($option_row->popup_enable_email && isset($wdi_email) && !is_email(stripslashes($wdi_email))) {
587
- $email_error_message = __( 'This is not a valid email address.', "wd-instagram-feed" );
588
- $wdi_name = WDILibrary::get('wdi_name', '');
589
- $wdi_comment = WDILibrary::get('wdi_comment', '');
590
- }
591
  }
592
- ?>
593
- <div id="wdi_comments">
594
- <div title="<?php echo __('Hide Comments', "wd-instagram-feed"); ?>" class="wdi_comments_close">
595
- <i class="wdi_comments_close_btn tenweb-i tenweb-i-arrow-<?php echo $theme_row->lightbox_comment_pos; ?>"></i>
596
- </div>
597
-
598
- <form id="wdi_comment_form" style="display:none !important;" method="post" action="<?php echo $popup_url; ?>"><!--Deprecated-->
599
- <p><label for="wdi_name"><?php echo __('Name', "wd-instagram-feed"); ?> * </label></p>
600
- <p><input type="text" name="wdi_name" id="wdi_name" <?php echo ((get_current_user_id() != 0) ? 'readonly="readonly"' : ''); ?>
601
- value="<?php echo ((get_current_user_id() != 0) ? get_userdata(get_current_user_id())->display_name : $wdi_name); ?>" /></p>
602
- <?php
603
- if ($option_row->popup_enable_email) {
604
- ?>
605
- <p><label for="wdi_email"><?php echo __('Email', "wd-instagram-feed"); ?> * </label></p>
606
- <p><input type="text" name="wdi_email" id="wdi_email"
607
- value="<?php echo ((get_current_user_id() != 0) ? get_userdata(get_current_user_id())->user_email : $wdi_email); ?>" /></p>
608
- <p><span class="wdi_comment_error"><?php echo $email_error_message; ?></span></p>
609
- <?php
610
- }
611
- ?>
612
- <p><label for="wdi_comment"><?php echo __('Comment', "wd-instagram-feed"); ?> * </label></p>
613
- <p><textarea class="wdi_comment_textarea" name="wdi_comment" id="wdi_comment"><?php echo $wdi_comment; ?></textarea></p>
614
- <?php
615
- if ($option_row->popup_enable_captcha) {
616
- ?>
617
- <p><label for="wdi_captcha_input"><?php echo __('Verification Code', "wd-instagram-feed"); ?></label></p>
618
- <p>
619
- <input id="wdi_captcha_input" name="wdi_captcha_input" class="wdi_captcha_input" type="text">
620
- <img id="wdi_captcha_img" class="wdi_captcha_img" type="captcha" digit="6" src="<?php echo add_query_arg(array('action' => 'wdi_captcha', 'digit' => 6, 'i' => ''), admin_url('admin-ajax.php')); ?>" onclick="wdi_captcha_refresh('wdi_captcha')" ontouchend="wdi_captcha_refresh('wdi_captcha')" />
621
- <span id="wdi_captcha_refresh" class="wdi_captcha_refresh" onclick="wdi_captcha_refresh('wdi_captcha')" ontouchend="wdi_captcha_refresh('wdi_captcha')"></span>
622
- </p>
623
- <p><span class="wdi_comment_error"><?php echo $captcha_error_message; ?></span></p>
624
- <?php
625
- }
626
- ?>
627
- <p><input onclick="if (wdi_spider_check_required('wdi_name', '<?php echo __('Name', "wd-instagram-feed"); ?>') <?php if ($option_row->popup_enable_email) { ?> || wdi_spider_check_required('wdi_email', '<?php echo __('Email', "wd-instagram-feed"); ?>') || wdi_spider_check_email('wdi_email') <?php } ?> || wdi_spider_check_required('wdi_comment', '<?php echo __('Comment', "wd-instagram-feed"); ?>')) { return false;}
628
- var cur_image_key = parseInt(jQuery('#wdi_current_image_key').val());
629
- ++wdi_data[cur_image_key]['comment_count'];
630
- wdi_spider_set_input_value('ajax_task', 'save');
631
- wdi_spider_set_input_value('image_id', jQuery('#wdi_popup_image').attr('image_id'));
632
- wdi_spider_ajax_save('wdi_comment_form');
633
- return false;"
634
- ontouchend="if (wdi_spider_check_required('wdi_name', '<?php echo __('Name', "wd-instagram-feed"); ?>') <?php if ($option_row->popup_enable_email) { ?> || wdi_spider_check_required('wdi_email', '<?php echo __('Email', "wd-instagram-feed"); ?>') || wdi_spider_check_email('wdi_email') <?php } ?> || wdi_spider_check_required('wdi_comment', '<?php echo __('Comment', "wd-instagram-feed"); ?>')) {return false;}
635
- var cur_image_key = parseInt(jQuery('#wdi_current_image_key').val());
636
- ++wdi_data[cur_image_key]['comment_count'];
637
- wdi_spider_set_input_value('ajax_task', 'save');
638
- wdi_spider_set_input_value('image_id', jQuery('#wdi_popup_image').attr('image_id'));
639
- wdi_spider_ajax_save('wdi_comment_form');
640
- return false;" class="wdi_submit" type="submit" name="wdi_submit" id="wdi_submit" value="<?php echo __('Submit', "wd-instagram-feed"); ?>" /></p>
641
- <?php
642
- $wdi_comment = WDILibrary::get('wdi_comment', '');
643
- echo ( !current_user_can('manage_options') && ( $comment_moderation && isset($wdi_comment)) ) ? __('Your comment is awaiting moderation', "wd-instagram-feed") : ''; ?>
644
- <input id="ajax_task" name="ajax_task" type="hidden" value="" />
645
- <input id="image_id" name="image_id" type="hidden" value="<?php echo $image_id; ?>" />
646
- <input id="comment_id" name="comment_id" type="hidden" value="" />
647
- </form>
648
- </div>
649
- <div id="wdi_added_comments">
650
- <p class="wdi_no_comment"><?php _e('There are no comments to show','wd-instagram-feed');?></p>
651
  </div>
652
  </div>
653
  </div>
 
 
654
  </div>
655
- <?php } ?>
656
  <a class="wdi_spider_popup_close" onclick="wdi_spider_destroypopup(1000); return false;" ontouchend="wdi_spider_destroypopup(1000); return false;"><span><i class="wdi_close_btn tenweb-i tenweb-i-times"></i></span></a>
657
  <script>
658
  var wdi_trans_in_progress = false;
@@ -740,7 +621,9 @@ continue;
740
  jQuery(".wdi_filmstrip_right").show();
741
  }
742
  }
 
743
  function wdi_change_image(current_key, key, wdi_data, from_effect) {
 
744
  wdi_pause_stream('#wdi_image_container');
745
  jQuery("#wdi_spider_popup_left").show();
746
  jQuery("#wdi_spider_popup_right").show();
@@ -758,19 +641,19 @@ continue;
758
  jQuery(this)[0].contentWindow.postMessage('{ "method": "pause" }', "*");
759
  jQuery(this)[0].contentWindow.postMessage('pause', '*');
760
  });
761
-
762
  if (typeof wdi_data[key] != 'undefined') {
763
  if (typeof wdi_data[current_key] != 'undefined') {
764
  if (jQuery('.wdi_ctrl_btn').hasClass('tenweb-i-pause')) {
765
-
766
  wdi_play();
767
  }
768
  if (!from_effect) {
769
  /* Change image key.*/
770
  jQuery("#wdi_current_image_key").val(key);
771
  /*if (current_key == '-1') {
772
- current_key = jQuery(".wdi_thumb_active").children("img").attr("image_key");
773
- }*/
774
  }
775
  if (wdi_trans_in_progress) {
776
  event_stack.push(current_key + '-' + key);
@@ -784,7 +667,7 @@ continue;
784
  return;
785
  }
786
  /*jQuery("#wdi_spider_popup_left").hover().css({"display": "inline"});
787
- jQuery("#wdi_spider_popup_right").hover().css({"display": "inline"});*/
788
  jQuery(".wdi_image_count").html(wdi_data[key]["number"]);
789
  /* Set active thumbnail position.*/
790
  wdi_current_filmstrip_pos = key * (jQuery(".wdi_filmstrip_thumbnail").<?php echo $width_or_height; ?>() + 2 + 2 * <?php echo $theme_row->lightbox_filmstrip_thumb_border_width; ?>);
@@ -804,7 +687,7 @@ continue;
804
  jQuery(".wdi_image_hits span").html(++wdi_data[key]["hit_count"]);
805
  /* Change image id.*/
806
  jQuery("#wdi_popup_image").attr('image_id', wdi_data[key]["id"]);
807
-
808
 
809
  //creating image title template
810
  var wdi_title_div = jQuery('<div class="wdi_title"></div>').on('click',function(){window.open('//instagram.com/'+wdi_data[key]['username'],'_blank');});
@@ -813,11 +696,11 @@ continue;
813
 
814
  //resetting title and description for custom scrollbar
815
  jQuery('.wdi_image_info_spun').html('<div class="wdi_image_info" >'+
816
- '<div class="wdi_image_title"></div>'+
817
- '<div class="wdi_image_description"></div>'+
818
- '</div>');
819
 
820
- /* Change carousel media dots*/
821
  if (typeof wdi_data[key]['carousel_media'] != "undefined" && wdi_data[key]['carousel_media'] != null) {
822
  if(jQuery(".wdi_carousel_btn_container").length){
823
  jQuery(".wdi_carousel_btn_container").remove();
@@ -837,14 +720,14 @@ continue;
837
  jQuery(".wdi_carousel_btn_container").remove();
838
  }
839
  }
840
-
841
  /* Change image title, description.*/
842
  jQuery(".wdi_image_title").html(jQuery('<span style="display: block;" />').append(wdi_title_div));
843
  jQuery(".wdi_image_description").html(jQuery('<span style="display: block;" />').text(wdi_data[key]["description"]).text());
844
  jQuery(".wdi_image_info").removeAttr("style");
845
  if (wdi_data[key]["alt"].trim() == "") {
846
  if (wdi_data[key]["description"].trim() == "") {
847
- jQuery(".wdi_image_info").css("background", "none");
848
  }
849
  }
850
  if (jQuery(".wdi_image_info_container1").css("display") != 'none') {
@@ -862,7 +745,7 @@ continue;
862
  }
863
  var current_image_class = jQuery(".wdi_popup_image_spun").css("zIndex") == 2 ? ".wdi_popup_image_spun" : ".wdi_popup_image_second_spun";
864
  var next_image_class = current_image_class == ".wdi_popup_image_second_spun" ? ".wdi_popup_image_spun" : ".wdi_popup_image_second_spun";
865
-
866
  var is_embed = wdi_data[key]['filetype'].indexOf("EMBED_") > -1 ? true : false;
867
  var is_embed_instagram_post = wdi_data[key]['filetype'].indexOf('INSTAGRAM_POST') > -1 ? true :false;
868
  var cur_height = jQuery(current_image_class).height();
@@ -879,11 +762,11 @@ continue;
879
  var post_height = 0;
880
  if(cur_height <cur_width +88 ){
881
  post_height = cur_height;
882
- post_width = post_height -88;
883
  }
884
  else{
885
  post_width = cur_width;
886
- post_height = post_width +88 ;
887
  }
888
  innhtml += wdi_spider_display_embed(wdi_data[key]['filetype'], wdi_data[key]['filename'], {class:"wdi_embed_frame", frameborder:"0", allowfullscreen:"allowfullscreen", style:"width:"+post_width+"px; height:"+post_height+"px; vertical-align:middle; display:inline-block; position:relative; top: "+0.5*(cur_height-post_height)+ "px; " },wdi_data[key]['carousel_media']);
889
  }
@@ -894,14 +777,14 @@ continue;
894
  }
895
  innhtml += '</span></span>';
896
  jQuery(next_image_class).html(innhtml);
897
-
898
  function wdi_afterload() {
899
 
900
 
901
  //setting max-heigth for custom scrollbar
902
  var wdi_desc_max_height = jQuery('.wdi_image_info_container1').height()-jQuery(".wdi_ctrl_btn_container").height()-parseInt(jQuery('.wdi_image_info').css('margin-bottom'))-parseInt(jQuery('.wdi_image_info').css('padding-bottom'));
903
  jQuery('.wdi_image_info').css('max-height',wdi_desc_max_height);
904
- //jQuery('.wdi_image_info').mCustomScrollbar({scrollInertia: 250});
905
 
906
  <?php
907
  if (isset($option_row->preload_images)) {
@@ -923,7 +806,7 @@ continue;
923
  jQuery("#wdi_download").attr("href", wdi_data[key]['thumb_url'].substring(0, wdi_data[key]['thumb_url'].length - 1) + 'l');
924
  }
925
  else {
926
- jQuery("#wdi_download").hide();
927
  }
928
  }
929
  var image_arr = wdi_data[key]['image_url'].split("/");
@@ -932,7 +815,7 @@ continue;
932
  jQuery("#wdi_download").attr("download", image_arr[image_arr.length - 1]);
933
  /* Change image social networks urls.*/
934
  var wdi_share_url = encodeURIComponent("<?php echo add_query_arg(array('action' => 'Share', 'curr_url' => $current_url, 'image_id' => ''), admin_url('admin-ajax.php')); ?>") + "=" + wdi_data[key]['id'] + encodeURIComponent('#wdi<?php echo $gallery_id; ?>/') + wdi_data[key]['id'];
935
-
936
  if (is_embed) {
937
  var wdi_share_image_url = encodeURIComponent(wdi_data[key]['thumb_url']);
938
  }
@@ -952,7 +835,6 @@ continue;
952
  //share popup urls
953
  jQuery("#wdi_popup_fb").attr('href',"https://www.facebook.com/sharer/sharer.php?u="+wdi_image_url);
954
  jQuery("#wdi_popup_tw").attr('href',"https://twitter.com/share?url=" + wdi_image_url);
955
- jQuery("#wdi_popup_gp").attr('href',"https://plus.google.com/share?url=" + wdi_image_url);
956
  jQuery('#wdi_popup_li').attr('href',"https://www.linkedin.com/shareArticle?mini=true&url="+wdi_image_url+"&title="+wdi_image_description);
957
  jQuery('#wdi_popup_pt').attr('href',"https://pinterest.com/pin/create/button/?url="+wdi_image_url+"&media="+wdi_image_url+"media/?size=l&description="+wdi_image_description);
958
  /* Load comments.*/
@@ -981,9 +863,9 @@ continue;
981
  // jQuery(".mCSB_scrollTools").hide();
982
  <?php
983
  if ($enable_image_filmstrip) {
984
- ?>
985
- wdi_move_filmstrip();
986
- <?php
987
  }
988
  ?>
989
 
@@ -1013,11 +895,11 @@ continue;
1013
  wdi_change_image(parseInt(jQuery('#wdi_current_image_key').val()), parseInt(jQuery('#wdi_current_image_key').val()) - 1, wdi_data)
1014
  }
1015
  else if (e.keyCode === 27) { /* Esc.*/
1016
- wdi_spider_destroypopup(1000);
1017
- }
1018
- else if (e.keyCode === 32) { /* Space.*/
1019
- jQuery(".wdi_play_pause").trigger('click');
1020
- }
1021
  });
1022
  function wdi_preload_images(key) {
1023
  count = <?php echo (int) $option_row->preload_images_count / 2; ?>;
@@ -1083,7 +965,7 @@ continue;
1083
  });
1084
 
1085
  jQuery(".wdi_image_container").css({height: (<?php echo $image_height - ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>)});
1086
-
1087
  jQuery(".wdi_popup_image").css({
1088
  maxHeight: <?php echo $image_height - ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>
1089
  });
@@ -1097,7 +979,7 @@ continue;
1097
  <?php } ?>
1098
  wdi_popup_current_height = <?php echo $image_height; ?>;
1099
  }
1100
- else {
1101
  jQuery("#wdi_spider_popup_wrap").css({
1102
  height: jQuery(window).height(),
1103
  top: 0,
@@ -1105,7 +987,7 @@ continue;
1105
  zIndex: 100000
1106
  });
1107
  jQuery(".wdi_image_container").css({height: (jQuery(window).height() - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>)});
1108
-
1109
  jQuery(".wdi_popup_image").css({
1110
  maxHeight: jQuery(window).height() - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>
1111
  });
@@ -1128,7 +1010,7 @@ continue;
1128
  });
1129
  jQuery(".wdi_image_wrap").css({width: <?php echo $image_width; ?> - comment_container_width});
1130
  jQuery(".wdi_image_container").css({width: (<?php echo $image_width - ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?> - comment_container_width)});
1131
-
1132
  jQuery(".wdi_popup_image").css({
1133
  maxWidth: <?php echo $image_width - ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?> - comment_container_width
1134
  });
@@ -1142,7 +1024,7 @@ continue;
1142
  <?php } ?>
1143
  wdi_popup_current_width = <?php echo $image_width; ?>;
1144
  }
1145
- else {
1146
  jQuery("#wdi_spider_popup_wrap").css({
1147
  width: jQuery(window).width(),
1148
  left: 0,
@@ -1151,7 +1033,7 @@ continue;
1151
  });
1152
  jQuery(".wdi_image_wrap").css({width: (jQuery(window).width() - comment_container_width)});
1153
  jQuery(".wdi_image_container").css({width: (jQuery(window).width() - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?> - comment_container_width)});
1154
-
1155
  jQuery(".wdi_popup_image").css({
1156
  maxWidth: jQuery(window).width() - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?> - comment_container_width
1157
  });
@@ -1170,7 +1052,7 @@ continue;
1170
  if (!(!(jQuery(window).height() > <?php echo $image_height - 2 * $theme_row->lightbox_close_btn_top; ?>) || !(jQuery(window).width() >= <?php echo $image_width - 2 * $theme_row->lightbox_close_btn_right; ?>) || !(<?php echo $open_with_fullscreen; ?> != 1))) {
1171
  jQuery(".wdi_spider_popup_close_fullscreen").attr("class", "wdi_spider_popup_close");
1172
  }
1173
- else {
1174
  if (!(!(jQuery("#wdi_spider_popup_wrap").width() <= jQuery(window).width()) || !(jQuery("#wdi_spider_popup_wrap").height() <= jQuery(window).height()))) {
1175
  jQuery(".wdi_spider_popup_close").attr("class", "wdi_ctrl_btn wdi_spider_popup_close_fullscreen");
1176
  }
@@ -1192,7 +1074,7 @@ continue;
1192
  function wdi_comment() {
1193
 
1194
  if (jQuery(".wdi_comment_container").hasClass("wdi_open")) {
1195
-
1196
  /* Close comment.*/
1197
  var border_width = parseInt(jQuery(".wdi_comment_container").css('borderRightWidth'));
1198
  if (!border_width) {
@@ -1200,25 +1082,25 @@ continue;
1200
  }
1201
  jQuery(".wdi_comment_container").animate({<?php echo $theme_row->lightbox_comment_pos; ?>: -jQuery(".wdi_comment_container").width() - border_width}, 500);
1202
  jQuery(".wdi_image_wrap").animate({
1203
- <?php echo $theme_row->lightbox_comment_pos; ?>: 0,
1204
  width: jQuery("#wdi_spider_popup_wrap").width()
1205
- }, 500);
1206
  jQuery(".wdi_image_container").animate({
1207
  width: jQuery("#wdi_spider_popup_wrap").width() - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>}, 500);
1208
  jQuery(".wdi_popup_image").animate({
1209
- maxWidth: jQuery("#wdi_spider_popup_wrap").width() - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>
1210
- }, {
1211
- duration: 500,
1212
- complete: function () { wdi_change_watermark_container(); }
1213
- });
1214
  jQuery(".wdi_popup_embed").animate({
1215
- width: jQuery("#wdi_spider_popup_wrap").width() - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>
1216
- }, {
1217
- duration: 500,
1218
- complete: function () {
1219
- wdi_resize_instagram_post();
1220
- wdi_change_watermark_container(); }
1221
- });
1222
  jQuery(".wdi_filmstrip_container").animate({<?php echo $width_or_height; ?>: jQuery(".wdi_spider_popup_wrap").<?php echo $width_or_height; ?>()}, 500);
1223
  jQuery(".wdi_filmstrip").animate({<?php echo $width_or_height; ?>: jQuery(".wdi_spider_popup_wrap").<?php echo $width_or_height; ?>() - 40}, 500);
1224
  /* Set filmstrip initial position.*/
@@ -1226,11 +1108,8 @@ continue;
1226
  jQuery(".wdi_comment_container").attr("class", "wdi_comment_container wdi_close");
1227
  jQuery(".wdi_comment").attr("title", "<?php echo __('Show Comments', "wd-instagram-feed"); ?>");
1228
  jQuery(".wdi_spider_popup_close_fullscreen").show();
1229
- // console.log("has open:"+jQuery(".wdi_comment_container").hasClass("wdi_open"));
1230
- // console.log("has clos:"+jQuery(".wdi_comment_container").hasClass("wdi_close"));
1231
  }
1232
  else {
1233
-
1234
  /* Open comment.*/
1235
  var comment_container_width = <?php echo $theme_row->lightbox_comment_width; ?>;
1236
  if (comment_container_width > jQuery(window).width()) {
@@ -1249,24 +1128,24 @@ continue;
1249
  }
1250
  jQuery(".wdi_comment_container").animate({<?php echo $theme_row->lightbox_comment_pos; ?>: 0}, 500);
1251
  jQuery(".wdi_image_wrap").animate({
1252
- <?php echo $theme_row->lightbox_comment_pos; ?>: jQuery(".wdi_comment_container").width(),
1253
  width: jQuery("#wdi_spider_popup_wrap").width() - jQuery(".wdi_comment_container").width()}, 500);
1254
  jQuery(".wdi_image_container").animate({
1255
  width: jQuery("#wdi_spider_popup_wrap").width() - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?> - jQuery(".wdi_comment_container").width()}, 500);
1256
  jQuery(".wdi_popup_image").animate({
1257
- maxWidth: jQuery("#wdi_spider_popup_wrap").width() - jQuery(".wdi_comment_container").width() - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>
1258
- }, {
1259
- duration: 500,
1260
- complete: function () { wdi_change_watermark_container(); }
1261
- });
1262
  jQuery(".wdi_popup_embed").animate({
1263
- width: jQuery("#wdi_spider_popup_wrap").width() - jQuery(".wdi_comment_container").width() - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>
1264
- }, {
1265
- duration: 500,
1266
- complete: function () {
1267
- wdi_resize_instagram_post();
1268
- wdi_change_watermark_container(); }
1269
- });
1270
  jQuery(".wdi_filmstrip_container").css({<?php echo $width_or_height; ?>: jQuery("#wdi_spider_popup_wrap").<?php echo $width_or_height; ?>() - <?php echo ($filmstrip_direction == 'vertical' ? 0: 'jQuery(".wdi_comment_container").width()'); ?>});
1271
  jQuery(".wdi_filmstrip").animate({<?php echo $width_or_height; ?>: jQuery(".wdi_filmstrip_container").<?php echo $width_or_height; ?>() - 40}, 500);
1272
  /* Set filmstrip initial position.*/
@@ -1274,6 +1153,7 @@ continue;
1274
  jQuery(".wdi_comment_container").attr("class", "wdi_comment_container wdi_open");
1275
  jQuery(".wdi_comment").attr("title", "<?php echo __('Hide Comments', "wd-instagram-feed"); ?>");
1276
  /* Load comments.*/
 
1277
  var cur_image_key = parseInt(jQuery("#wdi_current_image_key").val());
1278
  if (wdi_data[cur_image_key]["comment_count"] != 0) {
1279
  jQuery("#wdi_added_comments").show();/*deprecated*/
@@ -1281,12 +1161,20 @@ continue;
1281
  wdi_spider_set_input_value('image_id', jQuery('#wdi_popup_image').attr('image_id'));/*deprecated*/
1282
  wdi_spider_ajax_save('wdi_comment_form',cur_image_key);/*deprecated*/
1283
  }else{
1284
- jQuery("#wdi_added_comments").html('<p class="wdi_no_comment"><?php _e('There are no comments to show','wd-instagram-feed');?></p>');
1285
  }
1286
  }
1287
  }
1288
 
1289
  jQuery(document).ready(function () {
 
 
 
 
 
 
 
 
1290
  <?php
1291
  if ($image_right_click) {
1292
  ?>
@@ -1461,21 +1349,23 @@ continue;
1461
  if (jQuery(".wdi_image_info_container1").css("display") == 'none') {
1462
  jQuery(".wdi_image_info_container1").css("display", "table-cell");
1463
  jQuery(".wdi_info").attr("title", "<?php echo __('Hide info', "wd-instagram-feed"); ?>");
 
1464
 
1465
 
1466
- /* for free version */
1467
- /* if(!jQuery('.wdi_image_info').hasClass('mCustomScrollbar')){
1468
- var wdi_desc_max_height = <?php echo $image_height - ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?> -jQuery(".wdi_ctrl_btn_container").height()-parseInt(jQuery('.wdi_image_info').css('margin-bottom'))-parseInt(jQuery('.wdi_image_info').css('padding-bottom'));
1469
- jQuery('.wdi_image_info').css('max-height',wdi_desc_max_height+"px");
1470
- jQuery('.wdi_image_info').mCustomScrollbar({scrollInertia: 250});
1471
- }*/
1472
- }
 
1473
  else {
1474
  jQuery(".wdi_image_info_container1").css("display", "none");
1475
  jQuery(".wdi_info").attr("title", "<?php echo __('Show info', "wd-instagram-feed"); ?>");
1476
  }
1477
 
1478
-
1479
  });
1480
  /* Show/hide image rating.*/
1481
  jQuery(".wdi_rate").on(wdi_click, function() {
@@ -1499,50 +1389,50 @@ continue;
1499
  if (jQuery(".wdi_toggle_container i").hasClass(wdi_open_toggle_btn_class)) {
1500
  /* Close controll buttons.*/
1501
  <?php
1502
- if ((!$enable_image_filmstrip || $theme_row->lightbox_filmstrip_pos != 'bottom') && $theme_row->lightbox_ctrl_btn_pos == 'bottom' && $theme_row->lightbox_info_pos == 'bottom') {
1503
- ?>
1504
- jQuery(".wdi_image_info").animate({bottom: 0}, 500);
1505
- <?php
1506
- }
1507
- elseif ((!$enable_image_filmstrip || $theme_row->lightbox_filmstrip_pos != 'top') && $theme_row->lightbox_ctrl_btn_pos == 'top' && $theme_row->lightbox_info_pos == 'top') {
1508
- ?>
1509
- jQuery(".wdi_image_info").animate({top: 0}, 500);
1510
- <?php
1511
- }
1512
-
1513
  ?>
1514
  jQuery(".wdi_ctrl_btn_container").animate({<?php echo $theme_row->lightbox_ctrl_btn_pos; ?>: '-' + jQuery(".wdi_ctrl_btn_container").height() - 16}, 500);
1515
- jQuery(".wdi_carousel_btn_container").animate({<?php echo $theme_row->lightbox_ctrl_btn_pos; ?>: '40px'}, 500);
1516
  jQuery(".wdi_toggle_container").animate({
1517
- <?php echo $theme_row->lightbox_ctrl_btn_pos; ?>: 0
1518
- }, {
1519
- duration: 500,
1520
  complete: function () { jQuery(".wdi_toggle_container i").attr("class", "wdi_toggle_btn tenweb-i " + wdi_close_toggle_btn_class) }
1521
- });
1522
  }
1523
  else {
1524
  /* Open controll buttons.*/
1525
  <?php
1526
- if ((!$enable_image_filmstrip || $theme_row->lightbox_filmstrip_pos != 'bottom') && $theme_row->lightbox_ctrl_btn_pos == 'bottom' && $theme_row->lightbox_info_pos == 'bottom') {
1527
- ?>
1528
- jQuery(".wdi_image_info").animate({bottom: jQuery(".wdi_ctrl_btn_container").height()}, 500);
1529
- <?php
1530
- }
1531
- elseif ((!$enable_image_filmstrip || $theme_row->lightbox_filmstrip_pos != 'top') && $theme_row->lightbox_ctrl_btn_pos == 'top' && $theme_row->lightbox_info_pos == 'top') {
1532
- ?>
1533
- jQuery(".wdi_image_info").animate({top: jQuery(".wdi_ctrl_btn_container").height()}, 500);
1534
- <?php
1535
- }
1536
-
1537
  ?>
1538
  jQuery(".wdi_ctrl_btn_container").animate({<?php echo $theme_row->lightbox_ctrl_btn_pos; ?>: 0}, 500);
1539
- jQuery(".wdi_carousel_btn_container").animate({<?php echo $theme_row->lightbox_ctrl_btn_pos; ?>: jQuery(".wdi_ctrl_btn_container").height() + 25}, 500);
1540
  jQuery(".wdi_toggle_container").animate({
1541
- <?php echo $theme_row->lightbox_ctrl_btn_pos; ?>: jQuery(".wdi_ctrl_btn_container").height() + 16
1542
- }, {
1543
- duration: 500,
1544
  complete: function () { jQuery(".wdi_toggle_container i").attr("class", "wdi_toggle_btn tenweb-i " + wdi_open_toggle_btn_class) }
1545
- });
1546
  }
1547
 
1548
 
@@ -1576,34 +1466,34 @@ continue;
1576
  jQuery(".wdi_image_wrap").animate({width: wdi_popup_current_width - comment_container_width}, 500);
1577
  jQuery(".wdi_image_container").animate({height: wdi_popup_current_height - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>, width: wdi_popup_current_width - comment_container_width - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>}, 500);
1578
  jQuery(".wdi_popup_image").animate({
1579
- maxWidth: wdi_popup_current_width - comment_container_width - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>,
1580
- maxHeight: wdi_popup_current_height - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>
1581
- }, {
1582
- duration: 500,
1583
- complete: function () {
1584
- wdi_change_watermark_container();
1585
- if ((jQuery("#wdi_spider_popup_wrap").width() < jQuery(window).width())) {
1586
- if (jQuery("#wdi_spider_popup_wrap").height() < jQuery(window).height()) {
1587
- jQuery(".wdi_spider_popup_close_fullscreen").attr("class", "wdi_spider_popup_close");
 
1588
  }
1589
  }
1590
- }
1591
- });
1592
  jQuery(".wdi_popup_embed").animate({
1593
- width: wdi_popup_current_width - comment_container_width - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>,
1594
- height: wdi_popup_current_height - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>
1595
- }, {
1596
- duration: 500,
1597
- complete: function () {
1598
- wdi_resize_instagram_post();
1599
- wdi_change_watermark_container();
1600
- if (jQuery("#wdi_spider_popup_wrap").width() < jQuery(window).width()) {
1601
- if (jQuery("#wdi_spider_popup_wrap").height() < jQuery(window).height()) {
1602
- jQuery(".wdi_spider_popup_close_fullscreen").attr("class", "wdi_spider_popup_close");
 
1603
  }
1604
  }
1605
- }
1606
- });
1607
  jQuery(".wdi_filmstrip_container").animate({<?php echo $width_or_height; ?>: wdi_popup_current_<?php echo $width_or_height; ?> - <?php echo ($filmstrip_direction == 'horizontal' ? 'comment_container_width' : 0); ?>}, 500);
1608
  jQuery(".wdi_filmstrip").animate({<?php echo $width_or_height; ?>: wdi_popup_current_<?php echo $width_or_height; ?> - <?php echo ($filmstrip_direction == 'horizontal' ? 'comment_container_width' : 0); ?> - 40}, 500);
1609
  /* Set filmstrip initial position.*/
@@ -1626,21 +1516,21 @@ continue;
1626
  jQuery(".wdi_image_wrap").animate({width: (jQuery(window).width() - comment_container_width)}, 500);
1627
  jQuery(".wdi_image_container").animate({height: (wdi_popup_current_height - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>), width: wdi_popup_current_width - comment_container_width - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>}, 500);
1628
  jQuery(".wdi_popup_image").animate({
1629
- maxWidth: jQuery(window).width() - comment_container_width - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>,
1630
- maxHeight: jQuery(window).height() - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>
1631
- }, {
1632
- duration: 500,
1633
- complete: function () { wdi_change_watermark_container(); }
1634
- });
1635
  jQuery(".wdi_popup_embed").animate({
1636
- width: jQuery(window).width() - comment_container_width - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>,
1637
- height: jQuery(window).height() - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>
1638
- }, {
1639
- duration: 500,
1640
- complete: function () {
1641
- wdi_resize_instagram_post();
1642
- wdi_change_watermark_container(); }
1643
- });
1644
  jQuery(".wdi_filmstrip_container").animate({<?php echo $width_or_height; ?>: jQuery(window).<?php echo $width_or_height; ?>() - <?php echo ($filmstrip_direction == 'horizontal' ? 'comment_container_width' : 0); ?>}, 500);
1645
  jQuery(".wdi_filmstrip").animate({<?php echo $width_or_height; ?>: jQuery(window).<?php echo $width_or_height; ?>() - <?php echo ($filmstrip_direction == 'horizontal' ? 'comment_container_width' : 0); ?> - 40}, 500);
1646
  /* Set filmstrip initial position.*/
@@ -1667,10 +1557,10 @@ continue;
1667
  <?php
1668
  /* "Full width lightbox" sets yes.*/
1669
  if ($open_with_fullscreen) {
1670
- ?>
1671
  wdi_popup_current_width = jQuery(window).width();
1672
  wdi_popup_current_height = jQuery(window).height();
1673
- <?php
1674
  }
1675
  ?>
1676
  jQuery("#wdi_spider_popup_wrap").on("fscreenclose", function() {
@@ -1685,9 +1575,9 @@ continue;
1685
  });
1686
  jQuery(".wdi_image_wrap").css({width: wdi_popup_current_width - comment_container_width});
1687
  jQuery(".wdi_image_container").css({height: wdi_popup_current_height - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>, width: wdi_popup_current_width - comment_container_width - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>});
1688
-
1689
- /*jQuery(".wdi_slide_bg").css({height: wdi_popup_current_height - <?php echo $image_filmstrip_height; ?>});
1690
- jQuery(".wdi_popup_image_spun1").css({height: wdi_popup_current_height - <?php echo $image_filmstrip_height; ?>});*/
1691
  jQuery(".wdi_popup_image").css({
1692
  maxWidth: wdi_popup_current_width - comment_container_width - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>,
1693
  maxHeight: wdi_popup_current_height - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>
@@ -1739,7 +1629,7 @@ continue;
1739
  });
1740
  jQuery(".wdi_image_wrap").css({width: screen_width - comment_container_width});
1741
  jQuery(".wdi_image_container").css({height: (screen_height - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>), width: screen_width - comment_container_width - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>});
1742
- /* jQuery(".wdi_slide_bg").css({height: screen_height - <?php echo $image_filmstrip_height; ?>});*/
1743
  jQuery(".wdi_popup_image").css({
1744
  maxWidth: (screen_width - comment_container_width - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>),
1745
  maxHeight: (screen_height - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>)
@@ -1811,12 +1701,7 @@ continue;
1811
 
1812
  //if info is displayed by defult then double trigger
1813
  //info click for displaying it with proper scrollbar
1814
- if(<?php echo $popup_info_always_show?>){
1815
- setTimeout(function(){
1816
- jQuery(".wdi_info").trigger(wdi_click);
1817
- jQuery(".wdi_info").trigger(wdi_click);
1818
- },100);
1819
- }
1820
 
1821
 
1822
  });
13
  global $wp;
14
  require_once(WDI_DIR . '/framework/WDILibraryEmbed.php');
15
 
16
+ //////////////////////////////////////////////////////////////////
17
+ $feed_id = WDILibrary::get('feed_id', 0, 'intval', 'POST');
18
+ $current_feed = $this->model->get_feed_row_data( $feed_id );
19
  $is_hashtag = false;
20
+
 
 
 
 
 
21
  $theme_row = WDILibrary::arrayToObject($this->model->get_theme_row_data($current_feed['theme_id']));
22
  $option_row = WDILibrary::arrayToObject($current_feed);
23
  $option_row->preload_images_count = 0;
25
  $option_row->popup_enable_email = 0;
26
 
27
  //////////////////////////////////////////////////////////////////
28
+ $current_url = WDILibrary::get('current_url', '', 'sanitize_text_field', 'GET');
29
+ $current_url = ($current_url != '') ? add_query_arg( $current_url, '', home_url($wp->request) ) : '';
30
+ $tag_id = WDILibrary::get('tag_id', 0, 'intval', 'GET');
31
  $gallery_id = (isset($current_feed['id']) ? esc_html($current_feed['id']) : 0);
32
+ $wdi = WDILibrary::get('feed_counter', 0, 'intval', 'POST');
33
+ $current_image_id = WDILibrary::get('image_id', 0, 'intval', 'GET');
34
+ $current_image_index = WDILibrary::get('current_image_index', 0, 'intval', 'POST');
35
  $theme_id = (isset($current_feed['theme_id']) ? esc_html($current_feed['theme_id']) : 1);
36
 
37
+ $carousel_media_row = WDILibrary::get('carousel_media_row', '', 'sanitize_text_field', 'POST');
38
  $carousel_media = json_decode(stripslashes($carousel_media_row), true);
39
  $carousel_media = is_array($carousel_media) ? $carousel_media : array();
40
 
41
+ $thumb_width = WDILibrary::get('thumb_width', 90, 'floatval', 'GET');/*watch later*/
42
+ $thumb_height = WDILibrary::get('thumb_height', 90, 'floatval', 'GET');/*watch later*/
43
 
44
  $open_with_fullscreen = (isset($current_feed['popup_fullscreen']) ? esc_html($current_feed['popup_fullscreen']) : 0);
45
  $open_with_autoplay = (isset($current_feed['popup_autoplay']) ? esc_html($current_feed['popup_autoplay']) : 0);
48
 
49
  $image_effect = (isset($current_feed['popup_type']) && esc_html(isset($current_feed['popup_type'])) ? esc_html($current_feed['popup_type']) : 'fade');
50
 
51
+ $sort_by = WDILibrary::get('wd_sor', 'order', 'sanitize_text_field', 'GET');/*watch later*/
52
+ $order_by = WDILibrary::get('wd_ord', 'asc', 'sanitize_text_field', 'GET');/*watch later*/
53
 
54
  $enable_image_filmstrip = (isset($current_feed['popup_enable_filmstrip']) ? esc_html($current_feed['popup_enable_filmstrip']) : 0);
55
  $enable_image_fullscreen = (isset($current_feed['popup_enable_fullscreen']) ? esc_html($current_feed['popup_enable_fullscreen']) : 0);/*watch later*/
76
  $enable_image_google = (isset($current_feed['popup_enable_google']) ? esc_html($current_feed['popup_enable_google']) : 0);
77
  $enable_image_pinterest = (isset($current_feed['popup_enable_pinterest']) ? esc_html($current_feed['popup_enable_pinterest']) : 0);
78
  $enable_image_tumblr = (isset($current_feed['popup_enable_tumblr']) ? esc_html($current_feed['popup_enable_tumblr']) : 0);
 
79
  $image_right_click = (isset($current_feed['popup_image_right_click']) ? esc_html($current_feed['popup_image_right_click']) : 1);
80
 
81
  //$option_row = $this->model->get_option_row_data();
104
  }
105
 
106
 
107
+ $json = isset($_POST['image_rows']) ? $_POST['image_rows'] : '';
108
  str_replace('"',"&quot;", $json);
109
 
110
  $image_rows = json_decode(stripslashes($json));
111
+ $image_rows_count = WDILibrary::get('image_rows_count', 0, 'intval', 'POST');//parseint
112
  $image_rows = WDILibrary::arrayToObject($image_rows);
113
 
114
  /////////////////////////////////Parametes for deprecated content////////////////////
116
  $theme_row->lightbox_rate_size = 0;
117
  /////////////////////////////////////////////////////////////////////////////////////
118
 
119
+ $image_id = WDILibrary::get('image_id', $current_image_id, 'intval', 'POST');
120
+ //$comment_rows = $this->model->get_comment_rows_data($image_id);
121
+
122
  $params_array = array(
123
  'action' => 'GalleryBox',
124
  'image_id' => $current_image_id,
193
 
194
  $current_filename = '';
195
  ?>
196
+ <style>
197
  .wdi_popup_image {
198
  max-width: <?php echo $image_width - ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>px;
199
  max-height: <?php echo $image_height - ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>px;
263
 
264
  .wdi_image_info {
265
  <?php echo ((!$enable_image_filmstrip || $theme_row->lightbox_filmstrip_pos != 'bottom') && $theme_row->lightbox_ctrl_btn_pos == 'bottom' && $theme_row->lightbox_info_pos == 'bottom') ? 'bottom: ' . ($theme_row->lightbox_ctrl_btn_height + 2 * $theme_row->lightbox_ctrl_btn_margin_top) . 'px;' : '' ?>
266
+ width: 33%;
267
+ margin: <?php echo $theme_row->lightbox_info_margin; ?>;
 
 
 
 
268
  <?php echo ((!$enable_image_filmstrip || $theme_row->lightbox_filmstrip_pos != 'top') && $theme_row->lightbox_ctrl_btn_pos == 'top' && $theme_row->lightbox_info_pos == 'top') ? 'top: ' . ($theme_row->lightbox_ctrl_btn_height + 2 * $theme_row->lightbox_ctrl_btn_margin_top) . 'px;' : '' ?>
269
  }
270
  </style>
273
  <?php
274
  $image_id_exist = FALSE;
275
  foreach ($image_rows as $key => $image_row) {
276
+ if (strpos($image_row->filename, 'https://') === false) {
277
+ $image_row->filename = sanitize_text_field($image_row->filename);
278
+ } else {
279
+ $image_row->filename = esc_url_raw($image_row->filename);
 
280
  }
281
+ if (intval($image_row->id) == $image_id) {
282
+ $current_avg_rating = floatval($image_row->avg_rating);
283
+ $current_rate = floatval($image_row->rate);
284
+ $current_rate_count = intval($image_row->rate_count);
285
+ $current_image_key = sanitize_text_field($key);
286
+ }
287
+ if (intval($image_row->id) == $current_image_id) {
288
+ $current_image_alt = sanitize_text_field($image_row->alt);
289
+ $current_image_user_name = sanitize_text_field($image_row->username);
290
+ if (isset($image_row->profile_picture)){
291
  $current_image_user_pic = $image_row->profile_picture;
292
+ } else {
293
  $current_image_user_pic = '';
294
  }
295
+ $current_image_hit_count = intval($image_row->hit_count);
296
+ $current_image_description = str_replace('#',' #',str_replace(array("\r\n", "\n", "\r"), esc_html('<br />'), sanitize_text_field($image_row->description)));
297
+ $current_image_url = esc_url_raw($image_row->image_url);
298
+ $current_thumb_url = esc_url_raw($image_row->thumb_url);
299
+ $current_filetype = sanitize_text_field($image_row->filetype);
300
  $current_filename = $image_row->filename;
301
  $image_id_exist = TRUE;
302
  }
303
+ continue;
304
  //sanitizing image description
305
+ $instaDesc = sanitize_text_field($image_row->description);
306
  $instaDesc = preg_replace('/\\\\/', esc_html('&#92;'), $instaDesc);
307
 
308
  /*last two are ZWSP and P-SEP*/
320
  }
321
  ?>
322
  <div class="wdi_image_wrap">
323
+ <?php if ($enable_image_ctrl_btn || (!is_null($carousel_media) && count($carousel_media))) { ?>
324
  <div class="wdi_btn_container">
325
  <?php if(!is_null($carousel_media) && count($carousel_media)){ ?>
326
  <div class="wdi_carousel_btn_container">
334
  <?php
335
  }
336
 
337
+ if ($enable_image_ctrl_btn) {
338
+ $share_url = add_query_arg(array('action' => 'Share', 'curr_url' => $current_url, 'image_id' => $current_image_id), admin_url('admin-ajax.php')) . '#wdi' . $gallery_id . '/' . $current_image_id;
339
+ ?>
340
+ <div class="wdi_ctrl_btn_container">
341
+ <?php
342
+ if ($option_row->show_image_counts) {
343
+ ?>
344
+ <span class="wdi_image_count_container wdi_ctrl_btn">
345
+ <span class="wdi_image_count"><?php echo $current_image_key + 1; ?></span> /
346
+ <span><?php echo $image_rows_count; ?></span>
347
+ </span>
348
+ <?php
349
+ }
350
+ ?>
351
+ <i title="<?php echo __('Play', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_play_pause tenweb-i tenweb-i-play"></i>
352
+ <?php if ($enable_image_fullscreen) {
353
+ if (!$open_with_fullscreen) {
354
+ ?>
355
+ <i title="<?php echo __('Maximize', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_resize-full tenweb-i tenweb-i-expand "></i>
356
+ <?php
357
+ }
358
+ ?>
359
+ <i title="<?php echo __('Fullscreen', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_fullscreen tenweb-i tenweb-i-arrows-out"></i>
 
 
360
  <?php }
361
+ // @TօDօ API Changes 2020
362
+ ?>
363
+ <?php if ($popup_enable_rate) { ?>
364
+ <i title="<?php echo __('Show rating', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_rate tenweb-i tenweb-i-star"></i>
365
+ <?php }
366
+ $is_embed = preg_match('/EMBED/', $current_filetype) == 1 ? TRUE : FALSE;
367
+ $share_image_url = urlencode( $is_embed ? $current_thumb_url : site_url() . '/' . $WD_WDI_UPLOAD_DIR . $current_image_url);
368
+ if ($enable_image_facebook) {
369
+ ?>
370
+ <a id="wdi_facebook_a" href="https://www.facebook.com/sharer/sharer.php?u=<?php echo urlencode($share_url); ?>" target="_blank" title="<?php echo __('Share on Facebook', "wd-instagram-feed"); ?>">
371
+ <i title="<?php echo __('Share on Facebook', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_facebook tenweb-i tenweb-i-facebook-square"></i>
372
+ </a>
373
+ <?php
374
+ }
375
+ if ($enable_image_twitter) {
376
+ ?>
377
+ <a id="wdi_twitter_a" href="https://twitter.com/share?url=<?php echo urlencode($share_url); ?>" target="_blank" title="<?php echo __('Share on Twitter', "wd-instagram-feed"); ?>">
378
+ <i title="<?php echo __('Share on Twitter', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_twitter tenweb-i tenweb-i-twitter-square"></i>
379
+ </a>
380
+ <?php
381
+ }
382
+ if ($enable_image_pinterest) {
383
+ ?>
384
+ <a id="wdi_pinterest_a" href="http://pinterest.com/pin/create/button/?s=100&url=<?php echo urlencode($share_url); ?>&media=<?php echo $share_image_url; ?>&description=<?php echo $current_image_description; ?>" target="_blank" title="<?php echo __('Share on Pinterest', "wd-instagram-feed"); ?>">
385
+ <i title="<?php echo __('Share on Pinterest', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_pinterest tenweb-i tenweb-i-pinterest-square"></i>
386
+ </a>
387
+ <?php
388
+ }
389
+ if ($enable_image_tumblr) {
390
+ ?>
391
+ <a id="wdi_tumblr_a" href="https://www.tumblr.com/share/photo?source=<?php echo $share_image_url; ?>&caption=<?php echo urlencode($current_image_alt); ?>&clickthru=<?php echo urlencode($share_url); ?>" target="_blank" title="<?php echo __('Share on Tumblr', "wd-instagram-feed"); ?>">
392
+ <i title="<?php echo __('Share on Tumblr', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn wdi_tumblr tenweb-i tenweb-i-tumblr-square"></i>
393
+ </a>
394
+ <?php
395
+ }
396
+
397
+
398
+ if ($option_row->popup_enable_fullsize_image) {
399
+ ?>
400
+ <a id="wdi_fullsize_image" href="<?php echo !$is_embed ? site_url() . '/' . $WD_WDI_UPLOAD_DIR . $current_image_url : $current_image_url; ?>" target="_blank">
401
+ <i title="<?php echo __('Open image in Instagram.', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn tenweb-i tenweb-i-instagram"></i>
402
+ </a>
403
+ <?php
404
+ }
405
+ if ($option_row->popup_enable_download) {
406
+ $style = 'none';
407
+ $current_image_arr = explode('/', $current_image_url);
408
+ if (!$is_embed) {
409
+ $download_href = site_url() . '/' . $WD_WDI_UPLOAD_DIR . $current_image_url;
410
+ $style = 'inline-block';
411
+ }
412
+ elseif (preg_match('/FLICKR/', $current_filetype) == 1) {
413
+ $download_href = $current_filename;
414
+ $style = 'inline-block';
415
+ }
416
+ elseif (preg_match('/INSTAGRAM/', $current_filetype) == 1) {
417
+ if(preg_match('/IMAGE/',$current_filetype) == 1){
418
+ $download_href = substr_replace($current_thumb_url, 'l', -1);
419
+ }
420
+ if(preg_match('/VIDEO/',$current_filetype) == 1){
421
+ $download_href = $current_filename;
422
+ }
423
+
424
+
425
+ $style = 'inline-block';
426
+ }
427
+ ?>
428
+ <a id="wdi_download" href="<?php echo $download_href; ?>" target="_blank" download="<?php echo end($current_image_arr); ?>" style="display: <?php echo $style; ?>;">
429
+ <i title="<?php echo __('Download original image', "wd-instagram-feed"); ?>" class="wdi_ctrl_btn tenweb-i tenweb-i-download"></i>
430
+ </a>
431
+ <?php
432
+ }
433
+ ?>
434
+ </div>
435
+ <div class="wdi_toggle_container">
436
+ <i class="wdi_toggle_btn tenweb-i <?php echo (($theme_row->lightbox_ctrl_btn_pos == 'top') ? 'tenweb-i-angle-up' : 'tenweb-i-angle-down'); ?>"></i>
437
+ </div>
438
+
439
+ <?php } ?>
440
+ </div>
441
+ <?php
442
+ }
443
+ $current_pos = 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
444
 
445
+ if($enable_image_filmstrip) {
446
  $current_pos = $current_image_index * (($filmstrip_direction == 'horizontal' ? $image_filmstrip_width : $image_filmstrip_height) + $filmstrip_thumb_margin_hor);
447
  $current_key = $current_image_index;
448
  ?>
459
  <div class="wdi_title" onclick="window.open('//instagram.com/<?php echo $current_image_user_name; ?>','_blank')">
460
  <div class="wdi_header_text"><?php echo $current_image_user_name;?></div>
461
  <?php if(!empty($current_image_user_pic)): ?>
462
+ <div class="wdi_users_img_wrap"><img src="<?php echo $current_image_user_pic;?>" alt=""></div>
463
  <?php endif;?>
464
  </div>
465
  </div>
468
  </span>
469
  </div>
470
  </div>
471
+
472
  <div class="wdi_slide_container">
473
  <div class="wdi_slide_bg">
474
  <div class="wdi_slider">
475
  <?php
476
  $current_key = -6;
477
  foreach ($image_rows as $key => $image_row) {
478
+ if (strpos($image_row->filename, 'https://') === false) {
479
+ $image_row->filename = sanitize_text_field($image_row->filename);
480
+ } else {
481
+ $image_row->filename = esc_url_raw($image_row->filename);
482
+ }
483
+ $is_embed = preg_match('/EMBED/',sanitize_text_field($image_row->filetype))==1 ? true :false;
484
+ $is_embed_instagram_post = preg_match('/INSTAGRAM_POST/',sanitize_text_field($image_row->filetype))==1 ? true :false;
485
+ if (intval($image_row->id) == intval($current_image_id) ) {
486
  $current_key = $current_image_index;
487
  ?>
488
+ <span class="wdi_popup_image_spun" id="wdi_popup_image" image_id="<?php echo intval($image_row->id); ?>">
489
  <span class="wdi_popup_image_spun1" style="display: table; width: inherit; height: inherit;">
490
  <span class="wdi_popup_image_spun2" style="display: table-cell; vertical-align: middle; text-align: center;">
491
  <?php
492
+ if (!$is_embed) {
493
  ?>
494
+ <img class="wdi_popup_image wdi_popup_watermark" src="<?php echo site_url() . '/' . $WD_WDI_UPLOAD_DIR . esc_url_raw($image_row->image_url); ?>" alt="<?php echo sanitize_text_field($image_row->alt); ?>" />
 
495
  <?php
496
+ }
497
+ else { /*$is_embed*/ ?>
498
+ <span class="wdi_popup_embed wdi_popup_watermark" style="display:table; table-layout:fixed;">
499
+ <?php
500
  if($is_embed_instagram_post){
501
  $post_width = $image_width - ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0);
502
  $post_height = $image_height - ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0);
503
  if($post_height <$post_width +88 ){
504
+ $post_width =$post_height -88;
505
  }
506
  else{
507
+ $post_height =$post_width +88;
508
  }
509
+ WDILibraryEmbed::display_embed(sanitize_text_field($image_row->filetype), $image_row->filename, array('class'=>"wdi_embed_frame", 'frameborder'=>"0", 'style'=>"width:".$post_width."px; height:".$post_height."px; vertical-align:middle; display:inline-block; position:relative;"), $carousel_media);
510
  }
511
  else{
512
+ WDILibraryEmbed::display_embed(sanitize_text_field($image_row->filetype), $image_row->filename, array('class'=>"wdi_embed_frame", 'frameborder'=>"0", 'allowfullscreen'=>"allowfullscreen", 'style'=>"width:inherit; height:inherit; vertical-align:middle; display:table-cell;"), $carousel_media);
513
  }
514
  ?>
515
  </span>
516
  <?php
517
+ }
518
  ?>
519
  </span>
520
  </span>
521
  </span>
522
+ <span class="wdi_popup_image_second_spun">
523
  </span>
524
+ <input type="hidden" id="wdi_current_image_key" value="<?php echo $current_image_index; ?>" />
525
+ <?php
526
+ break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
527
  }
528
+ }
529
+ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
530
  </div>
531
  </div>
532
  </div>
533
+ <a id="wdi_spider_popup_left" <?php echo ($option_row->enable_loop == 0 && $current_key == 0) ? 'style="display: none;"' : ''; ?>><span id="wdi_spider_popup_left-ico"><span><i class="wdi_prev_btn tenweb-i <?php echo str_replace("fa-", "tenweb-i-", $theme_row->lightbox_rl_btn_style); ?>-left-sm"></i></span></span></a>
534
+ <a id="wdi_spider_popup_right" <?php echo ($option_row->enable_loop == 0 && $current_key == $image_rows_count - 1) ? 'style="display: none;"' : ''; ?>><span id="wdi_spider_popup_right-ico"><span><i class="wdi_next_btn tenweb-i <?php echo str_replace("fa-", "tenweb-i-", $theme_row->lightbox_rl_btn_style); ?>-right-sm"></i></span></span></a>
535
  </div>
536
+ </div>
537
  <a class="wdi_spider_popup_close" onclick="wdi_spider_destroypopup(1000); return false;" ontouchend="wdi_spider_destroypopup(1000); return false;"><span><i class="wdi_close_btn tenweb-i tenweb-i-times"></i></span></a>
538
  <script>
539
  var wdi_trans_in_progress = false;
621
  jQuery(".wdi_filmstrip_right").show();
622
  }
623
  }
624
+
625
  function wdi_change_image(current_key, key, wdi_data, from_effect) {
626
+
627
  wdi_pause_stream('#wdi_image_container');
628
  jQuery("#wdi_spider_popup_left").show();
629
  jQuery("#wdi_spider_popup_right").show();
641
  jQuery(this)[0].contentWindow.postMessage('{ "method": "pause" }', "*");
642
  jQuery(this)[0].contentWindow.postMessage('pause', '*');
643
  });
644
+
645
  if (typeof wdi_data[key] != 'undefined') {
646
  if (typeof wdi_data[current_key] != 'undefined') {
647
  if (jQuery('.wdi_ctrl_btn').hasClass('tenweb-i-pause')) {
648
+
649
  wdi_play();
650
  }
651
  if (!from_effect) {
652
  /* Change image key.*/
653
  jQuery("#wdi_current_image_key").val(key);
654
  /*if (current_key == '-1') {
655
+ current_key = jQuery(".wdi_thumb_active").children("img").attr("image_key");
656
+ }*/
657
  }
658
  if (wdi_trans_in_progress) {
659
  event_stack.push(current_key + '-' + key);
667
  return;
668
  }
669
  /*jQuery("#wdi_spider_popup_left").hover().css({"display": "inline"});
670
+ jQuery("#wdi_spider_popup_right").hover().css({"display": "inline"});*/
671
  jQuery(".wdi_image_count").html(wdi_data[key]["number"]);
672
  /* Set active thumbnail position.*/
673
  wdi_current_filmstrip_pos = key * (jQuery(".wdi_filmstrip_thumbnail").<?php echo $width_or_height; ?>() + 2 + 2 * <?php echo $theme_row->lightbox_filmstrip_thumb_border_width; ?>);
687
  jQuery(".wdi_image_hits span").html(++wdi_data[key]["hit_count"]);
688
  /* Change image id.*/
689
  jQuery("#wdi_popup_image").attr('image_id', wdi_data[key]["id"]);
690
+
691
 
692
  //creating image title template
693
  var wdi_title_div = jQuery('<div class="wdi_title"></div>').on('click',function(){window.open('//instagram.com/'+wdi_data[key]['username'],'_blank');});
696
 
697
  //resetting title and description for custom scrollbar
698
  jQuery('.wdi_image_info_spun').html('<div class="wdi_image_info" >'+
699
+ '<div class="wdi_image_title"></div>'+
700
+ '<div class="wdi_image_description"></div>'+
701
+ '</div>');
702
 
703
+ /* Change carousel media dots*/
704
  if (typeof wdi_data[key]['carousel_media'] != "undefined" && wdi_data[key]['carousel_media'] != null) {
705
  if(jQuery(".wdi_carousel_btn_container").length){
706
  jQuery(".wdi_carousel_btn_container").remove();
720
  jQuery(".wdi_carousel_btn_container").remove();
721
  }
722
  }
723
+
724
  /* Change image title, description.*/
725
  jQuery(".wdi_image_title").html(jQuery('<span style="display: block;" />').append(wdi_title_div));
726
  jQuery(".wdi_image_description").html(jQuery('<span style="display: block;" />').text(wdi_data[key]["description"]).text());
727
  jQuery(".wdi_image_info").removeAttr("style");
728
  if (wdi_data[key]["alt"].trim() == "") {
729
  if (wdi_data[key]["description"].trim() == "") {
730
+ jQuery(".wdi_image_info").css("background", "none");
731
  }
732
  }
733
  if (jQuery(".wdi_image_info_container1").css("display") != 'none') {
745
  }
746
  var current_image_class = jQuery(".wdi_popup_image_spun").css("zIndex") == 2 ? ".wdi_popup_image_spun" : ".wdi_popup_image_second_spun";
747
  var next_image_class = current_image_class == ".wdi_popup_image_second_spun" ? ".wdi_popup_image_spun" : ".wdi_popup_image_second_spun";
748
+
749
  var is_embed = wdi_data[key]['filetype'].indexOf("EMBED_") > -1 ? true : false;
750
  var is_embed_instagram_post = wdi_data[key]['filetype'].indexOf('INSTAGRAM_POST') > -1 ? true :false;
751
  var cur_height = jQuery(current_image_class).height();
762
  var post_height = 0;
763
  if(cur_height <cur_width +88 ){
764
  post_height = cur_height;
765
+ post_width = post_height -88;
766
  }
767
  else{
768
  post_width = cur_width;
769
+ post_height = post_width +88 ;
770
  }
771
  innhtml += wdi_spider_display_embed(wdi_data[key]['filetype'], wdi_data[key]['filename'], {class:"wdi_embed_frame", frameborder:"0", allowfullscreen:"allowfullscreen", style:"width:"+post_width+"px; height:"+post_height+"px; vertical-align:middle; display:inline-block; position:relative; top: "+0.5*(cur_height-post_height)+ "px; " },wdi_data[key]['carousel_media']);
772
  }
777
  }
778
  innhtml += '</span></span>';
779
  jQuery(next_image_class).html(innhtml);
780
+
781
  function wdi_afterload() {
782
 
783
 
784
  //setting max-heigth for custom scrollbar
785
  var wdi_desc_max_height = jQuery('.wdi_image_info_container1').height()-jQuery(".wdi_ctrl_btn_container").height()-parseInt(jQuery('.wdi_image_info').css('margin-bottom'))-parseInt(jQuery('.wdi_image_info').css('padding-bottom'));
786
  jQuery('.wdi_image_info').css('max-height',wdi_desc_max_height);
787
+ jQuery('.wdi_image_info').mCustomScrollbar({scrollInertia: 250});
788
 
789
  <?php
790
  if (isset($option_row->preload_images)) {
806
  jQuery("#wdi_download").attr("href", wdi_data[key]['thumb_url'].substring(0, wdi_data[key]['thumb_url'].length - 1) + 'l');
807
  }
808
  else {
809
+ jQuery("#wdi_download").hide();
810
  }
811
  }
812
  var image_arr = wdi_data[key]['image_url'].split("/");
815
  jQuery("#wdi_download").attr("download", image_arr[image_arr.length - 1]);
816
  /* Change image social networks urls.*/
817
  var wdi_share_url = encodeURIComponent("<?php echo add_query_arg(array('action' => 'Share', 'curr_url' => $current_url, 'image_id' => ''), admin_url('admin-ajax.php')); ?>") + "=" + wdi_data[key]['id'] + encodeURIComponent('#wdi<?php echo $gallery_id; ?>/') + wdi_data[key]['id'];
818
+
819
  if (is_embed) {
820
  var wdi_share_image_url = encodeURIComponent(wdi_data[key]['thumb_url']);
821
  }
835
  //share popup urls
836
  jQuery("#wdi_popup_fb").attr('href',"https://www.facebook.com/sharer/sharer.php?u="+wdi_image_url);
837
  jQuery("#wdi_popup_tw").attr('href',"https://twitter.com/share?url=" + wdi_image_url);
 
838
  jQuery('#wdi_popup_li').attr('href',"https://www.linkedin.com/shareArticle?mini=true&url="+wdi_image_url+"&title="+wdi_image_description);
839
  jQuery('#wdi_popup_pt').attr('href',"https://pinterest.com/pin/create/button/?url="+wdi_image_url+"&media="+wdi_image_url+"media/?size=l&description="+wdi_image_description);
840
  /* Load comments.*/
863
  // jQuery(".mCSB_scrollTools").hide();
864
  <?php
865
  if ($enable_image_filmstrip) {
866
+ ?>
867
+ wdi_move_filmstrip();
868
+ <?php
869
  }
870
  ?>
871
 
895
  wdi_change_image(parseInt(jQuery('#wdi_current_image_key').val()), parseInt(jQuery('#wdi_current_image_key').val()) - 1, wdi_data)
896
  }
897
  else if (e.keyCode === 27) { /* Esc.*/
898
+ wdi_spider_destroypopup(1000);
899
+ }
900
+ else if (e.keyCode === 32) { /* Space.*/
901
+ jQuery(".wdi_play_pause").trigger('click');
902
+ }
903
  });
904
  function wdi_preload_images(key) {
905
  count = <?php echo (int) $option_row->preload_images_count / 2; ?>;
965
  });
966
 
967
  jQuery(".wdi_image_container").css({height: (<?php echo $image_height - ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>)});
968
+
969
  jQuery(".wdi_popup_image").css({
970
  maxHeight: <?php echo $image_height - ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>
971
  });
979
  <?php } ?>
980
  wdi_popup_current_height = <?php echo $image_height; ?>;
981
  }
982
+ else {
983
  jQuery("#wdi_spider_popup_wrap").css({
984
  height: jQuery(window).height(),
985
  top: 0,
987
  zIndex: 100000
988
  });
989
  jQuery(".wdi_image_container").css({height: (jQuery(window).height() - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>)});
990
+
991
  jQuery(".wdi_popup_image").css({
992
  maxHeight: jQuery(window).height() - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>
993
  });
1010
  });
1011
  jQuery(".wdi_image_wrap").css({width: <?php echo $image_width; ?> - comment_container_width});
1012
  jQuery(".wdi_image_container").css({width: (<?php echo $image_width - ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?> - comment_container_width)});
1013
+
1014
  jQuery(".wdi_popup_image").css({
1015
  maxWidth: <?php echo $image_width - ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?> - comment_container_width
1016
  });
1024
  <?php } ?>
1025
  wdi_popup_current_width = <?php echo $image_width; ?>;
1026
  }
1027
+ else {
1028
  jQuery("#wdi_spider_popup_wrap").css({
1029
  width: jQuery(window).width(),
1030
  left: 0,
1033
  });
1034
  jQuery(".wdi_image_wrap").css({width: (jQuery(window).width() - comment_container_width)});
1035
  jQuery(".wdi_image_container").css({width: (jQuery(window).width() - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?> - comment_container_width)});
1036
+
1037
  jQuery(".wdi_popup_image").css({
1038
  maxWidth: jQuery(window).width() - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?> - comment_container_width
1039
  });
1052
  if (!(!(jQuery(window).height() > <?php echo $image_height - 2 * $theme_row->lightbox_close_btn_top; ?>) || !(jQuery(window).width() >= <?php echo $image_width - 2 * $theme_row->lightbox_close_btn_right; ?>) || !(<?php echo $open_with_fullscreen; ?> != 1))) {
1053
  jQuery(".wdi_spider_popup_close_fullscreen").attr("class", "wdi_spider_popup_close");
1054
  }
1055
+ else {
1056
  if (!(!(jQuery("#wdi_spider_popup_wrap").width() <= jQuery(window).width()) || !(jQuery("#wdi_spider_popup_wrap").height() <= jQuery(window).height()))) {
1057
  jQuery(".wdi_spider_popup_close").attr("class", "wdi_ctrl_btn wdi_spider_popup_close_fullscreen");
1058
  }
1074
  function wdi_comment() {
1075
 
1076
  if (jQuery(".wdi_comment_container").hasClass("wdi_open")) {
1077
+
1078
  /* Close comment.*/
1079
  var border_width = parseInt(jQuery(".wdi_comment_container").css('borderRightWidth'));
1080
  if (!border_width) {
1082
  }
1083
  jQuery(".wdi_comment_container").animate({<?php echo $theme_row->lightbox_comment_pos; ?>: -jQuery(".wdi_comment_container").width() - border_width}, 500);
1084
  jQuery(".wdi_image_wrap").animate({
1085
+ <?php echo $theme_row->lightbox_comment_pos; ?>: 0,
1086
  width: jQuery("#wdi_spider_popup_wrap").width()
1087
+ }, 500);
1088
  jQuery(".wdi_image_container").animate({
1089
  width: jQuery("#wdi_spider_popup_wrap").width() - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>}, 500);
1090
  jQuery(".wdi_popup_image").animate({
1091
+ maxWidth: jQuery("#wdi_spider_popup_wrap").width() - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>
1092
+ }, {
1093
+ duration: 500,
1094
+ complete: function () { wdi_change_watermark_container(); }
1095
+ });
1096
  jQuery(".wdi_popup_embed").animate({
1097
+ width: jQuery("#wdi_spider_popup_wrap").width() - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>
1098
+ }, {
1099
+ duration: 500,
1100
+ complete: function () {
1101
+ wdi_resize_instagram_post();
1102
+ wdi_change_watermark_container(); }
1103
+ });
1104
  jQuery(".wdi_filmstrip_container").animate({<?php echo $width_or_height; ?>: jQuery(".wdi_spider_popup_wrap").<?php echo $width_or_height; ?>()}, 500);
1105
  jQuery(".wdi_filmstrip").animate({<?php echo $width_or_height; ?>: jQuery(".wdi_spider_popup_wrap").<?php echo $width_or_height; ?>() - 40}, 500);
1106
  /* Set filmstrip initial position.*/
1108
  jQuery(".wdi_comment_container").attr("class", "wdi_comment_container wdi_close");
1109
  jQuery(".wdi_comment").attr("title", "<?php echo __('Show Comments', "wd-instagram-feed"); ?>");
1110
  jQuery(".wdi_spider_popup_close_fullscreen").show();
 
 
1111
  }
1112
  else {
 
1113
  /* Open comment.*/
1114
  var comment_container_width = <?php echo $theme_row->lightbox_comment_width; ?>;
1115
  if (comment_container_width > jQuery(window).width()) {
1128
  }
1129
  jQuery(".wdi_comment_container").animate({<?php echo $theme_row->lightbox_comment_pos; ?>: 0}, 500);
1130
  jQuery(".wdi_image_wrap").animate({
1131
+ <?php echo $theme_row->lightbox_comment_pos; ?>: jQuery(".wdi_comment_container").width(),
1132
  width: jQuery("#wdi_spider_popup_wrap").width() - jQuery(".wdi_comment_container").width()}, 500);
1133
  jQuery(".wdi_image_container").animate({
1134
  width: jQuery("#wdi_spider_popup_wrap").width() - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?> - jQuery(".wdi_comment_container").width()}, 500);
1135
  jQuery(".wdi_popup_image").animate({
1136
+ maxWidth: jQuery("#wdi_spider_popup_wrap").width() - jQuery(".wdi_comment_container").width() - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>
1137
+ }, {
1138
+ duration: 500,
1139
+ complete: function () { wdi_change_watermark_container(); }
1140
+ });
1141
  jQuery(".wdi_popup_embed").animate({
1142
+ width: jQuery("#wdi_spider_popup_wrap").width() - jQuery(".wdi_comment_container").width() - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>
1143
+ }, {
1144
+ duration: 500,
1145
+ complete: function () {
1146
+ wdi_resize_instagram_post();
1147
+ wdi_change_watermark_container(); }
1148
+ });
1149
  jQuery(".wdi_filmstrip_container").css({<?php echo $width_or_height; ?>: jQuery("#wdi_spider_popup_wrap").<?php echo $width_or_height; ?>() - <?php echo ($filmstrip_direction == 'vertical' ? 0: 'jQuery(".wdi_comment_container").width()'); ?>});
1150
  jQuery(".wdi_filmstrip").animate({<?php echo $width_or_height; ?>: jQuery(".wdi_filmstrip_container").<?php echo $width_or_height; ?>() - 40}, 500);
1151
  /* Set filmstrip initial position.*/
1153
  jQuery(".wdi_comment_container").attr("class", "wdi_comment_container wdi_open");
1154
  jQuery(".wdi_comment").attr("title", "<?php echo __('Hide Comments', "wd-instagram-feed"); ?>");
1155
  /* Load comments.*/
1156
+
1157
  var cur_image_key = parseInt(jQuery("#wdi_current_image_key").val());
1158
  if (wdi_data[cur_image_key]["comment_count"] != 0) {
1159
  jQuery("#wdi_added_comments").show();/*deprecated*/
1161
  wdi_spider_set_input_value('image_id', jQuery('#wdi_popup_image').attr('image_id'));/*deprecated*/
1162
  wdi_spider_ajax_save('wdi_comment_form',cur_image_key);/*deprecated*/
1163
  }else{
1164
+ jQuery("#wdi_added_comments").html('<p class="wdi_no_comment"><?php _e('There are no comments to show','wd-instagram-feed');?></p>');
1165
  }
1166
  }
1167
  }
1168
 
1169
  jQuery(document).ready(function () {
1170
+ /* Increase image hit counter.*/
1171
+ // wdi_spider_set_input_value('rate_ajax_task', 'save_hit_count');
1172
+ // wdi_spider_rate_ajax_save('wdi_rate_form');
1173
+ // jQuery(".wdi_image_hits span").html(++wdi_data["<?php echo $current_image_key; ?>"]["hit_count"]);
1174
+ // var wdi_hash = window.location.hash;
1175
+ // if (!wdi_hash || wdi_hash.indexOf("wdi") == "-1") {
1176
+ // window.location.hash = "wdi<?php echo $gallery_id; ?>/<?php echo $current_image_id; ?>";
1177
+ // }
1178
  <?php
1179
  if ($image_right_click) {
1180
  ?>
1349
  if (jQuery(".wdi_image_info_container1").css("display") == 'none') {
1350
  jQuery(".wdi_image_info_container1").css("display", "table-cell");
1351
  jQuery(".wdi_info").attr("title", "<?php echo __('Hide info', "wd-instagram-feed"); ?>");
1352
+
1353
 
1354
 
1355
+ if(!jQuery('.wdi_image_info').hasClass('mCustomScrollbar')){
1356
+ var wdi_desc_max_height = <?php echo $image_height - ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?> -jQuery(".wdi_ctrl_btn_container").height()-parseInt(jQuery('.wdi_image_info').css('margin-bottom'))-parseInt(jQuery('.wdi_image_info').css('padding-bottom'));
1357
+ jQuery('.wdi_image_info').css('max-height',wdi_desc_max_height+"px");
1358
+ jQuery('.wdi_image_info').mCustomScrollbar({scrollInertia: 250});
1359
+ }
1360
+
1361
+
1362
+ }
1363
  else {
1364
  jQuery(".wdi_image_info_container1").css("display", "none");
1365
  jQuery(".wdi_info").attr("title", "<?php echo __('Show info', "wd-instagram-feed"); ?>");
1366
  }
1367
 
1368
+
1369
  });
1370
  /* Show/hide image rating.*/
1371
  jQuery(".wdi_rate").on(wdi_click, function() {
1389
  if (jQuery(".wdi_toggle_container i").hasClass(wdi_open_toggle_btn_class)) {
1390
  /* Close controll buttons.*/
1391
  <?php
1392
+ if ((!$enable_image_filmstrip || $theme_row->lightbox_filmstrip_pos != 'bottom') && $theme_row->lightbox_ctrl_btn_pos == 'bottom' && $theme_row->lightbox_info_pos == 'bottom') {
1393
+ ?>
1394
+ jQuery(".wdi_image_info").animate({bottom: 0}, 500);
1395
+ <?php
1396
+ }
1397
+ elseif ((!$enable_image_filmstrip || $theme_row->lightbox_filmstrip_pos != 'top') && $theme_row->lightbox_ctrl_btn_pos == 'top' && $theme_row->lightbox_info_pos == 'top') {
1398
+ ?>
1399
+ jQuery(".wdi_image_info").animate({top: 0}, 500);
1400
+ <?php
1401
+ }
1402
+
1403
  ?>
1404
  jQuery(".wdi_ctrl_btn_container").animate({<?php echo $theme_row->lightbox_ctrl_btn_pos; ?>: '-' + jQuery(".wdi_ctrl_btn_container").height() - 16}, 500);
1405
+ jQuery(".wdi_carousel_btn_container").animate({<?php echo $theme_row->lightbox_ctrl_btn_pos; ?>: '40px'}, 500);
1406
  jQuery(".wdi_toggle_container").animate({
1407
+ <?php echo $theme_row->lightbox_ctrl_btn_pos; ?>: 0
1408
+ }, {
1409
+ duration: 500,
1410
  complete: function () { jQuery(".wdi_toggle_container i").attr("class", "wdi_toggle_btn tenweb-i " + wdi_close_toggle_btn_class) }
1411
+ });
1412
  }
1413
  else {
1414
  /* Open controll buttons.*/
1415
  <?php
1416
+ if ((!$enable_image_filmstrip || $theme_row->lightbox_filmstrip_pos != 'bottom') && $theme_row->lightbox_ctrl_btn_pos == 'bottom' && $theme_row->lightbox_info_pos == 'bottom') {
1417
+ ?>
1418
+ jQuery(".wdi_image_info").animate({bottom: jQuery(".wdi_ctrl_btn_container").height()}, 500);
1419
+ <?php
1420
+ }
1421
+ elseif ((!$enable_image_filmstrip || $theme_row->lightbox_filmstrip_pos != 'top') && $theme_row->lightbox_ctrl_btn_pos == 'top' && $theme_row->lightbox_info_pos == 'top') {
1422
+ ?>
1423
+ jQuery(".wdi_image_info").animate({top: jQuery(".wdi_ctrl_btn_container").height()}, 500);
1424
+ <?php
1425
+ }
1426
+
1427
  ?>
1428
  jQuery(".wdi_ctrl_btn_container").animate({<?php echo $theme_row->lightbox_ctrl_btn_pos; ?>: 0}, 500);
1429
+ jQuery(".wdi_carousel_btn_container").animate({<?php echo $theme_row->lightbox_ctrl_btn_pos; ?>: jQuery(".wdi_ctrl_btn_container").height() + 25}, 500);
1430
  jQuery(".wdi_toggle_container").animate({
1431
+ <?php echo $theme_row->lightbox_ctrl_btn_pos; ?>: jQuery(".wdi_ctrl_btn_container").height() + 16
1432
+ }, {
1433
+ duration: 500,
1434
  complete: function () { jQuery(".wdi_toggle_container i").attr("class", "wdi_toggle_btn tenweb-i " + wdi_open_toggle_btn_class) }
1435
+ });
1436
  }
1437
 
1438
 
1466
  jQuery(".wdi_image_wrap").animate({width: wdi_popup_current_width - comment_container_width}, 500);
1467
  jQuery(".wdi_image_container").animate({height: wdi_popup_current_height - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>, width: wdi_popup_current_width - comment_container_width - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>}, 500);
1468
  jQuery(".wdi_popup_image").animate({
1469
+ maxWidth: wdi_popup_current_width - comment_container_width - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>,
1470
+ maxHeight: wdi_popup_current_height - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>
1471
+ }, {
1472
+ duration: 500,
1473
+ complete: function () {
1474
+ wdi_change_watermark_container();
1475
+ if ((jQuery("#wdi_spider_popup_wrap").width() < jQuery(window).width())) {
1476
+ if (jQuery("#wdi_spider_popup_wrap").height() < jQuery(window).height()) {
1477
+ jQuery(".wdi_spider_popup_close_fullscreen").attr("class", "wdi_spider_popup_close");
1478
+ }
1479
  }
1480
  }
1481
+ });
 
1482
  jQuery(".wdi_popup_embed").animate({
1483
+ width: wdi_popup_current_width - comment_container_width - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>,
1484
+ height: wdi_popup_current_height - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>
1485
+ }, {
1486
+ duration: 500,
1487
+ complete: function () {
1488
+ wdi_resize_instagram_post();
1489
+ wdi_change_watermark_container();
1490
+ if (jQuery("#wdi_spider_popup_wrap").width() < jQuery(window).width()) {
1491
+ if (jQuery("#wdi_spider_popup_wrap").height() < jQuery(window).height()) {
1492
+ jQuery(".wdi_spider_popup_close_fullscreen").attr("class", "wdi_spider_popup_close");
1493
+ }
1494
  }
1495
  }
1496
+ });
 
1497
  jQuery(".wdi_filmstrip_container").animate({<?php echo $width_or_height; ?>: wdi_popup_current_<?php echo $width_or_height; ?> - <?php echo ($filmstrip_direction == 'horizontal' ? 'comment_container_width' : 0); ?>}, 500);
1498
  jQuery(".wdi_filmstrip").animate({<?php echo $width_or_height; ?>: wdi_popup_current_<?php echo $width_or_height; ?> - <?php echo ($filmstrip_direction == 'horizontal' ? 'comment_container_width' : 0); ?> - 40}, 500);
1499
  /* Set filmstrip initial position.*/
1516
  jQuery(".wdi_image_wrap").animate({width: (jQuery(window).width() - comment_container_width)}, 500);
1517
  jQuery(".wdi_image_container").animate({height: (wdi_popup_current_height - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>), width: wdi_popup_current_width - comment_container_width - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>}, 500);
1518
  jQuery(".wdi_popup_image").animate({
1519
+ maxWidth: jQuery(window).width() - comment_container_width - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>,
1520
+ maxHeight: jQuery(window).height() - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>
1521
+ }, {
1522
+ duration: 500,
1523
+ complete: function () { wdi_change_watermark_container(); }
1524
+ });
1525
  jQuery(".wdi_popup_embed").animate({
1526
+ width: jQuery(window).width() - comment_container_width - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>,
1527
+ height: jQuery(window).height() - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>
1528
+ }, {
1529
+ duration: 500,
1530
+ complete: function () {
1531
+ wdi_resize_instagram_post();
1532
+ wdi_change_watermark_container(); }
1533
+ });
1534
  jQuery(".wdi_filmstrip_container").animate({<?php echo $width_or_height; ?>: jQuery(window).<?php echo $width_or_height; ?>() - <?php echo ($filmstrip_direction == 'horizontal' ? 'comment_container_width' : 0); ?>}, 500);
1535
  jQuery(".wdi_filmstrip").animate({<?php echo $width_or_height; ?>: jQuery(window).<?php echo $width_or_height; ?>() - <?php echo ($filmstrip_direction == 'horizontal' ? 'comment_container_width' : 0); ?> - 40}, 500);
1536
  /* Set filmstrip initial position.*/
1557
  <?php
1558
  /* "Full width lightbox" sets yes.*/
1559
  if ($open_with_fullscreen) {
1560
+ ?>
1561
  wdi_popup_current_width = jQuery(window).width();
1562
  wdi_popup_current_height = jQuery(window).height();
1563
+ <?php
1564
  }
1565
  ?>
1566
  jQuery("#wdi_spider_popup_wrap").on("fscreenclose", function() {
1575
  });
1576
  jQuery(".wdi_image_wrap").css({width: wdi_popup_current_width - comment_container_width});
1577
  jQuery(".wdi_image_container").css({height: wdi_popup_current_height - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>, width: wdi_popup_current_width - comment_container_width - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>});
1578
+
1579
+ /*jQuery(".wdi_slide_bg").css({height: wdi_popup_current_height - <?php /*echo $image_filmstrip_height;*/ ?>});
1580
+ jQuery(".wdi_popup_image_spun1").css({height: wdi_popup_current_height - <?php /*echo $image_filmstrip_height;*/ ?>});*/
1581
  jQuery(".wdi_popup_image").css({
1582
  maxWidth: wdi_popup_current_width - comment_container_width - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>,
1583
  maxHeight: wdi_popup_current_height - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>
1629
  });
1630
  jQuery(".wdi_image_wrap").css({width: screen_width - comment_container_width});
1631
  jQuery(".wdi_image_container").css({height: (screen_height - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>), width: screen_width - comment_container_width - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>});
1632
+ /* jQuery(".wdi_slide_bg").css({height: screen_height - <?php /*echo $image_filmstrip_height;*/ ?>});*/
1633
  jQuery(".wdi_popup_image").css({
1634
  maxWidth: (screen_width - comment_container_width - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>),
1635
  maxHeight: (screen_height - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>)
1701
 
1702
  //if info is displayed by defult then double trigger
1703
  //info click for displaying it with proper scrollbar
1704
+
 
 
 
 
 
1705
 
1706
 
1707
  });
frontend/views/imagebrowser.php CHANGED
@@ -1,100 +1,140 @@
1
  <?php
 
2
  class WDI_ImageBrowser_view {
3
 
4
- private $model;
5
 
6
- public function __construct($model) {
7
- $this->model = $model;
8
- }
9
 
10
- public function display(){
11
  global $user_feed_header_args;
12
- $this->pass_feed_data_to_js();
13
- $feed_row = $this->model->get_feed_row();
14
- $wdi_feed_counter = $this->model->wdi_feed_counter;
15
- $this->add_theme_styles();
16
- $this->generate_feed_styles($feed_row);
17
- $style = $this->model->theme_row;
18
- $container_class = 'wdi_feed_theme_' . '1' . ' wdi_feed_browser_' . '1';
19
- $wdi_data_ajax = defined('DOING_AJAX') && DOING_AJAX ? 'data-wdi_ajax=1' : '';
20
- ?>
21
- <div id="wdi_feed_<?php echo $wdi_feed_counter?>" class="wdi_feed_main_container wdi_layout_ib <?php echo $container_class; ?>" <?php echo $wdi_data_ajax; ?> >
22
- <?php wdi_feed_frontend_messages();?>
23
- <div id="wdi_spider_popup_loading_<?php echo $wdi_feed_counter?>" class="wdi_spider_popup_loading"></div>
24
- <div id="wdi_spider_popup_overlay_<?php echo $wdi_feed_counter?>" class="wdi_spider_popup_overlay" onclick="wdi_spider_destroypopup(1000)"></div>
25
- <div class="wdi_feed_container">
26
- <div class="wdi_feed_info">
27
- <div id="wdi_feed_<?php echo $wdi_feed_counter?>_header" class='wdi_feed_header'></div>
 
 
28
  <div id="wdi_feed_<?php echo $wdi_feed_counter ?>_users" class='wdi_feed_users'>
29
  <?php
30
  if ( !empty($user_feed_header_args) ) {
31
  echo WDILibrary::user_feed_header_info( $user_feed_header_args );
32
  } ?>
33
  </div>
34
- </div>
35
- <?php
36
- if($feed_row['feed_display_view']==='pagination' && $style['pagination_position_vert']==='top'){
37
- ?><div id="wdi_pagination" class="wdi_pagination"><div class="wdi_pagination_container"><i id="wdi_first_page" title="<?php echo __('First Page',"wd-instagram-feed")?>" class="tenweb-i tenweb-i-step-backward wdi_pagination_ctrl wdi_disabled"></i><i id="wdi_prev" title="<?php echo __('Previous Page',"wd-instagram-feed")?>" class="tenweb-i tenweb-i-arrow-left wdi_pagination_ctrl"></i><i id="wdi_current_page" class="wdi_pagination_ctrl" style="font-style:normal">1</i><i id="wdi_next" title="<?php echo __('Next Page',"wd-instagram-feed")?>" class="tenweb-i tenweb-i-arrow-right wdi_pagination_ctrl"></i> <i id="wdi_last_page" title="<?php echo __('Last Page',"wd-instagram-feed")?>" class="tenweb-i tenweb-i-step-forward wdi_pagination_ctrl wdi_disabled"></i></div></div> <?php
38
- }
39
- ?>
40
- <div class="wdi_feed_wrapper <?php echo 'wdi_col_'.$feed_row['number_of_columns']?>" wdi-res='<?php echo 'wdi_col_'.$feed_row['number_of_columns']?>'></div>
41
- <div class="wdi_clear"></div>
42
- <?php switch($feed_row['feed_display_view']){
43
- case 'load_more_btn':{
44
- ?><div class="wdi_load_more"><div class="wdi_load_more_container"><div class="wdi_load_more_wrap"><div class="wdi_load_more_wrap_inner"><div class="wdi_load_more_text"><?php echo __('Load More',"wd-instagram-feed");?></div></div></div></div></div><?php
45
- break;
46
- }
47
- case 'pagination':{
48
- if($style['pagination_position_vert']==='bottom'){
49
- ?><div id="wdi_pagination" class="wdi_pagination"><div class="wdi_pagination_container"><i id="wdi_first_page" title="<?php echo __('First Page',"wd-instagram-feed")?>" class="tenweb-i tenweb-i-step-backward wdi_pagination_ctrl wdi_disabled"></i><i id="wdi_prev" title="<?php echo __('Previous Page',"wd-instagram-feed")?>" class="tenweb-i tenweb-i-arrow-left wdi_pagination_ctrl"></i><i id="wdi_current_page" class="wdi_pagination_ctrl" style="font-style:normal">1</i><i id="wdi_next" title="<?php echo __('Next Page',"wd-instagram-feed")?>" class="tenweb-i tenweb-i-arrow-right wdi_pagination_ctrl"></i> <i id="wdi_last_page" title="<?php echo __('Last Page',"wd-instagram-feed")?>" class="tenweb-i tenweb-i-step-forward wdi_pagination_ctrl wdi_disabled"></i></div></div> <?php
50
- }
51
-
52
- break;
53
- }
54
- case 'infinite_scroll':{
55
- ?><div id="wdi_infinite_scroll" class="wdi_infinite_scroll"></div> <?php
56
- }
57
- }
58
- ?>
59
- </div>
60
- <div class="wdi_front_overlay"></div>
61
- </div>
62
- <?php
63
-
64
- }
65
- public function pass_feed_data_to_js(){
66
- global $wdi_options;
67
- $feed_row = $this->model->get_feed_row();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
 
69
  $users = isset($feed_row['feed_users']) ? json_decode($feed_row['feed_users']) : null;
70
  if($users === null) {
71
  $users = array();
72
  }
73
 
74
- $wdi_feed_counter = $this->model->wdi_feed_counter;
75
- $feed_row['access_token'] = WDILibrary::get_user_access_token($users);
76
- $feed_row['wdi_feed_counter'] = $wdi_feed_counter;
77
-
78
- wp_localize_script("wdi_frontend", 'wdi_feed_'.$wdi_feed_counter,array('feed_row'=>$feed_row,'data'=>array(),'usersData'=>array(),'dataCount'=>0));
79
- wp_localize_script("wdi_frontend", 'wdi_theme_' . $this->model->theme_row['id'], $this->model->theme_row);
80
- wp_localize_script("wdi_frontend", 'wdi_front',array('feed_counter'=>$wdi_feed_counter));
81
 
82
- if(WDILibrary::is_ajax() || WDILibrary::elementor_is_active()) {
83
- wdi_load_frontend_scripts_ajax();
84
- }
85
- }
86
 
 
 
 
 
87
 
88
  private function add_theme_styles(){
89
 
90
- if(WDILibrary::is_ajax() || WDILibrary::elementor_is_active()) {
91
- $style_tag = "<link rel='stylesheet' id='%s' href='%s' type='text/css' media='all' />";
92
- echo sprintf($style_tag, 'wdi_default_theme', WDI_URL . '/css/default_theme.css' . '?ver=' . WDI_VERSION);
93
- } else {
94
- wp_enqueue_style("wdi_default_theme",WDI_URL . '/css/default_theme.css',array(),WDI_VERSION);
 
 
 
 
 
 
 
 
95
  }
96
 
97
- /*THIS METHOD FOR PAID VERSION*/
98
  }
99
 
100
  /**
@@ -102,99 +142,117 @@ class WDI_ImageBrowser_view {
102
  * @return boolean
103
  * */
104
  private function load_theme_css_file($generator){
105
- /*THIS METHOD FOR PAID VERSION*/
106
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  }
108
 
109
  public function generate_feed_styles($feed_row)
110
  {
111
- $style = $this->model->theme_row;
112
- $colNum = (100/$feed_row['number_of_columns']);
113
- $wdi_feed_counter = $this->model->wdi_feed_counter;
114
- ?>
115
- <style type="text/css">
116
-
117
- #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_feed_header{
118
- display: <?php echo ($feed_row['display_header']=='1')? 'block' : 'none'?>; /*if display-header is true display:block*/
119
- }
120
-
121
- <?php
122
-
123
  if($feed_row['display_user_post_follow_number'] == '1'){
124
  $header_text_padding =(intval($style['user_img_width']) - intval($style['users_text_font_size']))/4;
125
  }else{
126
  $header_text_padding =(intval($style['user_img_width']) - intval($style['users_text_font_size']))/2;
127
- }
128
  ?>
129
- #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_header_user_text {
130
- padding-top: <?php echo $header_text_padding; ?>px;
131
 
132
- }
133
 
134
- #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_header_user_text h3 {
135
- margin-top: <?php echo $header_text_padding ?>px;
136
- }
137
 
138
- #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_media_info{
139
- display: <?php echo ($feed_row['display_user_post_follow_number'] == '1') ? 'block' : 'none'; ?>
140
- }
141
 
142
- #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_feed_item{
143
- width: <?php echo $colNum.'%'?>;/*thumbnail_size*/
144
- }
145
 
146
- <?php if($feed_row['disable_mobile_layout']=="0"){
147
  ?>
148
- @media screen and (min-width: 800px) and (max-width:1024px){
149
- #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_feed_item{
150
- width: <?php echo ($colNum<33.33) ? '33.333333333333%' : $colNum.'%'?>;/*thumbnail_size*/
151
- margin: 0;
152
- display: inline-block;
153
- vertical-align: top;
154
- overflow: hidden;
155
- }
156
-
157
- #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_feed_container {
158
- width: 100%;
159
- margin: 0 auto;
160
- background-color: <?php echo $style['feed_container_bg_color']?>;/*feed_container_bg_color*/
161
- }
162
-
163
- }
164
-
165
- @media screen and (min-width: 480px) and (max-width:800px){
166
- #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_feed_item{
167
- width: <?php echo ($colNum<50) ? '50%' : $colNum.'%'?>;/*thumbnail_size*/
168
- margin: 0;
169
- display: inline-block;
170
- overflow: hidden;
171
- }
172
-
173
- #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_feed_container {
174
- width: 100%;
175
- margin: 0 auto;
176
- background-color: <?php echo $style['feed_container_bg_color']?>;/*feed_container_bg_color*/
177
- }
178
- }
179
-
180
- @media screen and (max-width: 480px){
181
- #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_feed_item{
182
- width: <?php echo ($colNum<100) ? '100%' : $colNum.'%'?>;/*thumbnail_size*/
183
- margin: 0;
184
- display: inline-block;
185
- overflow: hidden;
186
- }
187
-
188
- #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_feed_container {
189
- width: 100%;
190
- margin: 0 auto;
191
- background-color: <?php echo $style['feed_container_bg_color']?>;/*feed_container_bg_color*/
192
- }
193
- }
194
-
195
- <?php
196
  }?>
197
- </style>
198
- <?php
199
- }
 
 
 
 
 
200
  }
1
  <?php
2
+
3
  class WDI_ImageBrowser_view {
4
 
5
+ private $model;
6
 
7
+ public function __construct($model) {
8
+ $this->model = $model;
9
+ }
10
 
11
+ public function display() {
12
  global $user_feed_header_args;
13
+ $this->pass_feed_data_to_js();
14
+ $feed_row = $this->model->get_feed_row();
15
+ $wdi_feed_counter = $this->model->wdi_feed_counter;
16
+ $this->add_theme_styles();
17
+ $this->generate_feed_styles($feed_row);
18
+ $style = $this->model->theme_row;
19
+ $container_class = 'wdi_feed_theme_' . $style['id'] . ' wdi_feed_browser_' . $style['id'];
20
+ $wdi_data_ajax = defined('DOING_AJAX') && DOING_AJAX ? 'data-wdi_ajax=1' : '';
21
+ ?>
22
+ <div id="wdi_feed_<?php echo $wdi_feed_counter ?>"
23
+ class="wdi_feed_main_container wdi_layout_ib <?php echo $container_class; ?>" <?php echo $wdi_data_ajax; ?> >
24
+ <?php // wdi_feed_frontend_messages();?>
25
+ <div id="wdi_spider_popup_loading_<?php echo $wdi_feed_counter ?>" class="wdi_spider_popup_loading"></div>
26
+ <div id="wdi_spider_popup_overlay_<?php echo $wdi_feed_counter ?>" class="wdi_spider_popup_overlay"
27
+ onclick="wdi_spider_destroypopup(1000)"></div>
28
+ <div class="wdi_feed_container">
29
+ <div class="wdi_feed_info">
30
+ <div id="wdi_feed_<?php echo $wdi_feed_counter ?>_header" class='wdi_feed_header'></div>
31
  <div id="wdi_feed_<?php echo $wdi_feed_counter ?>_users" class='wdi_feed_users'>
32
  <?php
33
  if ( !empty($user_feed_header_args) ) {
34
  echo WDILibrary::user_feed_header_info( $user_feed_header_args );
35
  } ?>
36
  </div>
37
+ </div>
38
+ <?php
39
+ if ($feed_row['feed_display_view'] === 'pagination' && $style['pagination_position_vert'] === 'top') {
40
+ ?>
41
+ <div id="wdi_pagination" class="wdi_pagination">
42
+ <div class="wdi_pagination_container"><i id="wdi_first_page"
43
+ title="<?php echo __('First Page', "wd-instagram-feed") ?>"
44
+ class="tenweb-i tenweb-i-step-backward wdi_pagination_ctrl wdi_disabled"></i><i
45
+ id="wdi_prev" title="<?php echo __('Previous Page', "wd-instagram-feed") ?>"
46
+ class="tenweb-i tenweb-i-arrow-left wdi_pagination_ctrl"></i><i id="wdi_current_page" class="wdi_pagination_ctrl"
47
+ style="font-style:normal">1</i><i id="wdi_next"
48
+ title="<?php echo __('Next Page', "wd-instagram-feed") ?>"
49
+ class="tenweb-i tenweb-i-arrow-right wdi_pagination_ctrl"></i>
50
+ <i id="wdi_last_page" title="<?php echo __('Last Page', "wd-instagram-feed") ?>"
51
+ class="tenweb-i tenweb-i-step-forward wdi_pagination_ctrl wdi_disabled"></i></div></div> <?php
52
+ }
53
+ ?>
54
+ <div class="wdi_feed_wrapper <?php echo 'wdi_col_' . $feed_row['number_of_columns'] ?>"
55
+ wdi-res='<?php echo 'wdi_col_' . $feed_row['number_of_columns'] ?>'></div>
56
+ <div class="wdi_clear"></div>
57
+ <?php switch ($feed_row['feed_display_view']) {
58
+ case 'load_more_btn': {
59
+ ?>
60
+ <div class="wdi_load_more">
61
+ <div class="wdi_load_more_container">
62
+ <div class="wdi_load_more_wrap">
63
+ <div class="wdi_load_more_wrap_inner">
64
+ <div class="wdi_load_more_text"><?php echo __('Load More', "wd-instagram-feed"); ?></div>
65
+ </div>
66
+ </div>
67
+ </div></div><?php
68
+ break;
69
+ }
70
+ case 'pagination': {
71
+ if ($style['pagination_position_vert'] === 'bottom') {
72
+ ?>
73
+ <div id="wdi_pagination" class="wdi_pagination">
74
+ <div class="wdi_pagination_container"><i id="wdi_first_page"
75
+ title="<?php echo __('First Page', "wd-instagram-feed") ?>"
76
+ class="tenweb-i tenweb-i-step-backward wdi_pagination_ctrl wdi_disabled"></i><i
77
+ id="wdi_prev" title="<?php echo __('Previous Page', "wd-instagram-feed") ?>"
78
+ class="tenweb-i tenweb-i-arrow-left wdi_pagination_ctrl"></i><i id="wdi_current_page" class="wdi_pagination_ctrl"
79
+ style="font-style:normal">1</i><i id="wdi_next"
80
+ title="<?php echo __('Next Page', "wd-instagram-feed") ?>"
81
+ class="tenweb-i tenweb-i-arrow-right wdi_pagination_ctrl"></i>
82
+ <i id="wdi_last_page" title="<?php echo __('Last Page', "wd-instagram-feed") ?>"
83
+ class="tenweb-i tenweb-i-step-forward wdi_pagination_ctrl wdi_disabled"></i></div></div> <?php
84
+ }
85
+
86
+ break;
87
+ }
88
+ }
89
+ ?>
90
+ </div>
91
+ <div class="wdi_front_overlay"></div>
92
+ </div>
93
+ <?php
94
+
95
+ }
96
+
97
+ public function pass_feed_data_to_js()
98
+ {
99
+ global $wdi_options;
100
+ $feed_row = $this->model->get_feed_row();
101
 
102
  $users = isset($feed_row['feed_users']) ? json_decode($feed_row['feed_users']) : null;
103
  if($users === null) {
104
  $users = array();
105
  }
106
 
107
+ $wdi_feed_counter = $this->model->wdi_feed_counter;
108
+ $feed_row['access_token'] = WDILibrary::get_user_access_token($users);
109
+ $feed_row['wdi_feed_counter'] = $wdi_feed_counter;
 
 
 
 
110
 
111
+ wp_localize_script("wdi_frontend", 'wdi_feed_' . $wdi_feed_counter, array('feed_row' => $feed_row, 'data' => array(), 'usersData' => array(), 'dataCount' => 0));
112
+ wp_localize_script("wdi_frontend", 'wdi_theme_' . $this->model->theme_row['id'], $this->model->theme_row);
113
+ wp_localize_script("wdi_frontend", 'wdi_front', array('feed_counter' => $wdi_feed_counter));
 
114
 
115
+ if(WDILibrary::is_ajax() || WDILibrary::elementor_is_active()) {
116
+ wdi_load_frontend_scripts_ajax();
117
+ }
118
+ }
119
 
120
  private function add_theme_styles(){
121
 
122
+ $theme = $this->model->theme_row;
123
+
124
+ require_once WDI_DIR . '/framework/WDI_generate_styles.php';
125
+ $generator = new WDI_generate_styles($theme['id'], $theme);
126
+
127
+
128
+ if($this->load_theme_css_file($generator) === true) {
129
+ return;
130
+ }
131
+
132
+ if($generator->all_views_styles(true, true) === true &&
133
+ $this->load_theme_css_file($generator) === true) {
134
+ return;
135
  }
136
 
137
+ echo '<style>' . $generator->get_css() . '</style>';
138
  }
139
 
140
  /**
142
  * @return boolean
143
  * */
144
  private function load_theme_css_file($generator){
145
+ $file_url = $generator->get_file_url();
146
+ if($file_url !== "") {
147
+ $theme_path_parts = pathinfo($file_url);
148
+
149
+ if(WDILibrary::is_ajax() || WDILibrary::elementor_is_active()) {
150
+ $style_tag = "<link rel='stylesheet' id='%s' href='%s' type='text/css' media='all' />";
151
+ echo sprintf($style_tag, $theme_path_parts['basename'], $file_url . '?key=' . $generator->get_file_key());
152
+ } else {
153
+ wp_enqueue_style($theme_path_parts['basename'], $file_url . '?key=' . $generator->get_file_key());
154
+ }
155
+
156
+ return true;
157
+ } else {
158
+ return false;
159
+ }
160
  }
161
 
162
  public function generate_feed_styles($feed_row)
163
  {
164
+ $style = $this->model->theme_row;
165
+ $colNum = (100 / $feed_row['number_of_columns']);
166
+ $wdi_feed_counter = $this->model->wdi_feed_counter;
167
+
168
+ ob_start();
169
+ ?>
170
+ #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_feed_header {
171
+ display: <?php echo ($feed_row['display_header']=='1')? 'block' : 'none'?>; /*if display-header is true display:block*/
172
+ }
173
+
174
+ <?php
175
+
176
  if($feed_row['display_user_post_follow_number'] == '1'){
177
  $header_text_padding =(intval($style['user_img_width']) - intval($style['users_text_font_size']))/4;
178
  }else{
179
  $header_text_padding =(intval($style['user_img_width']) - intval($style['users_text_font_size']))/2;
180
+ }
181
  ?>
182
+ #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_header_user_text {
183
+ padding-top: <?php echo $header_text_padding; ?>px;
184
 
185
+ }
186
 
187
+ #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_header_user_text h3 {
188
+ margin-top: <?php echo $header_text_padding ?>px;
189
+ }
190
 
191
+ #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_media_info {
192
+ display: <?php echo ($feed_row['display_user_post_follow_number'] == '1') ? 'block' : 'none'; ?>
193
+ }
194
 
195
+ #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_feed_item {
196
+ width: <?php echo $colNum.'%'?>; /*thumbnail_size*/
197
+ }
198
 
199
+ <?php if($feed_row['disable_mobile_layout']=="0"){
200
  ?>
201
+ @media screen and (min-width: 800px) and (max-width: 1024px) {
202
+ #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_feed_item {
203
+ width: <?php echo ($colNum<33.33) ? '33.333333333333%' : $colNum.'%'?>; /*thumbnail_size*/
204
+ margin: 0;
205
+ display: inline-block;
206
+ vertical-align: top;
207
+ overflow: hidden;
208
+ }
209
+
210
+ #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_feed_container {
211
+ width: 100%;
212
+ margin: 0 auto;
213
+ background-color: <?php echo $style['feed_container_bg_color']?>; /*feed_container_bg_color*/
214
+ }
215
+
216
+ }
217
+
218
+ @media screen and (min-width: 480px) and (max-width: 800px) {
219
+ #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_feed_item {
220
+ width: <?php echo ($colNum<50) ? '50%' : $colNum.'%'?>; /*thumbnail_size*/
221
+ margin: 0;
222
+ display: inline-block;
223
+ overflow: hidden;
224
+ }
225
+
226
+ #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_feed_container {
227
+ width: 100%;
228
+ margin: 0 auto;
229
+ background-color: <?php echo $style['feed_container_bg_color']?>; /*feed_container_bg_color*/
230
+ }
231
+ }
232
+
233
+ @media screen and (max-width: 480px) {
234
+ #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_feed_item {
235
+ width: <?php echo ($colNum<100) ? '100%' : $colNum.'%'?>; /*thumbnail_size*/
236
+ margin: 0;
237
+ display: inline-block;
238
+ overflow: hidden;
239
+ }
240
+
241
+ #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_feed_container {
242
+ width: 100%;
243
+ margin: 0 auto;
244
+ background-color: <?php echo $style['feed_container_bg_color']?>; /*feed_container_bg_color*/
245
+ }
246
+ }
247
+
248
+ <?php
249
  }?>
250
+ <?php
251
+ $css = ob_get_contents();
252
+ ob_end_clean();
253
+
254
+ wp_register_style( 'generate_feed_styles', false );
255
+ wp_enqueue_style( 'generate_feed_styles' );
256
+ wp_add_inline_style( 'generate_feed_styles', $css );
257
+ }
258
  }
frontend/views/thumbnails.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
2
 
3
  class WDI_Thumbnails_view {
 
4
  private $model;
5
 
6
  public function __construct($model) {
@@ -15,14 +16,13 @@ class WDI_Thumbnails_view {
15
  $this->add_theme_styles();
16
  $this->generate_feed_styles($feed_row);
17
  $style = $this->model->theme_row;
18
- $container_class = 'wdi_feed_theme_' . '1' . ' wdi_feed_thumbnail_' . '1';
19
  $wdi_data_ajax = defined('DOING_AJAX') && DOING_AJAX ? 'data-wdi_ajax=1' : '';
20
  ?>
21
  <div id="wdi_feed_<?php echo $wdi_feed_counter ?>" class="wdi_feed_main_container wdi_layout_th <?php echo $container_class; ?>" <?php echo $wdi_data_ajax; ?> >
22
  <?php wdi_feed_frontend_messages();?>
23
  <div id="wdi_spider_popup_loading_<?php echo $wdi_feed_counter ?>" class="wdi_spider_popup_loading"></div>
24
- <div id="wdi_spider_popup_overlay_<?php echo $wdi_feed_counter ?>" class="wdi_spider_popup_overlay"
25
- onclick="wdi_spider_destroypopup(1000)"></div>
26
  <div class="wdi_feed_container">
27
  <div class="wdi_feed_info">
28
  <div id="wdi_feed_<?php echo $wdi_feed_counter ?>_header" class='wdi_feed_header'></div>
@@ -38,22 +38,21 @@ class WDI_Thumbnails_view {
38
  ?>
39
  <div id="wdi_pagination" class="wdi_pagination">
40
  <div class="wdi_pagination_container"><i id="wdi_first_page"
41
- title="<?php echo __('First Page', "wd-instagram-feed") ?>"
42
- class="tenweb-i tenweb-i-step-backward wdi_pagination_ctrl wdi_disabled"></i><i
43
- id="wdi_prev" title="<?php echo __('Previous Page', "wd-instagram-feed") ?>"
44
- class="tenweb-i tenweb-i-arrow-left wdi_pagination_ctrl"></i><i id="wdi_current_page" class="wdi_pagination_ctrl"
45
- style="font-style:normal">1</i><i id="wdi_next"
46
- title="<?php echo __('Next Page', "wd-instagram-feed") ?>"
47
- class="tenweb-i tenweb-i-arrow-right wdi_pagination_ctrl"></i>
48
  <i id="wdi_last_page" title="<?php echo __('Last Page', "wd-instagram-feed") ?>"
49
- class="tenweb-i tenweb-i-step-forward wdi_pagination_ctrl wdi_disabled"></i>
50
- </div>
51
- </div>
52
- <?php
53
  }
54
  ?>
55
- <div class="wdi_feed_wrapper <?php echo 'wdi_col_' . $feed_row['number_of_columns'] ?>" wdi-res='<?php echo 'wdi_col_' . $feed_row['number_of_columns'] ?>'></div>
 
56
  <div class="wdi_clear"></div>
 
57
  <?php switch ($feed_row['feed_display_view']) {
58
  case 'load_more_btn': {
59
  ?>
@@ -66,7 +65,7 @@ class WDI_Thumbnails_view {
66
  </div>
67
  </div>
68
  </div>
69
- <div class="wdi_spinner ">
70
  <div class="wdi_spinner_container">
71
  <div class="wdi_spinner_wrap">
72
  <div class="wdi_spinner_wrap_inner"><i class="wdi_load_more_spinner tenweb-i tenweb-i-spinner"></i></div>
@@ -74,38 +73,39 @@ class WDI_Thumbnails_view {
74
  </div>
75
  </div>
76
  <?php
 
77
  break;
78
  }
79
  case 'pagination': {
80
  if ($style['pagination_position_vert'] === 'bottom') {
81
  ?>
82
  <div id="wdi_pagination" class="wdi_pagination">
83
- <div class="wdi_pagination_container"><i id="wdi_first_page"
84
- title="<?php echo __('First Page', "wd-instagram-feed") ?>"
85
- class="tenweb-i tenweb-i-step-backward wdi_disabled wdi_pagination_ctrl"></i><i
86
- id="wdi_prev" title="<?php echo __('Previous Page', "wd-instagram-feed") ?>"
87
- class="tenweb-i tenweb-i-arrow-left wdi_pagination_ctrl"></i><i id="wdi_current_page" class="wdi_pagination_ctrl"
88
- style="font-style:normal">1</i><i id="wdi_next"
89
- title="<?php echo __('Next Page', "wd-instagram-feed") ?>"
90
- class="tenweb-i tenweb-i-arrow-right wdi_pagination_ctrl"></i>
91
- <i id="wdi_last_page" title="<?php echo __('Last Page', "wd-instagram-feed") ?>"
92
- class="tenweb-i tenweb-i-step-forward wdi_pagination_ctrl wdi_disabled"></i></div></div> <?php
93
  }
94
 
95
  break;
96
  }
97
- case 'infinite_scroll': {
98
- ?>
99
- <div id="wdi_infinite_scroll" class="wdi_infinite_scroll"></div> <?php
100
- }
101
  }
 
102
  ?>
 
103
  </div>
104
- <div class="wdi_front_overlay"></div>
105
  </div>
106
  <?php
 
107
  }
108
 
 
109
  public function pass_feed_data_to_js()
110
  {
111
  global $wdi_options;
@@ -132,14 +132,21 @@ class WDI_Thumbnails_view {
132
 
133
  private function add_theme_styles(){
134
 
135
- if(WDILibrary::is_ajax() || WDILibrary::elementor_is_active()) {
136
- $style_tag = "<link rel='stylesheet' id='%s' href='%s' type='text/css' media='all' />";
137
- echo sprintf($style_tag, 'wdi_default_theme', WDI_URL . '/css/default_theme.css' . '?ver=' . WDI_VERSION);
138
- } else {
139
- wp_enqueue_style("wdi_default_theme",WDI_URL . '/css/default_theme.css',array(),WDI_VERSION);
 
 
140
  }
141
 
142
- /*THIS METHOD FOR PAID VERSION*/
 
 
 
 
 
143
  }
144
 
145
  /**
@@ -147,8 +154,19 @@ class WDI_Thumbnails_view {
147
  * @return boolean
148
  * */
149
  private function load_theme_css_file($generator){
150
- /*THIS METHOD FOR PAID VERSION*/
151
- return false;
 
 
 
 
 
 
 
 
 
 
 
152
  }
153
 
154
  public function generate_feed_styles($feed_row)
@@ -156,9 +174,9 @@ class WDI_Thumbnails_view {
156
  $style = $this->model->theme_row;
157
  $wdi_feed_counter = $this->model->wdi_feed_counter;
158
  $colNum = (100 / $feed_row['number_of_columns']);
159
- ?>
160
- <style type="text/css">
161
 
 
 
162
  #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_feed_header {
163
  display: <?php echo ($feed_row['display_header']=='1')? 'block' : 'none'?>; /*if display-header is true display:block*/
164
  }
@@ -173,7 +191,6 @@ class WDI_Thumbnails_view {
173
  ?>
174
  #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_header_user_text {
175
  padding-top: <?php echo $header_text_padding; ?>px;
176
-
177
  }
178
 
179
  #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_header_user_text h3 {
@@ -186,9 +203,9 @@ class WDI_Thumbnails_view {
186
 
187
  #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_feed_item {
188
  width: <?php echo $colNum.'%'?>; /*thumbnail_size*/
 
189
  }
190
 
191
-
192
  <?php if($feed_row['disable_mobile_layout']=="0"){
193
  ?>
194
  @media screen and (min-width: 800px) and (max-width: 1024px) {
@@ -241,11 +258,12 @@ class WDI_Thumbnails_view {
241
  }
242
 
243
  <?php } ?>
244
- </style>
245
  <?php
246
- }
 
247
 
248
-
249
- }
250
-
251
- ?>
 
1
  <?php
2
 
3
  class WDI_Thumbnails_view {
4
+
5
  private $model;
6
 
7
  public function __construct($model) {
16
  $this->add_theme_styles();
17
  $this->generate_feed_styles($feed_row);
18
  $style = $this->model->theme_row;
19
+ $container_class = 'wdi_feed_theme_' . $style['id'] . ' wdi_feed_thumbnail_' . $style['id'];
20
  $wdi_data_ajax = defined('DOING_AJAX') && DOING_AJAX ? 'data-wdi_ajax=1' : '';
21
  ?>
22
  <div id="wdi_feed_<?php echo $wdi_feed_counter ?>" class="wdi_feed_main_container wdi_layout_th <?php echo $container_class; ?>" <?php echo $wdi_data_ajax; ?> >
23
  <?php wdi_feed_frontend_messages();?>
24
  <div id="wdi_spider_popup_loading_<?php echo $wdi_feed_counter ?>" class="wdi_spider_popup_loading"></div>
25
+ <div id="wdi_spider_popup_overlay_<?php echo $wdi_feed_counter ?>" class="wdi_spider_popup_overlay" onclick="wdi_spider_destroypopup(1000)"></div>
 
26
  <div class="wdi_feed_container">
27
  <div class="wdi_feed_info">
28
  <div id="wdi_feed_<?php echo $wdi_feed_counter ?>_header" class='wdi_feed_header'></div>
38
  ?>
39
  <div id="wdi_pagination" class="wdi_pagination">
40
  <div class="wdi_pagination_container"><i id="wdi_first_page"
41
+ title="<?php echo __('First Page', "wd-instagram-feed") ?>"
42
+ class="tenweb-i tenweb-i-step-backward wdi_pagination_ctrl wdi_disabled"></i><i
43
+ id="wdi_prev" title="<?php echo __('Previous Page', "wd-instagram-feed") ?>"
44
+ class="tenweb-i tenweb-i-arrow-left wdi_pagination_ctrl"></i><i id="wdi_current_page" class="wdi_pagination_ctrl"
45
+ style="font-style:normal">1</i><i id="wdi_next"
46
+ title="<?php echo __('Next Page', "wd-instagram-feed") ?>"
47
+ class="tenweb-i tenweb-i-arrow-right wdi_pagination_ctrl"></i>
48
  <i id="wdi_last_page" title="<?php echo __('Last Page', "wd-instagram-feed") ?>"
49
+ class="tenweb-i tenweb-i-step-forward wdi_pagination_ctrl wdi_disabled"></i></div></div> <?php
 
 
 
50
  }
51
  ?>
52
+ <div class="wdi_feed_wrapper <?php echo 'wdi_col_' . $feed_row['number_of_columns'] ?>"
53
+ wdi-res='<?php echo 'wdi_col_' . $feed_row['number_of_columns'] ?>'></div>
54
  <div class="wdi_clear"></div>
55
+
56
  <?php switch ($feed_row['feed_display_view']) {
57
  case 'load_more_btn': {
58
  ?>
65
  </div>
66
  </div>
67
  </div>
68
+ <div class="wdi_spinner">
69
  <div class="wdi_spinner_container">
70
  <div class="wdi_spinner_wrap">
71
  <div class="wdi_spinner_wrap_inner"><i class="wdi_load_more_spinner tenweb-i tenweb-i-spinner"></i></div>
73
  </div>
74
  </div>
75
  <?php
76
+
77
  break;
78
  }
79
  case 'pagination': {
80
  if ($style['pagination_position_vert'] === 'bottom') {
81
  ?>
82
  <div id="wdi_pagination" class="wdi_pagination">
83
+ <div class="wdi_pagination_container"><i id="wdi_first_page"
84
+ title="<?php echo __('First Page', "wd-instagram-feed") ?>"
85
+ class="tenweb-i tenweb-i-step-backward wdi_disabled wdi_pagination_ctrl"></i><i
86
+ id="wdi_prev" title="<?php echo __('Previous Page', "wd-instagram-feed") ?>"
87
+ class="tenweb-i tenweb-i-arrow-left wdi_pagination_ctrl"></i><i id="wdi_current_page" class="wdi_pagination_ctrl"
88
+ style="font-style:normal">1</i><i id="wdi_next"
89
+ title="<?php echo __('Next Page', "wd-instagram-feed") ?>"
90
+ class="tenweb-i tenweb-i-arrow-right wdi_pagination_ctrl"></i>
91
+ <i id="wdi_last_page" title="<?php echo __('Last Page', "wd-instagram-feed") ?>"
92
+ class="tenweb-i tenweb-i-step-forward wdi_pagination_ctrl wdi_disabled"></i></div></div> <?php
93
  }
94
 
95
  break;
96
  }
 
 
 
 
97
  }
98
+
99
  ?>
100
+
101
  </div>
102
+ <div class="wdi_front_overlay"></div>
103
  </div>
104
  <?php
105
+
106
  }
107
 
108
+
109
  public function pass_feed_data_to_js()
110
  {
111
  global $wdi_options;
132
 
133
  private function add_theme_styles(){
134
 
135
+ $theme = $this->model->theme_row;
136
+
137
+ require_once WDI_DIR . '/framework/WDI_generate_styles.php';
138
+ $generator = new WDI_generate_styles($theme['id'], $theme);
139
+
140
+ if($this->load_theme_css_file($generator) === true) {
141
+ return;
142
  }
143
 
144
+ if($generator->all_views_styles(true, true) === true &&
145
+ $this->load_theme_css_file($generator) === true) {
146
+ return;
147
+ }
148
+
149
+ echo '<style>' . $generator->get_css() . '</style>';
150
  }
151
 
152
  /**
154
  * @return boolean
155
  * */
156
  private function load_theme_css_file($generator){
157
+ $file_url = $generator->get_file_url();
158
+ if($file_url !== "") {
159
+ $theme_path_parts = pathinfo($file_url);
160
+ if(WDILibrary::is_ajax() || WDILibrary::elementor_is_active()) {
161
+ $style_tag = "<link rel='stylesheet' id='%s' href='%s' type='text/css' media='all' />";
162
+ echo sprintf($style_tag,$theme_path_parts['basename'], $file_url . '?key=' . $generator->get_file_key());
163
+ }else{
164
+ wp_enqueue_style($theme_path_parts['basename'], $file_url . '?key=' . $generator->get_file_key());
165
+ }
166
+ return true;
167
+ } else {
168
+ return false;
169
+ }
170
  }
171
 
172
  public function generate_feed_styles($feed_row)
174
  $style = $this->model->theme_row;
175
  $wdi_feed_counter = $this->model->wdi_feed_counter;
176
  $colNum = (100 / $feed_row['number_of_columns']);
 
 
177
 
178
+ ob_start()
179
+ ?>
180
  #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_feed_header {
181
  display: <?php echo ($feed_row['display_header']=='1')? 'block' : 'none'?>; /*if display-header is true display:block*/
182
  }
191
  ?>
192
  #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_header_user_text {
193
  padding-top: <?php echo $header_text_padding; ?>px;
 
194
  }
195
 
196
  #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_header_user_text h3 {
203
 
204
  #wdi_feed_<?php echo $wdi_feed_counter?> .wdi_feed_item {
205
  width: <?php echo $colNum.'%'?>; /*thumbnail_size*/
206
+ line-height: 0;
207
  }
208
 
 
209
  <?php if($feed_row['disable_mobile_layout']=="0"){
210
  ?>
211
  @media screen and (min-width: 800px) and (max-width: 1024px) {
258
  }
259
 
260
  <?php } ?>
 
261
  <?php
262
+ $css = ob_get_contents();
263
+ ob_end_clean();
264
 
265
+ wp_register_style( 'generate_feed_styles', false );
266
+ wp_enqueue_style( 'generate_feed_styles' );
267
+ wp_add_inline_style( 'generate_feed_styles', $css );
268
+ }
269
+ }
images/arrow3.png DELETED
Binary file
images/close.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="10" height="10.15" viewBox="0 0 10 10.15"><defs><style>.a{fill:#ccc;}</style></defs><g transform="translate(-56 187.5)"><path class="a" d="M56.88-186.575a9.05,9.05,0,0,0-.88.955c0,.038.7.774,1.556,1.632l1.564,1.564-1.564,1.564C56.7-180,56-179.267,56-179.229a8.647,8.647,0,0,0,.9.977l.9.9,1.564-1.564c.857-.857,1.594-1.556,1.632-1.556s.774.7,1.632,1.556L64.2-177.35l.9-.9a8.646,8.646,0,0,0,.9-.977c0-.038-.7-.774-1.556-1.632l-1.564-1.564,1.564-1.564C65.3-184.846,66-185.583,66-185.62a8.645,8.645,0,0,0-.9-.977l-.9-.9-1.564,1.564c-.857.857-1.594,1.556-1.632,1.556s-.767-.692-1.617-1.541-1.556-1.541-1.579-1.541S57.368-187.064,56.88-186.575Z" transform="translate(0)"/></g></svg>
images/feed_views/control_buttons.png CHANGED
Binary file
images/hny.jpg DELETED
Binary file
images/i_support.png DELETED
Binary file
images/instagram-connect-320.png ADDED
Binary file
images/instagram-connect.png ADDED
Binary file
images/instagram.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="30.3" height="30.3" viewBox="0 0 30.3 30.3"><defs><style>.a{fill:#fff;}</style></defs><path class="a" d="M20.831,0H9.469A9.47,9.47,0,0,0,0,9.469V20.831A9.47,9.47,0,0,0,9.469,30.3H20.831A9.47,9.47,0,0,0,30.3,20.831V9.469A9.47,9.47,0,0,0,20.831,0Zm6.628,20.831a6.635,6.635,0,0,1-6.628,6.628H9.469a6.635,6.635,0,0,1-6.628-6.628V9.469A6.635,6.635,0,0,1,9.469,2.841H20.831a6.635,6.635,0,0,1,6.628,6.628Z"/><path class="a" d="M135.575,128a7.575,7.575,0,1,0,7.575,7.575A7.575,7.575,0,0,0,135.575,128Zm0,12.309a4.734,4.734,0,1,1,4.734-4.734A4.741,4.741,0,0,1,135.575,140.309Z" transform="translate(-120.425 -120.425)"/><circle class="a" cx="1.009" cy="1.009" r="1.009" transform="translate(22.284 5.998)"/></svg>
images/instagram_logo.png DELETED
Binary file
images/menu_icon2.png DELETED
Binary file
images/minus.png DELETED
Binary file
images/notice.png DELETED
Binary file
images/plus.png DELETED
Binary file
images/publish.png DELETED
Binary file
images/seo_logo.png DELETED
Binary file
images/spinner.gif DELETED
Binary file
images/unpublish.png DELETED
Binary file
images/watermark.png DELETED
Binary file
images/wd-logo.png DELETED
Binary file
images/wd_slider.png DELETED
Binary file
js/gallerybox/wdi_gallery_box.js CHANGED
@@ -72,94 +72,9 @@ var wdi_construct_popup = function (popup, currentFeed, image_rows, current_imag
72
  this.theme_row = {};
73
  this.construct = function () {
74
  this.theme_row = window['wdi_theme_' + currentFeed.feed_row.theme_id];
75
- if (currentFeed.feed_row.popup_enable_filmstrip && currentFeed.feed_row.popup_enable_filmstrip === "1") {
76
- this.add_filmstrip();
77
- }
78
  this.set_wdi_data();
79
  };
80
 
81
- this.add_filmstrip = function () {
82
-
83
- var filmstrip_direction = 'horizontal';
84
- if (this.theme_row.lightbox_filmstrip_pos === 'right' || this.theme_row.lightbox_filmstrip_pos === 'left') {
85
- filmstrip_direction = 'vertical';
86
- }
87
-
88
- var fa_class_name_1 = (filmstrip_direction === "horizontal") ? 'tenweb-i-angle-left' : 'tenweb-i-angle-up';
89
- var fa_class_name_2 = (filmstrip_direction === "horizontal") ? 'tenweb-i-angle-right' : 'tenweb-i-angle-down';
90
-
91
- // var thumb_width = 90;
92
- // var thumb_height = 90;
93
-
94
- var thumbnails_html = "";
95
-
96
- var image_filmstrip_height,image_filmstrip_width;
97
- if (filmstrip_direction === 'horizontal') {
98
- image_filmstrip_width = image_filmstrip_height = (typeof currentFeed.feed_row['popup_filmstrip_height'] !== "undefined") ? (currentFeed.feed_row['popup_filmstrip_height']) : '20';
99
- }
100
- else {
101
- image_filmstrip_width = image_filmstrip_height = (typeof currentFeed.feed_row['popup_filmstrip_height'] !== "undefined") ? (currentFeed.feed_row['popup_filmstrip_height']) : '50';
102
- }
103
-
104
- image_filmstrip_height = image_filmstrip_width = parseInt(image_filmstrip_width);
105
-
106
- for (var i = 0; i < image_rows.length; i++) {
107
- var image_row = image_rows[i];
108
-
109
- var image_thumb_width,image_thumb_height,scale;
110
- if (image_row.resolution && image_row.resolution !== '') {
111
- var resolution_arr = image_row.resolution.split(" ");
112
- var resolution_w = intval($resolution_arr[0]);
113
- var resolution_h = intval($resolution_arr[2]);
114
- if (resolution_w !== 0 && resolution_h !== 0) {
115
- scale = Math.max(image_filmstrip_width / resolution_w, image_filmstrip_height / resolution_h);
116
- image_thumb_width = resolution_w * scale;
117
- image_thumb_height = resolution_h * scale;
118
- }
119
- else {
120
- image_thumb_width = image_filmstrip_width;
121
- image_thumb_height = image_filmstrip_height;
122
- }
123
- }
124
- else {
125
- image_thumb_width = image_filmstrip_width;
126
- image_thumb_height = image_filmstrip_height;
127
- }
128
-
129
- scale = Math.max(image_filmstrip_width / image_thumb_width, image_filmstrip_height / image_thumb_height);
130
- image_thumb_width *= scale;
131
- image_thumb_height *= scale;
132
- var thumb_left = (image_filmstrip_width - image_thumb_width) / 2;
133
- var thumb_top = (image_filmstrip_height - image_thumb_height) / 2;
134
-
135
- var class_name = "wdi_filmstrip_thumbnail " + ((parseInt(image_row.id) === parseInt(current_image_id)) ? 'wdi_thumb_active' : 'wdi_thumb_deactive');
136
-
137
- var img_style = 'width:' + image_thumb_width + 'px;' +
138
- 'height:'+image_thumb_height+'px;' +
139
- 'margin-left:'+thumb_left+'px;' +
140
- 'margin-top:'+thumb_top+'px;';
141
- var src = (typeof image_row.images[currentFeed.feedImageResolution] !== 'undefined' && typeof image_row.images[currentFeed.feedImageResolution]['url'] !== "undefined") ? image_row.images[currentFeed.feedImageResolution]['url'] : image_row.thumb_url;
142
- var onclick = 'wdi_change_image(parseInt(jQuery(\'#wdi_current_image_key\').val()), \'' + i + '\', wdi_data)';
143
- var ontouchend = 'wdi_change_image(parseInt(jQuery(\'#wdi_current_image_key\').val()), \'' + i + '\', wdi_data)';
144
-
145
- var img_html = '<img style="' + img_style + '" class="wdi_filmstrip_thumbnail_img" src="' + src + '" onclick="' + onclick + '" ontouchend="' + ontouchend + '" image_id="' + image_row.id + '" image_key="' + i + '" alt="' + image_row.alt + '" />';
146
- thumbnails_html += '<div id="wdi_filmstrip_thumbnail_' + i + '" class="' + class_name + '">' + img_html + '</div>';
147
-
148
-
149
- }
150
-
151
- var html = '' +
152
- '<div class="wdi_filmstrip_left"><i class="tenweb-i ' + fa_class_name_1 + '"></i></div>' +
153
- '<div class="wdi_filmstrip">' +
154
- '<div class="wdi_filmstrip_thumbnails">' +
155
- thumbnails_html +
156
- '</div>' +
157
- '</div>' +
158
- '<div class="wdi_filmstrip_right"><i class="tenweb-i ' + fa_class_name_2 + '"></i></div>';
159
-
160
- popup.find('.wdi_filmstrip_container').append(html);
161
- };
162
-
163
  this.set_wdi_data = function () {
164
 
165
  wdi_data = [];
@@ -211,6 +126,13 @@ function wdi_spider_receivedpopup(description, lifetime)
211
  var date = new Date();
212
  date.setDate(date.getDate() + lifetime);
213
  document.cookie = description + "=true;expires=" + date.toUTCString() + ";path=/";
 
 
 
 
 
 
 
214
  }
215
 
216
  function wdi_spider_isunsupporteduseragent()
@@ -414,9 +336,13 @@ wdi_comments_manager = {
414
  jQuery('.wdi_comments').append(wdi_comments);
415
  jQuery('.wdi_comments').append(wdi_added_comments);
416
 
417
- /* for free version */
418
-
419
-
 
 
 
 
420
 
421
  ////
422
  jQuery('.wdi_comments_close_btn').on('click', wdi_comment);
@@ -876,83 +802,7 @@ function wdi_testDom(prop) {
876
  return false;
877
  }
878
 
879
- function wdi_cube(tz, ntx, nty, nrx, nry, wrx, wry, current_image_class, next_image_class, direction) {
880
- /* If browser does not support 3d transforms/CSS transitions.*/
881
- if (!wdi_testBrowser_cssTransitions()) {
882
- return wdi_fallback(current_image_class, next_image_class, direction);
883
- }
884
- if (!wdi_testBrowser_cssTransforms3d()) {
885
- return wdi_fallback3d(current_image_class, next_image_class, direction);
886
- }
887
- wdi_trans_in_progress = true;
888
- /* Set active thumbnail.*/
889
- jQuery(".wdi_filmstrip_thumbnail").removeClass("wdi_thumb_active").addClass("wdi_thumb_deactive");
890
- jQuery("#wdi_filmstrip_thumbnail_" + wdi_current_key).removeClass("wdi_thumb_deactive").addClass("wdi_thumb_active");
891
- jQuery(".wdi_slide_bg").css('perspective', 1000);
892
- jQuery(current_image_class).css({
893
- transform : 'translateZ(' + tz + 'px)',
894
- backfaceVisibility : 'hidden'
895
- });
896
- jQuery(next_image_class).css({
897
- opacity : 1,
898
- filter: 'Alpha(opacity=100)',
899
- backfaceVisibility : 'hidden',
900
- transform : 'translateY(' + nty + 'px) translateX(' + ntx + 'px) rotateY('+ nry +'deg) rotateX('+ nrx +'deg)'
901
- });
902
- jQuery(".wdi_slider").css({
903
- transform: 'translateZ(-' + tz + 'px)',
904
- transformStyle: 'preserve-3d'
905
- });
906
- /* Execution steps.*/
907
- setTimeout(function () {
908
- jQuery(".wdi_slider").css({
909
- transition: 'all ' + wdi_transition_duration + 'ms ease-in-out',
910
- transform: 'translateZ(-' + tz + 'px) rotateX('+ wrx +'deg) rotateY('+ wry +'deg)'
911
- });
912
- }, 20);
913
- /* After transition.*/
914
- jQuery(".wdi_slider").one('webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend', jQuery.proxy(wdi_after_trans));
915
- function wdi_after_trans() {
916
- jQuery(current_image_class).removeAttr('style');
917
- jQuery(next_image_class).removeAttr('style');
918
- jQuery(".wdi_slider").removeAttr('style');
919
- jQuery(current_image_class).css({'opacity' : 0, filter: 'Alpha(opacity=0)', 'z-index': 1});
920
- jQuery(next_image_class).css({'opacity' : 1, filter: 'Alpha(opacity=100)', 'z-index' : 2});
921
-
922
- wdi_trans_in_progress = false;
923
- jQuery(current_image_class).html('');
924
- if (typeof event_stack !== 'undefined') {
925
- if (event_stack.length > 0) {
926
- key = event_stack[0].split("-");
927
- event_stack.shift();
928
- wdi_change_image(key[0], key[1], wdi_data, true);
929
- }
930
- }
931
- wdi_change_watermark_container();
932
- }
933
- }
934
 
935
- function wdi_cubeH(current_image_class, next_image_class, direction) {
936
- /* Set to half of image width.*/
937
- var dimension = jQuery(current_image_class).width() / 2;
938
- if (direction == 'right') {
939
- wdi_cube(dimension, dimension, 0, 0, 90, 0, -90, current_image_class, next_image_class, direction);
940
- }
941
- else if (direction == 'left') {
942
- wdi_cube(dimension, -dimension, 0, 0, -90, 0, 90, current_image_class, next_image_class, direction);
943
- }
944
- }
945
- function wdi_cubeV(current_image_class, next_image_class, direction) {
946
- /* Set to half of image height.*/
947
- var dimension = jQuery(current_image_class).height() / 2;
948
- /* If next slide.*/
949
- if (direction == 'right') {
950
- wdi_cube(dimension, 0, -dimension, 90, 0, -90, 0, current_image_class, next_image_class, direction);
951
- }
952
- else if (direction == 'left') {
953
- wdi_cube(dimension, 0, dimension, -90, 0, 90, 0, current_image_class, next_image_class, direction);
954
- }
955
- }
956
 
957
  /* For browsers that does not support transitions.*/
958
  function wdi_fallback(current_image_class, next_image_class, direction) {
@@ -1001,200 +851,6 @@ function wdi_fade(current_image_class, next_image_class, direction) {
1001
  jQuery(next_image_class).fadeTo(wdi_transition_duration, 1);
1002
  }
1003
  }
1004
-
1005
- function wdi_grid(cols, rows, ro, tx, ty, sc, op, current_image_class, next_image_class, direction) {
1006
- /* If browser does not support CSS transitions.*/
1007
- if (!wdi_testBrowser_cssTransitions()) {
1008
- return wdi_fallback(current_image_class, next_image_class, direction);
1009
- }
1010
- wdi_trans_in_progress = true;
1011
- /* Set active thumbnail.*/
1012
- jQuery(".wdi_filmstrip_thumbnail").removeClass("wdi_thumb_active").addClass("wdi_thumb_deactive");
1013
- jQuery("#wdi_filmstrip_thumbnail_" + wdi_current_key).removeClass("wdi_thumb_deactive").addClass("wdi_thumb_active");
1014
- /* The time (in ms) added to/subtracted from the delay total for each new gridlet.*/
1015
- var count = (wdi_transition_duration) / (cols + rows);
1016
- /* Gridlet creator (divisions of the image grid, positioned with background-images to replicate the look of an entire slide image when assembled)*/
1017
- function wdi_gridlet(width, height, top, img_top, left, img_left, src, imgWidth, imgHeight, c, r) {
1018
- var delay = (c + r) * count;
1019
- /* Return a gridlet elem with styles for specific transition.*/
1020
- return jQuery('<span class="wdi_gridlet" />').css({
1021
- display : "block",
1022
- width : width,
1023
- height : height,
1024
- top : top,
1025
- left : left,
1026
- backgroundImage : 'url("' + src + '")',
1027
- backgroundColor: jQuery(".wdi_spider_popup_wrap").css("background-color"),
1028
- /*backgroundColor: 'rgba(0, 0, 0, 0)',*/
1029
- backgroundRepeat: 'no-repeat',
1030
- backgroundPosition : img_left + 'px ' + img_top + 'px',
1031
- backgroundSize : imgWidth + 'px ' + imgHeight + 'px',
1032
- transition : 'all ' + wdi_transition_duration + 'ms ease-in-out ' + delay + 'ms',
1033
- transform : 'none'
1034
- });
1035
- }
1036
- /* Get the current slide's image.*/
1037
- var cur_img = jQuery(current_image_class).find('img');
1038
- /* Create a grid to hold the gridlets.*/
1039
- var grid = jQuery('<span style="display: block;" />').addClass('wdi_grid');
1040
- /* Prepend the grid to the next slide (i.e. so it's above the slide image).*/
1041
- jQuery(current_image_class).prepend(grid);
1042
- /* Vars to calculate positioning/size of gridlets.*/
1043
- var cont = jQuery(".wdi_slide_bg");
1044
- var imgWidth = cur_img.width();
1045
- var imgHeight = cur_img.height();
1046
- var contWidth = cont.width(),
1047
- contHeight = cont.height(),
1048
- colWidth = Math.floor(contWidth / cols),
1049
- rowHeight = Math.floor(contHeight / rows),
1050
- colRemainder = contWidth - (cols * colWidth),
1051
- colAdd = Math.ceil(colRemainder / cols),
1052
- rowRemainder = contHeight - (rows * rowHeight),
1053
- rowAdd = Math.ceil(rowRemainder / rows),
1054
- leftDist = 0,
1055
- img_leftDist = Math.ceil((jQuery(".wdi_slide_bg").width() - cur_img.width()) / 2);
1056
- var imgSrc = typeof cur_img.attr('src')=='undefined' ? '' :cur_img.attr('src');
1057
- /* tx/ty args can be passed as 'auto'/'min-auto' (meaning use slide width/height or negative slide width/height).*/
1058
- tx = tx === 'auto' ? contWidth : tx;
1059
- tx = tx === 'min-auto' ? - contWidth : tx;
1060
- ty = ty === 'auto' ? contHeight : ty;
1061
- ty = ty === 'min-auto' ? - contHeight : ty;
1062
- /* Loop through cols.*/
1063
- for (var i = 0; i < cols; i++) {
1064
- var topDist = 0,
1065
- img_topDst = Math.floor((jQuery(".wdi_slide_bg").height() - cur_img.height()) / 2),
1066
- newColWidth = colWidth;
1067
- /* If imgWidth (px) does not divide cleanly into the specified number of cols, adjust individual col widths to create correct total.*/
1068
- if (colRemainder > 0) {
1069
- var add = colRemainder >= colAdd ? colAdd : colRemainder;
1070
- newColWidth += add;
1071
- colRemainder -= add;
1072
- }
1073
- /* Nested loop to create row gridlets for each col.*/
1074
- for (var j = 0; j < rows; j++) {
1075
- var newRowHeight = rowHeight,
1076
- newRowRemainder = rowRemainder;
1077
- /* If contHeight (px) does not divide cleanly into the specified number of rows, adjust individual row heights to create correct total.*/
1078
- if (newRowRemainder > 0) {
1079
- add = newRowRemainder >= rowAdd ? rowAdd : rowRemainder;
1080
- newRowHeight += add;
1081
- newRowRemainder -= add;
1082
- }
1083
- /* Create & append gridlet to grid.*/
1084
- grid.append(wdi_gridlet(newColWidth, newRowHeight, topDist, img_topDst, leftDist, img_leftDist, imgSrc, imgWidth, imgHeight, i, j));
1085
- topDist += newRowHeight;
1086
- img_topDst -= newRowHeight;
1087
- }
1088
- img_leftDist -= newColWidth;
1089
- leftDist += newColWidth;
1090
- }
1091
- /* Set event listener on last gridlet to finish transitioning.*/
1092
- var last_gridlet = grid.children().last();
1093
- /* Show grid & hide the image it replaces.*/
1094
- grid.show();
1095
- cur_img.css('opacity', 0);
1096
- /* Add identifying classes to corner gridlets (useful if applying border radius).*/
1097
- grid.children().first().addClass('rs-top-left');
1098
- grid.children().last().addClass('rs-bottom-right');
1099
- grid.children().eq(rows - 1).addClass('rs-bottom-left');
1100
- grid.children().eq(- rows).addClass('rs-top-right');
1101
- /* Execution steps.*/
1102
- setTimeout(function () {
1103
- grid.children().css({
1104
- opacity: op,
1105
- transform: 'rotate('+ ro +'deg) translateX('+ tx +'px) translateY('+ ty +'px) scale('+ sc +')'
1106
- });
1107
- }, 1);
1108
- jQuery(next_image_class).css('opacity', 1);
1109
- /* After transition.*/
1110
- jQuery(last_gridlet).one('webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend', jQuery.proxy(wdi_after_trans));
1111
- function wdi_after_trans() {
1112
- jQuery(current_image_class).css({'opacity' : 0, 'z-index': 1});
1113
- jQuery(next_image_class).css({'opacity' : 1, 'z-index' : 2});
1114
- cur_img.css('opacity', 1);
1115
- grid.remove();
1116
- wdi_trans_in_progress = false;
1117
- jQuery(current_image_class).html('');
1118
- if (typeof event_stack !== 'undefined') {
1119
- if (event_stack.length > 0) {
1120
- key = event_stack[0].split("-");
1121
- event_stack.shift();
1122
- wdi_change_image(key[0], key[1], wdi_data, true);
1123
- }
1124
- }
1125
- wdi_change_watermark_container();
1126
- }
1127
- }
1128
- function wdi_sliceH(current_image_class, next_image_class, direction) {
1129
- if (direction == 'right') {
1130
- var translateX = 'min-auto';
1131
- }
1132
- else if (direction == 'left') {
1133
- var translateX = 'auto';
1134
- }
1135
- wdi_grid(1, 8, 0, translateX, 0, 1, 0, current_image_class, next_image_class, direction);
1136
- }
1137
- function wdi_sliceV(current_image_class, next_image_class, direction) {
1138
- if (direction == 'right') {
1139
- var translateY = 'min-auto';
1140
- }
1141
- else if (direction == 'left') {
1142
- var translateY = 'auto';
1143
- }
1144
- wdi_grid(10, 1, 0, 0, translateY, 1, 0, current_image_class, next_image_class, direction);
1145
- }
1146
- function wdi_slideV(current_image_class, next_image_class, direction) {
1147
- if (direction == 'right') {
1148
- var translateY = 'auto';
1149
- }
1150
- else if (direction == 'left') {
1151
- var translateY = 'min-auto';
1152
- }
1153
- wdi_grid(1, 1, 0, 0, translateY, 1, 1, current_image_class, next_image_class, direction);
1154
- }
1155
- function wdi_slideH(current_image_class, next_image_class, direction) {
1156
- if (direction == 'right') {
1157
- var translateX = 'min-auto';
1158
- }
1159
- else if (direction == 'left') {
1160
- var translateX = 'auto';
1161
- }
1162
- wdi_grid(1, 1, 0, translateX, 0, 1, 1, current_image_class, next_image_class, direction);
1163
- }
1164
- function wdi_scaleOut(current_image_class, next_image_class, direction) {
1165
- wdi_grid(1, 1, 0, 0, 0, 1.5, 0, current_image_class, next_image_class, direction);
1166
- }
1167
- function wdi_scaleIn(current_image_class, next_image_class, direction) {
1168
- wdi_grid(1, 1, 0, 0, 0, 0.5, 0, current_image_class, next_image_class, direction);
1169
- }
1170
- function wdi_blockScale(current_image_class, next_image_class, direction) {
1171
- wdi_grid(8, 6, 0, 0, 0, .6, 0, current_image_class, next_image_class, direction);
1172
- }
1173
- function wdi_kaleidoscope(current_image_class, next_image_class, direction) {
1174
- wdi_grid(10, 8, 0, 0, 0, 1, 0, current_image_class, next_image_class, direction);
1175
- }
1176
- function wdi_fan(current_image_class, next_image_class, direction) {
1177
- if (direction == 'right') {
1178
- var rotate = 45;
1179
- var translateX = 100;
1180
- }
1181
- else if (direction == 'left') {
1182
- var rotate = -45;
1183
- var translateX = -100;
1184
- }
1185
- wdi_grid(1, 10, rotate, translateX, 0, 1, 0, current_image_class, next_image_class, direction);
1186
- }
1187
- function wdi_blindV(current_image_class, next_image_class, direction) {
1188
- wdi_grid(1, 8, 0, 0, 0, .7, 0, current_image_class, next_image_class);
1189
- }
1190
- function wdi_blindH(current_image_class, next_image_class, direction) {
1191
- wdi_grid(10, 1, 0, 0, 0, .7, 0, current_image_class, next_image_class);
1192
- }
1193
- function wdi_random(current_image_class, next_image_class, direction) {
1194
- var anims = ['sliceH', 'sliceV', 'slideH', 'slideV', 'scaleOut', 'scaleIn', 'blockScale', 'kaleidoscope', 'fan', 'blindH', 'blindV'];
1195
- /* Pick a random transition from the anims array.*/
1196
- this["wdi_" + anims[Math.floor(Math.random() * anims.length)]](current_image_class, next_image_class, direction);
1197
- }
1198
  function wdi_pause_stream(parent){
1199
  jQuery(parent).find('video').each(function(){
1200
  jQuery(this).get(0).pause();
72
  this.theme_row = {};
73
  this.construct = function () {
74
  this.theme_row = window['wdi_theme_' + currentFeed.feed_row.theme_id];
 
 
 
75
  this.set_wdi_data();
76
  };
77
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  this.set_wdi_data = function () {
79
 
80
  wdi_data = [];
126
  var date = new Date();
127
  date.setDate(date.getDate() + lifetime);
128
  document.cookie = description + "=true;expires=" + date.toUTCString() + ";path=/";
129
+ jQuery(".wdi_image_info").mCustomScrollbar({
130
+ autoHideScrollbar: false,
131
+ scrollInertia: 150,
132
+ advanced: {
133
+ updateOnContentResize: true
134
+ }
135
+ });
136
  }
137
 
138
  function wdi_spider_isunsupporteduseragent()
336
  jQuery('.wdi_comments').append(wdi_comments);
337
  jQuery('.wdi_comments').append(wdi_added_comments);
338
 
339
+ if (typeof jQuery().mCustomScrollbar !== 'undefined') {
340
+ if (jQuery.isFunction(jQuery().mCustomScrollbar)) {
341
+ jQuery(".wdi_comments").mCustomScrollbar({
342
+ scrollInertia: 250
343
+ });
344
+ }
345
+ }
346
 
347
  ////
348
  jQuery('.wdi_comments_close_btn').on('click', wdi_comment);
802
  return false;
803
  }
804
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
805
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
806
 
807
  /* For browsers that does not support transitions.*/
808
  function wdi_fallback(current_image_class, next_image_class, direction) {
851
  jQuery(next_image_class).fadeTo(wdi_transition_duration, 1);
852
  }
853
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
854
  function wdi_pause_stream(parent){
855
  jQuery(parent).find('video').each(function(){
856
  jQuery(this).get(0).pause();
js/gallerybox/wdi_gallery_box.min.js CHANGED
@@ -1 +1 @@
1
- var isPopUpOpened=!1,wdi_data=[];function wdi_spider_createpopup(e,i,a,r,n,d,o,s,_){if(e=e.replace(/&#038;/g,"&"),!isPopUpOpened&&(isPopUpOpened=!0,!wdi_spider_hasalreadyreceivedpopup(d)&&!wdi_spider_isunsupporteduseragent())){jQuery("html").attr("style","overflow:hidden !important;"),jQuery("#wdi_spider_popup_loading_"+i).css({display:"block"}),jQuery("#wdi_spider_popup_overlay_"+i).css({display:"block"});for(var t,c=0,m=0;m<s.parsedData.length;m++)if(s.parsedData[m].id===_){c=m,t=[s.parsedData[m]];break}jQuery.ajax({type:"POST",url:e,dataType:"text",data:{action:"WDIGalleryBox",image_rows:JSON.stringify(t),feed_id:s.feed_row.id,feed_counter:s.feed_row.wdi_feed_counter,current_image_index:c,image_rows_count:s.parsedData.length,carousel_media_row:JSON.stringify(t[0].carousel_media)},success:function(e){var t=jQuery('<div id="wdi_spider_popup_wrap" class="wdi_spider_popup_wrap wdi_lightbox_theme_'+s.feed_row.theme_id+'" style="width:'+a+"px;height:"+r+"px;margin-top:-"+r/2+"px;margin-left: -"+a/2+'px; ">'+e+"</div>");new wdi_construct_popup(t,s,s.parsedData,_).construct(),t.hide().appendTo("body"),wdi_spider_showpopup(d,o,t,n),jQuery("#wdi_spider_popup_loading_"+i).css({display:"none !important;"})}})}}var wdi_construct_popup=function(h,f,g,y){this.theme_row={},this.construct=function(){this.theme_row=window["wdi_theme_"+f.feed_row.theme_id],f.feed_row.popup_enable_filmstrip&&"1"===f.feed_row.popup_enable_filmstrip&&this.add_filmstrip(),this.set_wdi_data()},this.add_filmstrip=function(){var e="horizontal";"right"!==this.theme_row.lightbox_filmstrip_pos&&"left"!==this.theme_row.lightbox_filmstrip_pos||(e="vertical");for(var t="horizontal"===e?"tenweb-i-angle-left":"tenweb-i-angle-up",i="horizontal"===e?"tenweb-i-angle-right":"tenweb-i-angle-down",a="",r=n="horizontal"===e?void 0!==f.feed_row.popup_filmstrip_height?f.feed_row.popup_filmstrip_height:"20":void 0!==f.feed_row.popup_filmstrip_height?f.feed_row.popup_filmstrip_height:"50",n=r=parseInt(r),d=0;d<g.length;d++){var o,s,_,c,m,u=g[d];m=u.resolution&&""!==u.resolution?(u.resolution.split(" "),_=intval($resolution_arr[0]),c=intval($resolution_arr[2]),0!==_&&0!==c?(o=_*(s=Math.max(r/_,n/c)),c*s):(o=r,n)):(o=r,n);var l=(r-(o*=s=Math.max(r/o,n/m)))/2,p=(n-(m*=s))/2;a+='<div id="wdi_filmstrip_thumbnail_'+d+'" class="'+("wdi_filmstrip_thumbnail "+(parseInt(u.id)===parseInt(y)?"wdi_thumb_active":"wdi_thumb_deactive"))+'">'+('<img style="'+("width:"+o+"px;height:"+m+"px;margin-left:"+l+"px;margin-top:"+p+"px;")+'" class="wdi_filmstrip_thumbnail_img" src="'+(void 0!==u.images[f.feedImageResolution]&&void 0!==u.images[f.feedImageResolution].url?u.images[f.feedImageResolution].url:u.thumb_url)+'" onclick="'+("wdi_change_image(parseInt(jQuery('#wdi_current_image_key').val()), '"+d+"', wdi_data)")+'" ontouchend="'+("wdi_change_image(parseInt(jQuery('#wdi_current_image_key').val()), '"+d+"', wdi_data)")+'" image_id="'+u.id+'" image_key="'+d+'" alt="'+u.alt+'" />')+"</div>"}var w='<div class="wdi_filmstrip_left"><i class="tenweb-i '+t+'"></i></div><div class="wdi_filmstrip"><div class="wdi_filmstrip_thumbnails">'+a+'</div></div><div class="wdi_filmstrip_right"><i class="tenweb-i '+i+'"></i></div>';h.find(".wdi_filmstrip_container").append(w)},this.set_wdi_data=function(){wdi_data=[];for(var e=0;e<g.length;e++)wdi_data[e]=[],wdi_data[e].number=e+1,wdi_data[e].id=g[e].id,wdi_data[e].alt=g[e].alt,wdi_data[e].description=wdi_front.escape_tags(g[e].description),wdi_data[e].username=g[e].username,wdi_data[e].profile_picture=g[e].profile_picture,wdi_data[e].image_url=g[e].image_url,wdi_data[e].thumb_url=g[e].thumb_url,wdi_data[e].date=g[e].date,wdi_data[e].comment_count=g[e].comment_count,wdi_data[e].filetype=g[e].filetype,wdi_data[e].filename=g[e].filename,wdi_data[e].avg_rating=g[e].avg_rating,wdi_data[e].rate=g[e].rate,wdi_data[e].rate_count=g[e].rate_count,wdi_data[e].hit_count=g[e].hit_count,wdi_data[e].comments_data=void 0!==g[e].comments_data?g[e].comments_data:"null",wdi_data[e].carousel_media=void 0!==g[e].carousel_media?g[e].carousel_media:null}};function wdi_spider_showpopup(e,t,i,a){isPopUpOpened=!0,i.show(),wdi_spider_receivedpopup(e,t)}function wdi_spider_hasalreadyreceivedpopup(e){return-1<document.cookie.indexOf(e)&&delete document.cookie[document.cookie.indexOf(e)],!1}function wdi_spider_receivedpopup(e,t){var i=new Date;i.setDate(i.getDate()+t),document.cookie=e+"=true;expires="+i.toUTCString()+";path=/"}function wdi_spider_isunsupporteduseragent(){return!window.XMLHttpRequest}function wdi_spider_destroypopup(e){null!=document.getElementById("wdi_spider_popup_wrap")&&(wdi_comments_manager.popup_destroyed(),void 0!==jQuery().fullscreen&&jQuery.isFunction(jQuery().fullscreen)&&jQuery.fullscreen.isFullScreen()&&jQuery.fullscreen.exit(),setTimeout(function(){jQuery(".wdi_spider_popup_wrap").remove(),jQuery(".wdi_spider_popup_loading").css({display:"none"}),jQuery(".wdi_spider_popup_overlay").css({display:"none"}),jQuery(document).off("keydown"),jQuery("html").attr("style","")},20)),isPopUpOpened=!1;var t=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()),i=document.querySelector('meta[name="viewport"]');t&&i&&(i.content="width=device-width, initial-scale=1");var a=jQuery(document).scrollTop();window.location.hash="",jQuery(document).scrollTop(a),"undefined"!=typeof wdi_playInterval&&clearInterval(wdi_playInterval)}function wdi_spider_ajax_save(e,t){return wdi_comments_manager.init(t),!1}function wdi_spider_set_input_value(e,t){document.getElementById(e)&&(document.getElementById(e).value=t)}function wdi_spider_form_submit(e,t){document.getElementById(t)&&document.getElementById(t).submit(),e.preventDefault?e.preventDefault():e.returnValue=!1}function wdi_spider_check_required(e,t){return""==jQuery("#"+e).val()&&(wdi_front.show_alert(t+"* "+wdi_objectL10n.wdi_field_required),jQuery("#"+e).attr("style","border-color: #FF0000;"),jQuery("#"+e).focus(),!0)}function wdi_spider_check_email(e){if(""!=jQuery("#"+e).val())return-1==jQuery("#"+e).val().replace(/^\s+|\s+$/g,"").search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)&&(wdi_front.show_alert(wdi_objectL10n.wdi_mail_validation),!0)}function wdi_captcha_refresh(e){document.getElementById(e+"_img")&&document.getElementById(e+"_input")&&(srcArr=document.getElementById(e+"_img").src.split("&r="),document.getElementById(e+"_img").src=srcArr[0]+"&r="+Math.floor(100*Math.random()),document.getElementById(e+"_img").style.display="inline-block",document.getElementById(e+"_input").value="")}function wdi_play_pause(e){var t,i,a=-1<navigator.userAgent.indexOf("Chrome"),r=-1<navigator.userAgent.indexOf("Safari");a&&r&&(r=!1),r||(t=e.get(0),i=!/firefox/i,navigator.userAgent.match(/firefox/i)&&(i=!0),i||(t.paused?t.play():t.pause()))}function wdi_spider_display_embed(e,t,i,a){var r="";switch(e){case"EMBED_OEMBED_YOUTUBE_VIDEO":var n="<iframe ";for(attr in""!=t&&(n+=' src="//www.youtube.com/embed/'+t+'?enablejsapi=1&wmode=transparent"'),i)/src/i.test(attr)||""!=attr&&""!=i[attr]&&(n+=" "+attr+'="'+i[attr]+'"');r+=n+=" ></iframe>";break;case"EMBED_OEMBED_VIMEO_VIDEO":var d="<iframe ";for(attr in""!=t&&(d+=' src="//player.vimeo.com/video/'+t+'?enablejsapi=1"'),i)/src/i.test(attr)||""!=attr&&""!=i[attr]&&(d+=" "+attr+'="'+i[attr]+'"');r+=d+=" ></iframe>";break;case"EMBED_OEMBED_FLICKR_IMAGE":var o="<div ";for(attr in i)/src/i.test(attr)||""!=attr&&""!=i[attr]&&(o+=" "+attr+'="'+i[attr]+'"');o+=" >",""!=t&&(o+='<img src="'+t+'" style="max-width:100% !important; max-height:100% !important; width:auto !important; height:auto !important;">'),r+=o+="</div>";break;case"EMBED_OEMBED_FLICKR_VIDEO":break;case"EMBED_OEMBED_INSTAGRAM_VIDEO":var s="<div ";for(attr in i)/src/i.test(attr)||""!=attr&&""!=i[attr]&&(s+=" "+attr+'="'+i[attr]+'"');s+=" >",""!=t&&(s+='<video onclick="wdi_play_pause(jQuery(this));" style="width:auto !important; height:auto !important; max-width:100% !important; max-height:100% !important; margin:0 !important;" controls><source src="'+t+'" type="video/mp4"> Your browser does not support the video tag. </video>'),r+=s+="</div>";break;case"EMBED_OEMBED_INSTAGRAM_IMAGE":s="<div ";for(attr in i)/src/i.test(attr)||""!=attr&&""!=i[attr]&&(s+=" "+attr+'="'+i[attr]+'"');if(s+=" >",null!=a&&a.length)for(var _=0;_<a.length;_++)"image"==a[_].type?s+='<img src="'+a[_].images.standard_resolution.url+'" style="max-width:100% !important; max-height:100% !important; width:auto !important; height:auto !important;" data-id="'+_+'" class="carousel_media '+(0==_?"active":"")+'">':"video"==a[_].type&&(s+='<video onclick="wdi_play_pause(jQuery(this));" style="width:auto !important; height:auto !important; max-width:100% !important; max-height:100% !important; margin:0 !important;" controls data-id="'+_+'" class="carousel_media '+(0==_?"active":"")+'"><source src="'+a[_].videos.standard_resolution.url+'" type="video/mp4"> Your browser does not support the video tag. </video>');else""!=t&&(s+='<img src="//instagram.com/p/'+t+'/media/?size=l" style=" max-width:100% !important; max-height:100% !important; width:auto; height:auto;">');r+=s+="</div>";break;case"EMBED_OEMBED_INSTAGRAM_POST":s="<div ";for(attr in i)/src/i.test(attr)||""!=attr&&""!=i[attr]&&(s+=" "+attr+'="'+i[attr]+'"',"CLASS"!=attr&&"class"!=attr&&"Class"!=attr||(obj_class=i[attr]));s+=" >",""!=t&&(s+='<iframe class="inner_instagram_iframe_'+obj_class+'" src="//instagr.am/p/'+t+'/embed/?enablejsapi=1" style="max-width:100% !important; max-height:100% !important; width:100%; height:100%; margin:0; display:table-cell; vertical-align:middle;"frameborder="0" scrolling="no" allowtransparency="false" allowfullscreen></iframe>'),r+=s+="</div>";break;case"EMBED_OEMBED_DAILYMOTION_VIDEO":var c="<iframe ";for(attr in""!=t&&(c+=' src="//www.dailymotion.com/embed/video/'+t+'?api=postMessage"'),i)/src/i.test(attr)||""!=attr&&""!=i[attr]&&(c+=" "+attr+'="'+i[attr]+'"');r+=c+=" ></iframe>";break;case"EMBED_OEMBED_IMGUR":var m="<div ";for(attr in i)/src/i.test(attr)||""!=attr&&""!=i[attr]&&(s+=" "+attr+'="'+i[attr]+'"');m+=" >",""!=t&&(m+='<img src="'+t+'" style="max-width:100% !important; max-height:100% !important; width:auto; height:auto !important;">'),r+=m+="</div>"}return r}function wdi_testBrowser_cssTransitions(){return wdi_testDom("Transition")}function wdi_testBrowser_cssTransforms3d(){return wdi_testDom("Perspective")}function wdi_testDom(e){for(var t=["","Webkit","Moz","ms","O","Khtml"],i=t.length;i--;)if(void 0!==document.body.style[t[i]+e])return!0;return!1}function wdi_cube(e,t,i,a,r,n,d,o,s,_){if(!wdi_testBrowser_cssTransitions())return wdi_fallback(o,s,_);if(!wdi_testBrowser_cssTransforms3d())return wdi_fallback3d(o,s,_);wdi_trans_in_progress=!0,jQuery(".wdi_filmstrip_thumbnail").removeClass("wdi_thumb_active").addClass("wdi_thumb_deactive"),jQuery("#wdi_filmstrip_thumbnail_"+wdi_current_key).removeClass("wdi_thumb_deactive").addClass("wdi_thumb_active"),jQuery(".wdi_slide_bg").css("perspective",1e3),jQuery(o).css({transform:"translateZ("+e+"px)",backfaceVisibility:"hidden"}),jQuery(s).css({opacity:1,filter:"Alpha(opacity=100)",backfaceVisibility:"hidden",transform:"translateY("+i+"px) translateX("+t+"px) rotateY("+r+"deg) rotateX("+a+"deg)"}),jQuery(".wdi_slider").css({transform:"translateZ(-"+e+"px)",transformStyle:"preserve-3d"}),setTimeout(function(){jQuery(".wdi_slider").css({transition:"all "+wdi_transition_duration+"ms ease-in-out",transform:"translateZ(-"+e+"px) rotateX("+n+"deg) rotateY("+d+"deg)"})},20),jQuery(".wdi_slider").one("webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend",jQuery.proxy(function(){jQuery(o).removeAttr("style"),jQuery(s).removeAttr("style"),jQuery(".wdi_slider").removeAttr("style"),jQuery(o).css({opacity:0,filter:"Alpha(opacity=0)","z-index":1}),jQuery(s).css({opacity:1,filter:"Alpha(opacity=100)","z-index":2}),wdi_trans_in_progress=!1,jQuery(o).html(""),"undefined"==typeof event_stack||0<event_stack.length&&(key=event_stack[0].split("-"),event_stack.shift(),wdi_change_image(key[0],key[1],wdi_data,!0));wdi_change_watermark_container()}))}function wdi_cubeH(e,t,i){var a=jQuery(e).width()/2;"right"==i?wdi_cube(a,a,0,0,90,0,-90,e,t,i):"left"==i&&wdi_cube(a,-a,0,0,-90,0,90,e,t,i)}function wdi_cubeV(e,t,i){var a=jQuery(e).height()/2;"right"==i?wdi_cube(a,0,-a,90,0,-90,0,e,t,i):"left"==i&&wdi_cube(a,0,a,-90,0,90,0,e,t,i)}function wdi_fallback(e,t,i){wdi_fade(e,t,i)}function wdi_fallback3d(e,t,i){wdi_sliceV(e,t,i)}function wdi_none(e,t,i){jQuery(e).css({opacity:0,"z-index":1}),jQuery(t).css({opacity:1,"z-index":2}),jQuery(".wdi_filmstrip_thumbnail").removeClass("wdi_thumb_active").addClass("wdi_thumb_deactive"),jQuery("#wdi_filmstrip_thumbnail_"+wdi_current_key).removeClass("wdi_thumb_deactive").addClass("wdi_thumb_active"),wdi_trans_in_progress=!1,jQuery(e).html(""),wdi_change_watermark_container()}function wdi_fade(e,t,i){jQuery(".wdi_filmstrip_thumbnail").removeClass("wdi_thumb_active").addClass("wdi_thumb_deactive"),jQuery("#wdi_filmstrip_thumbnail_"+wdi_current_key).removeClass("wdi_thumb_deactive").addClass("wdi_thumb_active"),wdi_testBrowser_cssTransitions()?(jQuery(t).css("transition","opacity "+wdi_transition_duration+"ms linear"),jQuery(e).css({opacity:0,"z-index":1}),jQuery(t).css({opacity:1,"z-index":2}),wdi_change_watermark_container()):(jQuery(e).animate({opacity:0,"z-index":1},wdi_transition_duration),jQuery(t).animate({opacity:1,"z-index":2},{duration:wdi_transition_duration,complete:function(){wdi_trans_in_progress=!1,jQuery(e).html(""),wdi_change_watermark_container()}}),jQuery(e).fadeTo(wdi_transition_duration,0),jQuery(t).fadeTo(wdi_transition_duration,1))}function wdi_grid(e,t,i,a,r,n,d,o,s,_){if(!wdi_testBrowser_cssTransitions())return wdi_fallback(o,s,_);wdi_trans_in_progress=!0,jQuery(".wdi_filmstrip_thumbnail").removeClass("wdi_thumb_active").addClass("wdi_thumb_deactive"),jQuery("#wdi_filmstrip_thumbnail_"+wdi_current_key).removeClass("wdi_thumb_deactive").addClass("wdi_thumb_active");var c=wdi_transition_duration/(e+t);var m=jQuery(o).find("img"),u=jQuery('<span style="display: block;" />').addClass("wdi_grid");jQuery(o).prepend(u);var l=jQuery(".wdi_slide_bg"),p=m.width(),w=m.height(),h=l.width(),f=l.height(),g=Math.floor(h/e),y=Math.floor(f/t),v=h-e*g,b=Math.ceil(v/e),j=f-t*y,Q=Math.ceil(j/t),k=0,x=Math.ceil((jQuery(".wdi_slide_bg").width()-m.width())/2),E=void 0===m.attr("src")?"":m.attr("src");a="min-auto"===(a="auto"===a?h:a)?-h:a,r="min-auto"===(r="auto"===r?f:r)?-f:r;for(var C,M,I,B,D,O,A,T,z,S,V=0;V<e;V++){var L,R=0,K=Math.floor((jQuery(".wdi_slide_bg").height()-m.height())/2),P=g;0<v&&(P+=L=b<=v?b:v,v-=L);for(var U=0;U<t;U++){var H=y,Y=j;0<Y&&(H+=L=Q<=Y?Q:j,Y-=L),u.append((C=P,M=H,I=R,B=K,D=k,O=x,A=E,T=p,z=w,S=(V+U)*c,jQuery('<span class="wdi_gridlet" />').css({display:"block",width:C,height:M,top:I,left:D,backgroundImage:'url("'+A+'")',backgroundColor:jQuery(".wdi_spider_popup_wrap").css("background-color"),backgroundRepeat:"no-repeat",backgroundPosition:O+"px "+B+"px",backgroundSize:T+"px "+z+"px",transition:"all "+wdi_transition_duration+"ms ease-in-out "+S+"ms",transform:"none"}))),R+=H,K-=H}x-=P,k+=P}var q=u.children().last();u.show(),m.css("opacity",0),u.children().first().addClass("rs-top-left"),u.children().last().addClass("rs-bottom-right"),u.children().eq(t-1).addClass("rs-bottom-left"),u.children().eq(-t).addClass("rs-top-right"),setTimeout(function(){u.children().css({opacity:d,transform:"rotate("+i+"deg) translateX("+a+"px) translateY("+r+"px) scale("+n+")"})},1),jQuery(s).css("opacity",1),jQuery(q).one("webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend",jQuery.proxy(function(){jQuery(o).css({opacity:0,"z-index":1}),jQuery(s).css({opacity:1,"z-index":2}),m.css("opacity",1),u.remove(),wdi_trans_in_progress=!1,jQuery(o).html(""),"undefined"==typeof event_stack||0<event_stack.length&&(key=event_stack[0].split("-"),event_stack.shift(),wdi_change_image(key[0],key[1],wdi_data,!0));wdi_change_watermark_container()}))}function wdi_sliceH(e,t,i){var a;"right"==i?a="min-auto":"left"==i&&(a="auto"),wdi_grid(1,8,0,a,0,1,0,e,t,i)}function wdi_sliceV(e,t,i){var a;"right"==i?a="min-auto":"left"==i&&(a="auto"),wdi_grid(10,1,0,0,a,1,0,e,t,i)}function wdi_slideV(e,t,i){var a;"right"==i?a="auto":"left"==i&&(a="min-auto"),wdi_grid(1,1,0,0,a,1,1,e,t,i)}function wdi_slideH(e,t,i){var a;"right"==i?a="min-auto":"left"==i&&(a="auto"),wdi_grid(1,1,0,a,0,1,1,e,t,i)}function wdi_scaleOut(e,t,i){wdi_grid(1,1,0,0,0,1.5,0,e,t,i)}function wdi_scaleIn(e,t,i){wdi_grid(1,1,0,0,0,.5,0,e,t,i)}function wdi_blockScale(e,t,i){wdi_grid(8,6,0,0,0,.6,0,e,t,i)}function wdi_kaleidoscope(e,t,i){wdi_grid(10,8,0,0,0,1,0,e,t,i)}function wdi_fan(e,t,i){var a,r;"right"==i?(a=45,r=100):"left"==i&&(a=-45,r=-100),wdi_grid(1,10,a,r,0,1,0,e,t,i)}function wdi_blindV(e,t,i){wdi_grid(1,8,0,0,0,.7,0,e,t)}function wdi_blindH(e,t,i){wdi_grid(10,1,0,0,0,.7,0,e,t)}function wdi_random(e,t,i){var a=["sliceH","sliceV","slideH","slideV","scaleOut","scaleIn","blockScale","kaleidoscope","fan","blindH","blindV"];this["wdi_"+a[Math.floor(Math.random()*a.length)]](e,t,i)}function wdi_pause_stream(e){jQuery(e).find("video").each(function(){jQuery(this).get(0).pause()})}function wdi_reset_zoom(){var e=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()),t=document.querySelector('meta[name="viewport"]');e&&t&&(t.content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=0")}Object.size=function(e){var t,i=0;for(t in e)e.hasOwnProperty(t)&&i++;return i},wdi_comments_manager={media_id:"",mediaComments:[],load_more_count:10,commentCounter:0,currentKey:-1,init:function(e){this.instagram=new WDIInstagram,this.instagram.addToken(wdi_front.access_token),this.currentKey!=e&&(this.currentKey=e,this.reset_comments())},reset_comments:function(){jQuery("#wdi_load_more_comments").remove(),jQuery("#wdi_added_comments").html(""),this.commentCounter=0,this.media_id=wdi_data[this.currentKey].id,this.getAjaxComments(this.currentKey)},popup_destroyed:function(){this.media_id="",this.mediaComments=[],this.commentCounter=0,this.currentKey=-1},showComments:function(e,t){(Object.size(e)-this.commentCounter-t<0||void 0===t)&&(t=Object.size(e)-this.commentCounter);var a=this.commentCounter;for(i=Object.size(e)-a-1;i>=Object.size(e)-a-t;i--){this.commentCounter++;var r=e[i].text,r=wdi_front.escape_tags(r);r=this.filterCommentText(r);var n=e[i].from.username,d=(e[i].from.profile_picture,jQuery('<div class="wdi_single_comment"></div>'));d.append(jQuery('<p class="wdi_comment_header_p"><span class="wdi_comment_header"><a target="_blank" href="//instagram.com/'+n+'">'+n+'</a></span><span class="wdi_comment_date">'+wdi_front.convertUnixDate(e[i].created_time)+"</span></p>")),d.append(jQuery('<div class="wdi_comment_body_p"><span class="wdi_comment_body"><p>'+r+"</p></span></div>")),jQuery("#wdi_added_comments").prepend(d)}this.updateScrollbar()},updateScrollbar:function(){var e=jQuery("#wdi_comments"),t=jQuery("#wdi_added_comments");jQuery(".wdi_comments").attr("class","wdi_comments"),jQuery(".wdi_comments").html(""),jQuery(".wdi_comments").append(e),jQuery(".wdi_comments").append(t),jQuery(".wdi_comments_close_btn").on("click",wdi_comment)},getAjaxComments:function(){this.instagram.getRecentMediaComments(this.media_id,{success:function(e){if(""==e||null==e||null==e)return errorMessage="Network Error, please try again later :(",void console.log("%c"+errorMessage,"color:#cc0000;");if(200!=e.meta.code)return errorMessage=e.meta.error_message,void console.log("%c"+errorMessage,"color:#cc0000;");wdi_comments_manager.mediaComments=e.data;var t=wdi_data[wdi_comments_manager.currentKey];t.comments_data=e.data,wdi_comments_manager.showComments(t.comments_data,wdi_comments_manager.load_more_count),wdi_comments_manager.ajax_comments_ready(e.data)}})},ajax_comments_ready:function(e){this.createLoadMoreAndBindEvent()},createLoadMoreAndBindEvent:function(){jQuery("#wdi_added_comments").prepend(jQuery('<p id="wdi_load_more_comments" class="wdi_load_more_comments">load more comments</p>')),jQuery(".wdi_comment_container #wdi_load_more_comments").on("click",function(){jQuery(this).remove(),wdi_comments_manager.showComments(wdi_comments_manager.mediaComments,wdi_comments_manager.load_more_count),wdi_comments_manager.createLoadMoreAndBindEvent()})},filterCommentText:function(e){for(var t=e.split(" "),i="",a=0;a<t.length;a++)switch(t[a][0]){case"@":i+='<a target="blank" class="wdi_comm_text_link" href="//instagram.com/'+t[a].substring(1,t[a].length)+'">'+t[a]+"</a> ";break;case"#":i+='<a target="blank" class="wdi_comm_text_link" href="//instagram.com/explore/tags/'+t[a].substring(1,t[a].length)+'">'+t[a]+"</a> ";break;default:i+=t[a]+" "}return i=i.substring(0,i.length-1)}};
1
+ var isPopUpOpened=!1,wdi_data=[];function wdi_spider_createpopup(e,t,i,a,r,n,d,o,s){if(e=e.replace(/&#038;/g,"&"),!isPopUpOpened&&(isPopUpOpened=!0,!wdi_spider_hasalreadyreceivedpopup(n)&&!wdi_spider_isunsupporteduseragent())){jQuery("html").attr("style","overflow:hidden !important;"),jQuery("#wdi_spider_popup_loading_"+t).css({display:"block"}),jQuery("#wdi_spider_popup_overlay_"+t).css({display:"block"});for(var _,c=0,m=0;m<o.parsedData.length;m++)if(o.parsedData[m].id===s){c=m,_=[o.parsedData[m]];break}jQuery.ajax({type:"POST",url:e,dataType:"text",data:{action:"WDIGalleryBox",image_rows:JSON.stringify(_),feed_id:o.feed_row.id,feed_counter:o.feed_row.wdi_feed_counter,current_image_index:c,image_rows_count:o.parsedData.length,carousel_media_row:JSON.stringify(_[0].carousel_media)},success:function(e){var _=jQuery('<div id="wdi_spider_popup_wrap" class="wdi_spider_popup_wrap wdi_lightbox_theme_'+o.feed_row.theme_id+'" style="width:'+i+"px;height:"+a+"px;margin-top:-"+a/2+"px;margin-left: -"+i/2+'px; ">'+e+"</div>");new wdi_construct_popup(_,o,o.parsedData,s).construct(),_.hide().appendTo("body"),wdi_spider_showpopup(n,d,_,r),jQuery("#wdi_spider_popup_loading_"+t).css({display:"none !important;"})}})}}var wdi_construct_popup=function(e,t,i,a){this.theme_row={},this.construct=function(){this.theme_row=window["wdi_theme_"+t.feed_row.theme_id],t.feed_row.popup_enable_filmstrip&&"1"===t.feed_row.popup_enable_filmstrip&&this.add_filmstrip(),this.set_wdi_data()},this.add_filmstrip=function(){var r="horizontal";"right"!==this.theme_row.lightbox_filmstrip_pos&&"left"!==this.theme_row.lightbox_filmstrip_pos||(r="vertical");var n,d,o="horizontal"===r?"tenweb-i-angle-left":"tenweb-i-angle-up",s="horizontal"===r?"tenweb-i-angle-right":"tenweb-i-angle-down",_="";d=n="horizontal"===r?void 0!==t.feed_row.popup_filmstrip_height?t.feed_row.popup_filmstrip_height:"20":void 0!==t.feed_row.popup_filmstrip_height?t.feed_row.popup_filmstrip_height:"50",n=d=parseInt(d);for(var c=0;c<i.length;c++){var m,l,u,p=i[c];if(p.resolution&&""!==p.resolution){p.resolution.split(" ");var w=intval($resolution_arr[0]),h=intval($resolution_arr[2]);0!==w&&0!==h?(m=w*(u=Math.max(d/w,n/h)),l=h*u):(m=d,l=n)}else m=d,l=n;var f=(d-(m*=u=Math.max(d/m,n/l)))/2,g=(n-(l*=u))/2;_+='<div id="wdi_filmstrip_thumbnail_'+c+'" class="'+("wdi_filmstrip_thumbnail "+(parseInt(p.id)===parseInt(a)?"wdi_thumb_active":"wdi_thumb_deactive"))+'">'+('<img style="'+("width:"+m+"px;height:"+l+"px;margin-left:"+f+"px;margin-top:"+g+"px;")+'" class="wdi_filmstrip_thumbnail_img" src="'+(void 0!==p.images[t.feedImageResolution]&&void 0!==p.images[t.feedImageResolution].url?p.images[t.feedImageResolution].url:p.thumb_url)+'" onclick="'+("wdi_change_image(parseInt(jQuery('#wdi_current_image_key').val()), '"+c+"', wdi_data)")+'" ontouchend="'+("wdi_change_image(parseInt(jQuery('#wdi_current_image_key').val()), '"+c+"', wdi_data)")+'" image_id="'+p.id+'" image_key="'+c+'" alt="'+p.alt+'" />')+"</div>"}var y='<div class="wdi_filmstrip_left"><i class="tenweb-i '+o+'"></i></div><div class="wdi_filmstrip"><div class="wdi_filmstrip_thumbnails">'+_+'</div></div><div class="wdi_filmstrip_right"><i class="tenweb-i '+s+'"></i></div>';e.find(".wdi_filmstrip_container").append(y)},this.set_wdi_data=function(){wdi_data=[];for(var e=0;e<i.length;e++)wdi_data[e]=[],wdi_data[e].number=e+1,wdi_data[e].id=i[e].id,wdi_data[e].alt=i[e].alt,wdi_data[e].description=wdi_front.escape_tags(i[e].description),wdi_data[e].username=i[e].username,wdi_data[e].profile_picture=i[e].profile_picture,wdi_data[e].image_url=i[e].image_url,wdi_data[e].thumb_url=i[e].thumb_url,wdi_data[e].date=i[e].date,wdi_data[e].comment_count=i[e].comment_count,wdi_data[e].filetype=i[e].filetype,wdi_data[e].filename=i[e].filename,wdi_data[e].avg_rating=i[e].avg_rating,wdi_data[e].rate=i[e].rate,wdi_data[e].rate_count=i[e].rate_count,wdi_data[e].hit_count=i[e].hit_count,wdi_data[e].comments_data=void 0!==i[e].comments_data?i[e].comments_data:"null",wdi_data[e].carousel_media=void 0!==i[e].carousel_media?i[e].carousel_media:null}};function wdi_spider_showpopup(e,t,i,a){isPopUpOpened=!0,i.show(),wdi_spider_receivedpopup(e,t)}function wdi_spider_hasalreadyreceivedpopup(e){return document.cookie.indexOf(e)>-1&&delete document.cookie[document.cookie.indexOf(e)],!1}function wdi_spider_receivedpopup(e,t){var i=new Date;i.setDate(i.getDate()+t),document.cookie=e+"=true;expires="+i.toUTCString()+";path=/"}function wdi_spider_isunsupporteduseragent(){return!window.XMLHttpRequest}function wdi_spider_destroypopup(e){null!=document.getElementById("wdi_spider_popup_wrap")&&(wdi_comments_manager.popup_destroyed(),void 0!==jQuery().fullscreen&&jQuery.isFunction(jQuery().fullscreen)&&jQuery.fullscreen.isFullScreen()&&jQuery.fullscreen.exit(),setTimeout(function(){jQuery(".wdi_spider_popup_wrap").remove(),jQuery(".wdi_spider_popup_loading").css({display:"none"}),jQuery(".wdi_spider_popup_overlay").css({display:"none"}),jQuery(document).off("keydown"),jQuery("html").attr("style","")},20)),isPopUpOpened=!1;var t=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()),i=document.querySelector('meta[name="viewport"]');t&&i&&(i.content="width=device-width, initial-scale=1");var a=jQuery(document).scrollTop();window.location.hash="",jQuery(document).scrollTop(a),"undefined"!=typeof wdi_playInterval&&clearInterval(wdi_playInterval)}function wdi_spider_ajax_save(e,t){return wdi_comments_manager.init(t),!1}function wdi_spider_set_input_value(e,t){document.getElementById(e)&&(document.getElementById(e).value=t)}function wdi_spider_form_submit(e,t){document.getElementById(t)&&document.getElementById(t).submit(),e.preventDefault?e.preventDefault():e.returnValue=!1}function wdi_spider_check_required(e,t){return""==jQuery("#"+e).val()&&(wdi_front.show_alert(t+"* "+wdi_objectL10n.wdi_field_required),jQuery("#"+e).attr("style","border-color: #FF0000;"),jQuery("#"+e).focus(),!0)}function wdi_spider_check_email(e){if(""!=jQuery("#"+e).val())return-1==jQuery("#"+e).val().replace(/^\s+|\s+$/g,"").search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)&&(wdi_front.show_alert(wdi_objectL10n.wdi_mail_validation),!0)}function wdi_captcha_refresh(e){document.getElementById(e+"_img")&&document.getElementById(e+"_input")&&(srcArr=document.getElementById(e+"_img").src.split("&r="),document.getElementById(e+"_img").src=srcArr[0]+"&r="+Math.floor(100*Math.random()),document.getElementById(e+"_img").style.display="inline-block",document.getElementById(e+"_input").value="")}function wdi_play_pause(e){var t=navigator.userAgent.indexOf("Chrome")>-1,i=navigator.userAgent.indexOf("Safari")>-1;if(t&&i&&(i=!1),!i){var a=e.get(0),r=!1;navigator.userAgent.match(/firefox/i)&&(r=!0),r||(a.paused?a.play():a.pause())}}function wdi_spider_display_embed(e,t,i,a){var r="";switch(e){case"EMBED_OEMBED_YOUTUBE_VIDEO":var n="<iframe ";for(attr in""!=t&&(n+=' src="//www.youtube.com/embed/'+t+'?enablejsapi=1&wmode=transparent"'),i)/src/i.test(attr)||""!=attr&&""!=i[attr]&&(n+=" "+attr+'="'+i[attr]+'"');r+=n+=" ></iframe>";break;case"EMBED_OEMBED_VIMEO_VIDEO":var d="<iframe ";for(attr in""!=t&&(d+=' src="//player.vimeo.com/video/'+t+'?enablejsapi=1"'),i)/src/i.test(attr)||""!=attr&&""!=i[attr]&&(d+=" "+attr+'="'+i[attr]+'"');r+=d+=" ></iframe>";break;case"EMBED_OEMBED_FLICKR_IMAGE":var o="<div ";for(attr in i)/src/i.test(attr)||""!=attr&&""!=i[attr]&&(o+=" "+attr+'="'+i[attr]+'"');o+=" >",""!=t&&(o+='<img src="'+t+'" style="max-width:100% !important; max-height:100% !important; width:auto !important; height:auto !important;">'),r+=o+="</div>";break;case"EMBED_OEMBED_FLICKR_VIDEO":break;case"EMBED_OEMBED_INSTAGRAM_VIDEO":var s="<div ";for(attr in i)/src/i.test(attr)||""!=attr&&""!=i[attr]&&(s+=" "+attr+'="'+i[attr]+'"');s+=" >",""!=t&&(s+='<video onclick="wdi_play_pause(jQuery(this));" style="width:auto !important; height:auto !important; max-width:100% !important; max-height:100% !important; margin:0 !important;" controls><source src="'+t+'" type="video/mp4"> Your browser does not support the video tag. </video>'),r+=s+="</div>";break;case"EMBED_OEMBED_INSTAGRAM_IMAGE":s="<div ";for(attr in i)/src/i.test(attr)||""!=attr&&""!=i[attr]&&(s+=" "+attr+'="'+i[attr]+'"');if(s+=" >",null!=a&&a.length)for(var _=0;_<a.length;_++)"image"==a[_].type?s+='<img src="'+a[_].images.standard_resolution.url+'" style="max-width:100% !important; max-height:100% !important; width:auto !important; height:auto !important;" data-id="'+_+'" class="carousel_media '+(0==_?"active":"")+'">':"video"==a[_].type&&(s+='<video onclick="wdi_play_pause(jQuery(this));" style="width:auto !important; height:auto !important; max-width:100% !important; max-height:100% !important; margin:0 !important;" controls data-id="'+_+'" class="carousel_media '+(0==_?"active":"")+'"><source src="'+a[_].videos.standard_resolution.url+'" type="video/mp4"> Your browser does not support the video tag. </video>');else""!=t&&(s+='<img src="//instagram.com/p/'+t+'/media/?size=l" style=" max-width:100% !important; max-height:100% !important; width:auto; height:auto;">');r+=s+="</div>";break;case"EMBED_OEMBED_INSTAGRAM_POST":s="<div ";for(attr in i)/src/i.test(attr)||""!=attr&&""!=i[attr]&&(s+=" "+attr+'="'+i[attr]+'"',"CLASS"!=attr&&"class"!=attr&&"Class"!=attr||(obj_class=i[attr]));s+=" >",""!=t&&(s+='<iframe class="inner_instagram_iframe_'+obj_class+'" src="//instagr.am/p/'+t+'/embed/?enablejsapi=1" style="max-width:100% !important; max-height:100% !important; width:100%; height:100%; margin:0; display:table-cell; vertical-align:middle;"frameborder="0" scrolling="no" allowtransparency="false" allowfullscreen></iframe>'),r+=s+="</div>";break;case"EMBED_OEMBED_DAILYMOTION_VIDEO":var c="<iframe ";for(attr in""!=t&&(c+=' src="//www.dailymotion.com/embed/video/'+t+'?api=postMessage"'),i)/src/i.test(attr)||""!=attr&&""!=i[attr]&&(c+=" "+attr+'="'+i[attr]+'"');r+=c+=" ></iframe>";break;case"EMBED_OEMBED_IMGUR":var m="<div ";for(attr in i)/src/i.test(attr)||""!=attr&&""!=i[attr]&&(s+=" "+attr+'="'+i[attr]+'"');m+=" >",""!=t&&(m+='<img src="'+t+'" style="max-width:100% !important; max-height:100% !important; width:auto; height:auto !important;">'),r+=m+="</div>"}return r}function wdi_testBrowser_cssTransitions(){return wdi_testDom("Transition")}function wdi_testBrowser_cssTransforms3d(){return wdi_testDom("Perspective")}function wdi_testDom(e){for(var t=["","Webkit","Moz","ms","O","Khtml"],i=t.length;i--;)if(void 0!==document.body.style[t[i]+e])return!0;return!1}function wdi_cube(e,t,i,a,r,n,d,o,s,_){if(!wdi_testBrowser_cssTransitions())return wdi_fallback(o,s,_);if(!wdi_testBrowser_cssTransforms3d())return wdi_fallback3d(o,s,_);wdi_trans_in_progress=!0,jQuery(".wdi_filmstrip_thumbnail").removeClass("wdi_thumb_active").addClass("wdi_thumb_deactive"),jQuery("#wdi_filmstrip_thumbnail_"+wdi_current_key).removeClass("wdi_thumb_deactive").addClass("wdi_thumb_active"),jQuery(".wdi_slide_bg").css("perspective",1e3),jQuery(o).css({transform:"translateZ("+e+"px)",backfaceVisibility:"hidden"}),jQuery(s).css({opacity:1,filter:"Alpha(opacity=100)",backfaceVisibility:"hidden",transform:"translateY("+i+"px) translateX("+t+"px) rotateY("+r+"deg) rotateX("+a+"deg)"}),jQuery(".wdi_slider").css({transform:"translateZ(-"+e+"px)",transformStyle:"preserve-3d"}),setTimeout(function(){jQuery(".wdi_slider").css({transition:"all "+wdi_transition_duration+"ms ease-in-out",transform:"translateZ(-"+e+"px) rotateX("+n+"deg) rotateY("+d+"deg)"})},20),jQuery(".wdi_slider").one("webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend",jQuery.proxy(function(){jQuery(o).removeAttr("style"),jQuery(s).removeAttr("style"),jQuery(".wdi_slider").removeAttr("style"),jQuery(o).css({opacity:0,filter:"Alpha(opacity=0)","z-index":1}),jQuery(s).css({opacity:1,filter:"Alpha(opacity=100)","z-index":2}),wdi_trans_in_progress=!1,jQuery(o).html(""),"undefined"!=typeof event_stack&&event_stack.length>0&&(key=event_stack[0].split("-"),event_stack.shift(),wdi_change_image(key[0],key[1],wdi_data,!0));wdi_change_watermark_container()}))}function wdi_cubeH(e,t,i){var a=jQuery(e).width()/2;"right"==i?wdi_cube(a,a,0,0,90,0,-90,e,t,i):"left"==i&&wdi_cube(a,-a,0,0,-90,0,90,e,t,i)}function wdi_cubeV(e,t,i){var a=jQuery(e).height()/2;"right"==i?wdi_cube(a,0,-a,90,0,-90,0,e,t,i):"left"==i&&wdi_cube(a,0,a,-90,0,90,0,e,t,i)}function wdi_fallback(e,t,i){wdi_fade(e,t,i)}function wdi_fallback3d(e,t,i){wdi_sliceV(e,t,i)}function wdi_none(e,t,i){jQuery(e).css({opacity:0,"z-index":1}),jQuery(t).css({opacity:1,"z-index":2}),jQuery(".wdi_filmstrip_thumbnail").removeClass("wdi_thumb_active").addClass("wdi_thumb_deactive"),jQuery("#wdi_filmstrip_thumbnail_"+wdi_current_key).removeClass("wdi_thumb_deactive").addClass("wdi_thumb_active"),wdi_trans_in_progress=!1,jQuery(e).html(""),wdi_change_watermark_container()}function wdi_fade(e,t,i){jQuery(".wdi_filmstrip_thumbnail").removeClass("wdi_thumb_active").addClass("wdi_thumb_deactive"),jQuery("#wdi_filmstrip_thumbnail_"+wdi_current_key).removeClass("wdi_thumb_deactive").addClass("wdi_thumb_active"),wdi_testBrowser_cssTransitions()?(jQuery(t).css("transition","opacity "+wdi_transition_duration+"ms linear"),jQuery(e).css({opacity:0,"z-index":1}),jQuery(t).css({opacity:1,"z-index":2}),wdi_change_watermark_container()):(jQuery(e).animate({opacity:0,"z-index":1},wdi_transition_duration),jQuery(t).animate({opacity:1,"z-index":2},{duration:wdi_transition_duration,complete:function(){wdi_trans_in_progress=!1,jQuery(e).html(""),wdi_change_watermark_container()}}),jQuery(e).fadeTo(wdi_transition_duration,0),jQuery(t).fadeTo(wdi_transition_duration,1))}function wdi_grid(e,t,i,a,r,n,d,o,s,_){if(!wdi_testBrowser_cssTransitions())return wdi_fallback(o,s,_);wdi_trans_in_progress=!0,jQuery(".wdi_filmstrip_thumbnail").removeClass("wdi_thumb_active").addClass("wdi_thumb_deactive"),jQuery("#wdi_filmstrip_thumbnail_"+wdi_current_key).removeClass("wdi_thumb_deactive").addClass("wdi_thumb_active");var c=wdi_transition_duration/(e+t);function m(e,t,i,a,r,n,d,o,s,_,m){var l=(_+m)*c;return jQuery('<span class="wdi_gridlet" />').css({display:"block",width:e,height:t,top:i,left:r,backgroundImage:'url("'+d+'")',backgroundColor:jQuery(".wdi_spider_popup_wrap").css("background-color"),backgroundRepeat:"no-repeat",backgroundPosition:n+"px "+a+"px",backgroundSize:o+"px "+s+"px",transition:"all "+wdi_transition_duration+"ms ease-in-out "+l+"ms",transform:"none"})}var l=jQuery(o).find("img"),u=jQuery('<span style="display: block;" />').addClass("wdi_grid");jQuery(o).prepend(u);var p=jQuery(".wdi_slide_bg"),w=l.width(),h=l.height(),f=p.width(),g=p.height(),y=Math.floor(f/e),v=Math.floor(g/t),b=f-e*y,j=Math.ceil(b/e),Q=g-t*v,k=Math.ceil(Q/t),x=0,E=Math.ceil((jQuery(".wdi_slide_bg").width()-l.width())/2),C=void 0===l.attr("src")?"":l.attr("src");a="min-auto"===(a="auto"===a?f:a)?-f:a,r="min-auto"===(r="auto"===r?g:r)?-g:r;for(var M=0;M<e;M++){var I=0,B=Math.floor((jQuery(".wdi_slide_bg").height()-l.height())/2),D=y;if(b>0){var O=b>=j?j:b;D+=O,b-=O}for(var A=0;A<t;A++){var T=v,z=Q;z>0&&(T+=O=z>=k?k:Q,z-=O),u.append(m(D,T,I,B,x,E,C,w,h,M,A)),I+=T,B-=T}E-=D,x+=D}var S=u.children().last();u.show(),l.css("opacity",0),u.children().first().addClass("rs-top-left"),u.children().last().addClass("rs-bottom-right"),u.children().eq(t-1).addClass("rs-bottom-left"),u.children().eq(-t).addClass("rs-top-right"),setTimeout(function(){u.children().css({opacity:d,transform:"rotate("+i+"deg) translateX("+a+"px) translateY("+r+"px) scale("+n+")"})},1),jQuery(s).css("opacity",1),jQuery(S).one("webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend",jQuery.proxy(function(){jQuery(o).css({opacity:0,"z-index":1}),jQuery(s).css({opacity:1,"z-index":2}),l.css("opacity",1),u.remove(),wdi_trans_in_progress=!1,jQuery(o).html(""),"undefined"!=typeof event_stack&&event_stack.length>0&&(key=event_stack[0].split("-"),event_stack.shift(),wdi_change_image(key[0],key[1],wdi_data,!0));wdi_change_watermark_container()}))}function wdi_sliceH(e,t,i){if("right"==i)var a="min-auto";else if("left"==i)a="auto";wdi_grid(1,8,0,a,0,1,0,e,t,i)}function wdi_sliceV(e,t,i){if("right"==i)var a="min-auto";else if("left"==i)a="auto";wdi_grid(10,1,0,0,a,1,0,e,t,i)}function wdi_slideV(e,t,i){if("right"==i)var a="auto";else if("left"==i)a="min-auto";wdi_grid(1,1,0,0,a,1,1,e,t,i)}function wdi_slideH(e,t,i){if("right"==i)var a="min-auto";else if("left"==i)a="auto";wdi_grid(1,1,0,a,0,1,1,e,t,i)}function wdi_scaleOut(e,t,i){wdi_grid(1,1,0,0,0,1.5,0,e,t,i)}function wdi_scaleIn(e,t,i){wdi_grid(1,1,0,0,0,.5,0,e,t,i)}function wdi_blockScale(e,t,i){wdi_grid(8,6,0,0,0,.6,0,e,t,i)}function wdi_kaleidoscope(e,t,i){wdi_grid(10,8,0,0,0,1,0,e,t,i)}function wdi_fan(e,t,i){if("right"==i)var a=45,r=100;else if("left"==i)a=-45,r=-100;wdi_grid(1,10,a,r,0,1,0,e,t,i)}function wdi_blindV(e,t,i){wdi_grid(1,8,0,0,0,.7,0,e,t)}function wdi_blindH(e,t,i){wdi_grid(10,1,0,0,0,.7,0,e,t)}function wdi_random(e,t,i){var a=["sliceH","sliceV","slideH","slideV","scaleOut","scaleIn","blockScale","kaleidoscope","fan","blindH","blindV"];this["wdi_"+a[Math.floor(Math.random()*a.length)]](e,t,i)}function wdi_pause_stream(e){jQuery(e).find("video").each(function(){jQuery(this).get(0).pause()})}function wdi_reset_zoom(){var e=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()),t=document.querySelector('meta[name="viewport"]');e&&t&&(t.content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=0")}Object.size=function(e){var t,i=0;for(t in e)e.hasOwnProperty(t)&&i++;return i},wdi_comments_manager={media_id:"",mediaComments:[],load_more_count:10,commentCounter:0,currentKey:-1,init:function(e){this.instagram=new WDIInstagram,this.instagram.addToken(wdi_front.access_token),this.currentKey!=e&&(this.currentKey=e,this.reset_comments())},reset_comments:function(){jQuery("#wdi_load_more_comments").remove(),jQuery("#wdi_added_comments").html(""),this.commentCounter=0,this.media_id=wdi_data[this.currentKey].id,this.getAjaxComments(this.currentKey)},popup_destroyed:function(){this.media_id="",this.mediaComments=[],this.commentCounter=0,this.currentKey=-1},showComments:function(e,t){(Object.size(e)-this.commentCounter-t<0||void 0===t)&&(t=Object.size(e)-this.commentCounter);var a=this.commentCounter;for(i=Object.size(e)-a-1;i>=Object.size(e)-a-t;i--){this.commentCounter++;var r=e[i].text;r=wdi_front.escape_tags(r),r=this.filterCommentText(r);var n=e[i].from.username,d=(e[i].from.profile_picture,jQuery('<div class="wdi_single_comment"></div>'));d.append(jQuery('<p class="wdi_comment_header_p"><span class="wdi_comment_header"><a target="_blank" href="//instagram.com/'+n+'">'+n+'</a></span><span class="wdi_comment_date">'+wdi_front.convertUnixDate(e[i].created_time)+"</span></p>")),d.append(jQuery('<div class="wdi_comment_body_p"><span class="wdi_comment_body"><p>'+r+"</p></span></div>")),jQuery("#wdi_added_comments").prepend(d)}this.updateScrollbar()},updateScrollbar:function(){var e=jQuery("#wdi_comments"),t=jQuery("#wdi_added_comments");jQuery(".wdi_comments").attr("class","wdi_comments"),jQuery(".wdi_comments").html(""),jQuery(".wdi_comments").append(e),jQuery(".wdi_comments").append(t),void 0!==jQuery().mCustomScrollbar&&jQuery.isFunction(jQuery().mCustomScrollbar)&&jQuery(".wdi_comments").mCustomScrollbar({scrollInertia:250}),jQuery(".wdi_comments_close_btn").on("click",wdi_comment)},getAjaxComments:function(){this.instagram.getRecentMediaComments(this.media_id,{success:function(e){if(""==e||null==e||null==e)return errorMessage="Network Error, please try again later :(",void console.log("%c"+errorMessage,"color:#cc0000;");if(200!=e.meta.code)return errorMessage=e.meta.error_message,void console.log("%c"+errorMessage,"color:#cc0000;");wdi_comments_manager.mediaComments=e.data;var t=wdi_data[wdi_comments_manager.currentKey];t.comments_data=e.data,wdi_comments_manager.showComments(t.comments_data,wdi_comments_manager.load_more_count),wdi_comments_manager.ajax_comments_ready(e.data)}})},ajax_comments_ready:function(e){this.createLoadMoreAndBindEvent()},createLoadMoreAndBindEvent:function(){jQuery("#wdi_added_comments").prepend(jQuery('<p id="wdi_load_more_comments" class="wdi_load_more_comments">load more comments</p>')),jQuery(".wdi_comment_container #wdi_load_more_comments").on("click",function(){jQuery(this).remove(),wdi_comments_manager.showComments(wdi_comments_manager.mediaComments,wdi_comments_manager.load_more_count),wdi_comments_manager.createLoadMoreAndBindEvent()})},filterCommentText:function(e){for(var t=e.split(" "),i="",a=0;a<t.length;a++)switch(t[a][0]){case"@":i+='<a target="blank" class="wdi_comm_text_link" href="//instagram.com/'+t[a].substring(1,t[a].length)+'">'+t[a]+"</a> ";break;case"#":i+='<a target="blank" class="wdi_comm_text_link" href="//instagram.com/explore/tags/'+t[a].substring(1,t[a].length)+'">'+t[a]+"</a> ";break;default:i+=t[a]+" "}return i=i.substring(0,i.length-1)}};
js/jquery.lazyload.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /*! Lazy Load 1.9.3 - MIT license - Copyright 2010-2013 Mika Tuupola */
2
+ !function(a,b,c,d){var e=a(b);a.fn.lazyload=function(f){function g(){var b=0;i.each(function(){var c=a(this);if(!j.skip_invisible||c.is(":visible"))if(a.abovethetop(this,j)||a.leftofbegin(this,j));else if(a.belowthefold(this,j)||a.rightoffold(this,j)){if(++b>j.failure_limit)return!1}else c.trigger("appear"),b=0})}var h,i=this,j={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:b,data_attribute:"original",skip_invisible:!0,appear:null,load:null,placeholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"};return f&&(d!==f.failurelimit&&(f.failure_limit=f.failurelimit,delete f.failurelimit),d!==f.effectspeed&&(f.effect_speed=f.effectspeed,delete f.effectspeed),a.extend(j,f)),h=j.container===d||j.container===b?e:a(j.container),0===j.event.indexOf("scroll")&&h.bind(j.event,function(){return g()}),this.each(function(){var b=this,c=a(b);b.loaded=!1,(c.attr("src")===d||c.attr("src")===!1)&&c.is("img")&&c.attr("src",j.placeholder),c.one("appear",function(){if(!this.loaded){if(j.appear){var d=i.length;j.appear.call(b,d,j)}a("<img />").bind("load",function(){var d=c.attr("data-"+j.data_attribute);c.hide(),c.is("img")?c.attr("src",d):c.css("background-image","url('"+d+"')"),c[j.effect](j.effect_speed),b.loaded=!0;var e=a.grep(i,function(a){return!a.loaded});if(i=a(e),j.load){var f=i.length;j.load.call(b,f,j)}}).attr("src",c.attr("data-"+j.data_attribute))}}),0!==j.event.indexOf("scroll")&&c.bind(j.event,function(){b.loaded||c.trigger("appear")})}),e.bind("resize",function(){g()}),/(?:iphone|ipod|ipad).*os 5/gi.test(navigator.appVersion)&&e.bind("pageshow",function(b){b.originalEvent&&b.originalEvent.persisted&&i.each(function(){a(this).trigger("appear")})}),a(c).ready(function(){g()}),this},a.belowthefold=function(c,f){var g;return g=f.container===d||f.container===b?(b.innerHeight?b.innerHeight:e.height())+e.scrollTop():a(f.container).offset().top+a(f.container).height(),g<=a(c).offset().top-f.threshold},a.rightoffold=function(c,f){var g;return g=f.container===d||f.container===b?e.width()+e.scrollLeft():a(f.container).offset().left+a(f.container).width(),g<=a(c).offset().left-f.threshold},a.abovethetop=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollTop():a(f.container).offset().top,g>=a(c).offset().top+f.threshold+a(c).height()},a.leftofbegin=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollLeft():a(f.container).offset().left,g>=a(c).offset().left+f.threshold+a(c).width()},a.inviewport=function(b,c){return!(a.rightoffold(b,c)||a.leftofbegin(b,c)||a.belowthefold(b,c)||a.abovethetop(b,c))},a.extend(a.expr[":"],{"below-the-fold":function(b){return a.belowthefold(b,{threshold:0})},"above-the-top":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-screen":function(b){return a.rightoffold(b,{threshold:0})},"left-of-screen":function(b){return!a.rightoffold(b,{threshold:0})},"in-viewport":function(b){return a.inviewport(b,{threshold:0})},"above-the-fold":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-fold":function(b){return a.rightoffold(b,{threshold:0})},"left-of-fold":function(b){return!a.rightoffold(b,{threshold:0})}})}(jQuery,window,document);
js/wd_bp_install.min.js DELETED
@@ -1 +0,0 @@
1
- function wd_bp_notice_install(){jQuery.post(wd_bp_url)}jQuery(document).ready(function(){jQuery(".wd_bp_notice_dissmiss").on("click",function(){jQuery("#wd_bp_notice_cont").hide(),jQuery.post(wd_bp_url)})});
 
js/wdi_admin.js CHANGED
@@ -1,5 +1,5 @@
1
  jQuery(document).ready(function() {
2
-
3
  jQuery("#wdi_reset_cache").click(function (e) {
4
  jQuery(".wdi_reset_cache_success").remove();
5
  e.preventDefault();
@@ -9,21 +9,19 @@ jQuery(document).ready(function() {
9
  dataType:"json",
10
  data: {
11
  wdi_nonce:wdi_ajax.wdi_nonce,
12
- action:"wdi_set_reset_cache"
 
13
  },
14
  success: function(data){
15
  if(data.success === false){
16
- jQuery("#wdi_reset_cache").before("<span class='wdi_reset_cache_success' style='color: #fc0000; margin-left: 15px; line-height: 2;'>Failed</span>");
17
  }else{
18
- jQuery("#wdi_reset_cache").before("<span class='wdi_reset_cache_success' style='color: #029117; margin-left: 15px; line-height: 2;'>Success</span>");
19
  }
20
  }
21
  });
22
-
23
  });
24
 
25
- jQuery('#wdi_ask_question').parent().attr('target','_blank');
26
-
27
  /*Feeds page*/
28
  wdi_controller.bindSaveFeedEvent();
29
  wdi_controller.bindAddNewUserOrHashtagEvent();
@@ -35,11 +33,8 @@ jQuery(document).ready(function() {
35
  /*Themes page*/
36
  wdi_controller.bindSaveThemeEvent();
37
 
38
- 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>"));
39
-
40
-
41
  if(jQuery('body').hasClass('instagram-feed_page_wdi_settings')){
42
- wdi_multiple_accounts_option_controller();
43
  wdi_advanced_option_controller();
44
  }
45
 
@@ -62,7 +57,6 @@ jQuery(document).ready(function() {
62
  'wdi_conditional_filters': 'show',
63
  'wdi_how_to_publish': 'show',
64
  };
65
- //var closed_sections = jQuery("#wdi_save_feed .wdi_section").find(".wdi_section_open");
66
  var wdi_sections = JSON.parse(localStorage.getItem('wdi_sections'));
67
  if (wdi_sections === null || wdi_sections === false) {
68
  wdi_sections = wdi_hide_show_sections_list;
@@ -72,7 +66,8 @@ jQuery(document).ready(function() {
72
  var wdi_section_el = jQuery("#wdi_save_feed").find("[data-section_name='" + i + "']");
73
  wdi_show_hide(wdi_sections[i], wdi_section_el);
74
  }
75
- } else {
 
76
  var wdi_section_parent_id = jQuery(element).data("section_name");
77
  var show_hide_section = null;
78
  if (element.hasClass("wdi_section_open")) {
@@ -90,82 +85,83 @@ jQuery(document).ready(function() {
90
  }
91
  }
92
 
 
 
 
 
 
 
 
 
 
 
 
 
93
 
94
- function wdi_show_hide(type, element) {
95
- if (type === "show") {
96
- var wdi_closable_section = element.closest(".wdi_section").find(".wdi_elements");
97
- if (wdi_closable_section.data("display") === "table") {
98
- wdi_closable_section.css({
99
- "display": "table"
100
- });
101
- } else {
102
- wdi_closable_section.css({
103
- "display": "block"
104
- });
105
- }
 
 
 
 
 
 
106
 
107
- element.css({
108
- 'border-bottom': "1px solid #f1f1f1",
109
- 'margin': '0 auto 15px'
110
- });
111
- element.removeClass("wdi_section_open");
112
- element.addClass("wdi_section_close");
113
- } else {
114
- element.closest(".wdi_section").find(".wdi_elements").css({
115
- 'display': 'none'
116
- });
117
- element.css({
118
- 'border-bottom': "0px",
119
- 'margin': '0 auto 0px'
120
- });
121
- element.removeClass("wdi_section_close");
122
- element.addClass("wdi_section_open");
123
- }
124
- }
125
 
 
 
 
 
126
  });
127
 
128
- function wdi_multiple_accounts_option_controller(){
129
- var $table = jQuery(jQuery('#wdi_user_id').closest('form').find('.form-table').get(1));
130
- $table.addClass('wdi_multiple_accounts_section');
131
- var html = '';
132
- var users_list = JSON.parse(wdi_options.wdi_authenticated_users_list);
133
-
134
- var index = 0;
135
- for(var i in users_list){
136
-
137
- html += "<tr data-multiple-account='" + index + "'>";
138
- html += "<th>Access Token</th>";
139
- html += '<td><input type="text" name="wdi_instagram_options[wdi_authenticated_users_list][access_token][]" size="53" required="" value="' + users_list[i].access_token + '"></td>';
140
- html += "</tr>";
141
-
142
- html += "<tr data-multiple-account='" + index + "' class='wdi_username_tr'>";
143
- html += "<th>Username</th>";
144
- html += '<td>' +
145
- '<div class="wdi_input_wrapper"><input type="text" name="wdi_instagram_options[wdi_authenticated_users_list][user_name][]" size="53" required="" value="' + users_list[i].user_name + '"></div>' +
146
- '<div class="wdi_remove_auth_user">Delete</div>' +
147
- '</td>';
148
- html += '<input type="hidden" name="wdi_instagram_options[wdi_authenticated_users_list][user_id][]" size="53" required="" value="' + users_list[i].user_id + '">';
149
- html += "</tr>";
150
- index++;
151
  }
152
 
153
- $table.append(html);
154
-
155
-
156
- jQuery('.wdi_remove_auth_user').on('click', function (e) {
157
- e.preventDefault();
158
-
159
- var data = jQuery(this).closest('.wdi_username_tr').data('multiple-account');
160
- jQuery(this).closest('.wdi_multiple_accounts_section').find('tr[data-multiple-account="' + data + '"]').remove();
161
-
162
- return false;
163
- });
164
-
165
  }
166
 
167
  function wdi_advanced_option_controller() {
168
-
169
  var $table = jQuery(jQuery('#wdi_user_id').closest('form').find('.form-table').get(1));
170
  $table.addClass('wdi_advanced_option wdi_advanced_option_close');
171
  var tr = "<tr class='wdi_advanced_option_head'><th style='width: 100%;'>ADVANCED OPTIONS AND MULTIPLE INSTAGRAM ACCOUNTS</th><td><div class='wdi_advanced_option_icon'></div></td></tr>";
@@ -183,7 +179,6 @@ function wdi_advanced_option_controller() {
183
  });
184
  }
185
 
186
-
187
  function wdi_controller() {};
188
 
189
  /**
@@ -226,48 +221,38 @@ wdi_controller.apiRedirected = function() {
226
  wdi_controller.getUserInfo(access_token);
227
  }
228
 
229
-
230
-
231
  /**
232
  * Used in Settings page for finding access token owners username
233
  * and and for filling it in username input field
234
  *
235
  * @param {String} access_token [Instagram API access token]
236
  */
237
- wdi_controller.getUserInfo = function(access_token) {
238
  this.instagram.getSelfInfo({
239
- success: function(response) {
240
-
241
-
242
- if (wdi_options.wdi_access_token === "") {
243
- jQuery('#wdi_user_name').attr('value', response['data']['username']);
244
- jQuery('#wdi_user_id').attr('value', response['data']['id']);
245
- } else {
246
- jQuery('.wdi_more_token_template .wdi_more_user_name').prop('disabled', false);
247
- jQuery('.wdi_more_token_template .wdi_more_user_id').prop('disabled', false);
248
-
249
- jQuery('.wdi_more_token_template .wdi_more_user_name').attr('value', response['data']['username']);
250
- jQuery('.wdi_more_token_template .wdi_more_user_id').attr('value', response['data']['id']);
251
- }
252
-
253
-
254
  jQuery(document).trigger('wdi_settings_filled');
255
  }
256
  })
257
  }
258
 
259
-
260
-
261
  wdi_controller.oldDisplayType = {};
262
  wdi_controller.displayTypeMemory = {};
263
 
264
-
265
  /*
266
  * Switches between feeds admin page tabs
267
  */
268
  wdi_controller.switchFeedTabs = function(tabname, section) {
269
 
270
-
271
  //add tabname in hidden field
272
  jQuery('#wdi_refresh_tab').attr('value', tabname);
273
 
@@ -322,20 +307,11 @@ wdi_controller.switchFeedTabs = function(tabname, section) {
322
  wdi_controller.displaySettingsSection(selectedSection);
323
  }
324
 
325
- // @TODO free There is a difference in free!
326
  // if tabname is conditional filters then call tab interface updater
327
- if( tabname != 'conditional_filters' ){
328
- jQuery( '#wdi-conditional-filters-ui' ).addClass('wdi_hidden');
329
- /* jQuery( '#wdi_save_feed_apply' ).removeClass( 'wdi_hidden' );
330
- jQuery( '#wdi_cancel_changes' ).removeClass( 'wdi_hidden' );
331
- jQuery( '#wdi_save_feed_submit' ).removeClass( 'wdi_hidden' );*/
332
- }else{
333
- jQuery( '#wdi-conditional-filters-ui' ).removeClass('wdi_hidden');
334
- /* jQuery( '#wdi_save_feed_apply' ).addClass( 'wdi_hidden' );
335
- jQuery( '#wdi_cancel_changes' ).addClass( 'wdi_hidden' );
336
- jQuery( '#wdi_save_feed_submit' ).addClass( 'wdi_hidden' );*/
337
  }
338
-
339
  }
340
 
341
  /*
@@ -383,15 +359,12 @@ wdi_controller.displaySettingsSection = function($this) {
383
  * Switches between themes admin page tabs
384
  */
385
  wdi_controller.switchThemeTabs = function(tabname, section) {
386
-
387
-
388
- //swap active tab class
389
  jQuery('.wdi_feed_tabs').filter('.wdi_feed_tab_active').each(function() {
390
  jQuery(this).removeClass('wdi_feed_tab_active');
391
  });
392
  jQuery('#wdi_' + tabname).addClass('wdi_feed_tab_active');
393
 
394
-
395
  //hiding options of other tabs
396
  jQuery('[tab]').each(function() {
397
  if (jQuery(this).attr('tab') != tabname) {
@@ -406,7 +379,6 @@ wdi_controller.switchThemeTabs = function(tabname, section) {
406
  //showing only requested display_type tab elements
407
  jQuery('.display_type[tab="' + tabname + '"]').css('display', 'block');
408
 
409
-
410
  //add tabname in hidden field
411
  jQuery('#wdi_refresh_tab').attr('value', tabname);
412
  //add sectionname in hidden field
@@ -425,10 +397,8 @@ wdi_controller.switchThemeTabs = function(tabname, section) {
425
  } else {
426
  jQuery('.display_type #' + section).trigger('click');
427
  }
428
-
429
  }
430
 
431
-
432
  /**
433
  * Binds events to control buttons
434
  */
@@ -447,230 +417,117 @@ wdi_controller.bindSaveFeedEvent = function() {
447
  });
448
  }
449
 
450
-
451
  /**
452
  * Submits form baset on given task
453
  * if task is cancel then it reloades the page
454
  * @param {String} task [this is self explanatory]
455
  */
456
- wdi_controller.save_feed = function(task) {
457
-
458
- if ("cancel" == task) {
 
 
 
 
 
459
  window.location = window.location.href;
460
  }
461
-
462
- //check if user input field is not empty then cancel save process and make an ajax request
463
- //add user in input field and then after it trigger save,apply or whatever
 
 
 
 
 
 
 
 
 
 
464
  wdi_controller.checkIfUserNotSaved(task);
465
- if (wdi_controller.waitingAjaxRequestEnd.button != 0) {
466
  return;
467
- };
468
-
469
- jQuery('#task').attr('value', task);
470
- var feed_users = this.feed_users,
471
- feed_users_json,
472
- id,
473
- username,
474
- errorInfo,
475
- profile_picture,
476
- defaultUser = {
477
- username: jQuery('#wdi_default_user').val(),
478
- id: jQuery('#wdi_default_user_id').val()
479
- };
480
-
481
- if (feed_users.length == 0) {
482
- feed_users.push(defaultUser);
483
- this.updateFeaturedImageSelect(defaultUser['username'], 'add', 'selected');
484
  }
485
-
486
- feed_users_json = this.stringifyUserData(feed_users);
487
-
488
- jQuery('#WDI_feed_users').val(feed_users_json);
489
-
490
- if (task == 'apply_changes' || task == 'save_feed') {
491
- id = jQuery('#wdi_add_or_edit').attr('value');
492
- jQuery('#wdi_current_id').attr('value', id);
493
  }
494
-
495
-
496
-
497
- username = jQuery('#WDI_thumb_user').val();
498
- //errorInfo = '';
499
- profile_picture = this.getUserProfilePic(username);
500
-
501
- //if username is selected default user and we don't have default users image then request it
502
- //typeof profile_picture will be undefined when user without adding any user submits form
503
- if ('false' == profile_picture || typeof profile_picture == 'undefined') {
504
- var _this = this;
505
-
506
- //deprecated API
507
-
508
- //this.instagram.searchForUsersByName(username, {
509
- this.instagram.getSelfInfo({
510
- success: function(response) {
511
- var vObj = _this.isValidResponse(response),
512
- user = response.data,
513
- profile_picture;
514
- if (vObj.valid && _this.hasData(response) && user) {
515
- profile_picture = user['profile_picture'];
516
- } else {
517
- profile_picture = '';
518
- }
519
-
520
- }
521
- });
522
-
523
- jQuery('#wdi_feed_thumb').attr('value', profile_picture);
524
- jQuery('#wdi_save_feed').submit();
525
- } else {
526
- jQuery('#wdi_feed_thumb').attr('value', profile_picture);
527
- jQuery('#wdi_save_feed').submit();
528
  }
 
 
 
 
 
 
529
  }
530
 
531
-
532
-
533
  /**
534
  * Takes user input as argument and makes an
535
  * instagram request for getting meta info such as username and user id
536
  * stores getted data in wdi_controller.feed_users array and updates some admin elements which
537
  * depend on users
538
  *
539
- * @param {String} user_input [username or hashtag, Note. hashtags should start with #]
540
  * @param {String} backend [if is set to 'backend' all confirms will be ignored while making requests]
541
  * @return {Void}
542
  */
543
- wdi_controller.makeInstagramUserRequest = function(user_input, ignoreConfirm) {
544
-
545
- var newUser,
546
- input_type,
547
- _this = this,
548
- selected;
549
-
550
- input_type = this.getInputType(user_input);
551
-
552
- if (wdi_version.is_pro == 'false') {
553
- if (jQuery('.wdi_user').length == 1) {
554
- alert(wdi_messages.only_one_user_or_hashtag);
555
- return false;
556
- }
557
  }
558
-
559
- var hashtag_feed = input_type === "hashtag";
560
- var user_feed = input_type === "user";
561
- for (var i in _this.feed_users) {
562
- if (_this.feed_users[i].username.charAt(0) === "#") {
563
- hashtag_feed = true;
564
- }
565
- else {
566
- user_feed = true;
567
- }
568
- if (user_feed && hashtag_feed) {
569
- alert("You can add only username or hashtags."); // todo
570
- return false;
571
- }
572
  }
573
-
574
- switch (input_type) {
 
 
 
 
 
 
 
 
575
  case 'user': {
576
- /*
577
- // @todo A new logic must be developed for the HASHTAG. 2020 API change.
578
- if ( typeof wdi_options.wdi_access_token === 'undefined' || wdi_options.wdi_access_token == '' ) {
579
- alert("To display your feed media , get Instagram API token from settings page.");
580
- return false;
581
- }
582
-
583
- if ( typeof wdi_options.wdi_users_list_authenticated[user_input] === 'undefined' ) {
584
- alert("Instagram 'User Name' is incorrect.");
585
- return false;
586
- }
587
- */
588
- user = wdi_options.wdi_users_list_authenticated[user_input];
589
- this.addUser(user);
590
-
591
- /*
592
- // @TODO comment by API 2020
593
- if (_this.feed_users.length > 0) {
594
- alert("You can add only one username");
595
- return false;
596
- }
597
- var token = '';
598
- if (user_input === wdi_options.wdi_user_name) {
599
- token = wdi_options.wdi_access_token;
600
- }
601
- else if (typeof _this.users_list[user_input] !== 'undefined') {
602
- token = _this.users_list[user_input].access_token;
603
- }
604
- else {
605
- alert("You can add only your usernames ( " + _this.usersnames.join(', ') + " )");
606
- return false;
607
- }
608
- this.instagram.resetTokens();
609
- this.instagram.addToken(token);
610
- this.instagram.getSelfInfo({
611
- success: function (response) {
612
- jQuery('#wdi_add_user_ajax').removeAttr('disabled');
613
- //contains information about response such as error messages and if
614
- //response is valid or not
615
- var vObj = _this.isValidResponse(response);
616
- if (vObj.valid == false) {
617
- alert(vObj.msg);
618
- return;
619
- }
620
- //this is the user object we are searching for, of user does not exists then it is false
621
- var user = response.data;
622
- if (vObj.valid && _this.hasData(response)) {
623
- _this.addUser(user);
624
- }
625
- else {
626
- if (!user) {
627
- alert(wdi_messages.user_not_exist.replace("%s", '"' + user_input + '"'))
628
- }
629
- else {
630
- alert(vObj.msg);
631
- }
632
- }
633
- }
634
- });
635
- */
636
  break;
637
  }
638
  case 'hashtag': {
639
- if ( typeof wdi_options.fb_token === "undefined" || wdi_options.fb_token === "" ) {
640
- alert("To display hashtag media , get Facebook API token from settings page.");
641
- return false;
642
- }
643
-
644
  var tagname = user_input.substr(1, user_input.length);
645
- tagname = tagname.replace(" ",'');
646
  var radio = jQuery("input[name='wdi_feed_settings[hashtag_top_recent]']:checked").val();
647
-
648
  this.instagram.getTagRecentMedia(tagname, {
649
- success: function (response) {
650
  jQuery('#wdi_add_user_ajax').removeAttr('disabled');
651
- //contain information about response such as error messages and if
652
- //response is valid or not
653
  var vObj = _this.isValidResponse(response);
654
- if (vObj.valid && _this.hasData(response)) {
655
  _this.addHashtag(tagname, response);
656
- if (wdi_version.is_pro == 'false') {
657
- if (jQuery('.wdi_user').length == 1) {
658
- jQuery('#wdi_add_user_ajax_input').attr('disabled', 'disabled');
659
- jQuery('#wdi_add_user_ajax_input').attr('placeholder', wdi_messages.available_in_pro);
660
- }
661
- }
662
  }
663
  else {
664
- if (!_this.hasData(response) && vObj.msg == 'success') {
665
- if (ignoreConfirm != true) {
666
- if (confirm(wdi_messages.hashtag_no_data)) {
667
  _this.addHashtag(tagname, response);
668
- if (wdi_version.is_pro == 'false') {
669
- if (jQuery('.wdi_user').length == 1) {
670
- jQuery('#wdi_add_user_ajax_input').attr('disabled', 'disabled');
671
- jQuery('#wdi_add_user_ajax_input').attr('placeholder', wdi_messages.available_in_pro);
672
- }
673
- }
674
  }
675
  else {
676
  jQuery('#wdi_add_user_ajax_input').val('');
@@ -678,21 +535,14 @@ wdi_controller.makeInstagramUserRequest = function(user_input, ignoreConfirm) {
678
  }
679
  else {
680
  _this.addHashtag(tagname, response);
681
- if (wdi_version.is_pro == 'false') {
682
- if (jQuery('.wdi_user').length == 1) {
683
- jQuery('#wdi_add_user_ajax_input').attr('disabled', 'disabled');
684
- jQuery('#wdi_add_user_ajax_input').attr('placeholder', wdi_messages.available_in_pro);
685
- }
686
- }
687
- else {
688
- alert(vObj.msg);
689
- }
690
  }
691
  }
 
 
 
692
  }
693
  }
694
- }, null, radio);
695
-
696
  break;
697
  }
698
  }
@@ -712,83 +562,73 @@ wdi_controller.checkForDuplicateUser = function(username) {
712
  return false;
713
  }
714
 
715
- wdi_controller.getInputType = function(input) {
716
  switch (input[0]) {
717
- case '#':
718
- {
719
- return 'hashtag';
720
- break;
721
- }
722
- case '%':
723
- {
724
- return 'location';
725
- break;
726
- }
727
- default:
728
- {
729
- return 'user';
730
- break;
731
- }
732
-
733
  }
734
  }
735
 
736
-
737
-
738
  /**
739
  * Makes username and id pairs from users array and return json_encoded string
740
  * @param {Array} feed_users [array of feed_users containing username and id and other parameters]
741
  * @return {String} [JSON encoded data]
742
  */
743
- wdi_controller.stringifyUserData = function(feed_users) {
744
  var users = [];
745
- for (var i = 0; i < feed_users.length; i++) {
746
  users.push({
747
- username: feed_users[i]['username'],
748
  id: feed_users[i]['id'],
749
- tag_id: (typeof feed_users[i]['tag_id'] !== "undefined") ? feed_users[i]['tag_id'] : ""
 
750
  })
751
  }
 
752
  return JSON.stringify(users);
753
  }
754
 
755
-
756
-
757
  /**
758
  * Binds 'click' and 'enter' event to add user button
759
  *
760
  */
761
- wdi_controller.bindAddNewUserOrHashtagEvent = function() {
762
- jQuery('#wdi_add_user_ajax').on('click', function() {
763
- if(typeof jQuery(this).attr('disabled') !== "undefined"){
764
  return;
765
- }else{
766
- jQuery(this).attr('disabled', 'disabled');
767
  }
768
-
769
- var user_input = jQuery('#wdi_add_user_ajax_input').val().trim().toLowerCase();
770
- if(wdi_controller.makeInstagramUserRequest(user_input) === false){
771
- jQuery(this).removeAttr('disabled', 'disabled');
 
 
772
  }
773
  });
774
-
775
- jQuery('#wdi_add_user_ajax_input').on("keypress", function(e) {
776
- if (e.keyCode == 13) {
777
-
778
- if(typeof jQuery("#wdi_add_user_ajax").attr('disabled') !== "undefined"){
779
- return;
780
- }else{
781
- jQuery("#wdi_add_user_ajax").attr('disabled', 'disabled');
782
- }
783
-
784
- var user_input = jQuery('#wdi_add_user_ajax_input').val().trim().toLowerCase();
785
- if(wdi_controller.makeInstagramUserRequest(user_input) === false){
786
- jQuery("#wdi_add_user_ajax").removeAttr('disabled', 'disabled');
787
- }
788
  return false; // prevent the button click from happening
789
  }
790
  });
791
-
792
  }
793
 
794
  /**
@@ -797,38 +637,39 @@ wdi_controller.bindAddNewUserOrHashtagEvent = function() {
797
  *
798
  * @param {Object} $this [jQuery object of remove user button]
799
  */
800
- wdi_controller.removeFeedUser = function($this) {
801
-
802
-
803
  var username = $this.parent().find('a span').text();
804
- if ($this.parent().find('a span').hasClass('wdi_hashtag')) {
805
  username = '#' + username;
806
  }
807
-
808
- for (var i = 0; i < this.feed_users.length; i++) {
809
- if (this.feed_users[i]['username'] == username) {
 
 
 
 
 
 
810
  this.feed_users.splice(i, 1);
811
  break;
812
  }
813
  }
814
-
 
 
 
 
 
815
  $this.parent().remove();
816
- //wdi_controller.updateHiddenField();
817
- if (username !== jQuery('#wdi_default_user').val()) {
 
818
  wdi_controller.updateFeaturedImageSelect(username, 'remove');
819
  }
820
-
821
- if(wdi_version.is_pro == 'false'){
822
- if( jQuery('.wdi_user').length == 0 ){
823
- jQuery('#wdi_add_user_ajax_input').removeAttr('disabled');
824
- jQuery('#wdi_add_user_ajax_input').attr('placeholder','');
825
- }
826
- }
827
-
828
- wdi_controller.changed_users();
829
  }
830
 
831
-
832
  /**
833
  * Adds or removes users from featured image select
834
  *
@@ -858,8 +699,8 @@ wdi_controller.updateFeaturedImageSelect = function(username, action, selected)
858
  {
859
  select.find('option[value="' + username + '"]').remove();
860
  if(this.feed_users.length > 0) {
861
- select.val(this.feed_users[0].username);
862
- }
863
 
864
  break;
865
  }
@@ -867,8 +708,6 @@ wdi_controller.updateFeaturedImageSelect = function(username, action, selected)
867
 
868
  }
869
 
870
-
871
-
872
  ////////////////////////////////////////////////////////////////////////////////
873
  ///////////////////////////////Themes Page//////////////////////////////////////
874
  ////////////////////////////////////////////////////////////////////////////////
@@ -883,9 +722,14 @@ wdi_controller.bindSaveThemeEvent = function() {
883
  jQuery('#wdi_current_id').attr('value', id);
884
  jQuery('#wdi_save_feed').submit();
885
  });
 
 
 
 
 
 
886
  }
887
 
888
-
889
  /**
890
  * This function is called when one of controll buttons are being clicked
891
  * it checks if user has typed any username in unsername input
@@ -914,16 +758,17 @@ wdi_controller.checkIfUserNotSaved = function(task) {
914
  }
915
  }
916
 
917
- //checking if user has typed username in input field but didn't saved it, trigger add action
918
- if (jQuery('#wdi_add_user_ajax_input').val().trim() != '') {
919
  var user_input = jQuery('#wdi_add_user_ajax_input').val().trim().toLowerCase();
920
  wdi_controller.waitingAjaxRequestEnd = {
921
  button: task
922
  };
923
- //making request
924
  wdi_controller.makeInstagramUserRequest(user_input);
925
  return 1;
926
- } else {
 
927
  wdi_controller.waitingAjaxRequestEnd = {
928
  button: 0
929
  };
@@ -948,7 +793,6 @@ wdi_controller.saveFeedAfterAjaxWait = function(correctUserFlag) {
948
  }
949
  }
950
 
951
-
952
  /**
953
  * Gets cookie value by name
954
  * @param {String} name [cookie name]
@@ -966,26 +810,27 @@ wdi_controller.getCookie = function(name) {
966
  * @param {Object} response [Instagram API response]
967
  * @return {Boolean}
968
  */
969
- wdi_controller.isValidResponse = function(response) {
970
-
971
  var obj = {};
972
  if (typeof response == 'undefined' || typeof response['meta']['code'] == 'undefined' || response['meta']['code'] != 200) {
973
  obj.valid = false;
974
  if (typeof response == 'undefined') {
975
  obj.msg = wdi_messages.instagram_server_error;
976
- } else if (response['meta']['code'] !== 200) {
 
977
  obj.msg = response['meta']['error_message'];
978
- } else {
 
979
  obj.msg = '';
980
  }
981
- } else {
 
982
  obj.valid = true;
983
  obj.msg = 'success';
984
  }
985
  return obj;
986
  }
987
 
988
-
989
  /**
990
  * Return true if response has data object which is not empty
991
  * @param {Onject} response [instagram API response]
@@ -999,7 +844,6 @@ wdi_controller.hasData = function(response) {
999
  }
1000
  }
1001
 
1002
-
1003
  /**
1004
  * Return true if user is featured user
1005
  * @param {String} [user] username we want to check
@@ -1010,7 +854,6 @@ wdi_controller.thumbUser = function(user) {
1010
  //return (jQuery('#wdi_thumb_user').val() == user) ? true : false;
1011
  }
1012
 
1013
-
1014
  /**
1015
  * finds user by username in instagram api request object
1016
  * if user is found then returns user object otherwise returns false
@@ -1041,80 +884,74 @@ wdi_controller.findUser = function(username, response) {
1041
  * @param {Object} response [instagram API response]
1042
  */
1043
  wdi_controller.addHashtag = function(tagname, response) {
1044
- //if tagname doesn't contain invalid characters
1045
  if (tagname.match(/[~!@$%&*#^()<>?]/) == null) {
1046
- if (this.checkForDuplicateUser('#' + tagname) == false) {
1047
  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>');
1048
- jQuery('#wdi_feed_users').append(newHashtag);
1049
- jQuery('#wdi_add_user_ajax_input').attr('value', '');
1050
  var profile_picture;
1051
  if (typeof response != 'undefined') {
1052
  profile_picture = (response['data'].length != 0 && typeof response['data'][0]['images']['thumbnail'] !== "undefined") ? response['data'][0]['images']['thumbnail']['url'] : '';
1053
  } else {
1054
  profile_picture = '';
1055
  }
1056
-
1057
- this.feed_users.push({
1058
- username: '#' + tagname,
1059
  id: '#' + tagname,
 
1060
  profile_picture: profile_picture,
1061
  tag_id: response.tag_id
1062
- });
1063
-
1064
  var user_input = '#' + tagname;
1065
  selected = this.thumbUser(user_input) ? 'selected' : '';
1066
 
1067
  wdi_controller.updateFeaturedImageSelect(user_input, 'add', selected);
1068
- } else {
1069
- alert('#' + tagname + ' ' + wdi_messages.already_added);
1070
- }
1071
  } else {
1072
  alert(wdi_messages.invalid_hashtag);
1073
  }
1074
 
1075
-
1076
  this.updateConditionalFiltersUi();
1077
 
1078
  wdi_controller.saveFeedAfterAjaxWait(true);
1079
 
1080
- wdi_controller.changed_users();
1081
  };
1082
 
1083
-
1084
  wdi_controller.changed_users = function () {
1085
- var has_hashtag = false;
1086
- for (var i = 0; i < this.feed_users.length; i++) {
1087
- if (this.feed_users[i].username[0] === '#') {
1088
- has_hashtag = true;
1089
- break;
1090
- }
1091
- }
1092
-
1093
- if(has_hashtag){
1094
  jQuery('.wdi_element_name_hashtag_top_recent').show();
1095
  jQuery('.wdi_element_name_show_username_on_thumb').hide();
1096
- }else{
1097
- jQuery('.wdi_element_name_hashtag_top_recent').hide();
1098
- jQuery('.wdi_element_name_show_username_on_thumb').show();
 
1099
  }
1100
  };
1101
 
1102
  /**
 
1103
  * Adds given user to internal array wdi_controller.feed_users and also updates GUI
1104
  *
1105
  * @param {Object} user [Object conatining user information such as id, username and profile picture]
1106
  */
1107
  wdi_controller.addUser = function(user) {
1108
- // TODO should be developed
1109
  if ( this.checkForDuplicateUser(user.username) == false ) {
1110
- // ' + '<img class="wdi_profile_pic" src="' + user['profile_picture'] + '">
1111
  newUser = jQuery('<div class="wdi_user"><a target="_blank" href="http://www.instagram.com/' + user.username + '"><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>');
1112
- jQuery('#wdi_feed_users').append(newUser);
1113
- jQuery('#wdi_add_user_ajax_input').attr('value', '');
1114
 
1115
  this.feed_users.push({
1116
- username: user.username,
1117
  id: user.id,
 
1118
  profile_picture: '' // user['profile_picture']
1119
  });
1120
 
@@ -1130,7 +967,6 @@ wdi_controller.addUser = function(user) {
1130
  wdi_controller.saveFeedAfterAjaxWait(true);
1131
  }
1132
 
1133
-
1134
  /**
1135
  * Scans internal wdi_controller.feed_users array and return profile picture url of given user
1136
  * if there is no profile picture then returns blank string
@@ -1147,8 +983,6 @@ wdi_controller.getUserProfilePic = function(username) {
1147
  return 'false';
1148
  }
1149
 
1150
-
1151
-
1152
  /*-------------------------------------------------------------
1153
  ----------------Conditional Filters Tab Methods----------------
1154
  -------------------------------------------------------------*/
@@ -1219,20 +1053,23 @@ wdi_controller.conditionalFiltersTabInit = function() {
1219
  }
1220
 
1221
  jQuery(this).parent().find('label').css({
1222
- 'line-height' : '24px',
1223
- 'height' : '24px',
1224
- 'padding' : '2px 5px',
1225
- 'display' : 'inline-block',
1226
- 'font-size': '15px',
1227
- 'color': 'black',
1228
- 'font-weight': '500',
1229
- '-webkit-user-select': 'none', /* Chrome/Safari */
1230
- '-moz-user-select': 'none', /* Firefox */
1231
- '-ms-user-select': 'none', /* IE10+ */
1232
-
1233
- /* Rules below not implemented in browsers yet */
1234
- '-o-user-select': 'none',
1235
- 'user-select': 'none',
 
 
 
1236
  });
1237
 
1238
  switch (jQuery(this).val()) {
@@ -1260,7 +1097,6 @@ wdi_controller.conditionalFiltersTabInit = function() {
1260
  });
1261
  //triggering change for updating first time
1262
  jQuery('#WDI_conditional_filter_type').trigger('change');
1263
-
1264
  }
1265
 
1266
  /**
@@ -1342,7 +1178,6 @@ wdi_controller.addConditionalFilter = function() {
1342
  alert(wdi_messages.selectConditionType);
1343
  return false;
1344
  }
1345
-
1346
  }
1347
 
1348
  /**
@@ -1561,7 +1396,6 @@ wdi_controller.updateFilterSource = function() {
1561
  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>";
1562
  sourceDiv.html(sourceDiv.html() + singleUserHtml);
1563
  }
1564
-
1565
  }
1566
 
1567
  /**
@@ -1578,12 +1412,26 @@ wdi_controller.isJsonString = function(str) {
1578
  return true;
1579
  }
1580
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1581
 
1582
  ///////////////////////////////////////////////////////////////////////////////
1583
  ///////////////Feeds and themes first view functions///////////////////////////
1584
  ////////////////////////////////////////////////////////////////////////////////
1585
-
1586
-
1587
  function wdi_spider_select_value(obj) {
1588
  obj.focus();
1589
  obj.select();
@@ -1630,7 +1478,6 @@ function wdi_bulk_actions(that) {
1630
  return true;
1631
  }
1632
 
1633
-
1634
  // Check all items.
1635
  function wdi_spider_check_all_items() {
1636
  wdi_spider_check_all_items_checkbox();
@@ -1665,11 +1512,59 @@ function wdi_spider_check_all(current) {
1665
  // Set value by id.
1666
  function wdi_spider_set_input_value(input_id, input_value) {
1667
  if (input_value === 'add') {
1668
- if (jQuery('#wdi_access_token').prop('value') == '') {
1669
  alert('Please get your access token');
1670
  }
1671
  }
1672
  if (document.getElementById(input_id)) {
1673
  document.getElementById(input_id).value = input_value;
1674
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1675
  }
1
  jQuery(document).ready(function() {
2
+ /* @ToDo It must be separate for each user */
3
  jQuery("#wdi_reset_cache").click(function (e) {
4
  jQuery(".wdi_reset_cache_success").remove();
5
  e.preventDefault();
9
  dataType:"json",
10
  data: {
11
  wdi_nonce:wdi_ajax.wdi_nonce,
12
+ task:"reset",
13
+ action:"wdi_cache"
14
  },
15
  success: function(data){
16
  if(data.success === false){
17
+ jQuery("#wdi_reset_cache").after("<span class='wdi_reset_cache_success' style='color: #fc0000; margin-left: 15px; line-height: 2;'>Failed</span>");
18
  }else{
19
+ jQuery("#wdi_reset_cache").after("<span class='wdi_reset_cache_success' style='color: #029117; margin-left: 15px; line-height: 2;'>Success</span>");
20
  }
21
  }
22
  });
 
23
  });
24
 
 
 
25
  /*Feeds page*/
26
  wdi_controller.bindSaveFeedEvent();
27
  wdi_controller.bindAddNewUserOrHashtagEvent();
33
  /*Themes page*/
34
  wdi_controller.bindSaveThemeEvent();
35
 
 
 
 
36
  if(jQuery('body').hasClass('instagram-feed_page_wdi_settings')){
37
+ //wdi_multiple_accounts_option_controller();
38
  wdi_advanced_option_controller();
39
  }
40
 
57
  'wdi_conditional_filters': 'show',
58
  'wdi_how_to_publish': 'show',
59
  };
 
60
  var wdi_sections = JSON.parse(localStorage.getItem('wdi_sections'));
61
  if (wdi_sections === null || wdi_sections === false) {
62
  wdi_sections = wdi_hide_show_sections_list;
66
  var wdi_section_el = jQuery("#wdi_save_feed").find("[data-section_name='" + i + "']");
67
  wdi_show_hide(wdi_sections[i], wdi_section_el);
68
  }
69
+ }
70
+ else {
71
  var wdi_section_parent_id = jQuery(element).data("section_name");
72
  var show_hide_section = null;
73
  if (element.hasClass("wdi_section_open")) {
85
  }
86
  }
87
 
88
+ function wdi_show_hide(type, element) {
89
+ if (type === "show") {
90
+ var wdi_closable_section = element.closest(".wdi_section").find(".wdi_elements");
91
+ if (wdi_closable_section.data("display") === "table") {
92
+ wdi_closable_section.css({
93
+ "display": "table"
94
+ });
95
+ } else {
96
+ wdi_closable_section.css({
97
+ "display": "block"
98
+ });
99
+ }
100
 
101
+ element.css({
102
+ 'border-bottom': "1px solid #f1f1f1",
103
+ 'margin': '0 auto 15px'
104
+ });
105
+ element.removeClass("wdi_section_open");
106
+ element.addClass("wdi_section_close");
107
+ } else {
108
+ element.closest(".wdi_section").find(".wdi_elements").css({
109
+ 'display': 'none'
110
+ });
111
+ element.css({
112
+ 'border-bottom': "0px",
113
+ 'margin': '0 auto 0px'
114
+ });
115
+ element.removeClass("wdi_section_close");
116
+ element.addClass("wdi_section_open");
117
+ }
118
+ }
119
 
120
+ jQuery(document).on('click', '.wdi-account-show-token', function() {
121
+ jQuery(this).find('i').toggleClass('dashicons-arrow-up-alt2 dashicons-arrow-down-alt2');
122
+ jQuery(this).parents('li').find('.wdi-account-accesstoken' ).slideToggle(300);
123
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
 
125
+ jQuery(document).on('click', '.wdi-advanced-options .wdi-advanced-headline', function() {
126
+ jQuery(this).find('i').toggleClass('dashicons-arrow-up-alt2 dashicons-arrow-down-alt2');
127
+ jQuery(this).parents('.wdi-advanced-options').find('.wdi-advanced-body' ).slideToggle(500);
128
+ });
129
  });
130
 
131
+ function wdi_multiple_accounts_option_controller() {
132
+ var $table = jQuery(jQuery('#wdi_user_id').closest('form').find('.form-table').get(1));
133
+ $table.addClass('wdi_multiple_accounts_section');
134
+ var html = '';
135
+ if( wdi_options.wdi_authenticated_users_list ) {
136
+ var users_list = JSON.parse(wdi_options.wdi_authenticated_users_list);
137
+ var index = 0;
138
+ for (var i in users_list) {
139
+ html += "<tr data-multiple-account='" + index + "'>";
140
+ html += "<th>Access Token</th>";
141
+ html += '<td><input type="text" name="wdi_instagram_options[wdi_authenticated_users_list][access_token][]" size="53" required="" value="' + users_list[i].access_token + '"></td>';
142
+ html += "</tr>";
143
+ html += "<tr data-multiple-account='" + index + "' class='wdi_username_tr'>";
144
+ html += "<th>Username</th>";
145
+ html += '<td>' +
146
+ '<div class="wdi_input_wrapper"><input type="text" name="wdi_instagram_options[wdi_authenticated_users_list][user_name][]" size="53" required="" value="' + users_list[i].user_name + '"></div>' +
147
+ '<div class="wdi_remove_auth_user">Delete</div>' +
148
+ '</td>';
149
+ html += '<input type="hidden" name="wdi_instagram_options[wdi_authenticated_users_list][user_id][]" size="53" required="" value="' + users_list[i].user_id + '">';
150
+ html += "</tr>";
151
+ index++;
152
+ }
153
+ $table.append(html);
154
  }
155
 
156
+ jQuery('.wdi_remove_auth_user').on('click', function (e) {
157
+ e.preventDefault();
158
+ var data = jQuery(this).closest('.wdi_username_tr').data('multiple-account');
159
+ jQuery(this).closest('.wdi_multiple_accounts_section').find('tr[data-multiple-account="' + data + '"]').remove();
160
+ return false;
161
+ });
 
 
 
 
 
 
162
  }
163
 
164
  function wdi_advanced_option_controller() {
 
165
  var $table = jQuery(jQuery('#wdi_user_id').closest('form').find('.form-table').get(1));
166
  $table.addClass('wdi_advanced_option wdi_advanced_option_close');
167
  var tr = "<tr class='wdi_advanced_option_head'><th style='width: 100%;'>ADVANCED OPTIONS AND MULTIPLE INSTAGRAM ACCOUNTS</th><td><div class='wdi_advanced_option_icon'></div></td></tr>";
179
  });
180
  }
181
 
 
182
  function wdi_controller() {};
183
 
184
  /**
221
  wdi_controller.getUserInfo(access_token);
222
  }
223
 
 
 
224
  /**
225
  * Used in Settings page for finding access token owners username
226
  * and and for filling it in username input field
227
  *
228
  * @param {String} access_token [Instagram API access token]
229
  */
230
+ wdi_controller.getUserInfo = function (access_token) {
231
  this.instagram.getSelfInfo({
232
+ success: function (response) {
233
+ if (wdi_options.wdi_access_token === "") {
234
+ jQuery('#wdi_user_name').attr('value', response['data']['username']);
235
+ jQuery('#wdi_user_id').attr('value', response['data']['id']);
236
+ }
237
+ else {
238
+ jQuery('.wdi_more_token_template .wdi_more_user_name').prop('disabled', false);
239
+ jQuery('.wdi_more_token_template .wdi_more_user_id').prop('disabled', false);
240
+ jQuery('.wdi_more_token_template .wdi_more_user_name').attr('value', response['data']['username']);
241
+ jQuery('.wdi_more_token_template .wdi_more_user_id').attr('value', response['data']['id']);
242
+ }
 
 
 
 
243
  jQuery(document).trigger('wdi_settings_filled');
244
  }
245
  })
246
  }
247
 
 
 
248
  wdi_controller.oldDisplayType = {};
249
  wdi_controller.displayTypeMemory = {};
250
 
 
251
  /*
252
  * Switches between feeds admin page tabs
253
  */
254
  wdi_controller.switchFeedTabs = function(tabname, section) {
255
 
 
256
  //add tabname in hidden field
257
  jQuery('#wdi_refresh_tab').attr('value', tabname);
258
 
307
  wdi_controller.displaySettingsSection(selectedSection);
308
  }
309
 
310
+ // @ToDo free There is a difference in free!
311
  // if tabname is conditional filters then call tab interface updater
312
+ if (tabname == 'conditional_filters') {
313
+ wdi_controller.updateConditionalFiltersUi();
 
 
 
 
 
 
 
 
314
  }
 
315
  }
316
 
317
  /*
359
  * Switches between themes admin page tabs
360
  */
361
  wdi_controller.switchThemeTabs = function(tabname, section) {
362
+ //swap active tab class
 
 
363
  jQuery('.wdi_feed_tabs').filter('.wdi_feed_tab_active').each(function() {
364
  jQuery(this).removeClass('wdi_feed_tab_active');
365
  });
366
  jQuery('#wdi_' + tabname).addClass('wdi_feed_tab_active');
367
 
 
368
  //hiding options of other tabs
369
  jQuery('[tab]').each(function() {
370
  if (jQuery(this).attr('tab') != tabname) {
379
  //showing only requested display_type tab elements
380
  jQuery('.display_type[tab="' + tabname + '"]').css('display', 'block');
381
 
 
382
  //add tabname in hidden field
383
  jQuery('#wdi_refresh_tab').attr('value', tabname);
384
  //add sectionname in hidden field
397
  } else {
398
  jQuery('.display_type #' + section).trigger('click');
399
  }
 
400
  }
401
 
 
402
  /**
403
  * Binds events to control buttons
404
  */
417
  });
418
  }
419
 
 
420
  /**
421
  * Submits form baset on given task
422
  * if task is cancel then it reloades the page
423
  * @param {String} task [this is self explanatory]
424
  */
425
+ wdi_controller.save_feed = function ( task ) {
426
+ var feed_users = this.feed_users,
427
+ id,
428
+ type,
429
+ username,
430
+ default_user = {},
431
+ json_feed_users = {};
432
+ if ( 'cancel' == task ) {
433
  window.location = window.location.href;
434
  }
435
+ type = jQuery('#WDI_user_name option:selected').data('type');
436
+ username = jQuery('#WDI_user_name option:selected').val();
437
+ var userObj = wdi_controller.getUserObj(username);
438
+ if ( !userObj ) {
439
+ alert(wdi_messages.user_field_required);
440
+ return false;
441
+ }
442
+ default_user = {
443
+ id: userObj.user_id,
444
+ username: userObj.user_name
445
+ }
446
+ // check if user input field is not empty then cancel save process and make an ajax request
447
+ // add user in input field and then after it trigger save,apply or whatever
448
  wdi_controller.checkIfUserNotSaved(task);
449
+ if ( wdi_controller.waitingAjaxRequestEnd.button != 0 ) {
450
  return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
451
  }
452
+ json_feed_users = jQuery('#WDI_feed_users').val();
453
+ if ( this.isJsonString(json_feed_users) ) {
454
+ json_feed_users = JSON.parse(json_feed_users);
455
+ for ( var i in json_feed_users ) {
456
+ if ( json_feed_users[i].username.charAt(0) === '#' ) {
457
+ feed_users.push(json_feed_users[i]);
458
+ }
459
+ }
460
  }
461
+ feed_users.push(default_user);
462
+ this.updateFeaturedImageSelect(username, 'add', 'selected');
463
+ jQuery('#WDI_feed_users').val(this.stringifyUserData(feed_users));
464
+ jQuery('#wdi_feed_thumb').val('');
465
+ if ( type == 'business' ) {
466
+ jQuery('#wdi_feed_thumb').val(userObj.profile_picture_url);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
467
  }
468
+ if ( task == 'apply_changes' || task == 'save_feed' ) {
469
+ id = jQuery('#wdi_add_or_edit').val();
470
+ jQuery('#wdi_current_id').val(id);
471
+ }
472
+ jQuery('#task').attr('value', task);
473
+ jQuery('#wdi_save_feed').submit();
474
  }
475
 
 
 
476
  /**
477
  * Takes user input as argument and makes an
478
  * instagram request for getting meta info such as username and user id
479
  * stores getted data in wdi_controller.feed_users array and updates some admin elements which
480
  * depend on users
481
  *
482
+ * @param {String} tag_name hashtag, [Note. hashtags should start with #]
483
  * @param {String} backend [if is set to 'backend' all confirms will be ignored while making requests]
484
  * @return {Void}
485
  */
486
+ wdi_controller.makeInstagramUserRequest = function ( user_input, ignoreConfirm ) {
487
+ var _this = this,
488
+ input_type = this.getInputType(user_input),
489
+ username,
490
+ userObj;
491
+ var is_hashtag = input_type === 'hashtag';
492
+ if ( user_input == '' ) {
493
+ alert(wdi_messages.please_write_hashtag);
494
+ return false;
 
 
 
 
 
495
  }
496
+ if ( user_input != '' && !is_hashtag ) {
497
+ alert(wdi_messages.invalid_hashtag);
498
+ return false;
 
 
 
 
 
 
 
 
 
 
 
499
  }
500
+ if ( _this.checkForDuplicateUser(user_input) ) {
501
+ alert(user_input + ' ' + wdi_messages.already_added);
502
+ return false;
503
+ }
504
+ username = jQuery('#WDI_user_name option:selected').val();
505
+ userObj = wdi_controller.getUserObj(username);
506
+ if ( userObj ) {
507
+ this.instagram.user = userObj;
508
+ }
509
+ switch ( input_type ) {
510
  case 'user': {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
511
  break;
512
  }
513
  case 'hashtag': {
 
 
 
 
 
514
  var tagname = user_input.substr(1, user_input.length);
515
+ tagname = tagname.replace(' ', '');
516
  var radio = jQuery("input[name='wdi_feed_settings[hashtag_top_recent]']:checked").val();
 
517
  this.instagram.getTagRecentMedia(tagname, {
518
+ success: function ( response ) {
519
  jQuery('#wdi_add_user_ajax').removeAttr('disabled');
520
+ // contain information about response such as error messages and if
521
+ // response is valid or not
522
  var vObj = _this.isValidResponse(response);
523
+ if ( vObj.valid && _this.hasData(response) ) {
524
  _this.addHashtag(tagname, response);
 
 
 
 
 
 
525
  }
526
  else {
527
+ if ( !_this.hasData(response) && vObj.msg == 'success' ) {
528
+ if ( ignoreConfirm != true ) {
529
+ if ( confirm(wdi_messages.hashtag_no_data) ) {
530
  _this.addHashtag(tagname, response);
 
 
 
 
 
 
531
  }
532
  else {
533
  jQuery('#wdi_add_user_ajax_input').val('');
535
  }
536
  else {
537
  _this.addHashtag(tagname, response);
 
 
 
 
 
 
 
 
 
538
  }
539
  }
540
+ else {
541
+ alert(vObj.msg);
542
+ }
543
  }
544
  }
545
+ }, null, radio);
 
546
  break;
547
  }
548
  }
562
  return false;
563
  }
564
 
565
+ wdi_controller.getInputType = function (input) {
566
  switch (input[0]) {
567
+ case '#': {
568
+ return 'hashtag';
569
+ break;
570
+ }
571
+ case '%': {
572
+ return 'location';
573
+ break;
574
+ }
575
+ default: {
576
+ return 'user';
577
+ break;
578
+ }
 
 
 
 
579
  }
580
  }
581
 
 
 
582
  /**
583
  * Makes username and id pairs from users array and return json_encoded string
584
  * @param {Array} feed_users [array of feed_users containing username and id and other parameters]
585
  * @return {String} [JSON encoded data]
586
  */
587
+ wdi_controller.stringifyUserData = function (feed_users) {
588
  var users = [];
589
+ for ( var i = 0; i < feed_users.length; i++ ) {
590
  users.push({
 
591
  id: feed_users[i]['id'],
592
+ username: feed_users[i]['username'],
593
+ tag_id: (typeof feed_users[i]['tag_id'] !== 'undefined') ? feed_users[i]['tag_id'] : ''
594
  })
595
  }
596
+
597
  return JSON.stringify(users);
598
  }
599
 
 
 
600
  /**
601
  * Binds 'click' and 'enter' event to add user button
602
  *
603
  */
604
+ wdi_controller.bindAddNewUserOrHashtagEvent = function () {
605
+ jQuery('#wdi_add_user_ajax').on('click', function () {
606
+ if ( typeof jQuery(this).attr('disabled') !== 'undefined' ) {
607
  return;
 
 
608
  }
609
+ else {
610
+ jQuery(this).attr('disabled', 'disabled');
611
+ }
612
+ var tag_name = jQuery('#wdi_add_user_ajax_input').val().trim().toLowerCase();
613
+ if ( wdi_controller.makeInstagramUserRequest(tag_name) === false ) {
614
+ jQuery(this).removeAttr('disabled', 'disabled');
615
  }
616
  });
617
+ jQuery('#wdi_add_user_ajax_input').on("keypress", function ( e ) {
618
+ if ( e.keyCode == 13 ) {
619
+ if ( typeof jQuery("#wdi_add_user_ajax").attr('disabled') !== "undefined" ) {
620
+ return;
621
+ }
622
+ else {
623
+ jQuery("#wdi_add_user_ajax").attr('disabled', 'disabled');
624
+ }
625
+ var tag_name = jQuery('#wdi_add_user_ajax_input').val().trim().toLowerCase();
626
+ if ( wdi_controller.makeInstagramUserRequest(tag_name) === false ) {
627
+ jQuery("#wdi_add_user_ajax").removeAttr('disabled', 'disabled');
628
+ }
 
 
629
  return false; // prevent the button click from happening
630
  }
631
  });
 
632
  }
633
 
634
  /**
637
  *
638
  * @param {Object} $this [jQuery object of remove user button]
639
  */
640
+ wdi_controller.removeFeedUser = function ( $this ) {
 
 
641
  var username = $this.parent().find('a span').text();
642
+ if ( $this.parent().find('a span').hasClass('wdi_hashtag') ) {
643
  username = '#' + username;
644
  }
645
+ if ( this.feed_users.length == 0 ) {
646
+ var feed_users = jQuery('#WDI_feed_users').val();
647
+ if ( typeof feed_users !== 'undefined' && this.isJsonString(feed_users) ) {
648
+ this.feed_users = JSON.parse(feed_users);
649
+ }
650
+ }
651
+ for ( var i = 0; i < this.feed_users.length; i++ ) {
652
+ var name = this.feed_users[i]['username'];
653
+ if ( name == username ) {
654
  this.feed_users.splice(i, 1);
655
  break;
656
  }
657
  }
658
+ for ( var i = 0; i < this.feed_users.length; i++ ) {
659
+ var name = this.feed_users[i]['username'];
660
+ if ( name.charAt(0) !== '#' ) {
661
+ this.feed_users.splice(i, 1);
662
+ }
663
+ }
664
  $this.parent().remove();
665
+ jQuery('#WDI_feed_users').val(this.stringifyUserData(this.feed_users));
666
+ // wdi_controller.updateHiddenField();
667
+ if ( username !== jQuery('#wdi_default_user').val() ) {
668
  wdi_controller.updateFeaturedImageSelect(username, 'remove');
669
  }
670
+ wdi_controller.changed_users();
 
 
 
 
 
 
 
 
671
  }
672
 
 
673
  /**
674
  * Adds or removes users from featured image select
675
  *
699
  {
700
  select.find('option[value="' + username + '"]').remove();
701
  if(this.feed_users.length > 0) {
702
+ select.val(this.feed_users[0].username);
703
+ }
704
 
705
  break;
706
  }
708
 
709
  }
710
 
 
 
711
  ////////////////////////////////////////////////////////////////////////////////
712
  ///////////////////////////////Themes Page//////////////////////////////////////
713
  ////////////////////////////////////////////////////////////////////////////////
722
  jQuery('#wdi_current_id').attr('value', id);
723
  jQuery('#wdi_save_feed').submit();
724
  });
725
+ jQuery('#wdi_save_theme_reset').on('click', function() {
726
+ jQuery('#task').attr('value', 'reset_changes');
727
+ var id = jQuery('#wdi_add_or_edit').attr('value');
728
+ jQuery('#wdi_current_id').attr('value', id);
729
+ jQuery('#wdi_save_feed').submit();
730
+ });
731
  }
732
 
 
733
  /**
734
  * This function is called when one of controll buttons are being clicked
735
  * it checks if user has typed any username in unsername input
758
  }
759
  }
760
 
761
+ // checking if user has typed username in input field but didn't saved it, trigger add action
762
+ if ( jQuery('#wdi_add_user_ajax_input').val().trim() != '' ) {
763
  var user_input = jQuery('#wdi_add_user_ajax_input').val().trim().toLowerCase();
764
  wdi_controller.waitingAjaxRequestEnd = {
765
  button: task
766
  };
767
+ // making request
768
  wdi_controller.makeInstagramUserRequest(user_input);
769
  return 1;
770
+ }
771
+ else {
772
  wdi_controller.waitingAjaxRequestEnd = {
773
  button: 0
774
  };
793
  }
794
  }
795
 
 
796
  /**
797
  * Gets cookie value by name
798
  * @param {String} name [cookie name]
810
  * @param {Object} response [Instagram API response]
811
  * @return {Boolean}
812
  */
813
+ wdi_controller.isValidResponse = function (response) {
 
814
  var obj = {};
815
  if (typeof response == 'undefined' || typeof response['meta']['code'] == 'undefined' || response['meta']['code'] != 200) {
816
  obj.valid = false;
817
  if (typeof response == 'undefined') {
818
  obj.msg = wdi_messages.instagram_server_error;
819
+ }
820
+ else if (response['meta']['code'] !== 200) {
821
  obj.msg = response['meta']['error_message'];
822
+ }
823
+ else {
824
  obj.msg = '';
825
  }
826
+ }
827
+ else {
828
  obj.valid = true;
829
  obj.msg = 'success';
830
  }
831
  return obj;
832
  }
833
 
 
834
  /**
835
  * Return true if response has data object which is not empty
836
  * @param {Onject} response [instagram API response]
844
  }
845
  }
846
 
 
847
  /**
848
  * Return true if user is featured user
849
  * @param {String} [user] username we want to check
854
  //return (jQuery('#wdi_thumb_user').val() == user) ? true : false;
855
  }
856
 
 
857
  /**
858
  * finds user by username in instagram api request object
859
  * if user is found then returns user object otherwise returns false
884
  * @param {Object} response [instagram API response]
885
  */
886
  wdi_controller.addHashtag = function(tagname, response) {
887
+ // if tagname doesn't contain invalid characters
888
  if (tagname.match(/[~!@$%&*#^()<>?]/) == null) {
 
889
  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>');
890
+ jQuery('#wdi_feed_users_ajax').append(newHashtag);
891
+ jQuery('#wdi_add_user_ajax_input').val('');
892
  var profile_picture;
893
  if (typeof response != 'undefined') {
894
  profile_picture = (response['data'].length != 0 && typeof response['data'][0]['images']['thumbnail'] !== "undefined") ? response['data'][0]['images']['thumbnail']['url'] : '';
895
  } else {
896
  profile_picture = '';
897
  }
898
+ var tag_obj = {
 
 
899
  id: '#' + tagname,
900
+ username: '#' + tagname,
901
  profile_picture: profile_picture,
902
  tag_id: response.tag_id
903
+ };
904
+ this.feed_users.push(tag_obj);
905
  var user_input = '#' + tagname;
906
  selected = this.thumbUser(user_input) ? 'selected' : '';
907
 
908
  wdi_controller.updateFeaturedImageSelect(user_input, 'add', selected);
909
+
 
 
910
  } else {
911
  alert(wdi_messages.invalid_hashtag);
912
  }
913
 
 
914
  this.updateConditionalFiltersUi();
915
 
916
  wdi_controller.saveFeedAfterAjaxWait(true);
917
 
918
+ wdi_controller.changed_users();
919
  };
920
 
 
921
  wdi_controller.changed_users = function () {
922
+ var has_hashtag = false;
923
+ for ( var i = 0; i < this.feed_users.length; i++ ) {
924
+ if ( this.feed_users[i].username[0] === '#' ) {
925
+ has_hashtag = true;
926
+ break;
927
+ }
928
+ }
929
+ if ( has_hashtag ) {
 
930
  jQuery('.wdi_element_name_hashtag_top_recent').show();
931
  jQuery('.wdi_element_name_show_username_on_thumb').hide();
932
+ }
933
+ else {
934
+ jQuery('.wdi_element_name_hashtag_top_recent').hide();
935
+ jQuery('.wdi_element_name_show_username_on_thumb').show();
936
  }
937
  };
938
 
939
  /**
940
+ * @ToDo This function is no longer used.
941
  * Adds given user to internal array wdi_controller.feed_users and also updates GUI
942
  *
943
  * @param {Object} user [Object conatining user information such as id, username and profile picture]
944
  */
945
  wdi_controller.addUser = function(user) {
946
+ user.username = user.user_name;
947
  if ( this.checkForDuplicateUser(user.username) == false ) {
 
948
  newUser = jQuery('<div class="wdi_user"><a target="_blank" href="http://www.instagram.com/' + user.username + '"><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>');
949
+ jQuery('#wdi_feed_users_ajax').append(newUser);
950
+ jQuery('#wdi_add_user_ajax_input').val('');
951
 
952
  this.feed_users.push({
 
953
  id: user.id,
954
+ username: user.username,
955
  profile_picture: '' // user['profile_picture']
956
  });
957
 
967
  wdi_controller.saveFeedAfterAjaxWait(true);
968
  }
969
 
 
970
  /**
971
  * Scans internal wdi_controller.feed_users array and return profile picture url of given user
972
  * if there is no profile picture then returns blank string
983
  return 'false';
984
  }
985
 
 
 
986
  /*-------------------------------------------------------------
987
  ----------------Conditional Filters Tab Methods----------------
988
  -------------------------------------------------------------*/
1053
  }
1054
 
1055
  jQuery(this).parent().find('label').css({
1056
+ // 'line-height': '24px',
1057
+ // 'height': '24px',
1058
+ // 'padding': '2px 5px',
1059
+ 'display': 'inline-block',
1060
+ // 'font-size': '15px',
1061
+ // 'color': 'black',
1062
+ // 'font-weight': '500',
1063
+ // '-webkit-user-select': 'none',
1064
+ // /* Chrome/Safari */
1065
+ // '-moz-user-select': 'none',
1066
+ // /* Firefox */
1067
+ // '-ms-user-select': 'none',
1068
+ // /* IE10+ */
1069
+ //
1070
+ // /* Rules below not implemented in browsers yet */
1071
+ // '-o-user-select': 'none',
1072
+ // 'user-select': 'none',
1073
  });
1074
 
1075
  switch (jQuery(this).val()) {
1097
  });
1098
  //triggering change for updating first time
1099
  jQuery('#WDI_conditional_filter_type').trigger('change');
 
1100
  }
1101
 
1102
  /**
1178
  alert(wdi_messages.selectConditionType);
1179
  return false;
1180
  }
 
1181
  }
1182
 
1183
  /**
1396
  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>";
1397
  sourceDiv.html(sourceDiv.html() + singleUserHtml);
1398
  }
 
1399
  }
1400
 
1401
  /**
1412
  return true;
1413
  }
1414
 
1415
+ wdi_controller.getUserObj = function (user) {
1416
+ var users = JSON.parse(wdi_options.wdi_authenticated_users_list);
1417
+ if (typeof users == 'object') {
1418
+ if (typeof users[user] == 'object' && users[user] != '') {
1419
+ return users[user];
1420
+ }
1421
+ else {
1422
+ console.log('Error: User not exist on Users object');
1423
+ }
1424
+ }
1425
+ else {
1426
+ console.log('Error: Wrong response when parsed on users (JSON.parse)');
1427
+ }
1428
+
1429
+ return false;
1430
+ }
1431
 
1432
  ///////////////////////////////////////////////////////////////////////////////
1433
  ///////////////Feeds and themes first view functions///////////////////////////
1434
  ////////////////////////////////////////////////////////////////////////////////
 
 
1435
  function wdi_spider_select_value(obj) {
1436
  obj.focus();
1437
  obj.select();
1478
  return true;
1479
  }
1480
 
 
1481
  // Check all items.
1482
  function wdi_spider_check_all_items() {
1483
  wdi_spider_check_all_items_checkbox();
1512
  // Set value by id.
1513
  function wdi_spider_set_input_value(input_id, input_value) {
1514
  if (input_value === 'add') {
1515
+ if (jQuery('#wdi_access_token').attr('value') == '') {
1516
  alert('Please get your access token');
1517
  }
1518
  }
1519
  if (document.getElementById(input_id)) {
1520
  document.getElementById(input_id).value = input_value;
1521
  }
1522
+ }
1523
+
1524
+ function wdi_account_refresh(user_name) {
1525
+ jQuery.ajax({
1526
+ type: 'POST',
1527
+ url: wdi_ajax.ajax_url,
1528
+ dataType: 'json',
1529
+ data: {
1530
+ page: 'wdi_settings',
1531
+ action: 'wdi_account_refresh',
1532
+ nonce: wdi_ajax.wdi_nonce,
1533
+ user_name: user_name
1534
+ },
1535
+ success: function (response) {
1536
+ if ( response.success ) {
1537
+
1538
+ }
1539
+ }
1540
+ });
1541
+ }
1542
+
1543
+ function wdi_account_remove(user_name) {
1544
+ jQuery.ajax({
1545
+ type: 'POST',
1546
+ url: wdi_ajax.ajax_url,
1547
+ dataType: 'json',
1548
+ data: {
1549
+ page: 'wdi_settings',
1550
+ action: 'wdi_account_disconnect',
1551
+ nonce: wdi_ajax.wdi_nonce,
1552
+ user_name: user_name
1553
+ },
1554
+ success: function (response) {
1555
+ if ( response.success ) {
1556
+ jQuery('.wdi-account-list-' + user_name).remove();
1557
+ }
1558
+ }
1559
+ });
1560
+ }
1561
+
1562
+ function wdi_popup_open(){
1563
+ jQuery('.wdi-popup').show();
1564
+ return;
1565
+ }
1566
+
1567
+ function wdi_popup_close(){
1568
+ jQuery('.wdi-popup').hide();
1569
+ return;
1570
  }
js/wdi_admin.min.js CHANGED
@@ -1 +1 @@
1
- function wdi_multiple_accounts_option_controller(){var e=jQuery(jQuery("#wdi_user_id").closest("form").find(".form-table").get(1));e.addClass("wdi_multiple_accounts_section");var t="",i=JSON.parse(wdi_options.wdi_authenticated_users_list),a=0;for(var r in i)t+="<tr data-multiple-account='"+a+"'>",t+="<th>Access Token</th>",t+='<td><input type="text" name="wdi_instagram_options[wdi_authenticated_users_list][access_token][]" size="53" required="" value="'+i[r].access_token+'"></td>',t+="</tr>",t+="<tr data-multiple-account='"+a+"' class='wdi_username_tr'>",t+="<th>Username</th>",t+='<td><div class="wdi_input_wrapper"><input type="text" name="wdi_instagram_options[wdi_authenticated_users_list][user_name][]" size="53" required="" value="'+i[r].user_name+'"></div><div class="wdi_remove_auth_user">Delete</div></td>',t+='<input type="hidden" name="wdi_instagram_options[wdi_authenticated_users_list][user_id][]" size="53" required="" value="'+i[r].user_id+'">',t+="</tr>",a++;e.append(t),jQuery(".wdi_remove_auth_user").on("click",function(e){e.preventDefault();var t=jQuery(this).closest(".wdi_username_tr").data("multiple-account");return jQuery(this).closest(".wdi_multiple_accounts_section").find('tr[data-multiple-account="'+t+'"]').remove(),!1})}function wdi_advanced_option_controller(){var e=jQuery(jQuery("#wdi_user_id").closest("form").find(".form-table").get(1));e.addClass("wdi_advanced_option wdi_advanced_option_close");$tr=jQuery("<tr class='wdi_advanced_option_head'><th style='width: 100%;'>ADVANCED OPTIONS AND MULTIPLE INSTAGRAM ACCOUNTS</th><td><div class='wdi_advanced_option_icon'></div></td></tr>"),e.prepend($tr),$tr.on("click",function(){e.hasClass("wdi_advanced_option_open")?(e.removeClass("wdi_advanced_option_open"),e.addClass("wdi_advanced_option_close")):(e.removeClass("wdi_advanced_option_close"),e.addClass("wdi_advanced_option_open"))})}function wdi_controller(){}function wdi_spider_select_value(e){e.focus(),e.select()}function wdi_spider_set_input_value(e,t){"add"===t&&""==jQuery("#wdi_access_token").attr("value")&&alert("Please get your access token"),document.getElementById(e)&&(document.getElementById(e).value=t)}function wdi_spider_form_submit(e,t){document.getElementById(t)&&document.getElementById(t).submit(),e.preventDefault?e.preventDefault():e.returnValue=!1}function wdi_bulk_actions(e){var t=jQuery(e).val();return""!=t&&(!("delete_all"==t&&!confirm(wdi_messages.do_you_want_to_delete_selected_items))&&(wdi_spider_set_input_value("task",t),jQuery("#wdi_feed_form").submit(),!0))}function wdi_spider_check_all_items(){wdi_spider_check_all_items_checkbox(),jQuery("#check_all").trigger("click")}function wdi_spider_check_all_items_checkbox(){var e,t;jQuery("#check_all_items").attr("checked")?(jQuery("#check_all_items").attr("checked",!1),jQuery("#draganddrop").hide()):(e=parseInt(jQuery(".displaying-num").html())?parseInt(jQuery(".displaying-num").html()):0,t=(jQuery('input[id^="check_pr_"]').length?parseInt(jQuery('input[id^="check_pr_"]').length):0)+e,jQuery("#check_all_items").attr("checked",!0),t&&(jQuery("#draganddrop").html("<strong><p>Selected "+t+" item"+(1<t?"s":"")+".</p></strong>"),jQuery("#draganddrop").show()))}function wdi_spider_check_all(e){jQuery(e).attr("checked")||(jQuery("#check_all_items").attr("checked",!1),jQuery("#draganddrop").hide())}function wdi_spider_set_input_value(e,t){"add"===t&&""==jQuery("#wdi_access_token").attr("value")&&alert("Please get your access token"),document.getElementById(e)&&(document.getElementById(e).value=t)}jQuery(document).ready(function(){function e(e){if(!1===e){var t=JSON.parse(localStorage.getItem("wdi_sections"));for(i in null!==t&&!1!==t||(t={wdi_layout_section:"show",wdi_media:"show",wdi_layout:"hide",wdi_advanced:"hide",wdi_lightbox_general:"show",wdi_lightbox_advanced:"hide",wdi_conditional_filters:"show",wdi_how_to_publish:"show"},localStorage.setItem("wdi_sections",JSON.stringify(t))),t){var a=jQuery("#wdi_save_feed").find("[data-section_name='"+i+"']");n(t[i],a)}}else{var r,s=jQuery(e).data("section_name"),d=null;e.hasClass("wdi_section_open")?(n("show",e),d="show"):e.hasClass("wdi_section_close")&&(n("hide",e),d="hide"),null!=d&&((r=JSON.parse(localStorage.getItem("wdi_sections"))||{})[s]=d,localStorage.setItem("wdi_sections",JSON.stringify(r)))}}function n(e,t){var i;"show"===e?("table"===(i=t.closest(".wdi_section").find(".wdi_elements")).data("display")?i.css({display:"table"}):i.css({display:"block"}),t.css({"border-bottom":"1px solid #f1f1f1",margin:"0 auto 15px"}),t.removeClass("wdi_section_open"),t.addClass("wdi_section_close")):(t.closest(".wdi_section").find(".wdi_elements").css({display:"none"}),t.css({"border-bottom":"0px",margin:"0 auto 0px"}),t.removeClass("wdi_section_close"),t.addClass("wdi_section_open"))}jQuery("#wdi_reset_cache").click(function(e){jQuery(".wdi_reset_cache_success").remove(),e.preventDefault(),jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_nonce:wdi_ajax.wdi_nonce,action:"wdi_set_reset_cache"},success:function(e){!1===e.success?jQuery("#wdi_reset_cache").before("<span class='wdi_reset_cache_success' style='color: #fc0000; margin-left: 15px; line-height: 2;'>Failed</span>"):jQuery("#wdi_reset_cache").before("<span class='wdi_reset_cache_success' style='color: #029117; margin-left: 15px; line-height: 2;'>Success</span>")}})}),jQuery("#wdi_ask_question").parent().attr("target","_blank"),wdi_controller.bindSaveFeedEvent(),wdi_controller.bindAddNewUserOrHashtagEvent(),jQuery(".display_type input").on("click",function(){wdi_controller.displaySettingsSection(jQuery(this))}),wdi_controller.conditionalFiltersTabInit(),wdi_controller.bindSaveThemeEvent(),jQuery("#wdi_add_user_ajax").after(jQuery("<br><label class='wdi_pro_only' for='wdi_add_user_ajax_input'>"+wdi_messages.username_hashtag_multiple+"</label>")),jQuery("body").hasClass("instagram-feed_page_wdi_settings")&&(wdi_multiple_accounts_option_controller(),wdi_advanced_option_controller()),jQuery(".wdi_section_name").click(function(){e(jQuery(this))}),e(!1)}),wdi_controller.getParameterByName=function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(location.search);return null===t?"":decodeURIComponent(t[1].replace(/\+/g," "))},wdi_controller.apiRedirected=function(){var e=this.getParameterByName("access_token").split("."),t=/^[^\\\/&?><"']*$/;for(i=0;i<e.length;i++)if(null===e[i].match(t))return;var a=e.join(".");jQuery(document).ready(function(){""===wdi_options.wdi_access_token?jQuery("#wdi_access_token").attr("value",a):(jQuery(".wdi_more_token_template .wdi_more_access_token").prop("disabled",!1),jQuery(".wdi_more_token_template .wdi_more_access_token").attr("value",a))}),wdi_controller.instagram.addToken(a),wdi_controller.getUserInfo(a)},wdi_controller.getUserInfo=function(e){this.instagram.getSelfInfo({success:function(e){""===wdi_options.wdi_access_token?(jQuery("#wdi_user_name").attr("value",e.data.username),jQuery("#wdi_user_id").attr("value",e.data.id)):(jQuery(".wdi_more_token_template .wdi_more_user_name").prop("disabled",!1),jQuery(".wdi_more_token_template .wdi_more_user_id").prop("disabled",!1),jQuery(".wdi_more_token_template .wdi_more_user_name").attr("value",e.data.username),jQuery(".wdi_more_token_template .wdi_more_user_id").attr("value",e.data.id)),jQuery(document).trigger("wdi_settings_filled")}})},wdi_controller.oldDisplayType={},wdi_controller.displayTypeMemory={},wdi_controller.switchFeedTabs=function(e,t){jQuery("#wdi_refresh_tab").attr("value",e),jQuery(".wdi_tab").hide(),jQuery("#"+e+"_tab").show(),jQuery(".display_type").css("display","none"),jQuery('.display_type[tab="'+e+'"]').css("display","block"),jQuery('.display_type[tab="'+e+'"]').length?jQuery(".display_type_content").show():jQuery(".display_type_content").hide(),jQuery(".wdi_feed_tabs").filter(".wdi_feed_tab_active").each(function(){jQuery(this).removeClass("wdi_feed_tab_active")}),jQuery("#wdi_"+e).addClass("wdi_feed_tab_active");var i=jQuery(),a=!1;null!=t&&""!=t&&(i=jQuery(".display_type #"+t).prop("checked",!0),jQuery("#wdi_feed_type").attr("value",t)),a||0!=(i=jQuery('.display_type[tab="'+e+'"] input[name="feed_type"]:checked')).length&&(a=!0),a||0!=(i=jQuery('.display_type[tab="'+e+'"] #thumbnails')).length&&(a=!0,i.prop("checked",!0),jQuery("#wdi_feed_type").attr("value","thumbnails")),a&&wdi_controller.displaySettingsSection(i),"conditional_filters"!=e?jQuery("#wdi-conditional-filters-ui").addClass("wdi_hidden"):jQuery("#wdi-conditional-filters-ui").removeClass("wdi_hidden")},wdi_controller.displaySettingsSection=function(e){var i=e.attr("id").toLowerCase().trim(),t=e.parent().parent().attr("tab"),a=jQuery("#wdi_refresh_section");wdi_controller.oldDisplayType={section:i,tab:t},wdi_controller.displayTypeMemory[t]=wdi_controller.oldDisplayType,null!=a&&a.attr("value",i);var r=jQuery(".wdi_border_wrapper .form-table");jQuery("#wdi_feed_type").attr("value",i);var s=0,d=!1;r.find(".wdi_element").each(function(){0;var e=jQuery(this).find(".wdwt_param").children().children().children().attr("section");if(void 0!==e){d=!1;var t=e.toLowerCase().trim().split(",");for(s=0;s<t.length;s++)t[s]===i&&(jQuery(this).css("display","block"),d=!0);!1===d&&jQuery(this).css("display","none")}})},wdi_controller.switchThemeTabs=function(e,t){jQuery(".wdi_feed_tabs").filter(".wdi_feed_tab_active").each(function(){jQuery(this).removeClass("wdi_feed_tab_active")}),jQuery("#wdi_"+e).addClass("wdi_feed_tab_active"),jQuery("[tab]").each(function(){jQuery(this).attr("tab")!=e?jQuery(this).parent().parent().parent().parent().parent().filter("tr").css("display","none"):jQuery(this).parent().parent().parent().parent().parent().filter("tr").css("display","block")}),jQuery(".display_type").css("display","none"),jQuery('.display_type[tab="'+e+'"]').css("display","block"),jQuery("#wdi_refresh_tab").attr("value",e),null!=t&&""!=t&&jQuery("#wdi_refresh_section").attr("value",t),null==t&&""!=t?null!=wdi_controller.displayTypeMemory[e]?jQuery(".display_type #"+wdi_controller.displayTypeMemory[e].section).trigger("click"):jQuery('.display_type[tab="'+e+'"]').first().find("input").trigger("click"):jQuery(".display_type #"+t).trigger("click")},wdi_controller.bindSaveFeedEvent=function(){var e=this;jQuery("#wdi_save_feed_submit").on("click",function(){e.save_feed("save_feed")}),jQuery("#wdi_save_feed_apply").on("click",function(){e.save_feed("apply_changes")}),jQuery("#wdi_cancel_changes").on("click",function(){e.save_feed("cancel")})},wdi_controller.save_feed=function(e){var t,i,a,r,s,d,n;"cancel"==e&&(window.location=window.location.href),wdi_controller.checkIfUserNotSaved(e),0==wdi_controller.waitingAjaxRequestEnd.button&&(jQuery("#task").attr("value",e),t=this.feed_users,d={username:jQuery("#wdi_default_user").val(),id:jQuery("#wdi_default_user_id").val()},0==t.length&&(t.push(d),this.updateFeaturedImageSelect(d.username,"add","selected")),i=this.stringifyUserData(t),jQuery("#WDI_feed_users").val(i),"apply_changes"!=e&&"save_feed"!=e||(a=jQuery("#wdi_add_or_edit").attr("value"),jQuery("#wdi_current_id").attr("value",a)),r=jQuery("#WDI_thumb_user").val(),"false"!=(s=this.getUserProfilePic(r))&&void 0!==s||(n=this).instagram.getSelfInfo({success:function(e){var t=n.isValidResponse(e),i=e.data;t.valid&&n.hasData(e)&&i&&i.profile_picture}}),jQuery("#wdi_feed_thumb").attr("value",s),jQuery("#wdi_save_feed").submit())},wdi_controller.makeInstagramUserRequest=function(e,i){var a=this,t=this.getInputType(e);if("false"==wdi_version.is_pro&&1==jQuery(".wdi_user").length)return alert(wdi_messages.only_one_user_or_hashtag),!1;var r="hashtag"===t,s="user"===t;for(var d in a.feed_users)if("#"===a.feed_users[d].username.charAt(0)?r=!0:s=!0,s&&r)return alert("You can add only username or hashtags."),!1;switch(t){case"user":user=wdi_options.wdi_users_list_authenticated[e],this.addUser(user);break;case"hashtag":if(void 0===wdi_options.fb_token||""===wdi_options.fb_token)return alert("To display hashtag media , get Facebook API token from settings page."),!1;var n=(n=e.substr(1,e.length)).replace(" ",""),l=jQuery("input[name='wdi_feed_settings[hashtag_top_recent]']:checked").val();this.instagram.getTagRecentMedia(n,{success:function(e){jQuery("#wdi_add_user_ajax").removeAttr("disabled");var t=a.isValidResponse(e);t.valid&&a.hasData(e)?(a.addHashtag(n,e),"false"==wdi_version.is_pro&&1==jQuery(".wdi_user").length&&(jQuery("#wdi_add_user_ajax_input").attr("disabled","disabled"),jQuery("#wdi_add_user_ajax_input").attr("placeholder",wdi_messages.available_in_pro))):a.hasData(e)||"success"!=t.msg||(1!=i?confirm(wdi_messages.hashtag_no_data)?(a.addHashtag(n,e),"false"==wdi_version.is_pro&&1==jQuery(".wdi_user").length&&(jQuery("#wdi_add_user_ajax_input").attr("disabled","disabled"),jQuery("#wdi_add_user_ajax_input").attr("placeholder",wdi_messages.available_in_pro))):jQuery("#wdi_add_user_ajax_input").val(""):(a.addHashtag(n,e),"false"==wdi_version.is_pro?1==jQuery(".wdi_user").length&&(jQuery("#wdi_add_user_ajax_input").attr("disabled","disabled"),jQuery("#wdi_add_user_ajax_input").attr("placeholder",wdi_messages.available_in_pro)):alert(t.msg)))}},null,l)}},wdi_controller.checkForDuplicateUser=function(e){for(var t=0;t<this.feed_users.length;t++)if(e==this.feed_users[t].username)return!0;return!1},wdi_controller.getInputType=function(e){switch(e[0]){case"#":return"hashtag";case"%":return"location";default:return"user"}},wdi_controller.stringifyUserData=function(e){for(var t=[],i=0;i<e.length;i++)t.push({username:e[i].username,id:e[i].id,tag_id:void 0!==e[i].tag_id?e[i].tag_id:""});return JSON.stringify(t)},wdi_controller.bindAddNewUserOrHashtagEvent=function(){jQuery("#wdi_add_user_ajax").on("click",function(){var e;void 0===jQuery(this).attr("disabled")&&(jQuery(this).attr("disabled","disabled"),e=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase(),!1===wdi_controller.makeInstagramUserRequest(e)&&jQuery(this).removeAttr("disabled","disabled"))}),jQuery("#wdi_add_user_ajax_input").on("keypress",function(e){if(13==e.keyCode){if(void 0!==jQuery("#wdi_add_user_ajax").attr("disabled"))return;jQuery("#wdi_add_user_ajax").attr("disabled","disabled");var t=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase();return!1===wdi_controller.makeInstagramUserRequest(t)&&jQuery("#wdi_add_user_ajax").removeAttr("disabled","disabled"),!1}})},wdi_controller.removeFeedUser=function(e){var t=e.parent().find("a span").text();e.parent().find("a span").hasClass("wdi_hashtag")&&(t="#"+t);for(var i=0;i<this.feed_users.length;i++)if(this.feed_users[i].username==t){this.feed_users.splice(i,1);break}e.parent().remove(),t!==jQuery("#wdi_default_user").val()&&wdi_controller.updateFeaturedImageSelect(t,"remove"),"false"==wdi_version.is_pro&&0==jQuery(".wdi_user").length&&(jQuery("#wdi_add_user_ajax_input").removeAttr("disabled"),jQuery("#wdi_add_user_ajax_input").attr("placeholder","")),wdi_controller.changed_users()},wdi_controller.updateFeaturedImageSelect=function(e,t,i){var a,r=jQuery("#WDI_thumb_user");switch("selected"!=i&&(i=""),t){case"add":r.find('option[value="'+e+'"]').length||(a=jQuery("<option "+i+' value="'+e+'">'+e+"</option>"),r.append(a));break;case"remove":r.find('option[value="'+e+'"]').remove(),0<this.feed_users.length&&r.val(this.feed_users[0].username)}},wdi_controller.bindSaveThemeEvent=function(){jQuery("#wdi_save_theme_submit").on("click",function(){jQuery("#task").attr("value","save_feed"),jQuery("#wdi_save_feed").submit()}),jQuery("#wdi_save_theme_apply").on("click",function(){jQuery("#task").attr("value","apply_changes");var e=jQuery("#wdi_add_or_edit").attr("value");jQuery("#wdi_current_id").attr("value",e),jQuery("#wdi_save_feed").submit()})},wdi_controller.checkIfUserNotSaved=function(e){switch(e){case"save_feed":e="submit";break;case"apply_changes":e="apply";break;case"reset_changes":e="reset"}if(""==jQuery("#wdi_add_user_ajax_input").val().trim())return wdi_controller.waitingAjaxRequestEnd={button:0},0;var t=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase();return wdi_controller.waitingAjaxRequestEnd={button:e},wdi_controller.makeInstagramUserRequest(t),1},wdi_controller.saveFeedAfterAjaxWait=function(e){var t;null!=wdi_controller.waitingAjaxRequestEnd&&(t=wdi_controller.waitingAjaxRequestEnd.button,e&&0!=t&&jQuery("#wdi_save_feed_"+t).trigger("click"),wdi_controller.waitingAjaxRequestEnd=void 0)},wdi_controller.getCookie=function(e){var t=("; "+document.cookie).split("; "+e+"=");if(2==t.length)return t.pop().split(";").shift()},wdi_controller.isValidResponse=function(e){var t={};return void 0===e||void 0===e.meta.code||200!=e.meta.code?(t.valid=!1,void 0===e?t.msg=wdi_messages.instagram_server_error:200!==e.meta.code?t.msg=e.meta.error_message:t.msg=""):(t.valid=!0,t.msg="success"),t},wdi_controller.hasData=function(e){return void 0!==e&&void 0!==e.data&&0!=e.data.length},wdi_controller.thumbUser=function(e){return 0<this.feed_users.length&&this.feed_users[0].username===e},wdi_controller.findUser=function(e,t){var i=[];void 0!==t&&void 0!==t.data&&(i=t.data);for(var a=0;a<i.length;a++)if(i[a].username==e)return i[a];return!1},wdi_controller.addHashtag=function(e,t){var i,a,r;null==e.match(/[~!@$%&*#^()<>?]/)?0==this.checkForDuplicateUser("#"+e)?(i=jQuery('<div class="wdi_user"><a target="_blank" href="https://instagram.com/explore/tags/'+e+'"><img class="wdi_profile_pic" src="'+wdi_url.plugin_url+'images/hashtag.png"><span class="wdi_hashtag">'+e+'</span><i style="display:table-cell;width:25px;"></i></a><img class="wdi_remove_user" onclick="wdi_controller.removeFeedUser(jQuery(this))" src="'+wdi_url.plugin_url+'/images/delete_user.png"></div>'),jQuery("#wdi_feed_users").append(i),jQuery("#wdi_add_user_ajax_input").attr("value",""),a=void 0!==t&&0!=t.data.length&&void 0!==t.data[0].images.thumbnail?t.data[0].images.thumbnail.url:"",this.feed_users.push({username:"#"+e,id:"#"+e,profile_picture:a,tag_id:t.tag_id}),r="#"+e,selected=this.thumbUser(r)?"selected":"",wdi_controller.updateFeaturedImageSelect(r,"add",selected)):alert("#"+e+" "+wdi_messages.already_added):alert(wdi_messages.invalid_hashtag),this.updateConditionalFiltersUi(),wdi_controller.saveFeedAfterAjaxWait(!0),wdi_controller.changed_users()},wdi_controller.changed_users=function(){for(var e=!1,t=0;t<this.feed_users.length;t++)if("#"===this.feed_users[t].username[0]){e=!0;break}e?(jQuery(".wdi_element_name_hashtag_top_recent").show(),jQuery(".wdi_element_name_show_username_on_thumb").hide()):(jQuery(".wdi_element_name_hashtag_top_recent").hide(),jQuery(".wdi_element_name_show_username_on_thumb").show())},wdi_controller.addUser=function(e){0==this.checkForDuplicateUser(e.username)?(newUser=jQuery('<div class="wdi_user"><a target="_blank" href="http://www.instagram.com/'+e.username+'"><span class="wdi_username">'+e.username+'</span><i style="display:table-cell;width:25px;"></i></a><img class="wdi_remove_user" onclick="wdi_controller.removeFeedUser(jQuery(this))" src="'+wdi_url.plugin_url+'images/delete_user.png"></div>'),jQuery("#wdi_feed_users").append(newUser),jQuery("#wdi_add_user_ajax_input").attr("value",""),this.feed_users.push({username:e.username,id:e.id,profile_picture:""})):alert(e.username+" "+wdi_messages.already_added),selected=this.thumbUser(e.username)?"selected":"",this.updateFeaturedImageSelect(e.username,"add",selected),this.updateConditionalFiltersUi(),wdi_controller.saveFeedAfterAjaxWait(!0)},wdi_controller.getUserProfilePic=function(e){for(var t=0;t<this.feed_users.length;t++)if(e==this.feed_users[t].username)return this.feed_users[t].profile_picture;return"false"},wdi_controller.conditionalFiltersTabInit=function(){this.setInitialFilters(),this.updateFiltersUi();var t=this;function e(){switch(jQuery("#WDI_wrap_conditional_filter_enable input:checked").val()){case"0":jQuery("#WDI_conditional_filters").parent().parent().addClass("wdi_hidden"),jQuery("#WDI_conditional_filter_type").parent().parent().parent().parent().parent().addClass("wdi_hidden"),jQuery("#wdi_final_condition").addClass("wdi_hidden"),jQuery("#WDI_filter_source").addClass("wdi_hidden");break;case"1":jQuery("#WDI_conditional_filters").parent().parent().removeClass("wdi_hidden"),jQuery("#WDI_conditional_filter_type").parent().parent().parent().parent().parent().removeClass("wdi_hidden"),jQuery("#wdi_final_condition").removeClass("wdi_hidden"),jQuery("#WDI_filter_source").removeClass("wdi_hidden")}}jQuery("#wdi_add_filter").on("click",function(){t.addConditionalFilter()&&jQuery("#wdi_filter_input").val("")}),jQuery(".wdi_filter_radio").on("click",function(){jQuery("#wdi_filter_input").trigger("focus")}),jQuery("#wdi_filter_input").on("keypress",function(e){if(13==e.keyCode)return t.addConditionalFilter()&&jQuery(this).val(""),!1}),e(),jQuery("#WDI_wrap_conditional_filter_enable input").on("change",function(){e()}),jQuery("#WDI_conditional_filter_type").on("change",function(){switch("none"==jQuery(this).val()||jQuery("#WDI_conditional_filters").css("display","block"),jQuery(this).parent().find("label").css({"line-height":"24px",height:"24px",padding:"2px 5px",display:"inline-block","font-size":"15px",color:"black","font-weight":"500","-webkit-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","-o-user-select":"none","user-select":"none"}),jQuery(this).val()){case"AND":jQuery("#WDI_conditional_filters").css("display","block"),jQuery(this).parent().find("label").html(wdi_messages.and_descr);break;case"OR":jQuery("#WDI_conditional_filters").css("display","block"),jQuery(this).parent().find("label").html(wdi_messages.or_descr);break;case"NOR":jQuery("#WDI_conditional_filters").css("display","block"),jQuery(this).parent().find("label").html(wdi_messages.nor_descr)}wdi_controller.updateFiltersUi()}),jQuery("#WDI_conditional_filter_type").trigger("change")},wdi_controller.addConditionalFilter=function(){var e=jQuery("#wdi_filter_input").val(),t=jQuery("#wdi_filter_type").val();if(filter={},""==e)return!1;switch(e=e.trim(),null==t&&("@"==e[0]?t="mention":"#"==e[0]?t="hashtag":"http"!=e.split("://")[0]&&"https"!=e.split("://")[0]||(t="url")),t){case"username":case"mention":"@"==e[0]&&(e=e.substr(1,e.length));break;case"hashtag":"#"==e[0]&&(e=e.substr(1,e.length));break;case"url":if(!/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(e))return alert(wdi_messages.invalid_url),!1}return filter={filter_type:t,filter_by:e,id:this.randomId()},null!=t?this.filterExists(filter)?(alert(e+" "+wdi_messages.already_added),!1):(this.conditionalFilters.push(filter),this.updateFiltersUi(),!0):(alert(wdi_messages.selectConditionType),!1)},wdi_controller.filterExists=function(e){for(var t=0;t<this.conditionalFilters.length;t++)if(this.conditionalFilters[t].filter_type==e.filter_type&&this.conditionalFilters[t].filter_by==e.filter_by)return!0;return!1},wdi_controller.updateFiltersUi=function(){for(var e,t=jQuery("#wdi_filters_ui").html(""),i=0;i<this.conditionalFilters.length;i++){if(0==i)if(1!=this.conditionalFilters.length)switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":break;case"OR":t.append(jQuery('<span class="wdi_logic">'+wdi_messages.either+"</span>"));break;case"NOR":t.append(jQuery('<span class="wdi_logic">'+wdi_messages.neither+"</span>"))}else switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":case"OR":break;case"NOR":t.append(jQuery('<span class="wdi_logic">'+wdi_messages.not+"</span>"))}switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":e=wdi_messages.and;break;case"OR":e=wdi_messages.or;break;case"NOR":e=wdi_messages.nor}1<=i&&t.append(jQuery('<span class="wdi_logic">'+e+"</span>")),t.append(this.createUiElement(this.conditionalFilters[i]))}this.updateFilterTextarea()},wdi_controller.createUiElement=function(e){var t;switch(e.filter_type){case"mention":t="@";break;case"hashtag":t="#";break;case"location":t="%";break;default:t=""}return jQuery('<span data-id="'+e.id+'" class="wdi_filter_item wdi_filter_by_'+e.filter_type+'"></span>').html(t+e.filter_by+'<span onclick="wdi_controller.removeConditionalFilter(jQuery(this));" class="wdi_remove_filter">X</span>')},wdi_controller.randomId=function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=0;i<5;i++)e+=t.charAt(Math.floor(Math.random()*t.length));return e},wdi_controller.removeConditionalFilter=function(e){for(var t=e.parent().attr("data-id"),i=0;i<this.conditionalFilters.length;i++)this.conditionalFilters[i].id==t&&this.conditionalFilters.splice(i,1);this.updateFiltersUi()},wdi_controller.updateFilterTextarea=function(){var e=this.conditionalFilters,t=JSON.stringify(e);jQuery("#wdi_conditional_filters_textarea").val(t)},wdi_controller.setInitialFilters=function(){var e=[],t=jQuery("#wdi_conditional_filters_textarea").val();this.isJsonString(t)&&(e=JSON.parse(t)),this.conditionalFilters=e},wdi_controller.updateConditionalFiltersUi=function(){wdi_controller.updateFilterSource()},wdi_controller.updateFilterSource=function(){if("liked"!=jQuery('input[name="wdi_feed_settings[liked_feed]"]:checked').val()){var e,t,i=[];jQuery(".wdi_user").each(function(){e=0!=jQuery(this).find(".wdi_username").length?jQuery(this).find(".wdi_username").text():jQuery(this).find(".wdi_hashtag").text(),t=jQuery(this).find("img").attr("src"),i.push({username:e,image:t})});for(var a=jQuery("#wdi_filter_source").html(""),r=0;r<i.length;r++){s="<div class='wdi_source_user'><span class='wdi_source_img'><img src='"+i[r].image+"'></span><span class='wdi_source_username'>"+i[r].username+"</span></div>";a.html(a.html()+s)}}else{var a,s="<div class='wdi_source_user'><span class='wdi_source_username'>Media I liked</span></div>";(a=jQuery("#wdi_filter_source").html("")).html(a.html()+s)}},wdi_controller.isJsonString=function(e){try{JSON.parse(e)}catch(e){return!1}return!0};
1
+ function wdi_multiple_accounts_option_controller(){var e=jQuery(jQuery("#wdi_user_id").closest("form").find(".form-table").get(1));e.addClass("wdi_multiple_accounts_section");var t="";if(wdi_options.wdi_authenticated_users_list){var i=JSON.parse(wdi_options.wdi_authenticated_users_list),r=0;for(var a in i)t+="<tr data-multiple-account='"+r+"'>",t+="<th>Access Token</th>",t+='<td><input type="text" name="wdi_instagram_options[wdi_authenticated_users_list][access_token][]" size="53" required="" value="'+i[a].access_token+'"></td>',t+="</tr>",t+="<tr data-multiple-account='"+r+"' class='wdi_username_tr'>",t+="<th>Username</th>",t+='<td><div class="wdi_input_wrapper"><input type="text" name="wdi_instagram_options[wdi_authenticated_users_list][user_name][]" size="53" required="" value="'+i[a].user_name+'"></div><div class="wdi_remove_auth_user">Delete</div></td>',t+='<input type="hidden" name="wdi_instagram_options[wdi_authenticated_users_list][user_id][]" size="53" required="" value="'+i[a].user_id+'">',t+="</tr>",r++;e.append(t)}jQuery(".wdi_remove_auth_user").on("click",function(e){e.preventDefault();var t=jQuery(this).closest(".wdi_username_tr").data("multiple-account");return jQuery(this).closest(".wdi_multiple_accounts_section").find('tr[data-multiple-account="'+t+'"]').remove(),!1})}function wdi_advanced_option_controller(){var e=jQuery(jQuery("#wdi_user_id").closest("form").find(".form-table").get(1));e.addClass("wdi_advanced_option wdi_advanced_option_close");$tr=jQuery("<tr class='wdi_advanced_option_head'><th style='width: 100%;'>ADVANCED OPTIONS AND MULTIPLE INSTAGRAM ACCOUNTS</th><td><div class='wdi_advanced_option_icon'></div></td></tr>"),e.prepend($tr),$tr.on("click",function(){e.hasClass("wdi_advanced_option_open")?(e.removeClass("wdi_advanced_option_open"),e.addClass("wdi_advanced_option_close")):(e.removeClass("wdi_advanced_option_close"),e.addClass("wdi_advanced_option_open"))})}function wdi_controller(){}function wdi_spider_select_value(e){e.focus(),e.select()}function wdi_spider_set_input_value(e,t){"add"===t&&""==jQuery("#wdi_access_token").attr("value")&&alert("Please get your access token"),document.getElementById(e)&&(document.getElementById(e).value=t)}function wdi_spider_form_submit(e,t){document.getElementById(t)&&document.getElementById(t).submit(),e.preventDefault?e.preventDefault():e.returnValue=!1}function wdi_bulk_actions(e){var t=jQuery(e).val();return""!=t&&(!("delete_all"==t&&!confirm(wdi_messages.do_you_want_to_delete_selected_items))&&(wdi_spider_set_input_value("task",t),jQuery("#wdi_feed_form").submit(),!0))}function wdi_spider_check_all_items(){wdi_spider_check_all_items_checkbox(),jQuery("#check_all").trigger("click")}function wdi_spider_check_all_items_checkbox(){if(jQuery("#check_all_items").prop("checked"))jQuery("#check_all_items").prop("checked",!1),jQuery("#draganddrop").hide();else{var e=parseInt(jQuery(".displaying-num").html())?parseInt(jQuery(".displaying-num").html()):0,t=(jQuery('input[id^="check_pr_"]').length?parseInt(jQuery('input[id^="check_pr_"]').length):0)+e;jQuery("#check_all_items").prop("checked",!0),t&&(jQuery("#draganddrop").html("<strong><p>Selected "+t+" item"+(t>1?"s":"")+".</p></strong>"),jQuery("#draganddrop").show())}}function wdi_spider_check_all(e){jQuery(e).prop("checked")||(jQuery("#check_all_items").prop("checked",!1),jQuery("#draganddrop").hide())}function wdi_spider_set_input_value(e,t){"add"===t&&""==jQuery("#wdi_access_token").attr("value")&&alert("Please get your access token"),document.getElementById(e)&&(document.getElementById(e).value=t)}function wdi_account_refresh(e){jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{page:"wdi_settings",action:"wdi_account_refresh",nonce:wdi_ajax.wdi_nonce,user_name:e},success:function(e){e.success}})}function wdi_account_remove(e){jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{page:"wdi_settings",action:"wdi_account_disconnect",nonce:wdi_ajax.wdi_nonce,user_name:e},success:function(t){t.success&&jQuery(".wdi-account-list-"+e).remove()}})}function wdi_popup_open(){jQuery(".wdi-popup").show()}function wdi_popup_close(){jQuery(".wdi-popup").hide()}jQuery(document).ready(function(){function e(e){if(!1===e){var r=JSON.parse(localStorage.getItem("wdi_sections"));for(i in null!==r&&!1!==r||(r={wdi_layout_section:"show",wdi_media:"show",wdi_layout:"hide",wdi_advanced:"hide",wdi_lightbox_general:"show",wdi_lightbox_advanced:"hide",wdi_conditional_filters:"show",wdi_how_to_publish:"show"},localStorage.setItem("wdi_sections",JSON.stringify(r))),r){var a=jQuery("#wdi_save_feed").find("[data-section_name='"+i+"']");t(r[i],a)}}else{var s=jQuery(e).data("section_name"),d=null;if(e.hasClass("wdi_section_open")?(t("show",e),d="show"):e.hasClass("wdi_section_close")&&(t("hide",e),d="hide"),null!=d){var n=JSON.parse(localStorage.getItem("wdi_sections"))||{};n[s]=d,localStorage.setItem("wdi_sections",JSON.stringify(n))}}}function t(e,t){if("show"===e){var i=t.closest(".wdi_section").find(".wdi_elements");"table"===i.data("display")?i.css({display:"table"}):i.css({display:"block"}),t.css({"border-bottom":"1px solid #f1f1f1",margin:"0 auto 15px"}),t.removeClass("wdi_section_open"),t.addClass("wdi_section_close")}else t.closest(".wdi_section").find(".wdi_elements").css({display:"none"}),t.css({"border-bottom":"0px",margin:"0 auto 0px"}),t.removeClass("wdi_section_close"),t.addClass("wdi_section_open")}jQuery("#wdi_reset_cache").click(function(e){jQuery(".wdi_reset_cache_success").remove(),e.preventDefault(),jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_nonce:wdi_ajax.wdi_nonce,task:"reset",action:"wdi_cache"},success:function(e){!1===e.success?jQuery("#wdi_reset_cache").after("<span class='wdi_reset_cache_success' style='color: #fc0000; margin-left: 15px; line-height: 2;'>Failed</span>"):jQuery("#wdi_reset_cache").after("<span class='wdi_reset_cache_success' style='color: #029117; margin-left: 15px; line-height: 2;'>Success</span>")}})}),wdi_controller.bindSaveFeedEvent(),wdi_controller.bindAddNewUserOrHashtagEvent(),jQuery(".display_type input").on("click",function(){wdi_controller.displaySettingsSection(jQuery(this))}),wdi_controller.conditionalFiltersTabInit(),wdi_controller.bindSaveThemeEvent(),jQuery("body").hasClass("instagram-feed_page_wdi_settings")&&wdi_advanced_option_controller(),jQuery(".wdi_section_name").click(function(){e(jQuery(this))}),e(!1),jQuery(document).on("click",".wdi-account-show-token",function(){jQuery(this).find("i").toggleClass("dashicons-arrow-up-alt2 dashicons-arrow-down-alt2"),jQuery(this).parents("li").find(".wdi-account-accesstoken").slideToggle(300)}),jQuery(document).on("click",".wdi-advanced-options .wdi-advanced-headline",function(){jQuery(this).find("i").toggleClass("dashicons-arrow-up-alt2 dashicons-arrow-down-alt2"),jQuery(this).parents(".wdi-advanced-options").find(".wdi-advanced-body").slideToggle(500)})}),wdi_controller.getParameterByName=function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(location.search);return null===t?"":decodeURIComponent(t[1].replace(/\+/g," "))},wdi_controller.apiRedirected=function(){var e=this.getParameterByName("access_token").split("."),t=/^[^\\\/&?><"']*$/;for(i=0;i<e.length;i++)if(null===e[i].match(t))return;var r=e.join(".");jQuery(document).ready(function(){""===wdi_options.wdi_access_token?jQuery("#wdi_access_token").attr("value",r):(jQuery(".wdi_more_token_template .wdi_more_access_token").prop("disabled",!1),jQuery(".wdi_more_token_template .wdi_more_access_token").attr("value",r))}),wdi_controller.instagram.addToken(r),wdi_controller.getUserInfo(r)},wdi_controller.getUserInfo=function(e){this.instagram.getSelfInfo({success:function(e){""===wdi_options.wdi_access_token?(jQuery("#wdi_user_name").attr("value",e.data.username),jQuery("#wdi_user_id").attr("value",e.data.id)):(jQuery(".wdi_more_token_template .wdi_more_user_name").prop("disabled",!1),jQuery(".wdi_more_token_template .wdi_more_user_id").prop("disabled",!1),jQuery(".wdi_more_token_template .wdi_more_user_name").attr("value",e.data.username),jQuery(".wdi_more_token_template .wdi_more_user_id").attr("value",e.data.id)),jQuery(document).trigger("wdi_settings_filled")}})},wdi_controller.oldDisplayType={},wdi_controller.displayTypeMemory={},wdi_controller.switchFeedTabs=function(e,t){jQuery("#wdi_refresh_tab").attr("value",e),jQuery(".wdi_tab").hide(),jQuery("#"+e+"_tab").show(),jQuery(".display_type").css("display","none"),jQuery('.display_type[tab="'+e+'"]').css("display","block"),jQuery('.display_type[tab="'+e+'"]').length?jQuery(".display_type_content").show():jQuery(".display_type_content").hide(),jQuery(".wdi_feed_tabs").filter(".wdi_feed_tab_active").each(function(){jQuery(this).removeClass("wdi_feed_tab_active")}),jQuery("#wdi_"+e).addClass("wdi_feed_tab_active");var i=jQuery(),r=!1;null!=t&&""!=t&&(i=jQuery(".display_type #"+t).prop("checked",!0),jQuery("#wdi_feed_type").attr("value",t)),r||0!=(i=jQuery('.display_type[tab="'+e+'"] input[name="feed_type"]:checked')).length&&(r=!0),r||0!=(i=jQuery('.display_type[tab="'+e+'"] #thumbnails')).length&&(r=!0,i.prop("checked",!0),jQuery("#wdi_feed_type").attr("value","thumbnails")),r&&wdi_controller.displaySettingsSection(i),"conditional_filters"==e&&wdi_controller.updateConditionalFiltersUi()},wdi_controller.displaySettingsSection=function(e){var t=e.attr("id").toLowerCase().trim(),i=e.parent().parent().attr("tab"),r=jQuery("#wdi_refresh_section");wdi_controller.oldDisplayType={section:t,tab:i},wdi_controller.displayTypeMemory[i]=wdi_controller.oldDisplayType,null!=r&&r.attr("value",t);var a=jQuery(".wdi_border_wrapper .form-table");jQuery("#wdi_feed_type").attr("value",t);var s=0,d=!1;a.find(".wdi_element").each(function(){0;var e=jQuery(this).find(".wdwt_param").children().children().children().attr("section");if(void 0!==e){d=!1;var i=e.toLowerCase().trim().split(",");for(s=0;s<i.length;s++)i[s]===t&&(jQuery(this).css("display","block"),d=!0);!1===d&&jQuery(this).css("display","none")}})},wdi_controller.switchThemeTabs=function(e,t){jQuery(".wdi_feed_tabs").filter(".wdi_feed_tab_active").each(function(){jQuery(this).removeClass("wdi_feed_tab_active")}),jQuery("#wdi_"+e).addClass("wdi_feed_tab_active"),jQuery("[tab]").each(function(){jQuery(this).attr("tab")!=e?jQuery(this).parent().parent().parent().parent().parent().filter("tr").css("display","none"):jQuery(this).parent().parent().parent().parent().parent().filter("tr").css("display","block")}),jQuery(".display_type").css("display","none"),jQuery('.display_type[tab="'+e+'"]').css("display","block"),jQuery("#wdi_refresh_tab").attr("value",e),null!=t&&""!=t&&jQuery("#wdi_refresh_section").attr("value",t),null==t&&""!=t?null!=wdi_controller.displayTypeMemory[e]?jQuery(".display_type #"+wdi_controller.displayTypeMemory[e].section).trigger("click"):jQuery('.display_type[tab="'+e+'"]').first().find("input").trigger("click"):jQuery(".display_type #"+t).trigger("click")},wdi_controller.bindSaveFeedEvent=function(){var e=this;jQuery("#wdi_save_feed_submit").on("click",function(){e.save_feed("save_feed")}),jQuery("#wdi_save_feed_apply").on("click",function(){e.save_feed("apply_changes")}),jQuery("#wdi_cancel_changes").on("click",function(){e.save_feed("cancel")})},wdi_controller.save_feed=function(e){var t,i,r,a,s=this.feed_users,d={};"cancel"==e&&(window.location=window.location.href),i=jQuery("#WDI_user_name option:selected").data("type"),r=jQuery("#WDI_user_name option:selected").val();var n=wdi_controller.getUserObj(r);if(!n)return alert(wdi_messages.user_field_required),!1;if(a={id:n.user_id,username:n.user_name},wdi_controller.checkIfUserNotSaved(e),0==wdi_controller.waitingAjaxRequestEnd.button){if(d=jQuery("#WDI_feed_users").val(),this.isJsonString(d))for(var l in d=JSON.parse(d))"#"===d[l].username.charAt(0)&&s.push(d[l]);s.push(a),this.updateFeaturedImageSelect(r,"add","selected"),jQuery("#WDI_feed_users").val(this.stringifyUserData(s)),jQuery("#wdi_feed_thumb").val(""),"business"==i&&jQuery("#wdi_feed_thumb").val(n.profile_picture_url),"apply_changes"!=e&&"save_feed"!=e||(t=jQuery("#wdi_add_or_edit").val(),jQuery("#wdi_current_id").val(t)),jQuery("#task").attr("value",e),jQuery("#wdi_save_feed").submit()}},wdi_controller.makeInstagramUserRequest=function(e,t){var i,r,a=this,s=this.getInputType(e),d="hashtag"===s;if(""==e)return alert(wdi_messages.please_write_hashtag),!1;if(""!=e&&!d)return alert(wdi_messages.invalid_hashtag),!1;if(a.checkForDuplicateUser(e))return alert(e+" "+wdi_messages.already_added),!1;switch(i=jQuery("#WDI_user_name option:selected").val(),(r=wdi_controller.getUserObj(i))&&(this.instagram.user=r),s){case"user":break;case"hashtag":var n=e.substr(1,e.length);n=n.replace(" ","");var l=jQuery("input[name='wdi_feed_settings[hashtag_top_recent]']:checked").val();this.instagram.getTagRecentMedia(n,{success:function(e){jQuery("#wdi_add_user_ajax").removeAttr("disabled");var i=a.isValidResponse(e);i.valid&&a.hasData(e)?a.addHashtag(n,e):a.hasData(e)||"success"!=i.msg?alert(i.msg):1!=t?confirm(wdi_messages.hashtag_no_data)?a.addHashtag(n,e):jQuery("#wdi_add_user_ajax_input").val(""):a.addHashtag(n,e)}},null,l)}},wdi_controller.checkForDuplicateUser=function(e){for(var t=0;t<this.feed_users.length;t++)if(e==this.feed_users[t].username)return!0;return!1},wdi_controller.getInputType=function(e){switch(e[0]){case"#":return"hashtag";case"%":return"location";default:return"user"}},wdi_controller.stringifyUserData=function(e){for(var t=[],i=0;i<e.length;i++)t.push({id:e[i].id,username:e[i].username,tag_id:void 0!==e[i].tag_id?e[i].tag_id:""});return JSON.stringify(t)},wdi_controller.bindAddNewUserOrHashtagEvent=function(){jQuery("#wdi_add_user_ajax").on("click",function(){if(void 0===jQuery(this).attr("disabled")){jQuery(this).attr("disabled","disabled");var e=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase();!1===wdi_controller.makeInstagramUserRequest(e)&&jQuery(this).removeAttr("disabled","disabled")}}),jQuery("#wdi_add_user_ajax_input").on("keypress",function(e){if(13==e.keyCode){if(void 0!==jQuery("#wdi_add_user_ajax").attr("disabled"))return;jQuery("#wdi_add_user_ajax").attr("disabled","disabled");var t=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase();return!1===wdi_controller.makeInstagramUserRequest(t)&&jQuery("#wdi_add_user_ajax").removeAttr("disabled","disabled"),!1}})},wdi_controller.removeFeedUser=function(e){var t=e.parent().find("a span").text();if(e.parent().find("a span").hasClass("wdi_hashtag")&&(t="#"+t),0==this.feed_users.length){var i=jQuery("#WDI_feed_users").val();void 0!==i&&this.isJsonString(i)&&(this.feed_users=JSON.parse(i))}for(var r=0;r<this.feed_users.length;r++){if(this.feed_users[r].username==t){this.feed_users.splice(r,1);break}}for(r=0;r<this.feed_users.length;r++){"#"!==this.feed_users[r].username.charAt(0)&&this.feed_users.splice(r,1)}e.parent().remove(),jQuery("#WDI_feed_users").val(this.stringifyUserData(this.feed_users)),t!==jQuery("#wdi_default_user").val()&&wdi_controller.updateFeaturedImageSelect(t,"remove"),wdi_controller.changed_users()},wdi_controller.updateFeaturedImageSelect=function(e,t,i){var r=jQuery("#WDI_thumb_user");switch("selected"!=i&&(i=""),t){case"add":if(!r.find('option[value="'+e+'"]').length){var a=jQuery("<option "+i+' value="'+e+'">'+e+"</option>");r.append(a)}break;case"remove":r.find('option[value="'+e+'"]').remove(),this.feed_users.length>0&&r.val(this.feed_users[0].username)}},wdi_controller.bindSaveThemeEvent=function(){jQuery("#wdi_save_theme_submit").on("click",function(){jQuery("#task").attr("value","save_feed"),jQuery("#wdi_save_feed").submit()}),jQuery("#wdi_save_theme_apply").on("click",function(){jQuery("#task").attr("value","apply_changes");var e=jQuery("#wdi_add_or_edit").attr("value");jQuery("#wdi_current_id").attr("value",e),jQuery("#wdi_save_feed").submit()}),jQuery("#wdi_save_theme_reset").on("click",function(){jQuery("#task").attr("value","reset_changes");var e=jQuery("#wdi_add_or_edit").attr("value");jQuery("#wdi_current_id").attr("value",e),jQuery("#wdi_save_feed").submit()})},wdi_controller.checkIfUserNotSaved=function(e){switch(e){case"save_feed":e="submit";break;case"apply_changes":e="apply";break;case"reset_changes":e="reset"}if(""!=jQuery("#wdi_add_user_ajax_input").val().trim()){var t=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase();return wdi_controller.waitingAjaxRequestEnd={button:e},wdi_controller.makeInstagramUserRequest(t),1}return wdi_controller.waitingAjaxRequestEnd={button:0},0},wdi_controller.saveFeedAfterAjaxWait=function(e){if(null!=wdi_controller.waitingAjaxRequestEnd){var t=wdi_controller.waitingAjaxRequestEnd.button;e&&0!=t&&jQuery("#wdi_save_feed_"+t).trigger("click"),wdi_controller.waitingAjaxRequestEnd=void 0}},wdi_controller.getCookie=function(e){var t=("; "+document.cookie).split("; "+e+"=");if(2==t.length)return t.pop().split(";").shift()},wdi_controller.isValidResponse=function(e){var t={};return void 0===e||void 0===e.meta.code||200!=e.meta.code?(t.valid=!1,void 0===e?t.msg=wdi_messages.instagram_server_error:200!==e.meta.code?t.msg=e.meta.error_message:t.msg=""):(t.valid=!0,t.msg="success"),t},wdi_controller.hasData=function(e){return void 0!==e&&void 0!==e.data&&0!=e.data.length},wdi_controller.thumbUser=function(e){return this.feed_users.length>0&&this.feed_users[0].username===e},wdi_controller.findUser=function(e,t){var i=[];void 0!==t&&void 0!==t.data&&(i=t.data);for(var r=0;r<i.length;r++)if(i[r].username==e)return i[r];return!1},wdi_controller.addHashtag=function(e,t){if(null==e.match(/[~!@$%&*#^()<>?]/)){var i=jQuery('<div class="wdi_user"><a target="_blank" href="https://instagram.com/explore/tags/'+e+'"><img class="wdi_profile_pic" src="'+wdi_url.plugin_url+'images/hashtag.png"><span class="wdi_hashtag">'+e+'</span><i style="display:table-cell;width:25px;"></i></a><img class="wdi_remove_user" onclick="wdi_controller.removeFeedUser(jQuery(this))" src="'+wdi_url.plugin_url+'/images/delete_user.png"></div>');jQuery("#wdi_feed_users_ajax").append(i),jQuery("#wdi_add_user_ajax_input").val("");var r={id:"#"+e,username:"#"+e,profile_picture:void 0!==t&&0!=t.data.length&&void 0!==t.data[0].images.thumbnail?t.data[0].images.thumbnail.url:"",tag_id:t.tag_id};this.feed_users.push(r);var a="#"+e;selected=this.thumbUser(a)?"selected":"",wdi_controller.updateFeaturedImageSelect(a,"add",selected)}else alert(wdi_messages.invalid_hashtag);this.updateConditionalFiltersUi(),wdi_controller.saveFeedAfterAjaxWait(!0),wdi_controller.changed_users()},wdi_controller.changed_users=function(){for(var e=!1,t=0;t<this.feed_users.length;t++)if("#"===this.feed_users[t].username[0]){e=!0;break}e?(jQuery(".wdi_element_name_hashtag_top_recent").show(),jQuery(".wdi_element_name_show_username_on_thumb").hide()):(jQuery(".wdi_element_name_hashtag_top_recent").hide(),jQuery(".wdi_element_name_show_username_on_thumb").show())},wdi_controller.addUser=function(e){e.username=e.user_name,0==this.checkForDuplicateUser(e.username)?(newUser=jQuery('<div class="wdi_user"><a target="_blank" href="http://www.instagram.com/'+e.username+'"><span class="wdi_username">'+e.username+'</span><i style="display:table-cell;width:25px;"></i></a><img class="wdi_remove_user" onclick="wdi_controller.removeFeedUser(jQuery(this))" src="'+wdi_url.plugin_url+'images/delete_user.png"></div>'),jQuery("#wdi_feed_users_ajax").append(newUser),jQuery("#wdi_add_user_ajax_input").val(""),this.feed_users.push({id:e.id,username:e.username,profile_picture:""})):alert(e.username+" "+wdi_messages.already_added),selected=this.thumbUser(e.username)?"selected":"",this.updateFeaturedImageSelect(e.username,"add",selected),this.updateConditionalFiltersUi(),wdi_controller.saveFeedAfterAjaxWait(!0)},wdi_controller.getUserProfilePic=function(e){for(var t=0;t<this.feed_users.length;t++)if(e==this.feed_users[t].username)return this.feed_users[t].profile_picture;return"false"},wdi_controller.conditionalFiltersTabInit=function(){this.setInitialFilters(),this.updateFiltersUi();var e=this;function t(){switch(jQuery("#WDI_wrap_conditional_filter_enable input:checked").val()){case"0":jQuery("#WDI_conditional_filters").parent().parent().addClass("wdi_hidden"),jQuery("#WDI_conditional_filter_type").parent().parent().parent().parent().parent().addClass("wdi_hidden"),jQuery("#wdi_final_condition").addClass("wdi_hidden"),jQuery("#WDI_filter_source").addClass("wdi_hidden");break;case"1":jQuery("#WDI_conditional_filters").parent().parent().removeClass("wdi_hidden"),jQuery("#WDI_conditional_filter_type").parent().parent().parent().parent().parent().removeClass("wdi_hidden"),jQuery("#wdi_final_condition").removeClass("wdi_hidden"),jQuery("#WDI_filter_source").removeClass("wdi_hidden")}}jQuery("#wdi_add_filter").on("click",function(){e.addConditionalFilter()&&jQuery("#wdi_filter_input").val("")}),jQuery(".wdi_filter_radio").on("click",function(){jQuery("#wdi_filter_input").trigger("focus")}),jQuery("#wdi_filter_input").on("keypress",function(t){if(13==t.keyCode)return e.addConditionalFilter()&&jQuery(this).val(""),!1}),t(),jQuery("#WDI_wrap_conditional_filter_enable input").on("change",function(){t()}),jQuery("#WDI_conditional_filter_type").on("change",function(){switch("none"==jQuery(this).val()||jQuery("#WDI_conditional_filters").css("display","block"),jQuery(this).parent().find("label").css({display:"inline-block"}),jQuery(this).val()){case"AND":jQuery("#WDI_conditional_filters").css("display","block"),jQuery(this).parent().find("label").html(wdi_messages.and_descr);break;case"OR":jQuery("#WDI_conditional_filters").css("display","block"),jQuery(this).parent().find("label").html(wdi_messages.or_descr);break;case"NOR":jQuery("#WDI_conditional_filters").css("display","block"),jQuery(this).parent().find("label").html(wdi_messages.nor_descr)}wdi_controller.updateFiltersUi()}),jQuery("#WDI_conditional_filter_type").trigger("change")},wdi_controller.addConditionalFilter=function(){var e=jQuery("#wdi_filter_input").val(),t=jQuery("#wdi_filter_type").val();if(filter={},""==e)return!1;switch(e=e.trim(),null==t&&("@"==e[0]?t="mention":"#"==e[0]?t="hashtag":"http"!=e.split("://")[0]&&"https"!=e.split("://")[0]||(t="url")),t){case"username":case"mention":"@"==e[0]&&(e=e.substr(1,e.length));break;case"hashtag":"#"==e[0]&&(e=e.substr(1,e.length));break;case"url":if(!/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(e))return alert(wdi_messages.invalid_url),!1}return filter={filter_type:t,filter_by:e,id:this.randomId()},null!=t?this.filterExists(filter)?(alert(e+" "+wdi_messages.already_added),!1):(this.conditionalFilters.push(filter),this.updateFiltersUi(),!0):(alert(wdi_messages.selectConditionType),!1)},wdi_controller.filterExists=function(e){for(var t=0;t<this.conditionalFilters.length;t++)if(this.conditionalFilters[t].filter_type==e.filter_type&&this.conditionalFilters[t].filter_by==e.filter_by)return!0;return!1},wdi_controller.updateFiltersUi=function(){for(var e=jQuery("#wdi_filters_ui").html(""),t=0;t<this.conditionalFilters.length;t++){if(0==t)if(1!=this.conditionalFilters.length)switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":break;case"OR":e.append(jQuery('<span class="wdi_logic">'+wdi_messages.either+"</span>"));break;case"NOR":e.append(jQuery('<span class="wdi_logic">'+wdi_messages.neither+"</span>"))}else switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":case"OR":break;case"NOR":e.append(jQuery('<span class="wdi_logic">'+wdi_messages.not+"</span>"))}var i;switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":i=wdi_messages.and;break;case"OR":i=wdi_messages.or;break;case"NOR":i=wdi_messages.nor}t>=1&&e.append(jQuery('<span class="wdi_logic">'+i+"</span>")),e.append(this.createUiElement(this.conditionalFilters[t]))}this.updateFilterTextarea()},wdi_controller.createUiElement=function(e){var t;switch(e.filter_type){case"mention":t="@";break;case"hashtag":t="#";break;case"location":t="%";break;default:t=""}return jQuery('<span data-id="'+e.id+'" class="wdi_filter_item wdi_filter_by_'+e.filter_type+'"></span>').html(t+e.filter_by+'<span onclick="wdi_controller.removeConditionalFilter(jQuery(this));" class="wdi_remove_filter">X</span>')},wdi_controller.randomId=function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=0;i<5;i++)e+=t.charAt(Math.floor(Math.random()*t.length));return e},wdi_controller.removeConditionalFilter=function(e){for(var t=e.parent().attr("data-id"),i=0;i<this.conditionalFilters.length;i++)this.conditionalFilters[i].id==t&&this.conditionalFilters.splice(i,1);this.updateFiltersUi()},wdi_controller.updateFilterTextarea=function(){var e,t=this.conditionalFilters;e=JSON.stringify(t),jQuery("#wdi_conditional_filters_textarea").val(e)},wdi_controller.setInitialFilters=function(){var e=[],t=jQuery("#wdi_conditional_filters_textarea").val();this.isJsonString(t)&&(e=JSON.parse(t)),this.conditionalFilters=e},wdi_controller.updateConditionalFiltersUi=function(){wdi_controller.updateFilterSource()},wdi_controller.updateFilterSource=function(){if("liked"!=jQuery('input[name="wdi_feed_settings[liked_feed]"]:checked').val()){var e,t,i=[];jQuery(".wdi_user").each(function(){e=0!=jQuery(this).find(".wdi_username").length?jQuery(this).find(".wdi_username").text():jQuery(this).find(".wdi_hashtag").text(),t=jQuery(this).find("img").attr("src"),i.push({username:e,image:t})});a=jQuery("#wdi_filter_source").html("");for(var r=0;r<i.length;r++){s="<div class='wdi_source_user'><span class='wdi_source_img'><img src='"+i[r].image+"'></span><span class='wdi_source_username'>"+i[r].username+"</span></div>";a.html(a.html()+s)}}else{var a,s="<div class='wdi_source_user'><span class='wdi_source_username'>Media I liked</span></div>";(a=jQuery("#wdi_filter_source").html("")).html(a.html()+s)}},wdi_controller.isJsonString=function(e){try{JSON.parse(e)}catch(e){return!1}return!0},wdi_controller.getUserObj=function(e){var t=JSON.parse(wdi_options.wdi_authenticated_users_list);if("object"==typeof t){if("object"==typeof t[e]&&""!=t[e])return t[e];console.log("Error: User not exist on Users object")}else console.log("Error: Wrong response when parsed on users (JSON.parse)");return!1};
js/wdi_frontend.js CHANGED
@@ -16,7 +16,7 @@ wdi_front.detectEvent = function ()
16
  }
17
 
18
  var wdi_error_show = false;
19
-
20
 
21
  wdi_front.escape_tags = function (text)
22
  {
@@ -40,7 +40,14 @@ wdi_front.show_alert = function (message, response, wdi_current_feed)
40
  if(typeof response.wdi_current_feed_name != "undefined"){
41
  var wdi_private_user_name = response.wdi_current_feed_name;
42
  var wdi_private_feed_names = wdi_current_feed.find(".wdi_private_feed_names");
43
- wdi_private_feed_names.html(wdi_private_user_name);
 
 
 
 
 
 
 
44
  wdi_current_feed.find(".wdi_private_feed_error").removeClass("wdi_hidden");
45
  }
46
  wdi_current_feed.find(".wdi_spinner").remove();
@@ -119,43 +126,7 @@ wdi_front.globalInit = function () {
119
  feed: currentFeed
120
  };
121
 
122
- currentFeed.instagram.filters = [
123
- {
124
- 'where': 'getUserRecentMedia',
125
- 'what': function (response, args, cArgs)
126
- {
127
- return args.feed.conditionalFilter(response, cArgs);
128
- }
129
- },
130
- {
131
- 'where': 'getUserMedia',
132
- 'what': function (response, args, cArgs)
133
- {
134
- return args.feed.conditionalFilter(response, cArgs);
135
- }
136
- },
137
- {
138
- 'where': 'getTagRecentMedia',
139
- 'what': function (response, args, cArgs)
140
- {
141
- return args.feed.conditionalFilter(response, cArgs);
142
- }
143
- },
144
- {
145
- 'where': 'getRecentLikedMedia',
146
- 'what': function (response, args, cArgs)
147
- {
148
- return args.feed.conditionalFilter(response, cArgs);
149
- }
150
- },
151
- {
152
- 'where': 'requestByUrl',
153
- 'what': function (response, args, cArgs)
154
- {
155
- return args.feed.conditionalFilter(response, cArgs);
156
- }
157
- }
158
- ];
159
 
160
  currentFeed.instagram.addToken(currentFeed['feed_row']['access_token']);
161
 
@@ -295,18 +266,15 @@ wdi_front.init = function (currentFeed)
295
  currentFeed.feedImageResolution = feedResolution.image;
296
  currentFeed.feedVideoResolution = feedResolution.video;
297
  for (var i = 0; i < currentFeed.dataCount; i++) {
298
- wdi_front.instagramRequest(i, currentFeed);
299
  }
300
  if (currentFeed.feed_row["number_of_photos"] > 0) {
301
  wdi_front.ajaxLoader(currentFeed);
302
  }
303
- //setting feed name
304
  if (currentFeed['feed_row']['display_header'] === '1') {
305
  wdi_front.show('header', currentFeed);
306
  }
307
- if (currentFeed['feed_row']['show_usernames'] === '1') {
308
- wdi_front.show('users', currentFeed);
309
- }
310
  }
311
 
312
  wdi_front.getFeedItemResolution = function (currentFeed) {
@@ -405,7 +373,7 @@ wdi_front.instagramRequest = function (id, currentFeed)
405
  }
406
  else {
407
  if (this.getInputType(feed_users[id]['username']) == 'hashtag') {
408
- currentFeed.instagram.getTagRecentMedia(this.stripHashtag(feed_users[id]['username']), {
409
  success: function (response)
410
  {
411
  if(typeof response.meta!= "undefined" && typeof response.meta.error_type != "undefined"){
@@ -1376,6 +1344,7 @@ wdi_front.createObject = function (obj, currentFeed)
1376
  }
1377
 
1378
  if(typeof obj.images[currentFeed.feedImageResolution] == "undefined"){
 
1379
  var image_url = wdi_url.plugin_url + "images/missing.png";
1380
  }else {
1381
  var image_url = obj.images[currentFeed.feedImageResolution].url;
@@ -1463,10 +1432,6 @@ wdi_front.getPhotoTemplate = function (currentFeed)
1463
  }
1464
 
1465
 
1466
- if (currentFeed.feed_row.show_username_on_thumb == '1' && currentFeed.data.length && currentFeed.data[0].user.username !== "") {
1467
- showUsernameOnThumb = '<span class="wdi_media_user">@<%= wdi_username%></span>';
1468
- }
1469
-
1470
  //checking if caption is opend by default then add wdi_full_caption class
1471
  //only in masonry
1472
  if (currentFeed.feed_row.show_full_description == 1 && currentFeed.feed_row.feed_type == 'masonry') {
@@ -1528,23 +1493,7 @@ wdi_front.getPhotoTemplate = function (currentFeed)
1528
  '</div>' +
1529
  '</div>' +
1530
  '</div>';
1531
- if (currentFeed['feed_row']['show_likes'] === '1' || currentFeed['feed_row']['show_comments'] === '1' || currentFeed['feed_row']['show_description'] === '1') {
1532
- source += '<div class="wdi_photo_meta">';
1533
- /* @TODO API Changes 2020 */
1534
- /*if (currentFeed['feed_row']['show_likes'] === '1') {
1535
- source += '<div class="wdi_thumb_likes"><i class="tenweb-i tenweb-i-heart-o">&nbsp;<%= likes%></i></div>';
1536
- }
1537
- if (currentFeed['feed_row']['show_comments'] === '1') {
1538
- source += '<div class="wdi_thumb_comments"><i class="tenweb-i tenweb-i-comment-square">&nbsp;<%= comments%></i></div>';
1539
- }
1540
- source += '<div class="wdi_clear"></div>';
1541
- if (currentFeed['feed_row']['show_description'] === '1') {
1542
- source += '<div class="wdi_photo_title" onclick=' + onclickevent + ' >' +
1543
- '<%=caption%>' +
1544
- '</div>';
1545
- }
1546
- source += '</div>';*/
1547
- }
1548
 
1549
  source += '</div>';
1550
  var template = _.template(source);
@@ -1579,9 +1528,7 @@ wdi_front.getSliderTemplate = function (currentFeed)
1579
  }
1580
 
1581
 
1582
- if (currentFeed.feed_row.show_username_on_thumb == '1' && currentFeed.data.length && currentFeed.data[0].user.username !== "") {
1583
- showUsernameOnThumb = '<span class="wdi_media_user">@<%= wdi_username%></span>';
1584
- }
1585
 
1586
  //checking if caption is opend by default then add wdi_full_caption class
1587
  //only in masonry
@@ -1646,23 +1593,7 @@ wdi_front.getSliderTemplate = function (currentFeed)
1646
  '</div>' +
1647
  '</div>' +
1648
  '</div>';
1649
- if (currentFeed['feed_row']['show_likes'] === '1' || currentFeed['feed_row']['show_comments'] === '1' || currentFeed['feed_row']['show_description'] === '1') {
1650
- source += '<div class="wdi_photo_meta">';
1651
- /* @TODO API Changes 2020 */
1652
- /*if (currentFeed['feed_row']['show_likes'] === '1') {
1653
- source += '<div class="wdi_thumb_likes"><i class="tenweb-i tenweb-i-heart-o">&nbsp;<%= likes%></i></div>';
1654
- }
1655
- if (currentFeed['feed_row']['show_comments'] === '1') {
1656
- source += '<div class="wdi_thumb_comments"><i class="tenweb-i tenweb-i-comment-square">&nbsp;<%= comments%></i></div>';
1657
- }
1658
- source += '<div class="wdi_clear"></div>';
1659
- if (currentFeed['feed_row']['show_description'] === '1') {
1660
- source += '<div class="wdi_photo_title" onclick=' + onclickevent + ' >' +
1661
- '<%=caption%>' +
1662
- '</div>';
1663
- }
1664
- source += '</div>';*/
1665
- }
1666
 
1667
  source += '</div>';
1668
  var template = _.template(source);
@@ -1705,9 +1636,6 @@ wdi_front.getVideoTemplate = function (currentFeed)
1705
  customClass = 'wdi_hidden';
1706
  }
1707
 
1708
- if (currentFeed.feed_row.show_username_on_thumb == '1' && currentFeed.data.length && currentFeed.data[0].user.username !== "") {
1709
- showUsernameOnThumb = '<span class="wdi_media_user">@<%= wdi_username%></span>';
1710
- }
1711
 
1712
  //checking if caption is opend by default then add wdi_full_caption class
1713
  //only in masonry
@@ -1774,23 +1702,7 @@ wdi_front.getVideoTemplate = function (currentFeed)
1774
  '</div>' +
1775
  '</div>' +
1776
  '</div>';
1777
- if (currentFeed['feed_row']['show_likes'] === '1' || currentFeed['feed_row']['show_comments'] === '1' || currentFeed['feed_row']['show_description'] === '1') {
1778
- source += '<div class="wdi_photo_meta">';
1779
- /* @TODO API Changes 2020 */
1780
- /*if (currentFeed['feed_row']['show_likes'] === '1') {
1781
- source += '<div class="wdi_thumb_likes"><i class="tenweb-i tenweb-i-heart-o">&nbsp;<%= likes%></i></div>';
1782
- }
1783
- if (currentFeed['feed_row']['show_comments'] === '1') {
1784
- source += '<div class="wdi_thumb_comments"><i class="tenweb-i tenweb-i-comment-square">&nbsp;<%= comments%></i></div>';
1785
- }
1786
- source += '<div class="wdi_clear"></div>';
1787
- if (currentFeed['feed_row']['show_description'] === '1') {
1788
- source += '<div class="wdi_photo_title" onclick=' + onclickevent + ' >' +
1789
- '<%=caption%>' +
1790
- '</div>';
1791
- }
1792
- source += '</div>';*/
1793
- }
1794
  source += '</div>';
1795
  var template = _.template(source);
1796
  return template;
@@ -1803,7 +1715,6 @@ wdi_front.bindEvents = function (currentFeed)
1803
  //no feed in DOM, ignore
1804
  return;
1805
  }
1806
-
1807
  if (currentFeed.feed_row.feed_display_view == 'load_more_btn') {
1808
  //binding load more event
1809
  jQuery('#wdi_feed_' + currentFeed.feed_row['wdi_feed_counter'] + ' .wdi_load_more_container').on(wdi_front.clickOrTouch, function ()
@@ -1835,31 +1746,8 @@ wdi_front.bindEvents = function (currentFeed)
1835
  //setting pagiantion flags
1836
  currentFeed.paginatorNextFlag = false;
1837
  }
1838
- if (currentFeed.feed_row.feed_display_view == 'infinite_scroll') {
1839
- //binding infinite scroll Events
1840
- jQuery(window).on('scroll', function ()
1841
- {
1842
- wdi_front.infiniteScroll(currentFeed);
1843
- });
1844
- //infinite scroll flags
1845
- currentFeed.infiniteScrollFlag = false;
1846
- }
1847
  }
1848
 
1849
- wdi_front.infiniteScroll = function (currentFeed)
1850
- {
1851
-
1852
- if ((jQuery(window).scrollTop() + jQuery(window).height() - 100) >= jQuery('#wdi_feed_' + currentFeed.feed_row['wdi_feed_counter'] + ' #wdi_infinite_scroll').offset().top) {
1853
- if (currentFeed.infiniteScrollFlag === false && currentFeed.stopInfiniteScrollFlag == false) {
1854
- currentFeed.infiniteScrollFlag = true;
1855
- wdi_front.loadMore(jQuery('#wdi_feed_' + currentFeed.feed_row['wdi_feed_counter'] + ' #wdi_infinite_scroll'), currentFeed);
1856
- } else
1857
- if (currentFeed.stopInfiniteScrollFlag) {
1858
- wdi_front.allImagesLoaded(currentFeed);
1859
- }
1860
-
1861
- }
1862
- }
1863
 
1864
  wdi_front.paginationFirstPage = function (btn, currentFeed)
1865
  {
@@ -2045,6 +1933,7 @@ wdi_front.loadMore = function (button, _currentFeed) {
2045
 
2046
 
2047
  //check if all data loaded then remove ajaxLoader
 
2048
  for (var i = 0; i < currentFeed.usersData.length; i++) {
2049
  if (currentFeed.usersData[i]['finished'] === 'finished') {
2050
  dataCounter++;
@@ -2087,17 +1976,14 @@ wdi_front.loadMore = function (button, _currentFeed) {
2087
  /*
2088
  * Requests images based on provided pagination url
2089
  */
2090
- wdi_front.loadMoreRequest = function (user, next_url, currentFeed, button)
2091
- {
2092
  /*if there was no initial request, do not allow loadmore request */
2093
- if(!currentFeed.mediaRequestsDone){
2094
  return;
2095
  }
2096
-
2097
  var usersData = currentFeed['usersData'];
2098
  var errorMessage = '';
2099
  /*sometimes (infinitescroll) loadMoreRequest is triggered before feed has any user data */
2100
-
2101
  var success_function = function (response) {
2102
  if (response === '' || typeof response == 'undefined' || response == null) {
2103
  errorMessage = wdi_front_messages.network_error;
@@ -2105,10 +1991,10 @@ wdi_front.loadMoreRequest = function (user, next_url, currentFeed, button)
2105
  wdi_front.show_alert(errorMessage, response, currentFeed);
2106
  return;
2107
  }
2108
- if ( typeof response.meta != 'undefined' && typeof response.meta.error_type != 'undefined' ) {
2109
  wdi_front.show_alert(false, response, currentFeed);
2110
  }
2111
- if ( typeof response.meta != 'undefined' && typeof response.meta.code != 'undefined' && response.meta.code != 200 ) {
2112
  errorMessage = response['meta']['error_message'];
2113
  currentFeed.loadMoreDataCount--;
2114
  wdi_front.show_alert(errorMessage, response, currentFeed);
@@ -2116,10 +2002,8 @@ wdi_front.loadMoreRequest = function (user, next_url, currentFeed, button)
2116
  }
2117
  response['user_id'] = user.user_id;
2118
  response['username'] = user.username;
2119
-
2120
  for (var i = 0; i < currentFeed['usersData'].length; i++) {
2121
  if (response['user_id'] === currentFeed['usersData'][i]['user_id']) {
2122
-
2123
  ///mmm!!!
2124
  if (response['user_id'][0] === '#') {
2125
  response['data'] = wdi_front.appendRequestHashtag(response['data'], response['user_id']);
@@ -2130,30 +2014,31 @@ wdi_front.loadMoreRequest = function (user, next_url, currentFeed, button)
2130
  used later in wdi_front.checkForLoadMoreDone(), in other cases when button is set to
2131
  initial we already keep data in that variable, so we don't deed to keep it again, it will give us duplicate value
2132
  */
2133
-
2134
  if (button == 'initial-keep') {
2135
  currentFeed.temproraryUsersData[i] = currentFeed.usersData[i];
2136
  }
2137
  currentFeed['usersData'][i] = response;
2138
-
2139
  currentFeed.loadMoreDataCount--;
2140
  }
2141
  }
2142
-
2143
- //checks if load more done then displays feed
2144
  wdi_front.checkForLoadMoreDone(currentFeed, button);
2145
  };
2146
-
2147
- if(user.username[0] !== "#") {
2148
  currentFeed.instagram.requestByUrl(next_url, {
2149
  success: success_function
2150
  });
2151
- }else{
2152
- currentFeed.instagram.getTagRecentMedia(user.username, {success
2153
- :success_function}, next_url, currentFeed.feed_row.hashtag_top_recent)
 
 
 
 
 
2154
  }
2155
  }
2156
 
 
2157
  wdi_front.checkForLoadMoreDone = function (currentFeed, button)
2158
  {
2159
  var load_more_number = currentFeed.feed_row['load_more_number'];
@@ -2291,26 +2176,10 @@ wdi_front.ajaxLoader = function (currentFeed)
2291
  feed_container.find('.wdi_spinner').removeClass('wdi_hidden');
2292
  }
2293
  /////////////////////////////////////////////////////
2294
- if (currentFeed.feed_row.feed_display_view == 'infinite_scroll') {
2295
- var loadingDiv;
2296
- if (feed_container.find('.wdi_ajax_loading').length == 0) {
2297
- 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>');
2298
- feed_container.append(loadingDiv);
2299
- } else {
2300
- loadingDiv = feed_container.find('.wdi_ajax_loading');
2301
- }
2302
- loadingDiv.removeClass('wdi_hidden');
2303
- }
2304
  }
2305
 
2306
  //if all images loaded then clicking load more causes it's removal
2307
- wdi_front.allImagesLoaded = function (currentFeed)
2308
- {
2309
- ////////////////////////////////////////////////////////////////////
2310
- //clearInterval(currentFeed.loadingInterval);
2311
- //jQuery('#wdi_feed_'+currentFeed.feed_row['wdi_feed_counter']+' .wdi_ajax_loading').remove();
2312
-
2313
- ////////////////////////////////////////////////////
2314
  var dataLength = wdi_front.getDataLength(currentFeed);
2315
  /*if there was no request for media, we do not know yet of feed data has been finished or not*/
2316
  if(! currentFeed.mediaRequestsDone){
@@ -2329,10 +2198,6 @@ wdi_front.allImagesLoaded = function (currentFeed)
2329
  feed_container.find('.wdi_load_more').removeClass('wdi_hidden');
2330
  feed_container.find('.wdi_spinner').addClass('wdi_hidden');
2331
  }
2332
-
2333
- if (currentFeed.feed_row.feed_display_view == 'infinite_scroll') {
2334
- jQuery('#wdi_feed_' + currentFeed.feed_row['wdi_feed_counter'] + ' .wdi_ajax_loading').addClass('wdi_hidden');
2335
- }
2336
  //custom event fired for user based custom js
2337
  feed_container.trigger('wdi_feed_loaded');
2338
  }
@@ -2348,21 +2213,22 @@ wdi_front.show = function (name, currentFeed) {
2348
  break;
2349
  }
2350
  case 'users': {
2351
- /* @TODO API Changes 2020 */
2352
- /*show_users(currentFeed);*/
2353
  break;
2354
  }
2355
  }
2356
 
2357
  function show_header() {
2358
  var templateData = {
 
2359
  'feed_name': currentFeed['feed_row']['feed_name'],
2360
  };
2361
 
2362
  var headerTemplate = wdi_front.getHeaderTemplate(),
2363
  html = headerTemplate(templateData),
2364
  containerHtml = feed_container.find('.wdi_feed_header').html();
2365
- feed_container.find('.wdi_feed_header').html(containerHtml + html);
2366
  }
2367
 
2368
  function show_users(currentFeed) {
@@ -2390,16 +2256,8 @@ wdi_front.show = function (name, currentFeed) {
2390
  wdi_front.show_alert(false, response, currentFeed);
2391
  }
2392
  response = _this.checkMediaResponse(response, currentFeed);
2393
- // @TODO free There is a difference in free!
2394
- if(response != false && response["meta"]["code"] === 400 && response["meta"]["error_type"] === "APINotAllowedError"){
2395
- var obj = null;
2396
- currentFeed.headerUserinfo.push(obj);
2397
- i++;
2398
- getThumb();
2399
- }
2400
-
2401
- if (response != false && response["meta"]["code"] === 200) {
2402
-
2403
  var obj = {
2404
  id: response['data']['id'],
2405
  name: response['data']['username'],
@@ -2619,6 +2477,9 @@ wdi_front.getUserTemplate = function (currentFeed, username)
2619
  wdi_front.getHeaderTemplate = function ()
2620
  {
2621
  var source = '<div class="wdi_header_wrapper">' +
 
 
 
2622
  '<div class="wdi_header_text"><%=feed_name%></div>' +
2623
  '<div class="wdi_clear">' +
2624
  '</div>';
@@ -2822,7 +2683,7 @@ wdi_front.getFileName = function (data)
2822
  wdi_front.getFileType = function (data)
2823
  {
2824
  /*if pure video, not carousel*/
2825
- //@TODO old if (data['type'] == 'video' && data.hasOwnProperty('videos')) {
2826
  if (data['media_type'] == 'VIDEO' && data.hasOwnProperty('videos')) {
2827
  return "EMBED_OEMBED_INSTAGRAM_VIDEO";
2828
  }
@@ -3058,64 +2919,6 @@ var WDIFeed = function (obj)
3058
  */
3059
  WDIFeed.prototype.conditionalFilter = function (response, args)
3060
  {
3061
-
3062
- var currentFeed = this,
3063
- conditional_filter_type = currentFeed.feed_row.conditional_filter_type,
3064
- filters = currentFeed.feed_row.conditional_filters;
3065
-
3066
-
3067
- if (args.ignoreFiltering == true) {
3068
-
3069
- } else {
3070
-
3071
- /**
3072
- * Get rid of duplicate media
3073
- */
3074
- response = this.avoidDuplicateMedia(response);
3075
- }
3076
-
3077
-
3078
- //if filters json is invalid then return response without filtering
3079
- if (!wdi_front.isJsonString(filters)) {
3080
- return response;
3081
- } else {
3082
- filters = JSON.parse(filters);
3083
- if (filters.length == 0) {
3084
- return response;
3085
- }
3086
- }
3087
-
3088
-
3089
- if (currentFeed.feed_row.conditional_filter_enable == '0') {
3090
- return response;
3091
- }
3092
- //increase counter for determing request count if this counter is more then
3093
- //currentFeed.maxConditionalFiltersRequestCount then program will terminate recursion loop
3094
- currentFeed.instagramRequestCounter++;
3095
-
3096
- switch (conditional_filter_type) {
3097
- case 'AND':
3098
- {
3099
- response = this.applyANDLogic(response, filters, currentFeed);
3100
- break;
3101
- }
3102
- case 'OR':
3103
- {
3104
- response = this.applyORLogic(response, filters, currentFeed)
3105
- break;
3106
- }
3107
- case 'NOR':
3108
- {
3109
- response = this.applyNORLogic(response, filters, currentFeed)
3110
- break;
3111
- }
3112
- default:
3113
- {
3114
- break;
3115
- }
3116
- }
3117
-
3118
-
3119
  return response;
3120
  }
3121
 
@@ -3181,7 +2984,6 @@ WDIFeed.prototype.applyORLogic = function (response, filters)
3181
  */
3182
  WDIFeed.prototype.applyNORLogic = function (response, filters)
3183
  {
3184
-
3185
  var res = response,
3186
  currentFeed = this,
3187
  matchedData = this.applyORLogic(response, filters, currentFeed),
@@ -3223,7 +3025,6 @@ WDIFeed.prototype.mediaExists = function (media, array)
3223
  */
3224
  WDIFeed.prototype.filterResponse = function (response, filter)
3225
  {
3226
-
3227
  switch (filter.filter_type) {
3228
  case 'hashtag':
3229
  {
@@ -3265,15 +3066,20 @@ WDIFeed.prototype.filterResponse = function (response, filter)
3265
  * @param {Object} filter [hashtag filter object]
3266
  * @return {Object} [filtered response]
3267
  */
 
 
3268
  WDIFeed.prototype.filterByHashtag = function (response, filter)
3269
  {
3270
  var filteredResponse = [],
3271
  currentTag,
3272
  media,
3273
  returnObject;
3274
-
3275
  for (var i = 0; i < response['data'].length; i++) {
3276
  media = response['data'][i];
 
 
 
 
3277
  for (var j = 0; j < media['tags'].length; j++) {
3278
  tag = media['tags'][j];
3279
  var tag1 = tag.toLowerCase();
@@ -3688,6 +3494,14 @@ else {
3688
  }
3689
 
3690
 
 
 
 
 
 
 
 
 
3691
  function wdi_extractHostname(url) {
3692
  if(typeof url === "undefined" || url===""){
3693
  return "";
16
  }
17
 
18
  var wdi_error_show = false;
19
+ var wdi_error_init = false;
20
 
21
  wdi_front.escape_tags = function (text)
22
  {
40
  if(typeof response.wdi_current_feed_name != "undefined"){
41
  var wdi_private_user_name = response.wdi_current_feed_name;
42
  var wdi_private_feed_names = wdi_current_feed.find(".wdi_private_feed_names");
43
+
44
+ if(typeof wdi_private_feed_names.attr("wdi_first_private_user") == "undefined"){
45
+ wdi_private_feed_names.attr("wdi_first_private_user",1);
46
+ }else{
47
+ wdi_private_user_name = ", " + wdi_private_user_name;
48
+ }
49
+
50
+ wdi_private_feed_names.append(wdi_private_user_name);
51
  wdi_current_feed.find(".wdi_private_feed_error").removeClass("wdi_hidden");
52
  }
53
  wdi_current_feed.find(".wdi_spinner").remove();
126
  feed: currentFeed
127
  };
128
 
129
+ currentFeed.instagram.filters = [];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
 
131
  currentFeed.instagram.addToken(currentFeed['feed_row']['access_token']);
132
 
266
  currentFeed.feedImageResolution = feedResolution.image;
267
  currentFeed.feedVideoResolution = feedResolution.video;
268
  for (var i = 0; i < currentFeed.dataCount; i++) {
269
+ wdi_front.instagramRequest(i, currentFeed);
270
  }
271
  if (currentFeed.feed_row["number_of_photos"] > 0) {
272
  wdi_front.ajaxLoader(currentFeed);
273
  }
274
+ // setting feed name
275
  if (currentFeed['feed_row']['display_header'] === '1') {
276
  wdi_front.show('header', currentFeed);
277
  }
 
 
 
278
  }
279
 
280
  wdi_front.getFeedItemResolution = function (currentFeed) {
373
  }
374
  else {
375
  if (this.getInputType(feed_users[id]['username']) == 'hashtag') {
376
+ currentFeed.instagram.getTagRecentMedia(this.stripHashtag(feed_users[id]['username']), {
377
  success: function (response)
378
  {
379
  if(typeof response.meta!= "undefined" && typeof response.meta.error_type != "undefined"){
1344
  }
1345
 
1346
  if(typeof obj.images[currentFeed.feedImageResolution] == "undefined"){
1347
+ debugger;
1348
  var image_url = wdi_url.plugin_url + "images/missing.png";
1349
  }else {
1350
  var image_url = obj.images[currentFeed.feedImageResolution].url;
1432
  }
1433
 
1434
 
 
 
 
 
1435
  //checking if caption is opend by default then add wdi_full_caption class
1436
  //only in masonry
1437
  if (currentFeed.feed_row.show_full_description == 1 && currentFeed.feed_row.feed_type == 'masonry') {
1493
  '</div>' +
1494
  '</div>' +
1495
  '</div>';
1496
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1497
 
1498
  source += '</div>';
1499
  var template = _.template(source);
1528
  }
1529
 
1530
 
1531
+
 
 
1532
 
1533
  //checking if caption is opend by default then add wdi_full_caption class
1534
  //only in masonry
1593
  '</div>' +
1594
  '</div>' +
1595
  '</div>';
1596
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1597
 
1598
  source += '</div>';
1599
  var template = _.template(source);
1636
  customClass = 'wdi_hidden';
1637
  }
1638
 
 
 
 
1639
 
1640
  //checking if caption is opend by default then add wdi_full_caption class
1641
  //only in masonry
1702
  '</div>' +
1703
  '</div>' +
1704
  '</div>';
1705
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1706
  source += '</div>';
1707
  var template = _.template(source);
1708
  return template;
1715
  //no feed in DOM, ignore
1716
  return;
1717
  }
 
1718
  if (currentFeed.feed_row.feed_display_view == 'load_more_btn') {
1719
  //binding load more event
1720
  jQuery('#wdi_feed_' + currentFeed.feed_row['wdi_feed_counter'] + ' .wdi_load_more_container').on(wdi_front.clickOrTouch, function ()
1746
  //setting pagiantion flags
1747
  currentFeed.paginatorNextFlag = false;
1748
  }
 
 
 
 
 
 
 
 
 
1749
  }
1750
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1751
 
1752
  wdi_front.paginationFirstPage = function (btn, currentFeed)
1753
  {
1933
 
1934
 
1935
  //check if all data loaded then remove ajaxLoader
1936
+ // To do Arsho
1937
  for (var i = 0; i < currentFeed.usersData.length; i++) {
1938
  if (currentFeed.usersData[i]['finished'] === 'finished') {
1939
  dataCounter++;
1976
  /*
1977
  * Requests images based on provided pagination url
1978
  */
1979
+ wdi_front.loadMoreRequest = function (user, next_url, currentFeed, button) {
 
1980
  /*if there was no initial request, do not allow loadmore request */
1981
+ if (!currentFeed.mediaRequestsDone) {
1982
  return;
1983
  }
 
1984
  var usersData = currentFeed['usersData'];
1985
  var errorMessage = '';
1986
  /*sometimes (infinitescroll) loadMoreRequest is triggered before feed has any user data */
 
1987
  var success_function = function (response) {
1988
  if (response === '' || typeof response == 'undefined' || response == null) {
1989
  errorMessage = wdi_front_messages.network_error;
1991
  wdi_front.show_alert(errorMessage, response, currentFeed);
1992
  return;
1993
  }
1994
+ if (typeof response.meta != 'undefined' && typeof response.meta.error_type != 'undefined') {
1995
  wdi_front.show_alert(false, response, currentFeed);
1996
  }
1997
+ if (typeof response.meta != 'undefined' && typeof response.meta.code != 'undefined' && response.meta.code != 200) {
1998
  errorMessage = response['meta']['error_message'];
1999
  currentFeed.loadMoreDataCount--;
2000
  wdi_front.show_alert(errorMessage, response, currentFeed);
2002
  }
2003
  response['user_id'] = user.user_id;
2004
  response['username'] = user.username;
 
2005
  for (var i = 0; i < currentFeed['usersData'].length; i++) {
2006
  if (response['user_id'] === currentFeed['usersData'][i]['user_id']) {
 
2007
  ///mmm!!!
2008
  if (response['user_id'][0] === '#') {
2009
  response['data'] = wdi_front.appendRequestHashtag(response['data'], response['user_id']);
2014
  used later in wdi_front.checkForLoadMoreDone(), in other cases when button is set to
2015
  initial we already keep data in that variable, so we don't deed to keep it again, it will give us duplicate value
2016
  */
 
2017
  if (button == 'initial-keep') {
2018
  currentFeed.temproraryUsersData[i] = currentFeed.usersData[i];
2019
  }
2020
  currentFeed['usersData'][i] = response;
 
2021
  currentFeed.loadMoreDataCount--;
2022
  }
2023
  }
 
 
2024
  wdi_front.checkForLoadMoreDone(currentFeed, button);
2025
  };
2026
+ if (user.username[0] !== "#") {
 
2027
  currentFeed.instagram.requestByUrl(next_url, {
2028
  success: success_function
2029
  });
2030
+ }
2031
+ else {
2032
+ currentFeed.instagram.getTagRecentMedia(user.username, {
2033
+ success: success_function
2034
+ },
2035
+ next_url,
2036
+ currentFeed.feed_row.hashtag_top_recent
2037
+ )
2038
  }
2039
  }
2040
 
2041
+
2042
  wdi_front.checkForLoadMoreDone = function (currentFeed, button)
2043
  {
2044
  var load_more_number = currentFeed.feed_row['load_more_number'];
2176
  feed_container.find('.wdi_spinner').removeClass('wdi_hidden');
2177
  }
2178
  /////////////////////////////////////////////////////
 
 
 
 
 
 
 
 
 
 
2179
  }
2180
 
2181
  //if all images loaded then clicking load more causes it's removal
2182
+ wdi_front.allImagesLoaded = function (currentFeed) {
 
 
 
 
 
 
2183
  var dataLength = wdi_front.getDataLength(currentFeed);
2184
  /*if there was no request for media, we do not know yet of feed data has been finished or not*/
2185
  if(! currentFeed.mediaRequestsDone){
2198
  feed_container.find('.wdi_load_more').removeClass('wdi_hidden');
2199
  feed_container.find('.wdi_spinner').addClass('wdi_hidden');
2200
  }
 
 
 
 
2201
  //custom event fired for user based custom js
2202
  feed_container.trigger('wdi_feed_loaded');
2203
  }
2213
  break;
2214
  }
2215
  case 'users': {
2216
+ /* @ToDo API Changes 2020 */
2217
+ /* show_users(currentFeed); */
2218
  break;
2219
  }
2220
  }
2221
 
2222
  function show_header() {
2223
  var templateData = {
2224
+ 'feed_thumb': currentFeed['feed_row']['feed_thumb'],
2225
  'feed_name': currentFeed['feed_row']['feed_name'],
2226
  };
2227
 
2228
  var headerTemplate = wdi_front.getHeaderTemplate(),
2229
  html = headerTemplate(templateData),
2230
  containerHtml = feed_container.find('.wdi_feed_header').html();
2231
+ feed_container.find('.wdi_feed_header').html(containerHtml + html);
2232
  }
2233
 
2234
  function show_users(currentFeed) {
2256
  wdi_front.show_alert(false, response, currentFeed);
2257
  }
2258
  response = _this.checkMediaResponse(response, currentFeed);
2259
+ // @ToDo free There is a difference in free!
2260
+ if (response != false) {
 
 
 
 
 
 
 
 
2261
  var obj = {
2262
  id: response['data']['id'],
2263
  name: response['data']['username'],
2477
  wdi_front.getHeaderTemplate = function ()
2478
  {
2479
  var source = '<div class="wdi_header_wrapper">' +
2480
+ '<div class="wdi_header_img_wrap">' +
2481
+ '<img src="<%=feed_thumb%>">' +
2482
+ '</div>' +
2483
  '<div class="wdi_header_text"><%=feed_name%></div>' +
2484
  '<div class="wdi_clear">' +
2485
  '</div>';
2683
  wdi_front.getFileType = function (data)
2684
  {
2685
  /*if pure video, not carousel*/
2686
+ //@ToDo old if (data['type'] == 'video' && data.hasOwnProperty('videos')) {
2687
  if (data['media_type'] == 'VIDEO' && data.hasOwnProperty('videos')) {
2688
  return "EMBED_OEMBED_INSTAGRAM_VIDEO";
2689
  }
2919
  */
2920
  WDIFeed.prototype.conditionalFilter = function (response, args)
2921
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2922
  return response;
2923
  }
2924
 
2984
  */
2985
  WDIFeed.prototype.applyNORLogic = function (response, filters)
2986
  {
 
2987
  var res = response,
2988
  currentFeed = this,
2989
  matchedData = this.applyORLogic(response, filters, currentFeed),
3025
  */
3026
  WDIFeed.prototype.filterResponse = function (response, filter)
3027
  {
 
3028
  switch (filter.filter_type) {
3029
  case 'hashtag':
3030
  {
3066
  * @param {Object} filter [hashtag filter object]
3067
  * @return {Object} [filtered response]
3068
  */
3069
+
3070
+
3071
  WDIFeed.prototype.filterByHashtag = function (response, filter)
3072
  {
3073
  var filteredResponse = [],
3074
  currentTag,
3075
  media,
3076
  returnObject;
 
3077
  for (var i = 0; i < response['data'].length; i++) {
3078
  media = response['data'][i];
3079
+
3080
+ if(typeof media['tags'] == 'undefined' ) {
3081
+ continue;
3082
+ }
3083
  for (var j = 0; j < media['tags'].length; j++) {
3084
  tag = media['tags'][j];
3085
  var tag1 = tag.toLowerCase();
3494
  }
3495
 
3496
 
3497
+ jQuery(document).ready(function () {
3498
+ setTimeout(function(){
3499
+ if(wdi_front_messages.show_alerts === '1' && jQuery('.wdi_check_fontawesome .tenweb-i-instagram').prop("tagName") !== 'I'){
3500
+ console.log('Font Awesome is not loaded properly. Please ask for support https://wordpress.org/support/plugin/wd-instagram-feed/');
3501
+ }
3502
+ }, 2000);
3503
+ });
3504
+
3505
  function wdi_extractHostname(url) {
3506
  if(typeof url === "undefined" || url===""){
3507
  return "";
js/wdi_frontend.min.js CHANGED
@@ -1 +1 @@
1
- "undefined"==typeof wdi_front&&(wdi_front={type:"not_declared"});var wdi_error_show=!(wdi_front.detectEvent=function(){return/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())?"touchend":"click"});function wdi_baseName(e){var t=e.substr(e.lastIndexOf("/"));return e.replace(t,"")}wdi_front.escape_tags=function(e){return void 0===e&&(e=""),e=e.toString().replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&#34;")},wdi_front.show_alert=function(e,t,i){var r,a,d;i=jQuery("#wdi_feed_"+i.feed_row.wdi_feed_counter),400===t.meta.code&&"APINotAllowedError"===t.meta.error_type&&(void 0!==t.wdi_current_feed_name&&(r=t.wdi_current_feed_name,i.find(".wdi_private_feed_names").html(r),i.find(".wdi_private_feed_error").removeClass("wdi_hidden")),i.find(".wdi_spinner").remove()),void 0!==i&&"APINotAllowedError"!=t.meta.error_type&&(i.find(".wdi_spinner").remove(),wdi_error_show=!0,a=i.find(".wdi_js_error"),d=i.find(".wdi_token_error"),0!=t&&null!=typeof t.meta&&"OAuthAccessTokenException"===t.meta.error_type?(d.removeClass("wdi_hidden"),"1"!=wdi_front_messages.wdi_token_error_flag&&jQuery.ajax({type:"POST",url:wdi_url.ajax_url,dataType:"json",data:{action:"wdi_token_flag",wdi_token_flag_nonce:wdi_front_messages.wdi_token_flag_nonce},success:function(e){}})):(a.removeClass("wdi_js_error"),a.addClass("wdi_js_error_no_animate"),jQuery(".wdi_js_error_no_animate").show()),wdi_front_messages.show_alerts||console.log("%c"+e,"color:#cc0000;")),wdi_error_show=!0},wdi_front.globalInit=function(){var e=wdi_front.feed_counter,t=0;void 0!==wdi_ajax.ajax_response&&(t=wdi_feed_counter_init.wdi_feed_counter_init);for(var i,r=t;r<=e;r++){0!==jQuery("#wdi_feed_"+r).length&&((i=new WDIFeed(window["wdi_feed_"+r])).instagram=new WDIInstagram,i.instagram.filterArguments={feed:i},i.instagram.filters=[{where:"getUserRecentMedia",what:function(e,t,i){return t.feed.conditionalFilter(e,i)}},{where:"getUserMedia",what:function(e,t,i){return t.feed.conditionalFilter(e,i)}},{where:"getTagRecentMedia",what:function(e,t,i){return t.feed.conditionalFilter(e,i)}},{where:"getRecentLikedMedia",what:function(e,t,i){return t.feed.conditionalFilter(e,i)}},{where:"requestByUrl",what:function(e,t,i){return t.feed.conditionalFilter(e,i)}}],i.instagram.addToken(i.feed_row.access_token),wdi_front.access_token=i.feed_row.access_token,i.dataStorageRaw=[],i.dataStorage=[],i.dataStorageList=[],i.allResponseLength=0,i.currentResponseLength=0,i.temproraryUsersData=[],i.removedUsers=0,i.nowLoadingImages=!0,i.imageIndex=0,i.resIndex=0,i.currentPage=1,i.userSortFlags=[],i.customFilterChanged=!1,i.maxConditionalFiltersRequestCount=10,i.instagramRequestCounter=0,i.mediaRequestsDone=!1,i.conditionalFilterBuffer=[],i.stopInfiniteScrollFlag=!1,"masonry"==i.feed_row.feed_type&&(i.displayedData=[]),"pagination"==i.feed_row.feed_display_view?(i.feed_row.resort_after_load_more=0,"image_browser"!=i.feed_row.feed_type?(i.feed_row.load_more_number=parseInt(i.feed_row.pagination_per_page_number),i.feed_row.number_of_photos=(1+parseInt(i.feed_row.pagination_preload_number))*i.feed_row.load_more_number):(i.feed_row.number_of_photos=1+parseInt(i.feed_row.image_browser_preload_number),i.feed_row.load_more_number=parseInt(i.feed_row.image_browser_load_number)),i.freeSpaces=(Math.floor(i.feed_row.pagination_per_page_number/i.feed_row.number_of_columns)+1)*i.feed_row.number_of_columns-i.feed_row.pagination_per_page_number):i.freeSpaces=0,i.galleryBox=function(e){wdi_spider_createpopup(wdi_url.ajax_url+"?gallery_id="+this.feed_row.id+"&image_id="+e,this.feed_row.wdi_feed_counter,this.feed_row.lightbox_width,this.feed_row.lightbox_height,1,"testpopup",5,this,e)},wdi_responsive.columnControl(i),"masonry"==i.feed_row.feed_type&&jQuery(window).trigger("resize"),wdi_front.bindEvents(i),window["wdi_feed_"+r]=i,wdi_front.init(i))}},wdi_front.init=function(e){if(jQuery(".wdi_js_error").hide(),e.photoCounter=e.feed_row.number_of_photos,"liked"==e.feed_row.liked_feed)e.feed_users=["self"];else{if(!wdi_front.isJsonString(e.feed_row.feed_users))return void wdi_front.show_alert(wdi_front_messages.invalid_users_format,!1,e);e.feed_users=JSON.parse(e.feed_row.feed_users)}var t=[];void 0!==window.wdi_all_tags&&(t=window.wdi_all_tags);for(var i=0;i<e.feed_users.length;i++)"#"===e.feed_users[i].username[0]&&void 0!==e.feed_users[i].tag_id&&(t[e.feed_users[i].tag_id]=e.feed_users[i]);window.wdi_all_tags=t,e.dataCount=e.feed_users.length;var r=wdi_front.getFeedItemResolution(e);e.feedImageResolution=r.image,e.feedVideoResolution=r.video;for(var a=0;a<e.dataCount;a++)wdi_front.instagramRequest(a,e);0<e.feed_row.number_of_photos&&wdi_front.ajaxLoader(e),"1"===e.feed_row.display_header&&wdi_front.show("header",e),"1"===e.feed_row.show_usernames&&wdi_front.show("users",e)},wdi_front.getFeedItemResolution=function(e){var t={image:"standard_resolution",video:"standard_resolution"};if("thumbnail"===e.feed_row.feed_resolution)return{image:"thumbnail",video:"low_bandwidth"};if("low"===e.feed_row.feed_resolution)return{image:"low_resolution",video:"low_resolution"};if("standard"===e.feed_row.feed_resolution)return{image:"standard_resolution",video:"standard_resolution"};var i=jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter).find(".wdi_feed_wrapper");i.append('<div class="wdi_feed_item" id="wdi_feed_item_example"></div>'),wdi_responsive.columnControl(e,1);var r=i.attr("wdi-res").split("wdi_col_");if(i.find("#wdi_feed_item_example").remove(),2!==r.length)return t;var a=parseInt(r[1]);if(a<=0)return t;var d=i.width()/a-10,o=t;return d<=150?(o.image="thumbnail",o.video="low_bandwidth"):150<d&&d<=320?(o.image="low_resolution",o.video="low_resolution"):(o.image="standard_resolution",o.video="standard_resolution"),o},wdi_front.isJsonString=function(e){try{JSON.parse(e)}catch(e){return!1}return!0},wdi_front.instagramRequest=function(t,i){var r=this,a=i.feed_users;"string"==typeof a[t]&&"self"===a[t]?i.instagram.getRecentLikedMedia({success:function(e){void 0!==e.meta&&void 0!==e.meta.error_type&&wdi_front.show_alert(!1,e,i),i.mediaRequestsDone=!0,0!=(e=r.checkMediaResponse(e,i))&&r.saveSelfUserData(e,i)}}):"hashtag"==this.getInputType(a[t].username)?i.instagram.getTagRecentMedia(this.stripHashtag(a[t].username),{success:function(e){void 0!==e.meta&&void 0!==e.meta.error_type&&wdi_front.show_alert(!1,e,i),i.mediaRequestsDone=!0,0!=(e=r.checkMediaResponse(e,i))&&r.saveUserData(e,i.feed_users[t],i)}},null,i.feed_row.hashtag_top_recent):"user"==this.getInputType(a[t].username)&&i.instagram.getUserMedia({user_id:a[t].id,success:function(e){void 0!==e.meta&&void 0!==e.meta.error_type&&(e.wdi_current_feed_name=a[t].username,wdi_front.show_alert(!1,e,i)),i.mediaRequestsDone=!0,0!=(e=r.checkMediaResponse(e,i))&&r.saveUserData(e,i.feed_users[t],i)}})},wdi_front.isHashtag=function(e){return"#"===e[0]},wdi_front.saveUserData=function(e,t,i){var r;e.username=t.username,e.user_id=t.id,"#"===e.user_id[0]&&(e.data=wdi_front.appendRequestHashtag(e.data,e.user_id)),i.usersData.push(e),i.currentResponseLength=wdi_front.getArrayContentLength(i.usersData,"data"),i.allResponseLength+=i.currentResponseLength,i.dataCount==i.usersData.length&&(i.currentResponseLength<i.feed_row.number_of_photos&&!wdi_front.userHasNoPhoto(i)?wdi_front.loadMore("initial-keep",i):(wdi_front.displayFeed(i),wdi_front.applyFilters(i),wdi_front.activeUsersCount(i)||"load_more_btn"==i.feed_row.feed_display_view&&((r=jQuery("#wdi_feed_"+i.feed_row.wdi_feed_counter)).find(".wdi_load_more").addClass("wdi_hidden"),r.find(".wdi_spinner").addClass("wdi_hidden"))))},wdi_front.saveSelfUserData=function(e,t){var i;e.user_id="",e.username="",t.usersData.push(e),t.currentResponseLength=wdi_front.getArrayContentLength(t.usersData,"data"),t.allResponseLength+=t.currentResponseLength,t.dataCount==t.usersData.length&&(t.currentResponseLength<t.feed_row.number_of_photos&&!wdi_front.userHasNoPhoto(t)?wdi_front.loadMore("initial-keep",t):(wdi_front.displayFeed(t),wdi_front.applyFilters(t),wdi_front.activeUsersCount(t)||"load_more_btn"==t.feed_row.feed_display_view&&((i=jQuery("#wdi_feed_"+t.feed_row.wdi_feed_counter)).find(".wdi_load_more").addClass("wdi_hidden"),i.find(".wdi_spinner").addClass("wdi_hidden"))))},wdi_front.userHasNoPhoto=function(e,t){var i=0,r=e.usersData;void 0!==t&&(r=t);for(var a=0;a<r.length;a++)void 0===r[a].pagination&&(r[a].pagination=[]),"liked"===e.feed_row.liked_feed?void 0===r[a].pagination.next_max_like_id&&i++:void 0===r[a].pagination.next_max_id&&i++;return i==r.length?1:0},wdi_front.appendRequestHashtag=function(e,t){for(var i=0;i<e.length;i++)e[i].wdi_hashtag=t;return e},wdi_front.displayFeed=function(e,t){0==e.customFilterChanged&&(i=wdi_front.feedSort(e,t));var i,r=e.customFilterChanged;1==e.customFilterChanged&&(i=e.customFilteredData,e.parsedData=wdi_front.parseLighboxData(e,!0)),"1"!=e.feed_row.resort_after_load_more?0==e.customFilterChanged&&(e.dataStorageList=e.dataStorageList.concat(i)):0==e.customFilterChanged&&(e.dataStorageList=i),"masonry"==e.feed_row.feed_type&&wdi_front.masonryDisplayFeedItems(i,e),"thumbnails"!=e.feed_row.feed_type&&"blog_style"!=e.feed_row.feed_type&&"image_browser"!=e.feed_row.feed_type||wdi_front.displayFeedItems(i,e),wdi_front.getDataLength(e)<e.photoCounter&&!r&&e.instagramRequestCounter<=e.maxConditionalFiltersRequestCount&&!wdi_front.allDataHasFinished(e)?wdi_front.loadMore("",e):wdi_front.allImagesLoaded(e),e.instagramRequestCounter>e.maxConditionalFiltersRequestCount&&(wdi_front.allImagesLoaded(e),0==i.length&&(e.stopInfiniteScrollFlag=!0)),"pagination"==e.feed_row.feed_display_view&&e.currentPage<e.paginator&&jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter).find("#wdi_last_page").removeClass("wdi_disabled"),e.instagramRequestCounter=0,e.conditionalFilterBuffer=[],wdi_front.updateUsersImages(e)},wdi_front.updateUsersImages=function(t){jQuery("#wdi_feed_"+t.feed_row.wdi_feed_counter).find(".wdi_single_user .wdi_user_img_wrap img").each(function(){if(jQuery(this).attr("src")==wdi_url.plugin_url+"images/missing.png"||""==jQuery(this).attr("src")){if("liked"==t.feed_row.liked_feed)return;for(var e=0;e<t.usersData.length;e++)t.usersData[e].username==jQuery(this).parent().parent().find("h3").text()&&0!=t.usersData[e].data.length&&jQuery(this).attr("src",t.usersData[e].data[0].images.thumbnail.url)}})},wdi_front.masonryDisplayFeedItems=function(e,t){var i=[],r=[];if(0!=jQuery("#wdi_feed_"+t.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").length){jQuery("#wdi_feed_"+t.feed_row.wdi_feed_counter+" .wdi_masonry_column").each(function(){1==t.feed_row.resort_after_load_more&&(jQuery(this).html(""),t.imageIndex=0),1==t.customFilterChanged&&(jQuery(this).html(""),t.imageIndex=0),"pagination"==t.feed_row.feed_display_view?i.push(0):i.push(jQuery(this).height()),r.push(jQuery(this))}),1==t.customFilterChanged&&(t.customFilterChanged=!1);for(var a,d,o,n,s,_=0;_<e.length;_++){"object"==typeof e[_].videos&&null==e[_].videos.standard_resolution||(t.displayedData.push(e[_]),a="image"==e[_].type?wdi_front.getPhotoTemplate(t):e[_].hasOwnProperty("videos")||"video"==e[_].type?wdi_front.getVideoTemplate(t):wdi_front.getSliderTemplate(t),d=e[_],o=a(wdi_front.createObject(d,t)),n=wdi_front.array_min(i),s=wdi_front.getImageResolution(e[_]),r[n.index].html(r[n.index].html()+o),i[n.index]+=r[n.index].width()*s,t.imageIndex++,"pagination"==t.feed_row.feed_display_view&&((_+1)%t.feed_row.pagination_per_page_number==0?t.resIndex+=t.freeSpaces+1:t.resIndex++))}t.wdi_loadedImages=0;var f=!1;t.wdi_load_count=_;var l=t.feed_row.wdi_feed_counter;jQuery("#wdi_feed_"+l+" img.wdi_img").on("load",function(){t.wdi_loadedImages++,w(),!1===f&&(wdi_responsive.columnControl(t,1),f=!0)});w(),1==t.paginatorNextFlag&&wdi_front.updatePagination(t,"next"),t.infiniteScrollFlag=!1}function w(){t.wdi_load_count===t.wdi_loadedImages&&0!=t.wdi_loadedImages&&(t.loadedImages=0,t.wdi_load_count=0,wdi_front.allImagesLoaded(t))}},wdi_front.getImageResolution=function(e){var t=e.images.standard_resolution.width;return e.images.standard_resolution.height/t},wdi_front.getDataLength=function(e,t){var i=0;if(void 0===t)for(var r=0;r<e.dataStorage.length;r++)i+=e.dataStorage[r].length;else for(r=0;r<t.length;r++)i+=t[r].length;return i},wdi_front.getArrayContentLength=function(e,t){for(var i=0,r=0;r<e.length;r++)"finished"!=e[r].finished&&(i+=e[r][t].length);return i},wdi_front.displayFeedItems=function(e,t){if(0!=jQuery("#wdi_feed_"+t.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").length){var i=t.feed_row.wdi_feed_counter,r=jQuery("#wdi_feed_"+i+" .wdi_feed_wrapper");"1"===t.feed_row.resort_after_load_more&&(r.html(""),t.imageIndex=0),1==t.customFilterChanged&&(r.html(""),t.imageIndex=0,t.customFilterChanged=!1);var a;wdi_front.getImgCount(t),e.length;"pagination"==t.feed_row.feed_display_view&&(a=t.feed_row.load_more_number,"image_browser"==t.feed_row.feed_type&&(a=1),(jQuery("#wdi_feed_"+t.feed_row.wdi_feed_counter+' [wdi_page="'+(t.currentPage-1)+'"]').length<a||0==e.length)&&(t.currentPage=--t.currentPage<=1?1:t.currentPage));for(var d,o,n,s=0;s<e.length;s++){"object"==typeof e[s].videos&&null==e[s].videos.standard_resolution||(d="image"==e[s].type?wdi_front.getPhotoTemplate(t):e[s].hasOwnProperty("videos")?wdi_front.getVideoTemplate(t):wdi_front.getSliderTemplate(t),o=e[s],n=d(wdi_front.createObject(o,t)),r.html(r.html()+n),t.imageIndex++,"pagination"==t.feed_row.feed_display_view&&((s+1)%t.feed_row.pagination_per_page_number==0?t.resIndex+=t.freeSpaces+1:t.resIndex++))}t.wdi_loadedImages=0;var _=!1;t.wdi_load_count=s;i=t.feed_row.wdi_feed_counter,r=jQuery("#wdi_feed_"+i+" img.wdi_img").on("load",function(){t.wdi_loadedImages++,t.wdi_load_count===t.wdi_loadedImages&&0!=t.wdi_loadedImages&&(t.loadedImages=0,t.wdi_load_count=0,wdi_front.allImagesLoaded(t)),!1===_&&(wdi_responsive.columnControl(t,1),_=!0)});1==t.paginatorNextFlag&&wdi_front.updatePagination(t,"next"),t.infiniteScrollFlag=!1}},wdi_front.checkFeedFinished=function(e){for(var t=0;t<e.usersData.length;t++)if(void 0===e.usersData[t].finished)return!1;return!0},wdi_front.sortingOperator=function(e,t){var i;switch(e){case"date":switch(t){case"asc":i=function(e,t){return e.created_time>t.created_time?1:-1};break;case"desc":i=function(e,t){return e.created_time>t.created_time?-1:1}}break;case"likes":switch(t){case"asc":i=function(e,t){return e.likes.count<t.likes.count?-1:1};break;case"desc":i=function(e,t){return e.likes.count<t.likes.count?1:-1}}break;case"comments":switch(t){case"asc":i=function(e,t){return e.comments.count<t.comments.count?-1:1};break;case"desc":i=function(e,t){return e.comments.count<t.comments.count?1:-1}}break;case"random":i=function(e,t){return.5<Math.random()?1:-1}}return i},wdi_front.feedSort=function(e,t){var i=e.feed_row.sort_images_by,r=e.feed_row.display_order;"1"===e.feed_row.resort_after_load_more?e.data=e.data.concat(wdi_front.smartPicker(e,t)):e.data=wdi_front.smartPicker(e,t);var a=wdi_front.sortingOperator(i,r);return e.data.sort(a),e.data},wdi_front.smartPicker=function(e,t){var i=[],r=0,a=[],d=Math.ceil(e.feed_row.number_of_photos/e.usersData.length),o=parseInt(e.feed_row.number_of_photos),n=0;""!=t&&void 0!==t&&null!=t&&(o=parseInt(t),d=Math.ceil(o/wdi_front.activeUsersCount(e)));e.storeRawData(e.usersData,"dataStorageRaw");for(var s,_=e.dataStorageRaw.sort(function(e,t){return e.length()>t.length()?1:-1}),f=e.usersData.sort(function(e,t){return e.data.length>t.data.length?1:-1}),l=0;l<f.length;l++){n+=d,_[l].length()<=n?(n-=_[l].length(),i.push(_[l].getData(_[l].length())),r+=i[i.length-1].length):(o<r+n&&(n=o-r),(!(s=[])===e.auto_trigger||s.length+wdi_front.getDataLength(e)+wdi_front.getDataLength(e,i)<e.feed_row.number_of_photos)&&(s=s.concat(_[l].getData(n))),n=0,r+=s.length,i.push(s))}for(l=0;l<i.length;l++)void 0===e.dataStorage[l]?e.dataStorage.push(i[l]):e.dataStorage[l]=e.dataStorage[l].concat(i[l]);for(e.parsedData=wdi_front.parseLighboxData(e),l=0;l<i.length;l++)a=a.concat(i[l]);return a},wdi_front.createObject=function(e,t){var i,r=null!=e.caption?e.caption.text:"&nbsp",a="";"video"==e.type&&e.videos[t.feedVideoResolution]&&null!=e.videos[t.feedVideoResolution].url&&(a=e.hasOwnProperty("videos")?e.videos[t.feedVideoResolution].url:""),i=void 0===e.images[t.feedImageResolution]?wdi_url.plugin_url+"images/missing.png":e.images[t.feedImageResolution].url;var d=t.imageIndex,o="square",n=e.images.standard_resolution.height,s=e.images.standard_resolution.width;s<n?o="portrait":n<s&&(o="landscape");var _=e.user.username;return""===_&&(_="no_user"),{id:e.id,caption:wdi_front.escape_tags(r),image_url:i,likes:e.likes.count,comments:e.comments.count,wdi_index:d,wdi_res_index:t.resIndex,wdi_media_user:_,link:e.link,video_url:a,wdi_username:_,wdi_shape:o}},wdi_front.setPage=function(e){var t=e.feed_row.feed_display_view,i=e.feed_row.feed_type;if("pagination"!=t)return"";var r,a=e.imageIndex;return r="image_browser"==i?1:Math.abs(e.feed_row.pagination_per_page_number),e.paginator=Math.ceil((a+1)/r),e.paginator},wdi_front.getPhotoTemplate=function(e){var t=wdi_front.setPage(e),i="",r="",a="",d="",o="tenweb-i-arrows-out",n="";"blog_style"!=e.feed_row.feed_type&&"image_browser"!=e.feed_row.feed_type||(o=""),sourceAttr=(""!=t&&(r='wdi_page="'+t+'"'),"src"),""!=t&&1!=t&&(i="wdi_hidden"),"1"==e.feed_row.show_username_on_thumb&&e.data.length&&""!==e.data[0].user.username&&(n='<span class="wdi_media_user">@<%= wdi_username%></span>'),1==e.feed_row.show_full_description&&"masonry"==e.feed_row.feed_type&&(i+=" wdi_full_caption");switch("blog_style"!==e.feed_row.feed_type&&("masonry"==e.feed_row.feed_type?e.feed_row.wdi_feed_counter:e.feed_row.wdi_feed_counter),e.feed_row.feed_item_onclick){case"lightbox":a="onclick=wdi_feed_"+e.feed_row.wdi_feed_counter+".galleryBox('<%=id%>')";break;case"instagram":a="onclick=\"window.open ('<%= link%>','_blank')\"",d="wdi_hover_off",o="";break;case"custom_redirect":a="onclick=\"window.open ('"+e.feed_row.redirect_url+"','_self')\"",d="wdi_hover_off",o="";break;case"none":d="wdi_cursor_off wdi_hover_off",o=a=""}var s='<div class="wdi_feed_item '+i+'" wdi_index=<%= wdi_index%> wdi_res_index=<%= wdi_res_index%> wdi_media_user=<%= wdi_media_user%> '+r+' wdi_type="image" id="wdi_'+e.feed_row.wdi_feed_counter+"_<%=id%>\"><div class=\"wdi_photo_wrap\"><div class=\"wdi_photo_wrap_inner\"><div class=\"wdi_photo_img <%= wdi_shape == 'square' ? 'wdi_shape_square' : (wdi_shape == 'portrait' ? 'wdi_shape_portrait' : (wdi_shape == 'landscape' ? 'wdi_shape_landscape' : 'wdi_shape_square') ) %>\"><img class=\"wdi_img\" "+sourceAttr+'="<%=image_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);"><div class="wdi_photo_overlay '+d+'" >'+n+'<div class="wdi_thumb_icon" '+a+' style="display:table;width:100%;height:100%;"><div style="display:table-cell;vertical-align:middle;text-align:center;color:white;"><i class="tenweb-i '+o+'"></i></div></div></div></div></div></div>';return"1"!==e.feed_row.show_likes&&"1"!==e.feed_row.show_comments&&"1"!==e.feed_row.show_description||(s+='<div class="wdi_photo_meta">'),s+="</div>",_.template(s)},wdi_front.getSliderTemplate=function(e){var t=wdi_front.setPage(e),i="",r="",a="",d="",o="tenweb-i-clone",n="";"blog_style"!=e.feed_row.feed_type&&"image_browser"!=e.feed_row.feed_type||(o=""),sourceAttr=(""!=t&&(r='wdi_page="'+t+'"'),"src"),""!=t&&1!=t&&(i="wdi_hidden"),"1"==e.feed_row.show_username_on_thumb&&e.data.length&&""!==e.data[0].user.username&&(n='<span class="wdi_media_user">@<%= wdi_username%></span>'),1==e.feed_row.show_full_description&&"masonry"==e.feed_row.feed_type&&(i+=" wdi_full_caption");switch("blog_style"!==e.feed_row.feed_type&&("masonry"==e.feed_row.feed_type?e.feed_row.wdi_feed_counter:e.feed_row.wdi_feed_counter),e.feed_row.feed_item_onclick){case"lightbox":a="onclick=wdi_feed_"+e.feed_row.wdi_feed_counter+".galleryBox('<%=id%>')";break;case"instagram":a="onclick=\"window.open ('<%= link%>','_blank')\"",d="wdi_hover_off",o="tenweb-i-clone";break;case"custom_redirect":a="onclick=\"window.open ('"+e.feed_row.redirect_url+"','_self')\"",d="wdi_hover_off",o="";break;case"none":d="wdi_cursor_off wdi_hover_off",o=a=""}var s='<div class="wdi_feed_item '+i+'" wdi_index=<%= wdi_index%> wdi_res_index=<%= wdi_res_index%> wdi_media_user=<%= wdi_media_user%> '+r+' wdi_type="slideshow" id="wdi_'+e.feed_row.wdi_feed_counter+"_<%=id%>\"><div class=\"wdi_photo_wrap\"><div class=\"wdi_photo_wrap_inner\"><div class=\"wdi_photo_img <%= wdi_shape == 'square' ? 'wdi_shape_square' : (wdi_shape == 'portrait' ? 'wdi_shape_portrait' : (wdi_shape == 'landscape' ? 'wdi_shape_landscape' : 'wdi_shape_square') ) %>\"><img class=\"wdi_img\" "+sourceAttr+'="<%=image_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);"><div class="wdi_photo_overlay '+d+'" >'+n+'<div class="wdi_thumb_icon" '+a+' style="display:table;width:100%;height:100%;"><div style="display:table-cell;vertical-align:middle;text-align:center;color:white;"><i class="tenweb-i '+o+'"></i></div></div></div></div></div></div>';return"1"!==e.feed_row.show_likes&&"1"!==e.feed_row.show_comments&&"1"!==e.feed_row.show_description||(s+='<div class="wdi_photo_meta">'),s+="</div>",_.template(s)},wdi_front.replaceToVideo=function(e,t,i){overlayHtml="<video style='width:auto !important; height:auto !important; max-width:100% !important; max-height:100% !important; margin:0 !important;' controls=''><source src='"+e+"' type='video/mp4'>Your browser does not support the video tag. </video>",jQuery("#wdi_feed_"+i+' [wdi_index="'+t+'"] .wdi_photo_wrap_inner').html(overlayHtml),jQuery("#wdi_feed_"+i+' [wdi_index="'+t+'"] .wdi_photo_wrap_inner video').get(0).play()},wdi_front.getVideoTemplate=function(e){var t=wdi_front.setPage(e),i="",r="",a="tenweb-i-play",d="",o="",n="",s=(""!=t&&(r='wdi_page="'+t+'"'),"src");""!=t&&1!=t&&(i="wdi_hidden"),"1"==e.feed_row.show_username_on_thumb&&e.data.length&&""!==e.data[0].user.username&&(n='<span class="wdi_media_user">@<%= wdi_username%></span>'),1==e.feed_row.show_full_description&&"masonry"==e.feed_row.feed_type&&(i+=" wdi_full_caption");switch("blog_style"!==e.feed_row.feed_type&&("masonry"==e.feed_row.feed_type?e.feed_row.wdi_feed_counter:e.feed_row.wdi_feed_counter),e.feed_row.feed_item_onclick){case"lightbox":d="onclick=wdi_feed_"+e.feed_row.wdi_feed_counter+".galleryBox('<%=id%>')";break;case"instagram":d="onclick=\"window.open ('<%= link%>','_blank')\"",o="wdi_hover_off",a="tenweb-i-play";break;case"custom_redirect":d="onclick=\"window.open ('"+e.feed_row.redirect_url+"','_self')\"",o="wdi_hover_off",a="";break;case"none":o="wdi_cursor_off wdi_hover_off",a="","blog_style"!=e.feed_row.feed_type&&"image_browser"!=e.feed_row.feed_type||(d="onclick=wdi_front.replaceToVideo('<%= video_url%>','<%= wdi_index%>',"+e.feed_row.wdi_feed_counter+")",o="",a="tenweb-i-play")}var f='<div class="wdi_feed_item '+i+'" wdi_index=<%= wdi_index%> wdi_res_index=<%= wdi_res_index%> wdi_media_user=<%= wdi_media_user%> '+r+' wdi_type="image" id="wdi_'+e.feed_row.wdi_feed_counter+"_<%=id%>\"><div class=\"wdi_photo_wrap\"><div class=\"wdi_photo_wrap_inner\"><div class=\"wdi_photo_img <%= wdi_shape == 'square' ? 'wdi_shape_square' : (wdi_shape == 'portrait' ? 'wdi_shape_portrait' : (wdi_shape == 'landscape' ? 'wdi_shape_landscape' : 'wdi_shape_square') ) %>\"><img class=\"wdi_img\" "+s+'="<%=image_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);"><div class="wdi_photo_overlay '+o+'" '+d+">"+n+'<div class="wdi_thumb_icon" style="display:table;width:100%;height:100%;"><div style="display:table-cell;vertical-align:middle;text-align:center;color:white;"><i class="tenweb-i '+a+'"></i></div></div></div></div></div></div>';return"1"!==e.feed_row.show_likes&&"1"!==e.feed_row.show_comments&&"1"!==e.feed_row.show_description||(f+='<div class="wdi_photo_meta">'),f+="</div>",_.template(f)},wdi_front.bindEvents=function(e){0!=jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").length&&("load_more_btn"==e.feed_row.feed_display_view&&jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" .wdi_load_more_container").on(wdi_front.clickOrTouch,function(){wdi_front.loadMore(jQuery(this).find(".wdi_load_more_wrap"))}),"pagination"==e.feed_row.feed_display_view&&(jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_next").on(wdi_front.clickOrTouch,function(){wdi_front.paginatorNext(jQuery(this),e)}),jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_prev").on(wdi_front.clickOrTouch,function(){wdi_front.paginatorPrev(jQuery(this),e)}),jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_last_page").on(wdi_front.clickOrTouch,function(){wdi_front.paginationLastPage(jQuery(this),e)}),jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_first_page").on(wdi_front.clickOrTouch,function(){wdi_front.paginationFirstPage(jQuery(this),e)}),e.paginatorNextFlag=!1),"infinite_scroll"==e.feed_row.feed_display_view&&(jQuery(window).on("scroll",function(){wdi_front.infiniteScroll(e)}),e.infiniteScrollFlag=!1))},wdi_front.infiniteScroll=function(e){jQuery(window).scrollTop()+jQuery(window).height()-100>=jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_infinite_scroll").offset().top&&(!1===e.infiniteScrollFlag&&0==e.stopInfiniteScrollFlag?(e.infiniteScrollFlag=!0,wdi_front.loadMore(jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_infinite_scroll"),e)):e.stopInfiniteScrollFlag&&wdi_front.allImagesLoaded(e))},wdi_front.paginationFirstPage=function(e,t){var i;1!=t.paginator&&1!=t.currentPage&&(i=t.currentPage,t.currentPage=1,wdi_front.updatePagination(t,"custom",i),e.parent().find("#wdi_last_page").removeClass("wdi_disabled")),e.addClass("wdi_disabled")},wdi_front.paginationLastPage=function(e,t){var i;1!=t.paginator&&t.currentPage!=t.paginator&&(i=t.currentPage,t.currentPage=t.paginator,wdi_front.updatePagination(t,"custom",i),e.addClass("wdi_disabled"),e.parent().find("#wdi_first_page").removeClass("wdi_disabled"))},wdi_front.paginatorNext=function(e,t){var i,r=e.parent().find("#wdi_last_page"),a=e.parent().find("#wdi_first_page");t.paginatorNextFlag=!0,t.paginator!=t.currentPage||wdi_front.checkFeedFinished(t)?t.paginator>t.currentPage&&(t.currentPage++,wdi_front.updatePagination(t,"next"),t.paginator>t.currentPage?r.removeClass("wdi_disabled"):r.addClass("wdi_disabled")):(t.currentPage++,i=t.feed_row.number_of_photos,wdi_front.loadMore(e,t,i),r.addClass("wdi_disabled")),a.removeClass("wdi_disabled")},wdi_front.paginatorPrev=function(e,t){var i=e.parent().find("#wdi_last_page"),r=e.parent().find("#wdi_first_page");1!=t.currentPage?(t.currentPage--,wdi_front.updatePagination(t,"prev"),i.removeClass("wdi_disabled"),1==t.currentPage&&r.addClass("wdi_disabled")):r.addClass("wdi_disabled")},wdi_front.updatePagination=function(e,t,i){var r="#wdi_feed_"+e.feed_row.wdi_feed_counter;switch(jQuery(r+' [wdi_page="'+e.currentPage+'"]').each(function(){jQuery(this).removeClass("wdi_hidden")}),t){case"next":var i=e.currentPage-1;jQuery(r+" .wdi_feed_wrapper").height(jQuery(".wdi_feed_wrapper").height()),jQuery(r+' [wdi_page="'+i+'"]').each(function(){jQuery(this).addClass("wdi_hidden")});break;case"prev":i=e.currentPage+1;jQuery(r+" .wdi_feed_wrapper").height(jQuery(".wdi_feed_wrapper").height()),jQuery(r+' [wdi_page="'+i+'"]').each(function(){jQuery(this).addClass("wdi_hidden")});break;case"custom":(i=i)!=e.currentPage&&(jQuery(r+" .wdi_feed_wrapper").height(jQuery(".wdi_feed_wrapper").height()),jQuery(r+' [wdi_page="'+i+'"]').each(function(){jQuery(this).addClass("wdi_hidden")}))}e.paginatorNextFlag=!1,jQuery(r+" .wdi_feed_wrapper").css("height","auto"),jQuery(r+" #wdi_current_page").text(e.currentPage)},wdi_front.loadMore=function(e,t){var i,r=0;""!=e&&void 0!==e&&"initial"!=e&&"initial-keep"!=e&&(i=window[e.parent().parent().parent().parent().attr("id")]),void 0!==t&&(i=t);for(var a=0,d=0,o=0;o<i.userSortFlags.length;o++)if(!0===i.userSortFlags[o].flag){a++;for(var n=0;n<i.usersData.length;n++)i.userSortFlags[o].id===i.usersData[n].user_id&&"finished"===i.usersData[n].finished&&d++}if(a!==d||0==a){i.auto_trigger=""===e,wdi_front.ajaxLoader(i),"masonry"===i.feed_row.feed_type&&"pagination"==i.feed_row.feed_display_view&&jQuery("#wdi_feed_"+wdi_front.feed_counter+" .wdi_full_caption").each(function(){jQuery(this).find(".wdi_photo_title").trigger(wdi_front.clickOrTouch)});for(o=0;o<i.usersData.length;o++)"finished"===i.usersData[o].finished&&r++;r===i.usersData.length&&(wdi_front.allImagesLoaded(i),jQuery("#wdi_feed_"+i.feed_row.wdi_feed_counter+" .wdi_load_more").remove());var s=i.usersData;i.loadMoreDataCount=i.feed_users.length;for(o=0;o<s.length;o++){var _,f=s[o].pagination,l={user_id:s[o].user_id,username:s[o].username};""!=f.next_url&&null!=f.next_url&&void 0!==f.next_url?(_=f.next_url,wdi_front.loadMoreRequest(l,_,i,e)):("initial-keep"==e&&(i.temproraryUsersData[o]=i.usersData[o]),i.loadMoreDataCount--,wdi_front.checkForLoadMoreDone(i,e))}}},wdi_front.loadMoreRequest=function(i,e,r,a){var d,t;r.mediaRequestsDone&&(r.usersData,d="",t=function(e){if(""===e||void 0===e||null==e)return d=wdi_front_messages.network_error,r.loadMoreDataCount--,void wdi_front.show_alert(d,e,r);if(void 0!==e.meta&&void 0!==e.meta.error_type&&wdi_front.show_alert(!1,e,r),void 0!==e.meta&&void 0!==e.meta.code&&200!=e.meta.code)return d=e.meta.error_message,r.loadMoreDataCount--,void wdi_front.show_alert(d,e,r);e.user_id=i.user_id,e.username=i.username;for(var t=0;t<r.usersData.length;t++)e.user_id===r.usersData[t].user_id&&("#"===e.user_id[0]&&(e.data=wdi_front.appendRequestHashtag(e.data,e.user_id)),"initial-keep"==a&&(r.temproraryUsersData[t]=r.usersData[t]),r.usersData[t]=e,r.loadMoreDataCount--);wdi_front.checkForLoadMoreDone(r,a)},"#"!==i.username[0]?r.instagram.requestByUrl(e,{success:t}):r.instagram.getTagRecentMedia(i.username,{success:t},e,r.feed_row.hashtag_top_recent))},wdi_front.checkForLoadMoreDone=function(e,t){var i=e.feed_row.load_more_number,r=e.feed_row.number_of_photos;if(0==e.loadMoreDataCount){e.temproraryUsersData=wdi_front.mergeData(e.temproraryUsersData,e.usersData);var a=wdi_front.getArrayContentLength(e.temproraryUsersData,"data");if("initial-keep"==t&&(t="initial"),"initial"==t)a<r&&!wdi_front.userHasNoPhoto(e,e.temproraryUsersData)&&e.instagramRequestCounter<=e.maxConditionalFiltersRequestCount?wdi_front.loadMore("initial",e):(e.usersData=e.temproraryUsersData,wdi_front.displayFeed(e),wdi_front.applyFilters(e),e.temproraryUsersData=[]);else if(a<i&&!wdi_front.userHasNoPhoto(e,e.temproraryUsersData)&&e.instagramRequestCounter<=e.maxConditionalFiltersRequestCount)wdi_front.loadMore(void 0,e);else{if(e.usersData=e.temproraryUsersData,!wdi_front.activeUsersCount(e))return;wdi_front.displayFeed(e,i),wdi_front.applyFilters(e),e.temproraryUsersData=[]}}},wdi_front.allDataHasFinished=function(e){for(var t=0,i=0;i<e.dataStorageRaw.length;i++)0==e.dataStorageRaw[i].length()&&1==e.dataStorageRaw[i].locked&&t++;return t==e.dataStorageRaw.length},wdi_front.mergeData=function(e,t){for(var i=0;i<t.length;i++)if(void 0!==e[i]){if("finished"==t[i].finished)continue;if(void 0===e[i].pagination.next_max_id&&void 0===e[i].pagination.next_max_like_id)continue;e[i].data=e[i].data.concat(t[i].data),e[i].pagination=t[i].pagination,e[i].user_id=t[i].user_id,e[i].username=t[i].username,e[i].meta=t[i].meta}else e.push(t[i]);return e},wdi_front.brokenImageHandler=function(e){var t,i=e.src.split("/p/");return void 0!==i[0]&&void 0!==i[1]&&"https://www.instagram.com"!==i[0]?(t=wdi_baseName(i[0])+"/p/"+i[1],e.src=t):e.src=wdi_url.plugin_url+"images/missing.png",!(e.onerror="")},wdi_front.ajaxLoader=function(e){var t,i=e.feed_row.wdi_feed_counter,r=jQuery("#wdi_feed_"+i);"load_more_btn"==e.feed_row.feed_display_view&&(r.find(".wdi_load_more").addClass("wdi_hidden"),r.find(".wdi_spinner").removeClass("wdi_hidden")),"infinite_scroll"==e.feed_row.feed_display_view&&(0==r.find(".wdi_ajax_loading").length?(t=jQuery('<div class="wdi_ajax_loading"><div><div><img class="wdi_load_more_spinner" src="'+wdi_url.plugin_url+'images/ajax_loader.png"></div></div></div>'),r.append(t)):t=r.find(".wdi_ajax_loading"),t.removeClass("wdi_hidden"))},wdi_front.allImagesLoaded=function(e){var t=wdi_front.getDataLength(e);e.mediaRequestsDone||jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").remove("wdi_nomedia"),0!=t||!e.mediaRequestsDone||0!=e.feed_row.conditional_filters.length&&0!=e.feed_row.conditional_filter_enable||jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").append("<p class='wdi_nomedia'>"+wdi_front_messages.feed_nomedia+"</p>");var i=e.feed_row.wdi_feed_counter,r=jQuery("#wdi_feed_"+i);"load_more_btn"==e.feed_row.feed_display_view&&(r.find(".wdi_load_more").removeClass("wdi_hidden"),r.find(".wdi_spinner").addClass("wdi_hidden")),"infinite_scroll"==e.feed_row.feed_display_view&&jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" .wdi_ajax_loading").addClass("wdi_hidden"),r.trigger("wdi_feed_loaded")},wdi_front.show=function(e,t){var i,r,a,d=t.feed_row.wdi_feed_counter,o=jQuery("#wdi_feed_"+d+" .wdi_feed_container");switch(e){case"header":i={feed_name:t.feed_row.feed_name},r=wdi_front.getHeaderTemplate()(i),a=o.find(".wdi_feed_header").html(),o.find(".wdi_feed_header").html(a+r)}},wdi_front.getUserTemplate=function(e,t){var i,r,a=e.dataCount;switch(t[0]){case"#":i="//instagram.com/explore/tags/"+t.substr(1,t.length);break;default:i="//instagram.com/"+t}r="onclick='"+('window.open("'+i+'","_blank")')+"'";var d='<div class="wdi_single_user" user_index="<%=user_index%>"><div class="wdi_header_user_text <%=hashtagClass%>"><div class="wdi_user_img_wrap"><img onerror="wdi_front.brokenImageHandler(this);" src="<%= user_img_url%>">';return 1<a&&(d+='<div title="'+wdi_front_messages.filter_title+'" class="wdi_filter_overlay"><div class="wdi_filter_icon"><span onclick="wdi_front.addFilter(<%=user_index%>,<%=feed_counter%>);" class="tenweb-i tenweb-i-filter"></span></div></div>'),d+="</div>",d+="<h3 "+r+"><%= user_name%></h3>","#"!==t[0]?("1"==e.feed_row.follow_on_instagram_btn&&(d+='<div class="wdi_user_controls"><div class="wdi_follow_btn" onclick="window.open(\'//instagram.com/<%= user_name%>\',\'_blank\')"><span> '+wdi_front_messages.follow+"</span></div></div>"),d+='<div class="wdi_media_info"><p class="wdi_posts"><span class="tenweb-i tenweb-i-camera-retro"></span><%= counts.media%></p><p class="wdi_followers"><span class="tenweb-i tenweb-i-user"></span><%= counts.followed_by%></p></div>'):d+='<div class="wdi_user_controls"></div><div class="wdi_media_info"><p class="wdi_posts"><span class="tenweb-i tenweb-i-camera-retro"></span><%= counts.media%></p><p class="wdi_followers"><span></span></p></div>',d+='<div class="wdi_clear"></div>',1==a&&"#"!==t[0]&&"1"==e.feed_row.display_user_info&&(d+='<div class="wdi_bio"><%= bio%></div>',d+='<div class="wdi_website"><a target="_blank" href="<%= website_url%>" ><%= website%></a></div>'),d+="</div></div>",_.template(d)},wdi_front.getHeaderTemplate=function(){return _.template('<div class="wdi_header_wrapper"><div class="wdi_header_text"><%=feed_name%></div><div class="wdi_clear"></div>')},wdi_front.addFilter=function(e,t){var i=window["wdi_feed_"+t];if(!(i.dataCount<2)&&0==i.nowLoadingImages){var r=jQuery("#wdi_feed_"+i.feed_row.wdi_feed_counter+'_users [user_index="'+e+'"]');r.find(".wdi_filter_overlay").toggleClass("wdi_filter_active_bg"),r.find(".wdi_header_user_text h3").toggleClass("wdi_filter_active_col"),r.find(".wdi_media_info").toggleClass("wdi_filter_active_col"),r.find(".wdi_follow_btn").toggleClass("wdi_filter_active_col"),i.customFilterChanged=!0,0==i.userSortFlags[e].flag?i.userSortFlags[e].flag=!0:i.userSortFlags[e].flag=!1;for(var a=0,d=0;d<i.userSortFlags.length;d++)1==i.userSortFlags[d].flag&&a++;"pagination"==i.feed_row.feed_display_view&&(i.resIndex=0),0!=a?wdi_front.filterData(i):i.customFilteredData=i.dataStorageList,wdi_front.displayFeed(i),"pagination"==i.feed_row.feed_display_view&&(i.paginator=Math.ceil(i.imageIndex/parseInt(i.feed_row.pagination_per_page_number)),i.currentPage=i.paginator,wdi_front.updatePagination(i,"custom",1),jQuery("#wdi_first_page").removeClass("wdi_disabled"),jQuery("#wdi_last_page").addClass("wdi_disabled"))}},wdi_front.filterData=function(e){var t=e.userSortFlags;e.customFilteredData=[];for(var i=0;i<e.dataStorageList.length;i++)for(var r=0;r<t.length;r++)(void 0!==e.dataStorageList[i].user.id&&e.dataStorageList[i].user.id==t[r].id||e.dataStorageList[i].wdi_hashtag==t[r].name)&&1==t[r].flag&&e.customFilteredData.push(e.dataStorageList[i])},wdi_front.applyFilters=function(e){for(var t=0;t<e.userSortFlags.length;t++){1==e.userSortFlags[t].flag&&(jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+'[user_index="'+t+'"]'),wdi_front.addFilter(t,e.feed_row.wdi_feed_counter),wdi_front.addFilter(t,e.feed_row.wdi_feed_counter))}},wdi_front.getImgCount=function(e){for(var t=e.dataStorage,i=0,r=0;r<t.length;r++)i+=t[r].length;return i},wdi_front.parseLighboxData=function(e,t){var i=e.dataStorage,r=e.feed_row.sort_images_by,a=e.feed_row.display_order,d=wdi_front.sortingOperator(r,a),o=[],n=[],s={};if(1==t)o=e.customFilteredData;else{for(var _=0;_<i.length;_++)for(var f=0;f<i[_].length;f++)o.push(i[_][f]);o.sort(d)}for(_=0;_<o.length;_++)s={alt:"",avg_rating:"",comment_count:o[_].comments.count,date:wdi_front.convertUnixDate(o[_].created_time),description:wdi_front.getDescription(null!==o[_].caption?wdi_front.escape_tags(o[_].caption.text):""),filename:wdi_front.getFileName(o[_]),filetype:wdi_front.getFileType(o[_]),hit_count:"0",id:o[_].id,image_url:o[_].link,number:0,rate:"",rate_count:"0",username:o[_].user.username,profile_picture:o[_].user.profile_picture,thumb_url:o[_].link+"media/?size=t",comments_data:o[_].comments.data,images:o[_].images,carousel_media:void 0!==o[_].carousel_media?o[_].carousel_media:null},n.push(s);return n},wdi_front.convertUnixDate=function(e){var t=parseInt(e),i=new Date(0);i.setUTCSeconds(t);var r=i.getFullYear()+"-"+i.getMonth()+"-"+i.getDate();return r+=" "+i.getHours()+":"+i.getMinutes()},wdi_front.getDescription=function(e){return e=e.replace(/\r?\n|\r/g," ")},wdi_front.getFileName=function(e){var t=e.link;if("video"===e.type&&e.hasOwnProperty("videos")&&null!=e.videos.standard_resolution)return e.videos.standard_resolution.url;var i=t.split("/");return i[i.length-2]},wdi_front.getFileType=function(e){return"VIDEO"==e.media_type&&e.hasOwnProperty("videos")?"EMBED_OEMBED_INSTAGRAM_VIDEO":"EMBED_OEMBED_INSTAGRAM_IMAGE"},wdi_front.array_max=function(e){for(var t=e[0],i=0,r=1;r<e.length;r++)t<e[r]&&(t=e[r],i=r);return{value:t,index:i}},wdi_front.array_min=function(e){for(var t=e[0],i=0,r=1;r<e.length;r++)t>e[r]&&(t=e[r],i=r);return{value:t,index:i}},wdi_front.activeUsersCount=function(e){for(var t=0,i=0;i<e.usersData.length;i++)"finished"!=e.usersData[i].finished&&t++;return t},wdi_front.checkMediaResponse=function(e,t){return""==e||void 0===e||null==e?(errorMessage=wdi_front_messages.connection_error,wdi_front.show_alert(errorMessage,e,t),!1):""!=e&&void 0!==e&&null!=e&&200!=e.meta.code?(errorMessage=e.meta.error_message,wdi_front.show_alert(errorMessage,e,t),!1):e},wdi_front.stripHashtag=function(e){switch(e[0]){case"#":return e.substr(1,e.length);default:return e}},wdi_front.getInputType=function(e){switch(e[0]){case"#":return"hashtag";case"%":return"location";default:return"user"}},wdi_front.regexpTestCaption=function(e,t){var i=!1,r=!1,a=t.replace(/[-[\]{}()*+?.,\\^$|]/g,"\\$&"),d=new RegExp("(?:^|\\s)"+a+"(?:^|\\s)"),o=new RegExp("(?:^|\\s)"+a,"g");for(null!=d.exec(e)&&(i=!0);null!=(match=o.exec(e));)r=!0;return 1==i||1==r},wdi_front.replaceNewLines=function(e){var t,i="vUkCJvN2ps3t",r=[];for(e=e.replace(/\r?\n|\r/g,i),t=new RegExp(i,"g");null!=(match=t.exec(e));)r.push(match.index);for(var a=e.split(i),d=0,o=0;o<a.length;o++)""==a[o]?d++:d=0,0<d&&(a.splice(o,1),d--,o--);return e=a.join(" ")},wdi_front.isEmptyObject=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0};var WDIFeed=function(e){this.data=e.data,this.dataCount=e.dataCount,this.feed_row=e.feed_row,this.usersData=e.usersData,(_this=this).set_images_loading_flag=function(e){window.addEventListener("load",function(){e.nowLoadingImages=!1})},this.set_images_loading_flag(_this)};function wdi_extractHostname(e){return void 0===e||""===e?"":e.replace(/(^\w+:|^)\/\//,"")}WDIFeed.prototype.conditionalFilter=function(e,t){var i=this,r=i.feed_row.conditional_filter_type,a=i.feed_row.conditional_filters;if(1==t.ignoreFiltering||(e=this.avoidDuplicateMedia(e)),!wdi_front.isJsonString(a))return e;if(0==(a=JSON.parse(a)).length)return e;if("0"==i.feed_row.conditional_filter_enable)return e;switch(i.instagramRequestCounter++,r){case"AND":e=this.applyANDLogic(e,a,i);break;case"OR":e=this.applyORLogic(e,a,i);break;case"NOR":e=this.applyNORLogic(e,a,i)}return e},WDIFeed.prototype.applyANDLogic=function(e,t){for(var i=0;i<t.length;i++)e=this.filterResponse(e,t[i]);return e},WDIFeed.prototype.applyORLogic=function(e,t){for(var i,r,a=[],d=[],o=0;o<t.length;o++)i=this.filterResponse(e,t[o]),a=a.concat(i.data),i={};for(o=0;o<a.length;o++)r=a[o],this.mediaExists(r,d)||this.mediaExists(r,this.dataStorageList)||d.push(r);return{data:d,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.applyNORLogic=function(e,t){for(var i=e,r=this.applyORLogic(e,t,this),a=[],d=0;d<i.data.length;d++)this.mediaExists(i.data[d],r.data)||a.push(i.data[d]);return{data:a,meta:i.meta,pagination:i.pagination}},WDIFeed.prototype.mediaExists=function(e,t){for(var i=0;i<t.length;i++)if(e.id==t[i].id)return!0;return!1},WDIFeed.prototype.filterResponse=function(e,t){switch(t.filter_type){case"hashtag":return this.filterByHashtag(e,t);case"username":return this.filterByUsername(e,t);case"mention":return this.filterByMention(e,t);case"description":return this.filterByDescription(e,t);case"location":return this.filterByLocation(e,t);case"url":return this.filterByUrl(e,t)}},WDIFeed.prototype.filterByHashtag=function(e,t){for(var i,r=[],a=0;a<e.data.length;a++){i=e.data[a];for(var d=0;d<i.tags.length;d++){tag=i.tags[d];var o=tag.toLowerCase(),n=t.filter_by.toLowerCase();o.trim()==n.trim()&&r.push(i)}}return{data:r,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByUsername=function(e,t){for(var i,r=[],a=0;a<e.data.length;a++)(i=e.data[a]).user.username.toLowerCase()==t.filter_by.toLowerCase()&&r.push(i);return{data:r,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByMention=function(e,t){for(var i,r=[],a=0;a<e.data.length;a++)null!==(i=e.data[a]).caption&&-1!=i.caption.text.toLowerCase().indexOf("@"+t.filter_by.toLowerCase())&&r.push(i);return{data:r,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByDescription=function(e,t){for(var i,r,a,d=[],o=0;o<e.data.length;o++){null!==(a=e.data[o]).caption&&(i=a.caption.text.toLowerCase(),i=wdi_front.replaceNewLines(i),r=t.filter_by.toLowerCase(),wdi_front.regexpTestCaption(i,r)&&d.push(a))}return{data:d,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByLocation=function(e,t){for(var i,r=[],a=0;a<e.data.length;a++)null!==(i=e.data[a]).location&&i.location.id==t.filter_by&&r.push(i);return{data:r,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByUrl=function(e,t){var i,r=[];t.filter_by=this.getIdFromUrl(t.filter_by);for(var a=0;a<e.data.length;a++)null!==(i=e.data[a]).link&&this.getIdFromUrl(i.link)==t.filter_by&&r.push(i);return{data:r,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.getIdFromUrl=function(e){for(var t=e.split("/"),i=!1,r=0;r<t.length;r++)if("p"==t[r]&&void 0!==t[r+1]){i=t[r+1];break}return i},WDIFeed.prototype.avoidDuplicateMedia=function(e){var t=e.data,i=[];void 0===t&&(t=[]);for(var r=0;r<t.length;r++)this.mediaExists(t[r],this.dataStorageList)||this.mediaExists(t[r],i)||this.mediaExists(t[r],this.conditionalFilterBuffer)||i.push(t[r]);return this.conditionalFilterBuffer=this.conditionalFilterBuffer.concat(i),{data:i,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.storeRawData=function(e,t){var r=this;if("object"==typeof this[t]&&"number"==typeof this[t].length)for(var i=0;i<e.length;i++){var a="";wdi_front.isHashtag(e[i].user_id)?void 0!==e[i].pagination.cursors&&(a=e[i].pagination.cursors.after):"liked"==r.feed_row.liked_feed?void 0===(a=e[i].pagination.next_max_like_id)&&(a=""):(null==e[i].pagination&&(e[i].pagination=[]),void 0===(a=e[i].pagination.next_max_id)&&(a="")),void 0===this[t][i]?this[t].push({data:e[i].data,index:0,locked:!1,hash_id:a,usersDataFinished:!1,userId:e[i].user_id,length:function(){return this.data.length-this.index},getData:function(e){var t=this.data.slice(this.index,this.index+e);if(this.index+=Math.min(e,this.length()),this.index==this.data.length&&1==this.locked&&0==this.usersDataFinished)for(var i=0;i<r.usersData.length;i++)if(r.usersData[i].user_id==this.userId){r.usersData[i].finished="finished",this.usersDataFinished=!0;break}return t}}):0==this[t][i].locked&&(a!=this[t][i].hash_id?(this[t][i].data=this[t][i].data.concat(e[i].data),this[t][i].hash_id=a):this[t][i].locked=!0)}},wdi_front.updateUsersIfNecessary=function(o){for(var n=o.feed_users,e=!1,t=0;t<n.length;t++)"#"!=n[t].username.substr(0,1)?""!=n[t].id&&"username"!=n[t].id||(e=!0,o.instagram.searchForUsersByName(n[t].username,{success:function(e){if(void 0!==e.meta&&void 0!==e.meta.error_type&&wdi_front.show_alert(!1,e,o),200==e.meta.code&&0<e.data.length){for(var t=!1,i=0;i<e.data.length;i++)if(e.data[i].username==e.args.username){t=!0;break}if(t)for(var r=0;r<n.length;r++)e.data[i].username==n[r].username&&(n[r].id=e.data[i].id)}for(var a=!1,d=0;d<n.length;d++)if(""==n[d].id||"username"==n[d].id){a=!0;break}a||(o.feed_row.feed_users=JSON.stringify(n),wdi_front.init(o))},username:n[t].username})):n[t].id=n[t].username;return e},void 0!==wdi_ajax.ajax_response?jQuery(document).one("ajaxStop",function(){"not_declared"!=wdi_front.type&&(wdi_front.clickOrTouch=wdi_front.detectEvent(),wdi_front.globalInit())}):jQuery(document).ready(function(){"not_declared"!=wdi_front.type&&(wdi_front.clickOrTouch=wdi_front.detectEvent(),wdi_front.globalInit())});
1
+ "undefined"==typeof wdi_front&&(wdi_front={type:"not_declared"}),wdi_front.detectEvent=function(){return/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())?"touchend":"click"};var wdi_error_show=!1,wdi_error_init=!1;function wdi_baseName(e){var t=e.substr(e.lastIndexOf("/"));return e.replace(t,"")}wdi_front.escape_tags=function(e){return void 0===e&&(e=""),e=e.toString().replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&#34;")},wdi_front.show_alert=function(e,t,r){if(r=jQuery("#wdi_feed_"+r.feed_row.wdi_feed_counter),400===t.meta.code&&"APINotAllowedError"===t.meta.error_type){if(void 0!==t.wdi_current_feed_name){var i=t.wdi_current_feed_name,a=r.find(".wdi_private_feed_names");void 0===a.attr("wdi_first_private_user")?a.attr("wdi_first_private_user",1):i=", "+i,a.append(i),r.find(".wdi_private_feed_error").removeClass("wdi_hidden")}r.find(".wdi_spinner").remove()}if(void 0!==r&&"APINotAllowedError"!=t.meta.error_type){r.find(".wdi_spinner").remove(),wdi_error_show=!0;var d=r.find(".wdi_js_error"),o=r.find(".wdi_token_error");0!=t&&null!=typeof t.meta&&"OAuthAccessTokenException"===t.meta.error_type?(o.removeClass("wdi_hidden"),"1"!=wdi_front_messages.wdi_token_error_flag&&jQuery.ajax({type:"POST",url:wdi_url.ajax_url,dataType:"json",data:{action:"wdi_token_flag",wdi_token_flag_nonce:wdi_front_messages.wdi_token_flag_nonce},success:function(e){}})):(d.removeClass("wdi_js_error"),d.addClass("wdi_js_error_no_animate"),jQuery(".wdi_js_error_no_animate").show()),wdi_front_messages.show_alerts||console.log("%c"+e,"color:#cc0000;")}wdi_error_show=!0},wdi_front.globalInit=function(){var e=wdi_front.feed_counter,t=0;if(void 0!==wdi_ajax.ajax_response)t=wdi_feed_counter_init.wdi_feed_counter_init;for(var r=t;r<=e;r++)if(0!==jQuery("#wdi_feed_"+r).length){var i=new WDIFeed(window["wdi_feed_"+r]);i.instagram=new WDIInstagram,i.instagram.filterArguments={feed:i},i.instagram.filters=[],i.instagram.addToken(i.feed_row.access_token),wdi_front.access_token=i.feed_row.access_token,i.dataStorageRaw=[],i.dataStorage=[],i.dataStorageList=[],i.allResponseLength=0,i.currentResponseLength=0,i.temproraryUsersData=[],i.removedUsers=0,i.nowLoadingImages=!0,i.imageIndex=0,i.resIndex=0,i.currentPage=1,i.userSortFlags=[],i.customFilterChanged=!1,i.maxConditionalFiltersRequestCount=10,i.instagramRequestCounter=0,i.mediaRequestsDone=!1,i.conditionalFilterBuffer=[],i.stopInfiniteScrollFlag=!1,"masonry"==i.feed_row.feed_type&&(i.displayedData=[]),"pagination"==i.feed_row.feed_display_view?(i.feed_row.resort_after_load_more=0,"image_browser"!=i.feed_row.feed_type?(i.feed_row.load_more_number=parseInt(i.feed_row.pagination_per_page_number),i.feed_row.number_of_photos=(1+parseInt(i.feed_row.pagination_preload_number))*i.feed_row.load_more_number):(i.feed_row.number_of_photos=1+parseInt(i.feed_row.image_browser_preload_number),i.feed_row.load_more_number=parseInt(i.feed_row.image_browser_load_number)),i.freeSpaces=(Math.floor(i.feed_row.pagination_per_page_number/i.feed_row.number_of_columns)+1)*i.feed_row.number_of_columns-i.feed_row.pagination_per_page_number):i.freeSpaces=0,i.galleryBox=function(e){wdi_spider_createpopup(wdi_url.ajax_url+"?gallery_id="+this.feed_row.id+"&image_id="+e,this.feed_row.wdi_feed_counter,this.feed_row.lightbox_width,this.feed_row.lightbox_height,1,"testpopup",5,this,e)},wdi_responsive.columnControl(i),"masonry"==i.feed_row.feed_type&&jQuery(window).trigger("resize"),wdi_front.bindEvents(i),window["wdi_feed_"+r]=i,wdi_front.init(i)}},wdi_front.init=function(e){if(jQuery(".wdi_js_error").hide(),e.photoCounter=e.feed_row.number_of_photos,"liked"==e.feed_row.liked_feed)e.feed_users=["self"];else{if(!wdi_front.isJsonString(e.feed_row.feed_users))return void wdi_front.show_alert(wdi_front_messages.invalid_users_format,!1,e);e.feed_users=JSON.parse(e.feed_row.feed_users)}var t=[];void 0!==window.wdi_all_tags&&(t=window.wdi_all_tags);for(var r=0;r<e.feed_users.length;r++)"#"===e.feed_users[r].username[0]&&void 0!==e.feed_users[r].tag_id&&(t[e.feed_users[r].tag_id]=e.feed_users[r]);window.wdi_all_tags=t,e.dataCount=e.feed_users.length;var i=wdi_front.getFeedItemResolution(e);e.feedImageResolution=i.image,e.feedVideoResolution=i.video;for(var a=0;a<e.dataCount;a++)wdi_front.instagramRequest(a,e);e.feed_row.number_of_photos>0&&wdi_front.ajaxLoader(e),"1"===e.feed_row.display_header&&wdi_front.show("header",e)},wdi_front.getFeedItemResolution=function(e){var t={image:"standard_resolution",video:"standard_resolution"};if("thumbnail"===e.feed_row.feed_resolution)return{image:"thumbnail",video:"low_bandwidth"};if("low"===e.feed_row.feed_resolution)return{image:"low_resolution",video:"low_resolution"};if("standard"===e.feed_row.feed_resolution)return{image:"standard_resolution",video:"standard_resolution"};var r=jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter).find(".wdi_feed_wrapper");r.append('<div class="wdi_feed_item" id="wdi_feed_item_example"></div>'),wdi_responsive.columnControl(e,1);var i=r.attr("wdi-res").split("wdi_col_");if(r.find("#wdi_feed_item_example").remove(),2!==i.length)return t;var a=parseInt(i[1]);if(a<=0)return t;var d=r.width()/a-10,o=t;return d<=150?(o.image="thumbnail",o.video="low_bandwidth"):d>150&&d<=320?(o.image="low_resolution",o.video="low_resolution"):(o.image="standard_resolution",o.video="standard_resolution"),o},wdi_front.isJsonString=function(e){try{JSON.parse(e)}catch(e){return!1}return!0},wdi_front.instagramRequest=function(e,t){var r=this,i=t.feed_users;"string"==typeof i[e]&&"self"===i[e]?t.instagram.getRecentLikedMedia({success:function(e){void 0!==e.meta&&void 0!==e.meta.error_type&&wdi_front.show_alert(!1,e,t),t.mediaRequestsDone=!0,0!=(e=r.checkMediaResponse(e,t))&&r.saveSelfUserData(e,t)}}):"hashtag"==this.getInputType(i[e].username)?t.instagram.getTagRecentMedia(this.stripHashtag(i[e].username),{success:function(i){void 0!==i.meta&&void 0!==i.meta.error_type&&wdi_front.show_alert(!1,i,t),t.mediaRequestsDone=!0,0!=(i=r.checkMediaResponse(i,t))&&r.saveUserData(i,t.feed_users[e],t)}},null,t.feed_row.hashtag_top_recent):"user"==this.getInputType(i[e].username)&&t.instagram.getUserMedia({user_id:i[e].id,success:function(a){void 0!==a.meta&&void 0!==a.meta.error_type&&(a.wdi_current_feed_name=i[e].username,wdi_front.show_alert(!1,a,t)),t.mediaRequestsDone=!0,0!=(a=r.checkMediaResponse(a,t))&&r.saveUserData(a,t.feed_users[e],t)}})},wdi_front.isHashtag=function(e){return"#"===e[0]},wdi_front.saveUserData=function(e,t,r){if(e.username=t.username,e.user_id=t.id,"#"===e.user_id[0]&&(e.data=wdi_front.appendRequestHashtag(e.data,e.user_id)),r.usersData.push(e),r.currentResponseLength=wdi_front.getArrayContentLength(r.usersData,"data"),r.allResponseLength+=r.currentResponseLength,r.dataCount==r.usersData.length)if(r.currentResponseLength<r.feed_row.number_of_photos&&!wdi_front.userHasNoPhoto(r))wdi_front.loadMore("initial-keep",r);else if(wdi_front.displayFeed(r),wdi_front.applyFilters(r),!wdi_front.activeUsersCount(r)&&"load_more_btn"==r.feed_row.feed_display_view){var i=jQuery("#wdi_feed_"+r.feed_row.wdi_feed_counter);i.find(".wdi_load_more").addClass("wdi_hidden"),i.find(".wdi_spinner").addClass("wdi_hidden")}},wdi_front.saveSelfUserData=function(e,t){if(e.user_id="",e.username="",t.usersData.push(e),t.currentResponseLength=wdi_front.getArrayContentLength(t.usersData,"data"),t.allResponseLength+=t.currentResponseLength,t.dataCount==t.usersData.length)if(t.currentResponseLength<t.feed_row.number_of_photos&&!wdi_front.userHasNoPhoto(t))wdi_front.loadMore("initial-keep",t);else if(wdi_front.displayFeed(t),wdi_front.applyFilters(t),!wdi_front.activeUsersCount(t)&&"load_more_btn"==t.feed_row.feed_display_view){var r=jQuery("#wdi_feed_"+t.feed_row.wdi_feed_counter);r.find(".wdi_load_more").addClass("wdi_hidden"),r.find(".wdi_spinner").addClass("wdi_hidden")}},wdi_front.userHasNoPhoto=function(e,t){var r=0,i=e.usersData;void 0!==t&&(i=t);for(var a=0;a<i.length;a++)void 0===i[a].pagination&&(i[a].pagination=[]),"liked"===e.feed_row.liked_feed?void 0===i[a].pagination.next_max_like_id&&r++:void 0===i[a].pagination.next_max_id&&r++;return r==i.length?1:0},wdi_front.appendRequestHashtag=function(e,t){for(var r=0;r<e.length;r++)e[r].wdi_hashtag=t;return e},wdi_front.displayFeed=function(e,t){if(0==e.customFilterChanged)var r=wdi_front.feedSort(e,t);var i=e.customFilterChanged;if(1==e.customFilterChanged){r=e.customFilteredData;e.parsedData=wdi_front.parseLighboxData(e,!0)}"1"!=e.feed_row.resort_after_load_more?0==e.customFilterChanged&&(e.dataStorageList=e.dataStorageList.concat(r)):0==e.customFilterChanged&&(e.dataStorageList=r),"masonry"==e.feed_row.feed_type&&wdi_front.masonryDisplayFeedItems(r,e),"thumbnails"!=e.feed_row.feed_type&&"blog_style"!=e.feed_row.feed_type&&"image_browser"!=e.feed_row.feed_type||wdi_front.displayFeedItems(r,e),wdi_front.getDataLength(e)<e.photoCounter&&!i&&e.instagramRequestCounter<=e.maxConditionalFiltersRequestCount&&!wdi_front.allDataHasFinished(e)?wdi_front.loadMore("",e):wdi_front.allImagesLoaded(e),e.instagramRequestCounter>e.maxConditionalFiltersRequestCount&&(wdi_front.allImagesLoaded(e),0==r.length&&(e.stopInfiniteScrollFlag=!0)),"pagination"==e.feed_row.feed_display_view&&e.currentPage<e.paginator&&jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter).find("#wdi_last_page").removeClass("wdi_disabled"),e.instagramRequestCounter=0,e.conditionalFilterBuffer=[],wdi_front.updateUsersImages(e)},wdi_front.updateUsersImages=function(e){jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter).find(".wdi_single_user .wdi_user_img_wrap img").each(function(){if(jQuery(this).attr("src")==wdi_url.plugin_url+"images/missing.png"||""==jQuery(this).attr("src")){if("liked"==e.feed_row.liked_feed)return;for(var t=0;t<e.usersData.length;t++)e.usersData[t].username==jQuery(this).parent().parent().find("h3").text()&&0!=e.usersData[t].data.length&&jQuery(this).attr("src",e.usersData[t].data[0].images.thumbnail.url)}})},wdi_front.masonryDisplayFeedItems=function(e,t){var r=[],i=[];if(0!=jQuery("#wdi_feed_"+t.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").length){jQuery("#wdi_feed_"+t.feed_row.wdi_feed_counter+" .wdi_masonry_column").each(function(){1==t.feed_row.resort_after_load_more&&(jQuery(this).html(""),t.imageIndex=0),1==t.customFilterChanged&&(jQuery(this).html(""),t.imageIndex=0),"pagination"==t.feed_row.feed_display_view?r.push(0):r.push(jQuery(this).height()),i.push(jQuery(this))}),1==t.customFilterChanged&&(t.customFilterChanged=!1);for(var a=0;a<e.length;a++)if("object"!=typeof e[a].videos||null!=e[a].videos.standard_resolution){if(t.displayedData.push(e[a]),"image"==e[a].type)var d=wdi_front.getPhotoTemplate(t);else if(e[a].hasOwnProperty("videos")||"video"==e[a].type)d=wdi_front.getVideoTemplate(t);else d=wdi_front.getSliderTemplate(t);var o=e[a],n=d(wdi_front.createObject(o,t)),s=wdi_front.array_min(r),_=wdi_front.getImageResolution(e[a]);i[s.index].html(i[s.index].html()+n),r[s.index]+=i[s.index].width()*_,t.imageIndex++,"pagination"==t.feed_row.feed_display_view&&((a+1)%t.feed_row.pagination_per_page_number==0?t.resIndex+=t.freeSpaces+1:t.resIndex++)}t.wdi_loadedImages=0;var f=!1;t.wdi_load_count=a;var l=t.feed_row.wdi_feed_counter;jQuery("#wdi_feed_"+l+" img.wdi_img").on("load",function(){t.wdi_loadedImages++,w(),!1===f&&(wdi_responsive.columnControl(t,1),f=!0)});w(),1==t.paginatorNextFlag&&wdi_front.updatePagination(t,"next"),t.infiniteScrollFlag=!1}function w(){t.wdi_load_count===t.wdi_loadedImages&&0!=t.wdi_loadedImages&&(t.loadedImages=0,t.wdi_load_count=0,wdi_front.allImagesLoaded(t))}},wdi_front.getImageResolution=function(e){var t=e.images.standard_resolution.width;return e.images.standard_resolution.height/t},wdi_front.getDataLength=function(e,t){var r=0;if(void 0===t)for(var i=0;i<e.dataStorage.length;i++)r+=e.dataStorage[i].length;else for(i=0;i<t.length;i++)r+=t[i].length;return r},wdi_front.getArrayContentLength=function(e,t){for(var r=0,i=0;i<e.length;i++)"finished"!=e[i].finished&&(r+=e[i][t].length);return r},wdi_front.displayFeedItems=function(e,t){if(0!=jQuery("#wdi_feed_"+t.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").length){var r=t.feed_row.wdi_feed_counter,i=jQuery("#wdi_feed_"+r+" .wdi_feed_wrapper");"1"===t.feed_row.resort_after_load_more&&(i.html(""),t.imageIndex=0),1==t.customFilterChanged&&(i.html(""),t.imageIndex=0,t.customFilterChanged=!1);wdi_front.getImgCount(t),e.length;if("pagination"==t.feed_row.feed_display_view){var a=t.feed_row.load_more_number;"image_browser"==t.feed_row.feed_type&&(a=1),(jQuery("#wdi_feed_"+t.feed_row.wdi_feed_counter+' [wdi_page="'+(t.currentPage-1)+'"]').length<a||0==e.length)&&(t.currentPage=--t.currentPage<=1?1:t.currentPage)}for(var d=0;d<e.length;d++)if("object"!=typeof e[d].videos||null!=e[d].videos.standard_resolution){if("image"==e[d].type)var o=wdi_front.getPhotoTemplate(t);else if(e[d].hasOwnProperty("videos"))o=wdi_front.getVideoTemplate(t);else o=wdi_front.getSliderTemplate(t);var n=e[d],s=o(wdi_front.createObject(n,t));i.html(i.html()+s),t.imageIndex++,"pagination"==t.feed_row.feed_display_view&&((d+1)%t.feed_row.pagination_per_page_number==0?t.resIndex+=t.freeSpaces+1:t.resIndex++)}t.wdi_loadedImages=0;var _=!1;t.wdi_load_count=d;r=t.feed_row.wdi_feed_counter,i=jQuery("#wdi_feed_"+r+" img.wdi_img").on("load",function(){t.wdi_loadedImages++,t.wdi_load_count===t.wdi_loadedImages&&0!=t.wdi_loadedImages&&(t.loadedImages=0,t.wdi_load_count=0,wdi_front.allImagesLoaded(t)),!1===_&&(wdi_responsive.columnControl(t,1),_=!0)});1==t.paginatorNextFlag&&wdi_front.updatePagination(t,"next"),t.infiniteScrollFlag=!1}},wdi_front.checkFeedFinished=function(e){for(var t=0;t<e.usersData.length;t++)if(void 0===e.usersData[t].finished)return!1;return!0},wdi_front.sortingOperator=function(e,t){var r;switch(e){case"date":switch(t){case"asc":r=function(e,t){return e.created_time>t.created_time?1:-1};break;case"desc":r=function(e,t){return e.created_time>t.created_time?-1:1}}break;case"likes":switch(t){case"asc":r=function(e,t){return e.likes.count<t.likes.count?-1:1};break;case"desc":r=function(e,t){return e.likes.count<t.likes.count?1:-1}}break;case"comments":switch(t){case"asc":r=function(e,t){return e.comments.count<t.comments.count?-1:1};break;case"desc":r=function(e,t){return e.comments.count<t.comments.count?1:-1}}break;case"random":r=function(e,t){return Math.random()>.5?1:-1}}return r},wdi_front.feedSort=function(e,t){var r=e.feed_row.sort_images_by,i=e.feed_row.display_order;"1"===e.feed_row.resort_after_load_more?e.data=e.data.concat(wdi_front.smartPicker(e,t)):e.data=wdi_front.smartPicker(e,t);var a=wdi_front.sortingOperator(r,i);return e.data.sort(a),e.data},wdi_front.smartPicker=function(e,t){var r=[],i=0,a=[],d=Math.ceil(e.feed_row.number_of_photos/e.usersData.length),o=parseInt(e.feed_row.number_of_photos),n=0;""!=t&&void 0!==t&&null!=t&&(o=parseInt(t),d=Math.ceil(o/wdi_front.activeUsersCount(e)));e.storeRawData(e.usersData,"dataStorageRaw");for(var s=e.dataStorageRaw.sort(function(e,t){return e.length()>t.length()?1:-1}),_=e.usersData.sort(function(e,t){return e.data.length>t.data.length?1:-1}),f=0;f<_.length;f++)if(n+=d,s[f].length()<=n)n-=s[f].length(),r.push(s[f].getData(s[f].length())),i+=r[r.length-1].length;else{i+n>o&&(n=o-i);var l=[];!1===e.auto_trigger?l=l.concat(s[f].getData(n)):l.length+wdi_front.getDataLength(e)+wdi_front.getDataLength(e,r)<e.feed_row.number_of_photos&&(l=l.concat(s[f].getData(n))),n=0,i+=l.length,r.push(l)}for(f=0;f<r.length;f++)void 0===e.dataStorage[f]?e.dataStorage.push(r[f]):e.dataStorage[f]=e.dataStorage[f].concat(r[f]);for(e.parsedData=wdi_front.parseLighboxData(e),f=0;f<r.length;f++)a=a.concat(r[f]);return a},wdi_front.createObject=function(e,t){var r=null!=e.caption?e.caption.text:"&nbsp",i="";if("video"==e.type&&e.videos[t.feedVideoResolution]&&null!=e.videos[t.feedVideoResolution].url&&(i=e.hasOwnProperty("videos")?e.videos[t.feedVideoResolution].url:""),void 0===e.images[t.feedImageResolution])var a=wdi_url.plugin_url+"images/missing.png";else a=e.images[t.feedImageResolution].url;var d=t.imageIndex,o="square",n=e.images.standard_resolution.height,s=e.images.standard_resolution.width;n>s?o="portrait":n<s&&(o="landscape");var _=e.user.username;return""===_&&(_="no_user"),{id:e.id,caption:wdi_front.escape_tags(r),image_url:a,likes:e.likes.count,comments:e.comments.count,wdi_index:d,wdi_res_index:t.resIndex,wdi_media_user:_,link:e.link,video_url:i,wdi_username:_,wdi_shape:o}},wdi_front.setPage=function(e){var t=e.feed_row.feed_display_view,r=e.feed_row.feed_type;if("pagination"!=t)return"";var i=e.imageIndex;if("image_browser"==r)var a=1;else a=Math.abs(e.feed_row.pagination_per_page_number);return e.paginator=Math.ceil((i+1)/a),e.paginator},wdi_front.getPhotoTemplate=function(e){var t=wdi_front.setPage(e),r="",i="",a="",d="",o="tenweb-i-arrows-out";"blog_style"!=e.feed_row.feed_type&&"image_browser"!=e.feed_row.feed_type||(o=""),""!=t?(i='wdi_page="'+t+'"',sourceAttr="src"):sourceAttr="src",""!=t&&1!=t&&(r="wdi_hidden"),1==e.feed_row.show_full_description&&"masonry"==e.feed_row.feed_type&&(r+=" wdi_full_caption");switch("blog_style"!==e.feed_row.feed_type&&("masonry"==e.feed_row.feed_type?"wdi_responsive.showMasonryCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");":"wdi_responsive.showCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");"),e.feed_row.feed_item_onclick){case"lightbox":a="onclick=wdi_feed_"+e.feed_row.wdi_feed_counter+".galleryBox('<%=id%>')";break;case"instagram":a="onclick=\"window.open ('<%= link%>','_blank')\"",d="wdi_hover_off",o="";break;case"custom_redirect":a="onclick=\"window.open ('"+e.feed_row.redirect_url+"','_self')\"",d="wdi_hover_off",o="";break;case"none":a="",d="wdi_cursor_off wdi_hover_off",o=""}var n='<div class="wdi_feed_item '+r+'" wdi_index=<%= wdi_index%> wdi_res_index=<%= wdi_res_index%> wdi_media_user=<%= wdi_media_user%> '+i+' wdi_type="image" id="wdi_'+e.feed_row.wdi_feed_counter+"_<%=id%>\"><div class=\"wdi_photo_wrap\"><div class=\"wdi_photo_wrap_inner\"><div class=\"wdi_photo_img <%= wdi_shape == 'square' ? 'wdi_shape_square' : (wdi_shape == 'portrait' ? 'wdi_shape_portrait' : (wdi_shape == 'landscape' ? 'wdi_shape_landscape' : 'wdi_shape_square') ) %>\"><img class=\"wdi_img\" "+sourceAttr+'="<%=image_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);"><div class="wdi_photo_overlay '+d+'" ><div class="wdi_thumb_icon" '+a+' style="display:table;width:100%;height:100%;"><div style="display:table-cell;vertical-align:middle;text-align:center;color:white;"><i class="tenweb-i '+o+'"></i></div></div></div></div></div></div>';return n+="</div>",_.template(n)},wdi_front.getSliderTemplate=function(e){var t=wdi_front.setPage(e),r="",i="",a="",d="",o="tenweb-i-clone";"blog_style"!=e.feed_row.feed_type&&"image_browser"!=e.feed_row.feed_type||(o=""),""!=t?(i='wdi_page="'+t+'"',sourceAttr="src"):sourceAttr="src",""!=t&&1!=t&&(r="wdi_hidden"),1==e.feed_row.show_full_description&&"masonry"==e.feed_row.feed_type&&(r+=" wdi_full_caption");switch("blog_style"!==e.feed_row.feed_type&&("masonry"==e.feed_row.feed_type?"wdi_responsive.showMasonryCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");":"wdi_responsive.showCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");"),e.feed_row.feed_item_onclick){case"lightbox":a="onclick=wdi_feed_"+e.feed_row.wdi_feed_counter+".galleryBox('<%=id%>')";break;case"instagram":a="onclick=\"window.open ('<%= link%>','_blank')\"",d="wdi_hover_off",o="tenweb-i-clone";break;case"custom_redirect":a="onclick=\"window.open ('"+e.feed_row.redirect_url+"','_self')\"",d="wdi_hover_off",o="";break;case"none":a="",d="wdi_cursor_off wdi_hover_off",o=""}var n='<div class="wdi_feed_item '+r+'" wdi_index=<%= wdi_index%> wdi_res_index=<%= wdi_res_index%> wdi_media_user=<%= wdi_media_user%> '+i+' wdi_type="slideshow" id="wdi_'+e.feed_row.wdi_feed_counter+"_<%=id%>\"><div class=\"wdi_photo_wrap\"><div class=\"wdi_photo_wrap_inner\"><div class=\"wdi_photo_img <%= wdi_shape == 'square' ? 'wdi_shape_square' : (wdi_shape == 'portrait' ? 'wdi_shape_portrait' : (wdi_shape == 'landscape' ? 'wdi_shape_landscape' : 'wdi_shape_square') ) %>\"><img class=\"wdi_img\" "+sourceAttr+'="<%=image_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);"><div class="wdi_photo_overlay '+d+'" ><div class="wdi_thumb_icon" '+a+' style="display:table;width:100%;height:100%;"><div style="display:table-cell;vertical-align:middle;text-align:center;color:white;"><i class="tenweb-i '+o+'"></i></div></div></div></div></div></div>';return n+="</div>",_.template(n)},wdi_front.replaceToVideo=function(e,t,r){overlayHtml="<video style='width:auto !important; height:auto !important; max-width:100% !important; max-height:100% !important; margin:0 !important;' controls=''><source src='"+e+"' type='video/mp4'>Your browser does not support the video tag. </video>",jQuery("#wdi_feed_"+r+' [wdi_index="'+t+'"] .wdi_photo_wrap_inner').html(overlayHtml),jQuery("#wdi_feed_"+r+' [wdi_index="'+t+'"] .wdi_photo_wrap_inner video').get(0).play()},wdi_front.getVideoTemplate=function(e){var t,r=wdi_front.setPage(e),i="",a="",d="tenweb-i-play",o="",n="";""!=r?(a='wdi_page="'+r+'"',t="src"):t="src",""!=r&&1!=r&&(i="wdi_hidden"),1==e.feed_row.show_full_description&&"masonry"==e.feed_row.feed_type&&(i+=" wdi_full_caption");switch("blog_style"!==e.feed_row.feed_type&&("masonry"==e.feed_row.feed_type?"wdi_responsive.showMasonryCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");":"wdi_responsive.showCaption(jQuery(this),"+e.feed_row.wdi_feed_counter+");"),e.feed_row.feed_item_onclick){case"lightbox":o="onclick=wdi_feed_"+e.feed_row.wdi_feed_counter+".galleryBox('<%=id%>')";break;case"instagram":o="onclick=\"window.open ('<%= link%>','_blank')\"",n="wdi_hover_off",d="tenweb-i-play";break;case"custom_redirect":o="onclick=\"window.open ('"+e.feed_row.redirect_url+"','_self')\"",n="wdi_hover_off",d="";break;case"none":n="wdi_cursor_off wdi_hover_off",d="","blog_style"!=e.feed_row.feed_type&&"image_browser"!=e.feed_row.feed_type||(o="onclick=wdi_front.replaceToVideo('<%= video_url%>','<%= wdi_index%>',"+e.feed_row.wdi_feed_counter+")",n="",d="tenweb-i-play")}var s='<div class="wdi_feed_item '+i+'" wdi_index=<%= wdi_index%> wdi_res_index=<%= wdi_res_index%> wdi_media_user=<%= wdi_media_user%> '+a+' wdi_type="image" id="wdi_'+e.feed_row.wdi_feed_counter+"_<%=id%>\"><div class=\"wdi_photo_wrap\"><div class=\"wdi_photo_wrap_inner\"><div class=\"wdi_photo_img <%= wdi_shape == 'square' ? 'wdi_shape_square' : (wdi_shape == 'portrait' ? 'wdi_shape_portrait' : (wdi_shape == 'landscape' ? 'wdi_shape_landscape' : 'wdi_shape_square') ) %>\"><img class=\"wdi_img\" "+t+'="<%=image_url%>" alt="feed_image" onerror="wdi_front.brokenImageHandler(this);"><div class="wdi_photo_overlay '+n+'" '+o+'><div class="wdi_thumb_icon" style="display:table;width:100%;height:100%;"><div style="display:table-cell;vertical-align:middle;text-align:center;color:white;"><i class="tenweb-i '+d+'"></i></div></div></div></div></div></div>';return s+="</div>",_.template(s)},wdi_front.bindEvents=function(e){0!=jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").length&&("load_more_btn"==e.feed_row.feed_display_view&&jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" .wdi_load_more_container").on(wdi_front.clickOrTouch,function(){wdi_front.loadMore(jQuery(this).find(".wdi_load_more_wrap"))}),"pagination"==e.feed_row.feed_display_view&&(jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_next").on(wdi_front.clickOrTouch,function(){wdi_front.paginatorNext(jQuery(this),e)}),jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_prev").on(wdi_front.clickOrTouch,function(){wdi_front.paginatorPrev(jQuery(this),e)}),jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_last_page").on(wdi_front.clickOrTouch,function(){wdi_front.paginationLastPage(jQuery(this),e)}),jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" #wdi_first_page").on(wdi_front.clickOrTouch,function(){wdi_front.paginationFirstPage(jQuery(this),e)}),e.paginatorNextFlag=!1))},wdi_front.paginationFirstPage=function(e,t){if(1!=t.paginator&&1!=t.currentPage){var r=t.currentPage;t.currentPage=1,wdi_front.updatePagination(t,"custom",r),e.parent().find("#wdi_last_page").removeClass("wdi_disabled"),e.addClass("wdi_disabled")}else e.addClass("wdi_disabled")},wdi_front.paginationLastPage=function(e,t){if(1!=t.paginator&&t.currentPage!=t.paginator){var r=t.currentPage;t.currentPage=t.paginator,wdi_front.updatePagination(t,"custom",r),e.addClass("wdi_disabled"),e.parent().find("#wdi_first_page").removeClass("wdi_disabled")}},wdi_front.paginatorNext=function(e,t){var r=e.parent().find("#wdi_last_page"),i=e.parent().find("#wdi_first_page");if(t.paginatorNextFlag=!0,t.paginator!=t.currentPage||wdi_front.checkFeedFinished(t))t.paginator>t.currentPage&&(t.currentPage++,wdi_front.updatePagination(t,"next"),t.paginator>t.currentPage?r.removeClass("wdi_disabled"):r.addClass("wdi_disabled"));else{t.currentPage++;var a=t.feed_row.number_of_photos;wdi_front.loadMore(e,t,a),r.addClass("wdi_disabled")}i.removeClass("wdi_disabled")},wdi_front.paginatorPrev=function(e,t){var r=e.parent().find("#wdi_last_page"),i=e.parent().find("#wdi_first_page");1!=t.currentPage?(t.currentPage--,wdi_front.updatePagination(t,"prev"),r.removeClass("wdi_disabled"),1==t.currentPage&&i.addClass("wdi_disabled")):i.addClass("wdi_disabled")},wdi_front.updatePagination=function(e,t,r){var i="#wdi_feed_"+e.feed_row.wdi_feed_counter;switch(jQuery(i+' [wdi_page="'+e.currentPage+'"]').each(function(){jQuery(this).removeClass("wdi_hidden")}),t){case"next":r=e.currentPage-1;jQuery(i+" .wdi_feed_wrapper").height(jQuery(".wdi_feed_wrapper").height()),jQuery(i+' [wdi_page="'+r+'"]').each(function(){jQuery(this).addClass("wdi_hidden")});break;case"prev":r=e.currentPage+1;jQuery(i+" .wdi_feed_wrapper").height(jQuery(".wdi_feed_wrapper").height()),jQuery(i+' [wdi_page="'+r+'"]').each(function(){jQuery(this).addClass("wdi_hidden")});break;case"custom":(r=r)!=e.currentPage&&(jQuery(i+" .wdi_feed_wrapper").height(jQuery(".wdi_feed_wrapper").height()),jQuery(i+' [wdi_page="'+r+'"]').each(function(){jQuery(this).addClass("wdi_hidden")}))}e.paginatorNextFlag=!1,jQuery(i+" .wdi_feed_wrapper").css("height","auto"),jQuery(i+" #wdi_current_page").text(e.currentPage)},wdi_front.loadMore=function(e,t){var r=0;if(""!=e&&void 0!==e&&"initial"!=e&&"initial-keep"!=e)var i=window[e.parent().parent().parent().parent().attr("id")];if(void 0!==t)i=t;for(var a=0,d=0,o=0;o<i.userSortFlags.length;o++)if(!0===i.userSortFlags[o].flag){a++;for(var n=0;n<i.usersData.length;n++)i.userSortFlags[o].id===i.usersData[n].user_id&&"finished"===i.usersData[n].finished&&d++}if(a!==d||0==a){i.auto_trigger=""===e,wdi_front.ajaxLoader(i),"masonry"===i.feed_row.feed_type&&"pagination"==i.feed_row.feed_display_view&&jQuery("#wdi_feed_"+wdi_front.feed_counter+" .wdi_full_caption").each(function(){jQuery(this).find(".wdi_photo_title").trigger(wdi_front.clickOrTouch)});for(o=0;o<i.usersData.length;o++)"finished"===i.usersData[o].finished&&r++;r===i.usersData.length&&(wdi_front.allImagesLoaded(i),jQuery("#wdi_feed_"+i.feed_row.wdi_feed_counter+" .wdi_load_more").remove());var s=i.usersData;i.loadMoreDataCount=i.feed_users.length;for(o=0;o<s.length;o++){var _=s[o].pagination,f={user_id:s[o].user_id,username:s[o].username};if(""!=_.next_url&&null!=_.next_url&&void 0!==_.next_url){var l=_.next_url;wdi_front.loadMoreRequest(f,l,i,e)}else"initial-keep"==e&&(i.temproraryUsersData[o]=i.usersData[o]),i.loadMoreDataCount--,wdi_front.checkForLoadMoreDone(i,e)}}},wdi_front.loadMoreRequest=function(e,t,r,i){if(r.mediaRequestsDone){r.usersData;var a="",d=function(t){if(""===t||void 0===t||null==t)return a=wdi_front_messages.network_error,r.loadMoreDataCount--,void wdi_front.show_alert(a,t,r);if(void 0!==t.meta&&void 0!==t.meta.error_type&&wdi_front.show_alert(!1,t,r),void 0!==t.meta&&void 0!==t.meta.code&&200!=t.meta.code)return a=t.meta.error_message,r.loadMoreDataCount--,void wdi_front.show_alert(a,t,r);t.user_id=e.user_id,t.username=e.username;for(var d=0;d<r.usersData.length;d++)t.user_id===r.usersData[d].user_id&&("#"===t.user_id[0]&&(t.data=wdi_front.appendRequestHashtag(t.data,t.user_id)),"initial-keep"==i&&(r.temproraryUsersData[d]=r.usersData[d]),r.usersData[d]=t,r.loadMoreDataCount--);wdi_front.checkForLoadMoreDone(r,i)};"#"!==e.username[0]?r.instagram.requestByUrl(t,{success:d}):r.instagram.getTagRecentMedia(e.username,{success:d},t,r.feed_row.hashtag_top_recent)}},wdi_front.checkForLoadMoreDone=function(e,t){var r=e.feed_row.load_more_number,i=e.feed_row.number_of_photos;if(0==e.loadMoreDataCount){e.temproraryUsersData=wdi_front.mergeData(e.temproraryUsersData,e.usersData);var a=wdi_front.getArrayContentLength(e.temproraryUsersData,"data");if("initial-keep"==t&&(t="initial"),"initial"==t)a<i&&!wdi_front.userHasNoPhoto(e,e.temproraryUsersData)&&e.instagramRequestCounter<=e.maxConditionalFiltersRequestCount?wdi_front.loadMore("initial",e):(e.usersData=e.temproraryUsersData,wdi_front.displayFeed(e),wdi_front.applyFilters(e),e.temproraryUsersData=[]);else if(a<r&&!wdi_front.userHasNoPhoto(e,e.temproraryUsersData)&&e.instagramRequestCounter<=e.maxConditionalFiltersRequestCount)wdi_front.loadMore(void 0,e);else{if(e.usersData=e.temproraryUsersData,!wdi_front.activeUsersCount(e))return;wdi_front.displayFeed(e,r),wdi_front.applyFilters(e),e.temproraryUsersData=[]}}},wdi_front.allDataHasFinished=function(e){for(var t=0,r=0;r<e.dataStorageRaw.length;r++)0==e.dataStorageRaw[r].length()&&1==e.dataStorageRaw[r].locked&&t++;return t==e.dataStorageRaw.length},wdi_front.mergeData=function(e,t){for(var r=0;r<t.length;r++)if(void 0!==e[r]){if("finished"==t[r].finished)continue;if(void 0===e[r].pagination.next_max_id&&void 0===e[r].pagination.next_max_like_id)continue;e[r].data=e[r].data.concat(t[r].data),e[r].pagination=t[r].pagination,e[r].user_id=t[r].user_id,e[r].username=t[r].username,e[r].meta=t[r].meta}else e.push(t[r]);return e},wdi_front.brokenImageHandler=function(e){var t=e.src.split("/p/");if(void 0!==t[0]&&void 0!==t[1]&&"https://www.instagram.com"!==t[0]){var r=wdi_baseName(t[0])+"/p/"+t[1];e.src=r}else e.src=wdi_url.plugin_url+"images/missing.png";return e.onerror="",!0},wdi_front.ajaxLoader=function(e){var t=e.feed_row.wdi_feed_counter,r=jQuery("#wdi_feed_"+t);"load_more_btn"==e.feed_row.feed_display_view&&(r.find(".wdi_load_more").addClass("wdi_hidden"),r.find(".wdi_spinner").removeClass("wdi_hidden"))},wdi_front.allImagesLoaded=function(e){var t=wdi_front.getDataLength(e);e.mediaRequestsDone||jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").remove("wdi_nomedia"),0!=t||!e.mediaRequestsDone||0!=e.feed_row.conditional_filters.length&&0!=e.feed_row.conditional_filter_enable||jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+" .wdi_feed_wrapper").append("<p class='wdi_nomedia'>"+wdi_front_messages.feed_nomedia+"</p>");var r=e.feed_row.wdi_feed_counter,i=jQuery("#wdi_feed_"+r);"load_more_btn"==e.feed_row.feed_display_view&&(i.find(".wdi_load_more").removeClass("wdi_hidden"),i.find(".wdi_spinner").addClass("wdi_hidden")),i.trigger("wdi_feed_loaded")},wdi_front.show=function(e,t){var r,i,a,d=t.feed_row.wdi_feed_counter,o=jQuery("#wdi_feed_"+d+" .wdi_feed_container");switch(e){case"header":r={feed_thumb:t.feed_row.feed_thumb,feed_name:t.feed_row.feed_name},i=wdi_front.getHeaderTemplate()(r),a=o.find(".wdi_feed_header").html(),o.find(".wdi_feed_header").html(a+i)}},wdi_front.getUserTemplate=function(e,t){var r,i,a=e.dataCount;switch(t[0]){case"#":r="//instagram.com/explore/tags/"+t.substr(1,t.length);break;default:r="//instagram.com/"+t}i="onclick='"+('window.open("'+r+'","_blank")')+"'";var d='<div class="wdi_single_user" user_index="<%=user_index%>"><div class="wdi_header_user_text <%=hashtagClass%>"><div class="wdi_user_img_wrap"><img onerror="wdi_front.brokenImageHandler(this);" src="<%= user_img_url%>">';return a>1&&(d+='<div title="'+wdi_front_messages.filter_title+'" class="wdi_filter_overlay"><div class="wdi_filter_icon"><span onclick="wdi_front.addFilter(<%=user_index%>,<%=feed_counter%>);" class="tenweb-i tenweb-i-filter"></span></div></div>'),d+="</div>",d+="<h3 "+i+"><%= user_name%></h3>","#"!==t[0]?("1"==e.feed_row.follow_on_instagram_btn&&(d+='<div class="wdi_user_controls"><div class="wdi_follow_btn" onclick="window.open(\'//instagram.com/<%= user_name%>\',\'_blank\')"><span> '+wdi_front_messages.follow+"</span></div></div>"),d+='<div class="wdi_media_info"><p class="wdi_posts"><span class="tenweb-i tenweb-i-camera-retro"></span><%= counts.media%></p><p class="wdi_followers"><span class="tenweb-i tenweb-i-user"></span><%= counts.followed_by%></p></div>'):d+='<div class="wdi_user_controls"></div><div class="wdi_media_info"><p class="wdi_posts"><span class="tenweb-i tenweb-i-camera-retro"></span><%= counts.media%></p><p class="wdi_followers"><span></span></p></div>',d+='<div class="wdi_clear"></div>',1==a&&"#"!==t[0]&&"1"==e.feed_row.display_user_info&&(d+='<div class="wdi_bio"><%= bio%></div>',d+='<div class="wdi_website"><a target="_blank" href="<%= website_url%>" ><%= website%></a></div>'),d+="</div></div>",_.template(d)},wdi_front.getHeaderTemplate=function(){return _.template('<div class="wdi_header_wrapper"><div class="wdi_header_img_wrap"><img src="<%=feed_thumb%>"></div><div class="wdi_header_text"><%=feed_name%></div><div class="wdi_clear"></div>')},wdi_front.addFilter=function(e,t){var r=window["wdi_feed_"+t];if(!(r.dataCount<2)&&0==r.nowLoadingImages){var i=jQuery("#wdi_feed_"+r.feed_row.wdi_feed_counter+'_users [user_index="'+e+'"]');i.find(".wdi_filter_overlay").toggleClass("wdi_filter_active_bg"),i.find(".wdi_header_user_text h3").toggleClass("wdi_filter_active_col"),i.find(".wdi_media_info").toggleClass("wdi_filter_active_col"),i.find(".wdi_follow_btn").toggleClass("wdi_filter_active_col"),r.customFilterChanged=!0,0==r.userSortFlags[e].flag?r.userSortFlags[e].flag=!0:r.userSortFlags[e].flag=!1;for(var a=0,d=0;d<r.userSortFlags.length;d++)1==r.userSortFlags[d].flag&&a++;"pagination"==r.feed_row.feed_display_view&&(r.resIndex=0),0!=a?(wdi_front.filterData(r),wdi_front.displayFeed(r)):(r.customFilteredData=r.dataStorageList,wdi_front.displayFeed(r)),"pagination"==r.feed_row.feed_display_view&&(r.paginator=Math.ceil(r.imageIndex/parseInt(r.feed_row.pagination_per_page_number)),r.currentPage=r.paginator,wdi_front.updatePagination(r,"custom",1),jQuery("#wdi_first_page").removeClass("wdi_disabled"),jQuery("#wdi_last_page").addClass("wdi_disabled"))}},wdi_front.filterData=function(e){var t=e.userSortFlags;e.customFilteredData=[];for(var r=0;r<e.dataStorageList.length;r++)for(var i=0;i<t.length;i++)(void 0!==e.dataStorageList[r].user.id&&e.dataStorageList[r].user.id==t[i].id||e.dataStorageList[r].wdi_hashtag==t[i].name)&&1==t[i].flag&&e.customFilteredData.push(e.dataStorageList[r])},wdi_front.applyFilters=function(e){for(var t=0;t<e.userSortFlags.length;t++)if(1==e.userSortFlags[t].flag){jQuery("#wdi_feed_"+e.feed_row.wdi_feed_counter+'[user_index="'+t+'"]');wdi_front.addFilter(t,e.feed_row.wdi_feed_counter),wdi_front.addFilter(t,e.feed_row.wdi_feed_counter)}},wdi_front.getImgCount=function(e){for(var t=e.dataStorage,r=0,i=0;i<t.length;i++)r+=t[i].length;return r},wdi_front.parseLighboxData=function(e,t){var r=e.dataStorage,i=e.feed_row.sort_images_by,a=e.feed_row.display_order,d=wdi_front.sortingOperator(i,a),o=[],n=[],s={};if(1==t)o=e.customFilteredData;else{for(var _=0;_<r.length;_++)for(var f=0;f<r[_].length;f++)o.push(r[_][f]);o.sort(d)}for(_=0;_<o.length;_++)s={alt:"",avg_rating:"",comment_count:o[_].comments.count,date:wdi_front.convertUnixDate(o[_].created_time),description:wdi_front.getDescription(null!==o[_].caption?wdi_front.escape_tags(o[_].caption.text):""),filename:wdi_front.getFileName(o[_]),filetype:wdi_front.getFileType(o[_]),hit_count:"0",id:o[_].id,image_url:o[_].link,number:0,rate:"",rate_count:"0",username:o[_].user.username,profile_picture:o[_].user.profile_picture,thumb_url:o[_].link+"media/?size=t",comments_data:o[_].comments.data,images:o[_].images,carousel_media:void 0!==o[_].carousel_media?o[_].carousel_media:null},n.push(s);return n},wdi_front.convertUnixDate=function(e){var t=parseInt(e),r=new Date(0);r.setUTCSeconds(t);var i=r.getFullYear()+"-"+r.getMonth()+"-"+r.getDate();return i+=" "+r.getHours()+":"+r.getMinutes()},wdi_front.getDescription=function(e){return e=e.replace(/\r?\n|\r/g," ")},wdi_front.getFileName=function(e){var t=e.link;if("video"===e.type&&e.hasOwnProperty("videos")&&null!=e.videos.standard_resolution)return e.videos.standard_resolution.url;var r=t.split("/");return r[r.length-2]},wdi_front.getFileType=function(e){return"VIDEO"==e.media_type&&e.hasOwnProperty("videos")?"EMBED_OEMBED_INSTAGRAM_VIDEO":"EMBED_OEMBED_INSTAGRAM_IMAGE"},wdi_front.array_max=function(e){for(var t=e[0],r=0,i=1;i<e.length;i++)t<e[i]&&(t=e[i],r=i);return{value:t,index:r}},wdi_front.array_min=function(e){for(var t=e[0],r=0,i=1;i<e.length;i++)t>e[i]&&(t=e[i],r=i);return{value:t,index:r}},wdi_front.activeUsersCount=function(e){for(var t=0,r=0;r<e.usersData.length;r++)"finished"!=e.usersData[r].finished&&t++;return t},wdi_front.checkMediaResponse=function(e,t){return""==e||void 0===e||null==e?(errorMessage=wdi_front_messages.connection_error,wdi_front.show_alert(errorMessage,e,t),!1):""!=e&&void 0!==e&&null!=e&&200!=e.meta.code?(errorMessage=e.meta.error_message,wdi_front.show_alert(errorMessage,e,t),!1):e},wdi_front.stripHashtag=function(e){switch(e[0]){case"#":return e.substr(1,e.length);default:return e}},wdi_front.getInputType=function(e){switch(e[0]){case"#":return"hashtag";case"%":return"location";default:return"user"}},wdi_front.regexpTestCaption=function(e,t){var r=!1,i=!1,a=t.replace(/[-[\]{}()*+?.,\\^$|]/g,"\\$&"),d=new RegExp("(?:^|\\s)"+a+"(?:^|\\s)"),o=new RegExp("(?:^|\\s)"+a,"g");for(null!=d.exec(e)&&(r=!0);null!=(match=o.exec(e));)i=!0;return 1==r||1==i},wdi_front.replaceNewLines=function(e){var t,r=[];for(e=e.replace(/\r?\n|\r/g,"vUkCJvN2ps3t"),t=new RegExp("vUkCJvN2ps3t","g");null!=(match=t.exec(e));)r.push(match.index);for(var i=e.split("vUkCJvN2ps3t"),a=0,d=0;d<i.length;d++)""==i[d]?a++:a=0,a>0&&(i.splice(d,1),a--,d--);return e=i.join(" ")},wdi_front.isEmptyObject=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0};var WDIFeed=function(e){this.data=e.data,this.dataCount=e.dataCount,this.feed_row=e.feed_row,this.usersData=e.usersData,_this=this,this.set_images_loading_flag=function(e){window.addEventListener("load",function(){e.nowLoadingImages=!1})},this.set_images_loading_flag(_this)};function wdi_extractHostname(e){return void 0===e||""===e?"":e.replace(/(^\w+:|^)\/\//,"")}WDIFeed.prototype.conditionalFilter=function(e,t){return e},WDIFeed.prototype.applyANDLogic=function(e,t){for(var r=0;r<t.length;r++)e=this.filterResponse(e,t[r]);return e},WDIFeed.prototype.applyORLogic=function(e,t){for(var r,i,a=[],d=[],o=0;o<t.length;o++)r=this.filterResponse(e,t[o]),a=a.concat(r.data),r={};for(o=0;o<a.length;o++)i=a[o],this.mediaExists(i,d)||this.mediaExists(i,this.dataStorageList)||d.push(i);return{data:d,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.applyNORLogic=function(e,t){for(var r=e,i=this.applyORLogic(e,t,this),a=[],d=0;d<r.data.length;d++)this.mediaExists(r.data[d],i.data)||a.push(r.data[d]);return{data:a,meta:r.meta,pagination:r.pagination}},WDIFeed.prototype.mediaExists=function(e,t){for(var r=0;r<t.length;r++)if(e.id==t[r].id)return!0;return!1},WDIFeed.prototype.filterResponse=function(e,t){switch(t.filter_type){case"hashtag":return this.filterByHashtag(e,t);case"username":return this.filterByUsername(e,t);case"mention":return this.filterByMention(e,t);case"description":return this.filterByDescription(e,t);case"location":return this.filterByLocation(e,t);case"url":return this.filterByUrl(e,t)}},WDIFeed.prototype.filterByHashtag=function(e,t){for(var r,i=[],a=0;a<e.data.length;a++)if(void 0!==(r=e.data[a]).tags)for(var d=0;d<r.tags.length;d++){tag=r.tags[d];var o=tag.toLowerCase(),n=t.filter_by.toLowerCase();o.trim()==n.trim()&&i.push(r)}return{data:i,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByUsername=function(e,t){for(var r,i=[],a=0;a<e.data.length;a++)(r=e.data[a]).user.username.toLowerCase()==t.filter_by.toLowerCase()&&i.push(r);return{data:i,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByMention=function(e,t){for(var r,i=[],a=0;a<e.data.length;a++)null!==(r=e.data[a]).caption&&-1!=r.caption.text.toLowerCase().indexOf("@"+t.filter_by.toLowerCase())&&i.push(r);return{data:i,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByDescription=function(e,t){for(var r,i,a=[],d=0;d<e.data.length;d++)if(null!==(r=e.data[d]).caption){i=r.caption.text.toLowerCase(),i=wdi_front.replaceNewLines(i);var o=t.filter_by.toLowerCase();wdi_front.regexpTestCaption(i,o)&&a.push(r)}return{data:a,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByLocation=function(e,t){for(var r,i=[],a=0;a<e.data.length;a++)null!==(r=e.data[a]).location&&r.location.id==t.filter_by&&i.push(r);return{data:i,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.filterByUrl=function(e,t){var r,i=[];t.filter_by=this.getIdFromUrl(t.filter_by);for(var a=0;a<e.data.length;a++)null!==(r=e.data[a]).link&&this.getIdFromUrl(r.link)==t.filter_by&&i.push(r);return{data:i,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.getIdFromUrl=function(e){for(var t=e.split("/"),r=!1,i=0;i<t.length;i++)if("p"==t[i]&&void 0!==t[i+1]){r=t[i+1];break}return r},WDIFeed.prototype.avoidDuplicateMedia=function(e){var t=e.data,r=[];void 0===t&&(t=[]);for(var i=0;i<t.length;i++)this.mediaExists(t[i],this.dataStorageList)||this.mediaExists(t[i],r)||this.mediaExists(t[i],this.conditionalFilterBuffer)||r.push(t[i]);return this.conditionalFilterBuffer=this.conditionalFilterBuffer.concat(r),{data:r,meta:e.meta,pagination:e.pagination}},WDIFeed.prototype.storeRawData=function(e,t){var r=this;if("object"==typeof this[t]&&"number"==typeof this[t].length)for(var i=0;i<e.length;i++){var a="";wdi_front.isHashtag(e[i].user_id)?void 0!==e[i].pagination.cursors&&(a=e[i].pagination.cursors.after):"liked"==r.feed_row.liked_feed?void 0===(a=e[i].pagination.next_max_like_id)&&(a=""):(null==e[i].pagination&&(e[i].pagination=[]),void 0===(a=e[i].pagination.next_max_id)&&(a="")),void 0===this[t][i]?this[t].push({data:e[i].data,index:0,locked:!1,hash_id:a,usersDataFinished:!1,userId:e[i].user_id,length:function(){return this.data.length-this.index},getData:function(e){var t=this.data.slice(this.index,this.index+e);if(this.index+=Math.min(e,this.length()),this.index==this.data.length&&1==this.locked&&0==this.usersDataFinished)for(var i=0;i<r.usersData.length;i++)if(r.usersData[i].user_id==this.userId){r.usersData[i].finished="finished",this.usersDataFinished=!0;break}return t}}):0==this[t][i].locked&&(a!=this[t][i].hash_id?(this[t][i].data=this[t][i].data.concat(e[i].data),this[t][i].hash_id=a):this[t][i].locked=!0)}},wdi_front.updateUsersIfNecessary=function(e){for(var t=e.feed_users,r=!1,i=0;i<t.length;i++)"#"!=t[i].username.substr(0,1)?""!=t[i].id&&"username"!=t[i].id||(r=!0,e.instagram.searchForUsersByName(t[i].username,{success:function(r){if(void 0!==r.meta&&void 0!==r.meta.error_type&&wdi_front.show_alert(!1,r,e),200==r.meta.code&&r.data.length>0){for(var i=!1,a=0;a<r.data.length;a++)if(r.data[a].username==r.args.username){i=!0;break}if(i)for(var d=0;d<t.length;d++)r.data[a].username==t[d].username&&(t[d].id=r.data[a].id)}for(var o=!1,n=0;n<t.length;n++)if(""==t[n].id||"username"==t[n].id){o=!0;break}o||(e.feed_row.feed_users=JSON.stringify(t),wdi_front.init(e))},username:t[i].username})):t[i].id=t[i].username;return r},void 0!==wdi_ajax.ajax_response?jQuery(document).one("ajaxStop",function(){"not_declared"!=wdi_front.type&&(wdi_front.clickOrTouch=wdi_front.detectEvent(),wdi_front.globalInit())}):jQuery(document).ready(function(){"not_declared"!=wdi_front.type&&(wdi_front.clickOrTouch=wdi_front.detectEvent(),wdi_front.globalInit())}),jQuery(document).ready(function(){setTimeout(function(){"1"===wdi_front_messages.show_alerts&&"I"!==jQuery(".wdi_check_fontawesome .tenweb-i-instagram").prop("tagName")&&console.log("Font Awesome is not loaded properly. Please ask for support https://wordpress.org/support/plugin/wd-instagram-feed/")},2e3)});
js/wdi_instagram.js CHANGED
@@ -18,26 +18,6 @@
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
  * WDIInstagram object constructor
43
  * @param {Object} args
@@ -51,9 +31,9 @@
51
  * else if function in method of some object then it should be an array
52
  * ['parent_object_name','filtering_function_name']]
53
  */
54
- function WDIInstagram(args)
55
- {
56
 
 
57
  this.access_tokens = [];
58
  this.filters = [];
59
  if (typeof args != 'undefined') {
@@ -86,13 +66,11 @@ function WDIInstagram(args)
86
  * @param {String} methodName [name of WDIInstagram method]
87
  * @return {Function} [filtering function for {methodName}]
88
  */
89
- this.getFilter = function (methodName)
90
- {
91
  var filters = _this.filters;
92
  if (typeof filters == "undefined") {
93
  return false;
94
  }
95
-
96
  for (var i = 0; i < filters.length; i++) {
97
  if (filters[i].where == methodName) {
98
 
@@ -118,30 +96,57 @@ function WDIInstagram(args)
118
  return false;
119
  }
120
 
121
- function getAccessToken() {
122
- var access_tokens = _this.access_tokens,
123
- index = parseInt(Math.random(0, 1) * access_tokens.length);
124
- return access_tokens[index];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  }
126
 
127
- function getGraphAcessToken() {
128
- if (typeof wdi_options !== "undefined") {
129
- return wdi_options.fb_token;
130
- } else if (typeof wdi_ajax !== "undefined") {
131
- return wdi_ajax.fb_token;
132
- } else {
133
- return "";
134
- }
 
 
135
  }
136
 
137
- function getBusinessAccountId() {
138
- if (typeof wdi_options !== "undefined") {
139
- return wdi_options.business_account_id;
140
- } else if (typeof wdi_ajax !== "undefined") {
141
- return wdi_ajax.business_account_id;
142
- } else {
143
- return "";
144
- }
 
 
 
 
 
 
 
 
145
  }
146
 
147
  /**
@@ -175,12 +180,12 @@ function WDIInstagram(args)
175
  * @param tagname => A valid tag name without a leading #. (eg. snowy, nofilter)
176
  * @param args = {
177
  * success : 'success_callback',
178
- * error : 'error_callback',
179
- * statusCode : statusCode
180
  * count : 'media_count',
181
- * min_tag_id : 'min_tag_id',
182
- * max_tag_id : 'max_tag_id',
183
- * args : arguments to be passed to filtering function
184
  * }
185
  *
186
  *
@@ -190,30 +195,21 @@ function WDIInstagram(args)
190
  *
191
  * @return object of founded media
192
  */
193
- this.getTagRecentMedia = function (tagname, args, next_url, endpoint)
194
- {
195
-
196
- var hastag_data_url = 'https://graph.facebook.com/ig_hashtag_search/';
197
- hastag_data_url += '?user_id=' + getBusinessAccountId();
198
- hastag_data_url += '&q=' + tagname;
199
- hastag_data_url += '&access_token=' + getGraphAcessToken();
200
-
201
  var instagram = this,
202
  noArgument = false,
203
  successFlag = false,
204
  statusCode = this.statusCode,
205
  errorFlag = false,
206
  argFlag = false,
207
- filter = this.getFilter('getTagRecentMedia')
208
-
209
- endpoint = (parseInt(endpoint) === 0) ? "top_media" : "recent_media"
210
-
211
- var baseUrl = 'https://graph.facebook.com/{tagid}/' + endpoint + '/?fields=media_url,caption,id,media_type,comments_count,like_count,permalink,children{media_url,id,media_type,permalink}';
212
 
 
213
 
214
  if (typeof args == 'undefined' || args.length === 0) {
215
  noArgument = true;
216
- } else {
 
217
 
218
  if ('success' in args) {
219
  successFlag = true;
@@ -224,13 +220,13 @@ function WDIInstagram(args)
224
  if ('error' in args) {
225
  errorFlag = true;
226
  }
227
- //
228
  if ('args' in args) {
229
  argFlag = true;
230
  } else {
231
  args.args = {};
232
  }
233
- //
234
  if ('count' in args) {
235
  args['count'] = parseInt(args['count']);
236
  if (!Number.isInteger(args['count']) || args['count'] <= 0) {
@@ -239,356 +235,148 @@ function WDIInstagram(args)
239
  } else {
240
  args.count = 33;
241
  }
242
-
243
- baseUrl += '&limit=' + args.count;
244
-
245
- if ('min_tag_id' in args) {
246
- baseUrl += '&min_tag_id=' + args.min_tag_id;
247
- }
248
-
249
- if ('max_tag_id' in args) {
250
- baseUrl += '&max_tag_id=' + args.max_tag_id;
251
- }
252
-
253
- baseUrl += "&access_token=" + getGraphAcessToken();
254
- baseUrl += "&user_id=" + getBusinessAccountId();
255
  }
256
 
257
  var wdiTagId = this.getTagId(tagname);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
258
 
259
- var wdi_callback = function (cache_data) {
260
- if(cache_data === false) {
261
-
262
- jQuery.ajax({
263
- type: 'POST',
264
- url: baseUrl,
265
- dataType: 'jsonp',
266
- success: function (response) {
267
- response = _this.convertHashtagData(response);
268
- response.meta = {"code": 200};
269
- response.tag_id = wdiTagId;
270
- _this.setDataToCache(baseUrl,response);
271
- success(response)
272
- },
273
- error: function (response) {
274
- if (errorFlag) {
275
- if (typeof args['error'] == 'object' && args['error'].length == 2) {
276
- if (typeof window[args['error'][0]][args['error'][1]] == 'function') {
277
- window[args['error'][0]][args['error'][1]](response);
278
- }
279
- } else if (typeof args['error'] == 'string') {
280
- if (typeof window[args['error']] == 'function') {
281
- window[args['error']](response);
282
- }
283
- } else if (typeof args['error'] == 'function') {
284
- args['error'](response);
285
- }
286
- }
287
- },
288
- statusCode: statusCode
289
- });
290
 
 
291
 
292
- }
293
- else{
294
- success(cache_data)
295
- }
296
-
297
- function success(response) {
298
- if (typeof response["data"] === "undefined") response["data"] = [];
299
- if (successFlag) {
300
- if (typeof args.success == 'object' && args.success.length == 2) {
301
- if (typeof window[args.success[0]] != 'undefined') {
302
- if (typeof window[args.success[0]][args.success[1]] == 'function') {
303
- if (filter) {
304
- response = filter(response, instagram.filterArguments, args.args);
305
- }
306
- window[args.success[0]][args.success[1]](response);
307
- }
308
- }
309
-
310
- } else if (typeof args.success == 'string') {
311
- if (typeof window[args.success] == 'function') {
312
- if (filter) {
313
- response = filter(response, instagram.filterArguments, args.args);
314
- }
315
- window[args.success](response);
316
- }
317
- } else if (typeof args.success == 'function') {
318
- if (filter) {
319
- response = filter(response, instagram.filterArguments, args.args);
320
- }
321
- args.success(response);
322
- }
323
- }
324
- }
325
- };
326
 
327
- if (wdiTagId === false) {
328
- jQuery.ajax({
329
- type: 'GET',
330
- url: hastag_data_url,
331
- dataType: 'jsonp',
332
- }).done(function (response) {
333
 
334
 
335
- if (typeof response.error === 'undefined') {
336
- wdiTagId = response.data[0].id;
337
- } else {
338
- alert(response.error.message);
339
- return;
340
- }
341
 
342
- if (typeof next_url === "undefined" || next_url === null) {
343
- baseUrl = baseUrl.replace('{tagid}', wdiTagId);
344
- } else {
345
- baseUrl = next_url;
346
- }
347
 
348
- var all_tags = [];
349
- if(typeof window['wdi_all_tags'] !== "undefined"){
350
- all_tags = window['wdi_all_tags'];
351
- }
 
352
 
353
- all_tags[wdiTagId] = {
354
- id: "#" + tagname,
355
- username: "#" + tagname,
356
- tag_id: wdiTagId
357
- };
358
 
359
- window['wdi_all_tags'] = all_tags;
360
 
361
- _this.getDataFromCache(wdi_callback, baseUrl);
362
 
363
- });
364
- } else {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
365
 
366
- if (typeof next_url === "undefined" || next_url === null) {
367
- baseUrl = baseUrl.replace('{tagid}', wdiTagId);
368
- } else {
369
- baseUrl = next_url;
 
 
370
  }
371
- _this.getDataFromCache(wdi_callback, baseUrl);
 
 
 
 
 
 
 
 
372
 
 
 
 
 
 
 
373
  }
 
 
374
  }
375
 
376
  this.getTagId = function (tagname) {
377
- var feed_users = [];
378
 
379
- if (typeof wdi_controller !== "undefined") {
380
- feed_users = wdi_controller.feed_users;
381
- if (feed_users.length === 0) {
382
- var json = jQuery('#WDI_feed_users').val();
383
- feed_users = JSON.parse(json);
384
- }
385
- }else if(typeof window['wdi_all_tags'] !== "undefined"){
386
- feed_users = window['wdi_all_tags'];
387
  }
 
 
 
 
388
 
389
-
390
- for (var i in feed_users) {
391
-
392
- if (tagname === feed_users[i].username || "#" + tagname === feed_users[i].username) {
393
-
394
- if (typeof feed_users[i].tag_id !== "undefined") {
395
- return feed_users[i].tag_id;
396
- }
397
- return false;
398
-
399
- }
400
-
401
  }
 
402
 
403
- return false;
404
  };
405
 
406
  this.convertHashtagData = function (data) {
407
- var converted_data = {
408
- data: [],
409
- pagination: {}
410
- };
411
-
412
- if(typeof data.paging !== "undefined"){
413
- converted_data.pagination = {
414
- cursors: {after: data.paging.cursors.after},
415
- next_url: data.paging.next
416
- }
417
- }
418
-
419
- for (var i in data.data) {
420
- var media = data.data[i];
421
-
422
- var media_type;
423
- if (media.media_type === "IMAGE") {
424
- media_type = "image";
425
- } else if (media.media_type === "VIDEO") {
426
- media_type = "video";
427
- } else {
428
- media_type = "carousel";
429
- }
430
-
431
- var converted = {
432
- "id": media.id,
433
- "user": {
434
- "id": "",
435
- "full_name": "",
436
- "profile_picture": "",
437
- "username": ""
438
- },
439
- "images": {
440
- "thumbnail": {
441
- "width": 150,
442
- "height": 150,
443
- "url": media.permalink + "media?size=t"
444
- },
445
- "low_resolution": {
446
- "width": 320,
447
- "height": 320,
448
- "url": media.permalink + "media?size=m"
449
- },
450
- "standard_resolution": {
451
- "width": 1080,
452
- "height": 1080,
453
- "url": media.permalink + "media?size=l"
454
- }
455
- },
456
- "created_time": media.timestamp,
457
- "caption": {
458
- "id": "",
459
- "text": media.caption,
460
- "created_time": "",
461
- "from": {
462
- "id": "",
463
- "full_name": "",
464
- "profile_picture": "",
465
- "username": ""
466
- }
467
- },
468
- "user_has_liked": (media.like_count > 0),
469
- "likes": {
470
- "count": media.like_count
471
- },
472
- "tags": [],
473
- "filter": "Normal",
474
- "comments": {
475
- "count": media.comments_count
476
- },
477
- "type": media_type,
478
- "link": media.permalink,
479
- "location": null,
480
- "attribution": null,
481
- "users_in_photo": []
482
- };
483
-
484
- if (media.media_type === "IMAGE" || media.media_type === "CAROUSEL_ALBUM") {
485
- converted.images = {
486
- "thumbnail": {
487
- "width": 150,
488
- "height": 150,
489
- "url": media.permalink + "media?size=t"
490
- },
491
- "low_resolution": {
492
- "width": 320,
493
- "height": 320,
494
- "url": media.permalink + "media?size=m"
495
- },
496
- "standard_resolution": {
497
- "width": 1080,
498
- "height": 1080,
499
- "url": media.permalink + "media?size=l"
500
- }
501
- };
502
- } else if (media.media_type === "VIDEO") {
503
- converted.videos = {
504
- "standard_resolution": {
505
- "width": 640,
506
- "height": 800,
507
- "url": media.media_url,
508
- },
509
- "low_bandwidth": {
510
- "width": 480,
511
- "height": 600,
512
- "url": media.media_url,
513
- },
514
- "low_resolution": {
515
- "width": 480,
516
- "height": 600,
517
- "url": media.media_url,
518
- }
519
- };
520
- }
521
-
522
- if (media.media_type === "CAROUSEL_ALBUM") {
523
- converted.carousel_media = [];
524
-
525
- for (var j in media.children.data) {
526
- if (media.children.data[j].media_type === "IMAGE") {
527
- var child = {
528
- "images": {
529
- "thumbnail": {
530
- "width": 150,
531
- "height": 150,
532
- "url": media.children.data[j].media_url + "media?size=t"
533
- },
534
- "low_resolution": {
535
- "width": 320,
536
- "height": 320,
537
- "url": media.children.data[j].permalink + "media?size=m"
538
- },
539
- "standard_resolution": {
540
- "width": 640,
541
- "height": 640,
542
- "url": media.children.data[j].media_url
543
- }
544
- },
545
- "users_in_photo": [],
546
- "type": "image"
547
- };
548
- } else {
549
- var child = {
550
- "videos": {
551
- "standard_resolution": {
552
- "width": 640,
553
- "height": 800,
554
- "url": media.children.data[j].media_url,
555
- "id": media.children.data[j].id
556
- },
557
- "low_bandwidth": {
558
- "width": 480,
559
- "height": 600,
560
- "url": media.children.data[j].media_url,
561
- "id": media.children.data[j].id
562
- },
563
- "low_resolution": {
564
- "width": 480,
565
- "height": 600,
566
- "url": media.children.data[j].media_url,
567
- "id": media.children.data[j].id
568
- }
569
- },
570
- "users_in_photo": [],
571
- "type": "video"
572
- };
573
- }
574
-
575
- converted.carousel_media.push(child);
576
-
577
- }
578
-
579
- }
580
-
581
- converted_data.data.push(converted);
582
- }
583
-
584
- return converted_data;
585
- };
586
- var carusel_media_ids = [];
587
- this.convertPersonalData = function (data) {
588
  var converted_data = {
589
- data: [],
590
- pagination: {}
591
- };
592
 
593
  if(typeof data.paging !== "undefined"){
594
  converted_data.pagination = {
@@ -597,7 +385,7 @@ function WDIInstagram(args)
597
  }
598
  }
599
 
600
- for ( var i in data.data ) {
601
  var media = data.data[i];
602
 
603
  var media_type;
@@ -648,14 +436,13 @@ function WDIInstagram(args)
648
  },
649
  "user_has_liked": (media.like_count > 0),
650
  "likes": {
651
- "count": 0, // media.like_count
652
  },
653
  "tags": [],
654
  "filter": "Normal",
655
  "comments": {
656
- "count": 0, // media.comments_count
657
  },
658
- "media_type": media.media_type,
659
  "type": media_type,
660
  "link": media.permalink,
661
  "location": null,
@@ -681,8 +468,7 @@ function WDIInstagram(args)
681
  "url": media.permalink + "media?size=l"
682
  }
683
  };
684
- }
685
- else if (media.media_type === "VIDEO") {
686
  converted.videos = {
687
  "standard_resolution": {
688
  "width": 640,
@@ -703,66 +489,70 @@ function WDIInstagram(args)
703
  }
704
 
705
  if (media.media_type === "CAROUSEL_ALBUM") {
706
- carusel_media_ids.push({'index' : i, 'media_id' : media.id});
707
- }
708
- converted_data.data.push(converted);
709
- }
710
- return converted_data;
711
- };
712
-
713
 
714
- /**
715
- Object which will get from instagram endpoint carousel media data
716
- */
717
- var childMedia = [];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
718
 
719
- /**
720
- * Get media info by id.
721
- *
722
- * @param media_id => Media id
723
- * @param ind => index for object
724
- *
725
- *
726
- * @return object of founded media
727
- */
728
- this.getChildMediaById = function ( media_id, ind ) {
729
- jQuery.ajax({
730
- type: 'GET',
731
- dataType: 'json',
732
- async: false,
733
- url: 'https://graph.instagram.com/v1.0/' + media_id + '/?fields=id,media_type,media_url,permalink,thumbnail_url,username,timestamp&access_token='+ getAccessToken(),
734
- success: function (response_media) {
735
- childMedia[ind] = response_media;
736
- }
737
- });
738
- };
739
 
740
- /**
741
- * Get media children id by gallery id.
742
- *
743
- * @param media_id => Media id
744
- *
745
- *
746
- * @return object of founded media only child media ids
747
- */
748
- this.getMediaChildren = function (media_id) {
749
- var req_url = 'https://graph.instagram.com/' + media_id + '/children?access_token=' + getAccessToken();
750
- return jQuery.ajax({
751
- type: 'POST',
752
- url: req_url,
753
- dataType: 'jsonp',
754
- async:false,
755
- success: function (response) {
756
- if( typeof response.data !== "undefined" && response.data.length > 0 ) {
757
- jQuery.each(response.data, function (key, value) {
758
- _this.getChildMediaById(value.id, key);
759
- });
760
  }
 
761
  }
762
- });
763
 
764
- }
 
765
 
 
 
766
 
767
  /**
768
  * Search for tags by name.
@@ -810,6 +600,14 @@ function WDIInstagram(args)
810
  }
811
  }
812
 
 
 
 
 
 
 
 
 
813
 
814
  var req_url = 'https://api.instagram.com/v1/tags/search?q=' + tagname + '&access_token=' + getAccessToken();
815
  var wdi_callback = function (cache_data) {
@@ -883,27 +681,10 @@ function WDIInstagram(args)
883
 
884
  /*deprecated API*/
885
  /**
886
- * Get a list of users matching the query.
887
- *
888
- *
889
- * @definition success_callback => which function to call in case of success
890
- * @definition error_callback => which function to call in case of error
891
- * @definition statusCode => StatusCode object.
892
- *
893
- * @param username
894
- * @param args = {
895
- * success: 'success_callback',
896
- * error: 'error_callback',
897
- * statusCode : statusCode
898
- * }
899
- *
900
- *
901
- * if callback function is property of any other object just give it as array [ 'parent_object', 'callback_function']
902
- * or you can pass as callback function an anonymous function
903
- *
904
- *
905
- * @return object of founded users
906
- */
907
  this.searchForUsersByName = function (username, args)
908
  {
909
  var instagram = this,
@@ -1005,7 +786,9 @@ function WDIInstagram(args)
1005
  *
1006
  * @return object of founded media
1007
  */
1008
-
 
 
1009
  this.getRecentLikedMedia = function (args)
1010
  {
1011
  var instagram = this,
@@ -1136,6 +919,12 @@ function WDIInstagram(args)
1136
  *
1137
  * @return object of founded media
1138
  */
 
 
 
 
 
 
1139
  this.getUserRecentMedia = function (user_id, args)
1140
  {
1141
  var instagram = this,
@@ -1275,16 +1064,20 @@ function WDIInstagram(args)
1275
  *
1276
  * @return object of founded media
1277
  */
1278
- this.getUserMedia = function (args)
1279
- {
 
 
 
 
1280
  var instagram = this,
1281
  noArgument = false,
1282
  successFlag = false,
1283
  statusCode = this.statusCode,
1284
  errorFlag = false,
1285
  argFlag = false,
1286
- filter = this.getFilter('getUserMedia'),
1287
- baseUrl = 'https://graph.instagram.com/v1.0/' + args.user_id + '/media?access_token=' + getAccessToken();
1288
 
1289
  if (typeof args == 'undefined' || args.length === 0) {
1290
  noArgument = true;
@@ -1314,167 +1107,27 @@ function WDIInstagram(args)
1314
  } else {
1315
  args.count = 20;
1316
  }
1317
-
1318
- baseUrl += '&count=' + args.count;
1319
-
1320
- if ('min_id' in args) {
1321
- baseUrl += '&min_id=' + args.min_id;
1322
- }
1323
-
1324
- if ('max_id' in args) {
1325
- baseUrl += '&max_id=' + args.max_id;
1326
- }
1327
  }
1328
 
1329
- var wdi_callback = function (cache_data) {
1330
- if(cache_data === false){
1331
- jQuery.ajax({
1332
- type: 'POST',
1333
- dataType: 'jsonp',
1334
- url: baseUrl,
1335
- success: function (response)
1336
- {
1337
- // new functionality on API 2020 get media by ID
1338
- // @TODO this functionality is bad It is wrong to use ajax in the loop
1339
- if( response.data && response.data.length > 0 ) {
1340
- var media = [];
1341
- for ( var i = 0; i < response.data.length; i++ ) {
1342
- var media_id = response.data[i]['id'];
1343
- jQuery.ajax({
1344
- type: 'GET',
1345
- dataType: 'json',
1346
- url: 'https://graph.instagram.com/v1.0/' + media_id + '/?fields=id,media_type,media_url,permalink,thumbnail_url,username,caption,timestamp&access_token='+ getAccessToken(),
1347
- statusCode: statusCode,
1348
- async: false,
1349
- success: function (response_media) {
1350
- media.push(response_media);
1351
- },
1352
- error: function (response_media) {
1353
- }
1354
- });
1355
- }
1356
- }
1357
- response.data = media;
1358
- response = _this.convertPersonalData(response);
1359
-
1360
- if( carusel_media_ids.length > 0 ) {
1361
- set_carousel_media( response, carusel_media_ids, 0 );
1362
- } else {
1363
- response.meta = {"code": 200};
1364
- _this.setDataToCache(baseUrl, response);
1365
- success(response);
1366
- }
1367
- },
1368
- error: function (response)
1369
- {
1370
- if (errorFlag) {
1371
- if (typeof args['error'] == 'object' && args['error'].length == 2) {
1372
- if (typeof window[args['error'][0]][args['error'][1]] == 'function') {
1373
- window[args['error'][0]][args['error'][1]](response);
1374
- }
1375
- } else
1376
- if (typeof args['error'] == 'string') {
1377
- if (typeof window[args['error']] == 'function') {
1378
- window[args['error']](response);
1379
- }
1380
- } else
1381
- if (typeof args['error'] == 'function') {
1382
- args['error'](response);
1383
- }
1384
- }
1385
- },
1386
- statusCode: statusCode
1387
- });
1388
- } else {
1389
- success(cache_data);
1390
- }
1391
-
1392
- /**
1393
- * Set to global media object the carousel media data as key carousel-media.
1394
- *
1395
- * @param response => Global media object
1396
- * @param carusel_media_ids => Child ids
1397
- * @param ind => index counter
1398
- *
1399
- */
1400
- function set_carousel_media( response, carusel_media_ids, ind ) {
1401
- jQuery.when(_this.getMediaChildren(carusel_media_ids[ind].media_id)).done(function () {
1402
- if( childMedia.length > 0 ) {
1403
- var media = response['data'][ind];
1404
- media['children'] = {};
1405
- media['children']['data'] = childMedia;
1406
- var index = carusel_media_ids[ind].index;
1407
- response.data[index].carousel_media = [];
1408
- for (var j in media.children.data) {
1409
- if (media.children.data[j].media_type === "IMAGE") {
1410
- var child = {
1411
- "images": {
1412
- "thumbnail": {
1413
- "width": 150,
1414
- "height": 150,
1415
- "url": media.children.data[j].media_url + "media?size=t"
1416
- },
1417
- "low_resolution": {
1418
- "width": 320,
1419
- "height": 320,
1420
- "url": media.children.data[j].permalink + "media?size=m"
1421
- },
1422
- "standard_resolution": {
1423
- "width": 640,
1424
- "height": 640,
1425
- "url": media.children.data[j].media_url
1426
- }
1427
- },
1428
- "users_in_photo": [],
1429
- "type": "image"
1430
- };
1431
- }
1432
- else {
1433
- var child = {
1434
- "videos": {
1435
- "standard_resolution": {
1436
- "width": 640,
1437
- "height": 800,
1438
- "url": media.children.data[j].media_url,
1439
- "id": media.children.data[j].id
1440
- },
1441
- "low_bandwidth": {
1442
- "width": 480,
1443
- "height": 600,
1444
- "url": media.children.data[j].media_url,
1445
- "id": media.children.data[j].id
1446
- },
1447
- "low_resolution": {
1448
- "width": 480,
1449
- "height": 600,
1450
- "url": media.children.data[j].media_url,
1451
- "id": media.children.data[j].id
1452
- }
1453
- },
1454
- "users_in_photo": [],
1455
- "type": "video"
1456
- };
1457
- }
1458
- response.data[index].carousel_media.push(child);
1459
- }
1460
- }
1461
-
1462
- if( ind < (carusel_media_ids.length-1) ) {
1463
- set_carousel_media( response,carusel_media_ids,++ind );
1464
- } else {
1465
- response.meta = {"code": 200};
1466
- _this.setDataToCache(baseUrl, response);
1467
- success(response);
1468
- }
1469
- });
1470
- }
1471
 
1472
- function success(response) {
 
 
 
 
 
 
 
 
 
 
 
1473
  if (successFlag) {
1474
  if (typeof args.success == 'object' && args.success.length == 2) {
1475
  if (typeof window[args.success[0]] != 'undefined') {
1476
  if (typeof window[args.success[0]][args.success[1]] == 'function') {
1477
  if (filter) {
 
1478
  response = filter(response, instagram.filterArguments, args);
1479
  }
1480
  window[args.success[0]][args.success[1]](response);
@@ -1484,6 +1137,7 @@ function WDIInstagram(args)
1484
  if (typeof args.success == 'string') {
1485
  if (typeof window[args.success] == 'function') {
1486
  if (filter) {
 
1487
  response = filter(response, instagram.filterArguments, args);
1488
  }
1489
  window[args.success](response);
@@ -1491,16 +1145,34 @@ function WDIInstagram(args)
1491
  } else
1492
  if (typeof args.success == 'function') {
1493
  if (filter) {
 
1494
  response = filter(response, instagram.filterArguments, args);
1495
  }
1496
  args.success(response);
1497
  }
1498
  }
1499
- }
1500
- }
1501
-
1502
- _this.getDataFromCache(wdi_callback, baseUrl);
1503
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1504
  }
1505
 
1506
  /* deprecated API */
@@ -1526,8 +1198,12 @@ function WDIInstagram(args)
1526
  *
1527
  * @return object of founded info
1528
  */
1529
- this.getUserInfo = function (user_id, args)
1530
- {
 
 
 
 
1531
  var instagram = this,
1532
  noArgument = false,
1533
  successFlag = false,
@@ -1607,7 +1283,6 @@ function WDIInstagram(args)
1607
  });
1608
  }
1609
 
1610
-
1611
  /**
1612
  * Get information about the owner of the access_token.
1613
  *
@@ -1629,8 +1304,12 @@ function WDIInstagram(args)
1629
  *
1630
  * @return object of founded info
1631
  */
1632
- this.getSelfInfo = function (args)
1633
- {
 
 
 
 
1634
  var instagram = this,
1635
  noArgument = false,
1636
  successFlag = false,
@@ -1639,81 +1318,82 @@ function WDIInstagram(args)
1639
  filter = this.getFilter('getSelfInfo');
1640
  if (typeof args == 'undefined' || args.length === 0) {
1641
  noArgument = true;
1642
- } else {
 
1643
  if ('success' in args) {
1644
  successFlag = true;
1645
  }
1646
-
1647
  if ('error' in args) {
1648
  errorFlag = true;
1649
  }
1650
-
1651
  if ('statusCode' in args) {
1652
  statusCode = args['statusCode'];
1653
  }
1654
  }
1655
-
1656
- var req_url = 'https://api.instagram.com/v1/users/self/?access_token=' + getAccessToken();
1657
  var wdi_callback = function (cache_data) {
1658
- if(cache_data === false){
1659
  jQuery.ajax({
1660
  type: 'POST',
1661
  dataType: 'jsonp',
1662
- url:req_url,
1663
- success: function (response)
1664
- {
1665
- _this.setDataToCache(req_url,response);
1666
  if (successFlag) {
1667
  if (typeof args.success == 'object' && args.success.length == 2) {
1668
  if (typeof window[args.success[0]] != 'undefined') {
1669
  if (typeof window[args.success[0]][args.success[1]] == 'function') {
1670
  if (filter) {
 
1671
  response = filter(response, instagram.filterArguments);
1672
  }
1673
  window[args.success[0]][args.success[1]](response);
1674
  }
1675
  }
1676
- } else
1677
- if (typeof args.success == 'string') {
1678
- if (typeof window[args.success] == 'function') {
1679
- if (filter) {
1680
- response = filter(response, instagram.filterArguments);
 
 
 
 
1681
  }
1682
- window[args.success](response);
1683
  }
1684
- } else
1685
- if (typeof args.success == 'function') {
1686
- if (filter) {
1687
- response = filter(response, instagram.filterArguments);
 
 
 
 
1688
  }
1689
- args.success(response);
1690
  }
1691
  }
1692
  },
1693
- error: function (response)
1694
- {
1695
-
1696
  if (errorFlag) {
1697
  if (typeof args['error'] == 'object' && args['error'].length == 2) {
1698
  if (typeof window[args['error'][0]][args['error'][1]] == 'function') {
1699
  window[args['error'][0]][args['error'][1]](response);
1700
  }
1701
- } else
1702
- if (typeof args['error'] == 'string') {
1703
  if (typeof window[args['error']] == 'function') {
1704
  window[args['error']](response);
1705
  }
1706
- } else
1707
- if (typeof args['error'] == 'function') {
1708
  args['error'](response);
1709
  }
1710
  }
1711
- },
1712
- statusCode: statusCode
1713
-
1714
  });
1715
  }
1716
- else{
1717
  success(cache_data);
1718
  }
1719
 
@@ -1728,26 +1408,29 @@ function WDIInstagram(args)
1728
  window[args.success[0]][args.success[1]](response);
1729
  }
1730
  }
1731
- } else
1732
- if (typeof args.success == 'string') {
1733
- if (typeof window[args.success] == 'function') {
1734
- if (filter) {
1735
- response = filter(response, instagram.filterArguments);
 
 
 
1736
  }
1737
- window[args.success](response);
1738
  }
1739
- } else
1740
- if (typeof args.success == 'function') {
1741
- if (filter) {
1742
- response = filter(response, instagram.filt
18
  *
19
  */
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  /**
22
  * WDIInstagram object constructor
23
  * @param {Object} args
31
  * else if function in method of some object then it should be an array
32
  * ['parent_object_name','filtering_function_name']]
33
  */
34
+ function WDIInstagram(args) {
 
35
 
36
+ this.user = {};
37
  this.access_tokens = [];
38
  this.filters = [];
39
  if (typeof args != 'undefined') {
66
  * @param {String} methodName [name of WDIInstagram method]
67
  * @return {Function} [filtering function for {methodName}]
68
  */
69
+ this.getFilter = function (methodName) {
 
70
  var filters = _this.filters;
71
  if (typeof filters == "undefined") {
72
  return false;
73
  }
 
74
  for (var i = 0; i < filters.length; i++) {
75
  if (filters[i].where == methodName) {
76
 
96
  return false;
97
  }
98
 
99
+ function getUserId() {
100
+ if ( typeof _this.user !== 'undefined' && typeof _this.user.user_id !== 'undefined' ) {
101
+ return _this.user.user_id
102
+ }
103
+ else if ( typeof wdi_object !== 'undefined' && typeof wdi_object.user !== 'undefined' ) {
104
+ return wdi_object.user.user_id;
105
+ }
106
+ else {
107
+ return '';
108
+ }
109
+ }
110
+ function getUserName() {
111
+ if ( typeof _this.user !== 'undefined' && typeof _this.user.user_name !== 'undefined' ) {
112
+ return _this.user.user_name
113
+ }
114
+ else if ( typeof wdi_object !== 'undefined' && typeof wdi_object.user !== 'undefined' ) {
115
+ return wdi_object.user.user_name;
116
+ }
117
+ else {
118
+ return '';
119
+ }
120
  }
121
 
122
+ function getAccessToken() {
123
+ if ( typeof _this.user !== 'undefined' && typeof _this.user.access_token !== 'undefined' ) {
124
+ return _this.user.access_token
125
+ }
126
+ else if ( typeof wdi_object !== 'undefined' && typeof wdi_object.user !== 'undefined' && typeof wdi_object.user.access_token !== 'undefined' ) {
127
+ return wdi_object.user.access_token;
128
+ }
129
+ else {
130
+ return '';
131
+ }
132
  }
133
 
134
+ function getGraphAcessToken() {
135
+ if ( typeof _this.user !== 'undefined' && typeof _this.user.access_token !== 'undefined' ) {
136
+ return _this.user.access_token
137
+ }
138
+ if ( typeof wdi_object !== 'undefined' && typeof wdi_object.user !== 'undefined' ) {
139
+ return wdi_object.user.access_token;
140
+ }
141
+ if ( typeof wdi_options !== 'undefined' ) {
142
+ return wdi_options.fb_token;
143
+ }
144
+ else if ( typeof wdi_ajax !== 'undefined' ) {
145
+ return wdi_ajax.fb_token;
146
+ }
147
+ else {
148
+ return "";
149
+ }
150
  }
151
 
152
  /**
180
  * @param tagname => A valid tag name without a leading #. (eg. snowy, nofilter)
181
  * @param args = {
182
  * success : 'success_callback',
183
+ * error : 'error_callback',
184
+ * statusCode : 'statusCode',
185
  * count : 'media_count',
186
+ * min_tag_id : 'min_tag_id',
187
+ * max_tag_id : 'max_tag_id',
188
+ * args : arguments to be passed to filtering function
189
  * }
190
  *
191
  *
195
  *
196
  * @return object of founded media
197
  */
198
+ this.getTagRecentMedia = function (tagname, args, next_url, endpoint) {
 
 
 
 
 
 
 
199
  var instagram = this,
200
  noArgument = false,
201
  successFlag = false,
202
  statusCode = this.statusCode,
203
  errorFlag = false,
204
  argFlag = false,
205
+ filter = this.getFilter('getTagRecentMedia');
 
 
 
 
206
 
207
+ endpoint = (parseInt(endpoint) === 0) ? "top_media" : "recent_media";
208
 
209
  if (typeof args == 'undefined' || args.length === 0) {
210
  noArgument = true;
211
+ }
212
+ else {
213
 
214
  if ('success' in args) {
215
  successFlag = true;
220
  if ('error' in args) {
221
  errorFlag = true;
222
  }
223
+
224
  if ('args' in args) {
225
  argFlag = true;
226
  } else {
227
  args.args = {};
228
  }
229
+
230
  if ('count' in args) {
231
  args['count'] = parseInt(args['count']);
232
  if (!Number.isInteger(args['count']) || args['count'] <= 0) {
235
  } else {
236
  args.count = 33;
237
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
238
  }
239
 
240
  var wdiTagId = this.getTagId(tagname);
241
+ jQuery.ajax({
242
+ type: "POST",
243
+ url: wdi_ajax.ajax_url,
244
+ dataType:"json",
245
+ data: {
246
+ tagname:tagname,
247
+ endpoint:endpoint,
248
+ wdi_nonce:wdi_ajax.wdi_nonce,
249
+ wdiTagId:wdiTagId,
250
+ next_url:next_url,
251
+ user_name:getUserName(),
252
+ action:"wdi_getTagRecentMedia"
253
+ },
254
+ success: function (response) {
255
+ if(wdiTagId === false){
256
+ wdiTagId = "";
257
+ }
258
+ if(typeof response.tag_data !== "undefined"){
259
 
260
+ var tag_data = response.tag_data;
261
+ if(typeof tag_data.tag_id !== "undefined"){
262
+ wdiTagId = tag_data.tag_id;
263
+ }
264
+ var all_tags = [];
265
+ if(typeof window['wdi_all_tags'] !== "undefined"){
266
+ all_tags = window['wdi_all_tags'];
267
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
268
 
269
+ all_tags[tag_data.tag_id] = tag_data;
270
 
271
+ window['wdi_all_tags'] = all_tags;
272
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
273
 
274
+ response = response.response;
 
 
 
 
 
275
 
276
 
 
 
 
 
 
 
277
 
 
 
 
 
 
278
 
279
+ response = _this.convertHashtagData(response);
280
+ response.meta = {"code": 200};
281
+ response.tag_id = wdiTagId;
282
+ response = _this.addTags(response);
283
+ success(response)
284
 
 
 
 
 
 
285
 
 
286
 
 
287
 
288
+ },
289
+ error: function (response) {
290
+ if (errorFlag) {
291
+ if (typeof args['error'] == 'object' && args['error'].length == 2) {
292
+ if (typeof window[args['error'][0]][args['error'][1]] == 'function') {
293
+ window[args['error'][0]][args['error'][1]](response);
294
+ }
295
+ } else if (typeof args['error'] == 'string') {
296
+ if (typeof window[args['error']] == 'function') {
297
+ window[args['error']](response);
298
+ }
299
+ } else if (typeof args['error'] == 'function') {
300
+ args['error'](response);
301
+ }
302
+ }
303
+ },
304
+ statusCode: statusCode
305
+ });
306
+ function success(response) {
307
+ if (typeof response["data"] === "undefined") response["data"] = [];
308
+ if (successFlag) {
309
+ if (typeof args.success == 'object' && args.success.length == 2) {
310
+ if (typeof window[args.success[0]] != 'undefined') {
311
+ if (typeof window[args.success[0]][args.success[1]] == 'function') {
312
+ if (filter) {
313
+ response = filter(response, instagram.filterArguments, args.args);
314
+ }
315
+ window[args.success[0]][args.success[1]](response);
316
+ }
317
+ }
318
 
319
+ } else if (typeof args.success == 'string') {
320
+ if (typeof window[args.success] == 'function') {
321
+ if (filter) {
322
+ response = filter(response, instagram.filterArguments, args.args);
323
+ }
324
+ window[args.success](response);
325
  }
326
+ } else if (typeof args.success == 'function') {
327
+ if (filter) {
328
+ response = filter(response, instagram.filterArguments, args.args);
329
+ }
330
+ args.success(response);
331
+ }
332
+ }
333
+ }
334
+ }
335
 
336
+ this.addTags = function (response) {
337
+ for (i in response.data) {
338
+ var caption = response.data[i].caption.text;
339
+ if (typeof caption !== 'undefined' && caption !== '' && caption.indexOf('#') != -1) {
340
+ var res = caption.split('#');
341
+ response.data[i].tags = res;
342
  }
343
+ }
344
+ return response;
345
  }
346
 
347
  this.getTagId = function (tagname) {
 
348
 
349
+ var feed_users = [];
350
+ if ( typeof wdi_controller !== 'undefined' ) {
351
+ feed_users = wdi_controller.feed_users;
352
+ if (feed_users.length === 0) {
353
+ var json = jQuery('#WDI_feed_users').val();
354
+ if (typeof json !== 'undefined' && json !== '' ) {
355
+ feed_users = JSON.parse(json);
356
+ }
357
  }
358
+ }
359
+ else if(typeof window['wdi_all_tags'] !== "undefined"){
360
+ feed_users = window['wdi_all_tags'];
361
+ }
362
 
363
+ for (var i in feed_users) {
364
+ if (tagname === feed_users[i].username || "#" + tagname === feed_users[i].username) {
365
+ if (typeof feed_users[i].tag_id !== "undefined") {
366
+ return feed_users[i].tag_id;
367
+ }
368
+ return false;
 
 
 
 
 
 
369
  }
370
+ }
371
 
372
+ return false;
373
  };
374
 
375
  this.convertHashtagData = function (data) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
376
  var converted_data = {
377
+ data: [],
378
+ pagination: {}
379
+ };
380
 
381
  if(typeof data.paging !== "undefined"){
382
  converted_data.pagination = {
385
  }
386
  }
387
 
388
+ for (var i in data.data) {
389
  var media = data.data[i];
390
 
391
  var media_type;
436
  },
437
  "user_has_liked": (media.like_count > 0),
438
  "likes": {
439
+ "count": media.like_count
440
  },
441
  "tags": [],
442
  "filter": "Normal",
443
  "comments": {
444
+ "count": media.comments_count
445
  },
 
446
  "type": media_type,
447
  "link": media.permalink,
448
  "location": null,
468
  "url": media.permalink + "media?size=l"
469
  }
470
  };
471
+ } else if (media.media_type === "VIDEO") {
 
472
  converted.videos = {
473
  "standard_resolution": {
474
  "width": 640,
489
  }
490
 
491
  if (media.media_type === "CAROUSEL_ALBUM") {
492
+ converted.carousel_media = [];
 
 
 
 
 
 
493
 
494
+ for (var j in media.children.data) {
495
+ if (media.children.data[j].media_type === "IMAGE") {
496
+ var child = {
497
+ "images": {
498
+ "thumbnail": {
499
+ "width": 150,
500
+ "height": 150,
501
+ "url": media.children.data[j].media_url + "media?size=t"
502
+ },
503
+ "low_resolution": {
504
+ "width": 320,
505
+ "height": 320,
506
+ "url": media.children.data[j].permalink + "media?size=m"
507
+ },
508
+ "standard_resolution": {
509
+ "width": 640,
510
+ "height": 640,
511
+ "url": media.children.data[j].media_url
512
+ }
513
+ },
514
+ "users_in_photo": [],
515
+ "type": "image"
516
+ };
517
+ }
518
+ else {
519
+ var child = {
520
+ "videos": {
521
+ "standard_resolution": {
522
+ "width": 640,
523
+ "height": 800,
524
+ "url": media.children.data[j].media_url,
525
+ "id": media.children.data[j].id
526
+ },
527
+ "low_bandwidth": {
528
+ "width": 480,
529
+ "height": 600,
530
+ "url": media.children.data[j].media_url,
531
+ "id": media.children.data[j].id
532
+ },
533
+ "low_resolution": {
534
+ "width": 480,
535
+ "height": 600,
536
+ "url": media.children.data[j].media_url,
537
+ "id": media.children.data[j].id
538
+ }
539
+ },
540
+ "users_in_photo": [],
541
+ "type": "video"
542
+ };
543
+ }
544
 
545
+ converted.carousel_media.push(child);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
546
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
547
  }
548
+
549
  }
 
550
 
551
+ converted_data.data.push(converted);
552
+ }
553
 
554
+ return converted_data;
555
+ };
556
 
557
  /**
558
  * Search for tags by name.
600
  }
601
  }
602
 
603
+ /**
604
+ * ToDo replace this by https://developers.facebook.com/docs/instagram-api/reference/ig-hashtag-search
605
+ *
606
+ * 1. business user flow
607
+ * 2. no additional permission needed for app (?)
608
+ *
609
+ *
610
+ * ***/
611
 
612
  var req_url = 'https://api.instagram.com/v1/tags/search?q=' + tagname + '&access_token=' + getAccessToken();
613
  var wdi_callback = function (cache_data) {
681
 
682
  /*deprecated API*/
683
  /**
684
+ * ToDo method called from updateUsersIfNecessary, not used anymore
685
+ * TOREMOVE ?
686
+ * ***/
687
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
688
  this.searchForUsersByName = function (username, args)
689
  {
690
  var instagram = this,
786
  *
787
  * @return object of founded media
788
  */
789
+ /**
790
+ * ToDo check if we still use liked media , or if this is allowed. Most probably thre is no endpoint for liked media on Graph API.
791
+ * */
792
  this.getRecentLikedMedia = function (args)
793
  {
794
  var instagram = this,
919
  *
920
  * @return object of founded media
921
  */
922
+
923
+ /**
924
+ * ToDo replace this by two endpoints, depending on whether this user is business or not
925
+ * business - https://developers.facebook.com/docs/instagram-api/reference/user/media#get-media
926
+ * personal - https://developers.facebook.com/docs/instagram-basic-display-api/reference/user/media#reading - requires more permissions
927
+ * */
928
  this.getUserRecentMedia = function (user_id, args)
929
  {
930
  var instagram = this,
1064
  *
1065
  * @return object of founded media
1066
  */
1067
+
1068
+ /**
1069
+ * ToDo, we should not use this anymore, get user_id for current user and get user_id/media with graph or basic API
1070
+ */
1071
+
1072
+ this.getUserMedia = function (args) {
1073
  var instagram = this,
1074
  noArgument = false,
1075
  successFlag = false,
1076
  statusCode = this.statusCode,
1077
  errorFlag = false,
1078
  argFlag = false,
1079
+ filter = this.getFilter('getUserMedia');
1080
+
1081
 
1082
  if (typeof args == 'undefined' || args.length === 0) {
1083
  noArgument = true;
1107
  } else {
1108
  args.count = 20;
1109
  }
 
 
 
 
 
 
 
 
 
 
1110
  }
1111
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1112
 
1113
+ jQuery.ajax({
1114
+ type: "POST",
1115
+ url: wdi_ajax.ajax_url,
1116
+ dataType:"json",
1117
+ data: {
1118
+ wdi_nonce:wdi_ajax.wdi_nonce,
1119
+ action:"wdi_getUserMedia",
1120
+ user_name:getUserName()
1121
+ },
1122
+ success: function (response)
1123
+ {
1124
+ response.meta = {"code": 200};
1125
  if (successFlag) {
1126
  if (typeof args.success == 'object' && args.success.length == 2) {
1127
  if (typeof window[args.success[0]] != 'undefined') {
1128
  if (typeof window[args.success[0]][args.success[1]] == 'function') {
1129
  if (filter) {
1130
+ response = _this.addTags(response);
1131
  response = filter(response, instagram.filterArguments, args);
1132
  }
1133
  window[args.success[0]][args.success[1]](response);
1137
  if (typeof args.success == 'string') {
1138
  if (typeof window[args.success] == 'function') {
1139
  if (filter) {
1140
+ response = _this.addTags(response);
1141
  response = filter(response, instagram.filterArguments, args);
1142
  }
1143
  window[args.success](response);
1145
  } else
1146
  if (typeof args.success == 'function') {
1147
  if (filter) {
1148
+ response = _this.addTags(response);
1149
  response = filter(response, instagram.filterArguments, args);
1150
  }
1151
  args.success(response);
1152
  }
1153
  }
 
 
 
 
1154
 
1155
+ },
1156
+ error: function (response)
1157
+ {
1158
+ if (errorFlag) {
1159
+ if (typeof args['error'] == 'object' && args['error'].length == 2) {
1160
+ if (typeof window[args['error'][0]][args['error'][1]] == 'function') {
1161
+ window[args['error'][0]][args['error'][1]](response);
1162
+ }
1163
+ } else
1164
+ if (typeof args['error'] == 'string') {
1165
+ if (typeof window[args['error']] == 'function') {
1166
+ window[args['error']](response);
1167
+ }
1168
+ } else
1169
+ if (typeof args['error'] == 'function') {
1170
+ args['error'](response);
1171
+ }
1172
+ }
1173
+ },
1174
+ statusCode: statusCode
1175
+ });
1176
  }
1177
 
1178
  /* deprecated API */
1198
  *
1199
  * @return object of founded info
1200
  */
1201
+
1202
+ /*
1203
+ * ToDo use to get user's ID having his token. https://developers.facebook.com/docs/instagram-basic-display-api/reference/user
1204
+ * should be used for both business and personal accounts
1205
+ * */
1206
+ this.getUserInfo = function (user_id, args) {
1207
  var instagram = this,
1208
  noArgument = false,
1209
  successFlag = false,
1283
  });
1284
  }
1285
 
 
1286
  /**
1287
  * Get information about the owner of the access_token.
1288
  *
1304
  *
1305
  * @return object of founded info
1306
  */
1307
+
1308
+ /**
1309
+ * ToDo to remove
1310
+ * this part has been replaced with php․
1311
+ * **/
1312
+ this.getSelfInfo = function (args) {
1313
  var instagram = this,
1314
  noArgument = false,
1315
  successFlag = false,
1318
  filter = this.getFilter('getSelfInfo');
1319
  if (typeof args == 'undefined' || args.length === 0) {
1320
  noArgument = true;
1321
+ }
1322
+ else {
1323
  if ('success' in args) {
1324
  successFlag = true;
1325
  }
 
1326
  if ('error' in args) {
1327
  errorFlag = true;
1328
  }
 
1329
  if ('statusCode' in args) {
1330
  statusCode = args['statusCode'];
1331
  }
1332
  }
1333
+ var req_url = 'https://graph.facebook.com/v3.2/' + getUserId() + '?fields=id,ig_id,username,name,biography,profile_picture_url,followers_count,follows_count,media_count,website&access_token=' + getAccessToken();
 
1334
  var wdi_callback = function (cache_data) {
1335
+ if (cache_data === false) {
1336
  jQuery.ajax({
1337
  type: 'POST',
1338
  dataType: 'jsonp',
1339
+ url: req_url,
1340
+ statusCode: statusCode,
1341
+ success: function (response) {
1342
+ _this.setDataToCache(req_url, response);
1343
  if (successFlag) {
1344
  if (typeof args.success == 'object' && args.success.length == 2) {
1345
  if (typeof window[args.success[0]] != 'undefined') {
1346
  if (typeof window[args.success[0]][args.success[1]] == 'function') {
1347
  if (filter) {
1348
+ response.meta = {"code": 200};
1349
  response = filter(response, instagram.filterArguments);
1350
  }
1351
  window[args.success[0]][args.success[1]](response);
1352
  }
1353
  }
1354
+ }
1355
+ else {
1356
+ if (typeof args.success == 'string') {
1357
+ if (typeof window[args.success] == 'function') {
1358
+ if (filter) {
1359
+ response.meta = {"code": 200};
1360
+ response = filter(response, instagram.filterArguments);
1361
+ }
1362
+ window[args.success](response);
1363
  }
 
1364
  }
1365
+ else {
1366
+ if (typeof args.success == 'function') {
1367
+ if (filter) {
1368
+ response.meta = {"code": 200};
1369
+ response = filter(response, instagram.filterArguments);
1370
+ }
1371
+ args.success(response);
1372
+ }
1373
  }
 
1374
  }
1375
  }
1376
  },
1377
+ error: function (response) {
 
 
1378
  if (errorFlag) {
1379
  if (typeof args['error'] == 'object' && args['error'].length == 2) {
1380
  if (typeof window[args['error'][0]][args['error'][1]] == 'function') {
1381
  window[args['error'][0]][args['error'][1]](response);
1382
  }
1383
+ }
1384
+ else if (typeof args['error'] == 'string') {
1385
  if (typeof window[args['error']] == 'function') {
1386
  window[args['error']](response);
1387
  }
1388
+ }
1389
+ else if (typeof args['error'] == 'function') {
1390
  args['error'](response);
1391
  }
1392
  }
1393
+ }
 
 
1394
  });
1395
  }
1396
+ else {
1397
  success(cache_data);
1398
  }
1399
 
1408
  window[args.success[0]][args.success[1]](response);
1409
  }
1410
  }
1411
+ }
1412
+ else {
1413
+ if (typeof args.success == 'string') {
1414
+ if (typeof window[args.success] == 'function') {
1415
+ if (filter) {
1416
+ response = filter(response, instagram.filterArguments);
1417
+ }
1418
+ window[args.success](response);
1419
  }
 
1420
  }