Version Description
New: Signing up with multiple accounts
Fixed: Settings page layout when language is not English
Download this release
Release Info
Developer | webdorado |
Plugin | WD Instagram Feed – Instagram Gallery |
Version | 1.3.2 |
Comparing to | |
See all releases |
Code changes from version 1.3.1 to 1.3.2
- admin-functions.php +63 -7
- admin/views/WDIViewFeeds_wdi.php +17 -5
- admin/views/WDIViewSettings_wdi.php +21 -12
- changelog.txt +4 -0
- css/wdi_backend.css +57 -4
- css/wdi_backend.min.css +1 -1
- framework/WDILibrary.php +44 -5
- framework/WDI_admin_view.php +25 -1
- frontend/views/WDIViewImageBrowser_view.php +8 -3
- frontend/views/WDIViewThumbnails_view.php +8 -1
- images/multiple_accounts.png +0 -0
- js/wdi_admin.js +84 -5
- js/wdi_admin.min.js +1 -1
- js/wdi_instagram.js +5 -0
- js/wdi_instagram.min.js +1 -1
- readme.txt +5 -1
- wd-instagram-feed.php +13 -7
admin-functions.php
CHANGED
@@ -499,10 +499,9 @@ function wdi_configure_section_callback(){
|
|
499 |
?>
|
500 |
<div id="login_with_instagram">
|
501 |
|
502 |
-
<?php if (!isset($options['wdi_access_token']) || $options['wdi_access_token'] == ''){
|
503 |
-
|
504 |
-
|
505 |
-
<?php }
|
506 |
if (isset($options['wdi_access_token']) && $options['wdi_access_token'] != '' && $default_feed_permalink !== null) { ?>
|
507 |
<a target="_blank" href="<?php echo $default_feed_permalink; ?>" class="wdi_default_feed_button"></a>
|
508 |
<?php }
|
@@ -527,10 +526,13 @@ function wdi_configure_section_callback(){
|
|
527 |
<?php
|
528 |
}
|
529 |
|
530 |
-
|
531 |
//Callback function for Settings Customize Section
|
532 |
-
function wdi_customize_section_callback()
|
533 |
-
|
|
|
|
|
|
|
|
|
534 |
|
535 |
}
|
536 |
|
@@ -565,6 +567,10 @@ function wdi_field_callback($element)
|
|
565 |
$wdi_formBuilder->link_button($setting);
|
566 |
break;
|
567 |
}
|
|
|
|
|
|
|
|
|
568 |
}
|
569 |
}
|
570 |
|
@@ -597,10 +603,54 @@ function wdi_sanitize_options($input)
|
|
597 |
$output[$key] = esc_js(str_replace(array("\n", "\r"), "", $input[$key]));
|
598 |
break;
|
599 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
600 |
default: {
|
601 |
if (isset($input[$key])) {
|
|
|
|
|
|
|
602 |
$output[$key] = strip_tags(stripslashes($input[$key]));
|
603 |
}
|
|
|
|
|
604 |
break;
|
605 |
}
|
606 |
}
|
@@ -619,6 +669,7 @@ function wdi_get_settings()
|
|
619 |
|
620 |
'wdi_transient_time' => array('name'=>'wdi_transient_time','sanitize_type'=>'number','field_or_not'=>'','type'=>'input', 'input_type'=>'number', 'section'=>'wdi_configure_section', 'title'=>__('Check for new posts every (min)',"wd-instagram-feed"),'default'=>'' ,'value'=>60),
|
621 |
'wdi_reset_cache' => array('name'=>'wdi_reset_cache','sanitize_type'=>'','field_or_not'=>'','type'=>'link_button', 'section'=>'wdi_configure_section', 'href'=>admin_url( 'admin.php?page=wdi_settings' ), 'title'=>__('Reset cache with Instagram data',"wd-instagram-feed"),'default'=>'', 'value'=>'Reset cache'),
|
|
|
622 |
|
623 |
'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")),
|
624 |
'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")),
|
@@ -651,6 +702,11 @@ function wdi_set_options_defaults()
|
|
651 |
$options['wdi_plugin_uninstalled'] = 'false';
|
652 |
}
|
653 |
|
|
|
|
|
|
|
|
|
|
|
654 |
add_option(WDI_OPT, $options, '', 'yes');
|
655 |
update_option(WDI_OPT, $options, 'yes');
|
656 |
wdi_get_options();
|
499 |
?>
|
500 |
<div id="login_with_instagram">
|
501 |
|
502 |
+
<?php if (!isset($options['wdi_access_token']) || $options['wdi_access_token'] == ''){
|
503 |
+
WDILibrary::add_auth_button();
|
504 |
+
}
|
|
|
505 |
if (isset($options['wdi_access_token']) && $options['wdi_access_token'] != '' && $default_feed_permalink !== null) { ?>
|
506 |
<a target="_blank" href="<?php echo $default_feed_permalink; ?>" class="wdi_default_feed_button"></a>
|
507 |
<?php }
|
526 |
<?php
|
527 |
}
|
528 |
|
|
|
529 |
//Callback function for Settings Customize Section
|
530 |
+
function wdi_customize_section_callback(){
|
531 |
+
|
532 |
+
}
|
533 |
+
|
534 |
+
//Callback function for Multiple accounts Section
|
535 |
+
function wdi_multiple_accounts_section_callback(){
|
536 |
|
537 |
}
|
538 |
|
567 |
$wdi_formBuilder->link_button($setting);
|
568 |
break;
|
569 |
}
|
570 |
+
case 'users_list':{
|
571 |
+
$wdi_formBuilder->users_list($setting);
|
572 |
+
break;
|
573 |
+
}
|
574 |
}
|
575 |
}
|
576 |
|
603 |
$output[$key] = esc_js(str_replace(array("\n", "\r"), "", $input[$key]));
|
604 |
break;
|
605 |
}
|
606 |
+
case 'users_list': {
|
607 |
+
global $wdi_options;
|
608 |
+
|
609 |
+
$users_list = array();
|
610 |
+
$option = $input['wdi_authenticated_users_list'];
|
611 |
+
//$saved_user_list = json_decode($wdi_options['wdi_authenticated_users_list'], true);
|
612 |
+
|
613 |
+
if(!empty($option['access_token'])) {
|
614 |
+
|
615 |
+
$user_count = count($option['access_token']);
|
616 |
+
for($i = 0; $i < $user_count; $i++) {
|
617 |
+
|
618 |
+
if(!empty($option['access_token'][$i]) &&
|
619 |
+
!empty($option['user_name'][$i]) &&
|
620 |
+
!empty($option['user_id'][$i])) {
|
621 |
+
|
622 |
+
$user_name = $option['user_name'][$i];
|
623 |
+
|
624 |
+
if($wdi_options['wdi_user_name'] === $user_name) {
|
625 |
+
continue;
|
626 |
+
}
|
627 |
+
|
628 |
+
$users_list[$user_name] = array(
|
629 |
+
'access_token' => $option['access_token'][$i],
|
630 |
+
'user_name' => $user_name,
|
631 |
+
'user_id' => $option['user_id'][$i],
|
632 |
+
);
|
633 |
+
}
|
634 |
+
|
635 |
+
}
|
636 |
+
}
|
637 |
+
|
638 |
+
if(isset($users_list[$input['wdi_user_name']])){
|
639 |
+
unset($users_list[$input['wdi_user_name']]);
|
640 |
+
}
|
641 |
+
|
642 |
+
$output[$key] = json_encode($users_list);
|
643 |
+
break;
|
644 |
+
}
|
645 |
default: {
|
646 |
if (isset($input[$key])) {
|
647 |
+
if(is_array($input[$key])){
|
648 |
+
$output[$key] = strip_tags( stripslashes( json_encode($input[ $key ] ) ));
|
649 |
+
}else{
|
650 |
$output[$key] = strip_tags(stripslashes($input[$key]));
|
651 |
}
|
652 |
+
|
653 |
+
}
|
654 |
break;
|
655 |
}
|
656 |
}
|
669 |
|
670 |
'wdi_transient_time' => array('name'=>'wdi_transient_time','sanitize_type'=>'number','field_or_not'=>'','type'=>'input', 'input_type'=>'number', 'section'=>'wdi_configure_section', 'title'=>__('Check for new posts every (min)',"wd-instagram-feed"),'default'=>'' ,'value'=>60),
|
671 |
'wdi_reset_cache' => array('name'=>'wdi_reset_cache','sanitize_type'=>'','field_or_not'=>'','type'=>'link_button', 'section'=>'wdi_configure_section', 'href'=>admin_url( 'admin.php?page=wdi_settings' ), 'title'=>__('Reset cache with Instagram data',"wd-instagram-feed"),'default'=>'', 'value'=>'Reset cache'),
|
672 |
+
'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_multiple_accounts_section','title'=>__('Multiple Instagram accounts ?',"wd-instagram-feed")),
|
673 |
|
674 |
'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")),
|
675 |
'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")),
|
702 |
$options['wdi_plugin_uninstalled'] = 'false';
|
703 |
}
|
704 |
|
705 |
+
|
706 |
+
if(empty($options['wdi_authenticated_users_list'])){
|
707 |
+
$options['wdi_authenticated_users_list'] = '[]';
|
708 |
+
}
|
709 |
+
|
710 |
add_option(WDI_OPT, $options, '', 'yes');
|
711 |
update_option(WDI_OPT, $options, 'yes');
|
712 |
wdi_get_options();
|
admin/views/WDIViewFeeds_wdi.php
CHANGED
@@ -667,25 +667,37 @@ public function genarateFeedViews()
|
|
667 |
}
|
668 |
|
669 |
|
670 |
-
public function display_feed_users($feed_row)
|
671 |
-
{
|
672 |
global $wdi_options;
|
673 |
|
674 |
$users = isset($feed_row['feed_users']) ? $feed_row['feed_users'] : "";
|
675 |
-
|
676 |
$users = json_decode($users);
|
|
|
677 |
if ($users === null) {
|
678 |
$users = array();
|
679 |
}
|
680 |
|
681 |
-
|
682 |
?>
|
683 |
<script>
|
684 |
jQuery(document).ready(function ()
|
685 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
686 |
wdi_controller.instagram = new WDIInstagram();
|
687 |
wdi_controller.feed_users = [];
|
688 |
-
wdi_controller.instagram.addToken(<?php echo '"' . $
|
689 |
|
690 |
wdi_controller.updateFeaturedImageSelect(<?php echo '"' . $wdi_options['wdi_user_name'] . '"'; ?>, 'add', 'selected');
|
691 |
|
667 |
}
|
668 |
|
669 |
|
670 |
+
public function display_feed_users($feed_row){
|
|
|
671 |
global $wdi_options;
|
672 |
|
673 |
$users = isset($feed_row['feed_users']) ? $feed_row['feed_users'] : "";
|
|
|
674 |
$users = json_decode($users);
|
675 |
+
|
676 |
if ($users === null) {
|
677 |
$users = array();
|
678 |
}
|
679 |
|
680 |
+
$token = WDILibrary::get_user_access_token($users);
|
681 |
?>
|
682 |
<script>
|
683 |
jQuery(document).ready(function ()
|
684 |
{
|
685 |
+
|
686 |
+
var users_list = JSON.parse(wdi_options.wdi_authenticated_users_list);
|
687 |
+
if (typeof users_list !== 'object') {
|
688 |
+
users_list = {};
|
689 |
+
}
|
690 |
+
|
691 |
+
var usersnames = [wdi_options.wdi_user_name];
|
692 |
+
for(var i in users_list){
|
693 |
+
usersnames.push(users_list[i].user_name);
|
694 |
+
}
|
695 |
+
|
696 |
+
wdi_controller.users_list = users_list;
|
697 |
+
wdi_controller.usersnames = usersnames;
|
698 |
wdi_controller.instagram = new WDIInstagram();
|
699 |
wdi_controller.feed_users = [];
|
700 |
+
wdi_controller.instagram.addToken(<?php echo '"' . $token . '"'; ?>);
|
701 |
|
702 |
wdi_controller.updateFeaturedImageSelect(<?php echo '"' . $wdi_options['wdi_user_name'] . '"'; ?>, 'add', 'selected');
|
703 |
|
admin/views/WDIViewSettings_wdi.php
CHANGED
@@ -68,21 +68,31 @@ private $model;
|
|
68 |
<?php settings_fields('wdi_all_settings'); ?>
|
69 |
<?php do_settings_sections('settings_wdi'); ?>
|
70 |
<div id="wdi_options_page_buttons_wrapper">
|
71 |
-
|
|
|
72 |
<?php submit_button(); ?>
|
73 |
</div>
|
74 |
</form>
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
body.toplevel_page_wdi_settings table:nth-of-type(2){
|
81 |
-
display:none;
|
82 |
-
}
|
83 |
|
84 |
-
|
85 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
<script>
|
87 |
jQuery(document).ready(function(){
|
88 |
|
@@ -139,7 +149,6 @@ private $model;
|
|
139 |
});
|
140 |
});
|
141 |
</script>
|
142 |
-
|
143 |
<?php
|
144 |
}
|
145 |
}
|
68 |
<?php settings_fields('wdi_all_settings'); ?>
|
69 |
<?php do_settings_sections('settings_wdi'); ?>
|
70 |
<div id="wdi_options_page_buttons_wrapper">
|
71 |
+
<div id="wdi_reset_access_token"
|
72 |
+
class="button button-secondary"><?php _e("Reset Primary Access Token", "wd-instagram-feed") ?></div>
|
73 |
<?php submit_button(); ?>
|
74 |
</div>
|
75 |
</form>
|
76 |
+
<style>
|
77 |
+
<?php if(!isset($wdi_options['wdi_access_token']) || empty($wdi_options['wdi_access_token'])){ ?>
|
78 |
+
body.instagram-feed-wd_page_wdi_settings table:nth-of-type(2) {
|
79 |
+
display: none;
|
80 |
+
}
|
|
|
|
|
|
|
81 |
|
82 |
+
body.toplevel_page_wdi_settings table:nth-of-type(2) {
|
83 |
+
display: none;
|
84 |
+
}
|
85 |
+
|
86 |
+
body.instagram-feed-wd_page_wdi_settings table:nth-of-type(3) {
|
87 |
+
display: none;
|
88 |
+
}
|
89 |
+
|
90 |
+
body.toplevel_page_wdi_settings table:nth-of-type(3) {
|
91 |
+
display: none;
|
92 |
+
}
|
93 |
+
|
94 |
+
<?php } ?>
|
95 |
+
</style>
|
96 |
<script>
|
97 |
jQuery(document).ready(function(){
|
98 |
|
149 |
});
|
150 |
});
|
151 |
</script>
|
|
|
152 |
<?php
|
153 |
}
|
154 |
}
|
changelog.txt
CHANGED
@@ -1,3 +1,7 @@
|
|
|
|
|
|
|
|
|
|
1 |
= 1.3.1 =
|
2 |
Fixed: Security issues. Reported by Karan Saini https://www.karansaini.com/
|
3 |
|
1 |
+
= 1.3.2 =
|
2 |
+
New: Signing up with multiple accounts
|
3 |
+
Fixed: Settings page layout when language is not English
|
4 |
+
|
5 |
= 1.3.1 =
|
6 |
Fixed: Security issues. Reported by Karan Saini https://www.karansaini.com/
|
7 |
|
css/wdi_backend.css
CHANGED
@@ -291,6 +291,58 @@ border: 1px solid rgb(185, 185, 185);
|
|
291 |
#login_with_instagram .wdi_edit_default_feed_button{
|
292 |
background-image: url('../images/edit_feed_button.png');
|
293 |
float: left;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
}
|
295 |
|
296 |
#wdi_options_page_buttons_wrapper .submit {
|
@@ -1703,10 +1755,11 @@ border: 1px solid rgb(185, 185, 185);
|
|
1703 |
#wdi_reset_cache{
|
1704 |
float: right;
|
1705 |
}
|
1706 |
-
|
1707 |
-
|
1708 |
-
|
1709 |
-
body.toplevel_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(4)
|
|
|
1710 |
display: none;
|
1711 |
}
|
1712 |
|
291 |
#login_with_instagram .wdi_edit_default_feed_button{
|
292 |
background-image: url('../images/edit_feed_button.png');
|
293 |
float: left;
|
294 |
+
|
295 |
+
}
|
296 |
+
|
297 |
+
#wdwt_wrap_wdi_authenticated_users_list{
|
298 |
+
display: inline-block;
|
299 |
+
width: 100%;
|
300 |
+
}
|
301 |
+
|
302 |
+
#wdwt_wrap_wdi_authenticated_users_list .wdi_sign_in_button{
|
303 |
+
background-image: url(../images/multiple_accounts.png);
|
304 |
+
background-repeat: no-repeat;
|
305 |
+
background-position: left top;
|
306 |
+
width: 228px;
|
307 |
+
height: 36px;
|
308 |
+
display: inline-block;
|
309 |
+
float: right;
|
310 |
+
margin-top: 2px;
|
311 |
+
padding-bottom: 5px;
|
312 |
+
}
|
313 |
+
|
314 |
+
.wdi_multiple_accounts_section tr:not(:first-child) th{
|
315 |
+
font-style: italic;
|
316 |
+
}
|
317 |
+
|
318 |
+
.wdi_multiple_accounts_section tr:not(:first-child) th,
|
319 |
+
.wdi_multiple_accounts_section tr:not(:first-child) td{
|
320 |
+
padding-top: 2px;
|
321 |
+
padding-bottom: 0;
|
322 |
+
font-weight: 400;
|
323 |
+
}
|
324 |
+
|
325 |
+
.wdi_multiple_accounts_section tr:first-child th{
|
326 |
+
padding-bottom: 20px;
|
327 |
+
}
|
328 |
+
|
329 |
+
.wdi_multiple_accounts_section .wdi_username_tr td{
|
330 |
+
padding-bottom: 5px !important;
|
331 |
+
}
|
332 |
+
|
333 |
+
.wdi_multiple_accounts_section .wdi_input_wrapper{
|
334 |
+
width: 100%;
|
335 |
+
display: inline-block;
|
336 |
+
}
|
337 |
+
|
338 |
+
.wdi_multiple_accounts_section .wdi_remove_auth_user{
|
339 |
+
display: inline-block;
|
340 |
+
float: right;
|
341 |
+
color: #0075A5;
|
342 |
+
cursor: pointer;
|
343 |
+
font-weight: 300;
|
344 |
+
font-size: 14px;
|
345 |
+
margin-right: 3px;
|
346 |
}
|
347 |
|
348 |
#wdi_options_page_buttons_wrapper .submit {
|
1755 |
#wdi_reset_cache{
|
1756 |
float: right;
|
1757 |
}
|
1758 |
+
|
1759 |
+
|
1760 |
+
body.toplevel_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(3),
|
1761 |
+
body.toplevel_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(4),
|
1762 |
+
body.toplevel_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(5){
|
1763 |
display: none;
|
1764 |
}
|
1765 |
|
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-wd_page_wdi_settings form{width:65%}.instagram-feed-wd_page_wdi_settings table td{padding-left:0;padding-right:0}.instagram-feed-wd_page_wdi_settings table th{padding-left:4px}.instagram-feed-wd_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}#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-wd_page_wdi_settings table.wdi_advanced_option th{padding-left:12px}.instagram-feed-wd_page_wdi_settings table.wdi_advanced_option td .wdwt_param{margin-left:15px}.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-wd_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(3){display:none}body.toplevel_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(4){display:none}body.instagram-feed-wd_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(3){display:table-row !important}body.instagram-feed-wd_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(4){display:table-row !important}
|
1 |
+
.wdi_clear{clear:both}.wdi_clear_tag:after{content:"";display:table;clear:both}#wdi_unistall{background-color:#d82121;border-color:#d31818;box-shadow:inset 0 1px 0 rgba(230,120,120,0.5),0 1px 0 rgba(0,0,0,.15)}#wdi_unistall:hover{background-color:#da1313}#wdi_unistall_table th{width:45%}.display_type_content{background:#fff;border:1px solid #dedede;margin-bottom:15px}.wdi_tooltip,.wdi_settings_link{display:block;font-size:14px !important;font-weight:bold;line-height:20px;margin-bottom:5px;color:#444;text-decoration:none}p.wdi_about_filed{font-size:13px;font-style:italic}.wdi_tooltip:hover,.wdi_settings_link:hover{color:#23282d;position:relative}.wdi_tooltip:hover:after{content:attr(wdi-tooltip);padding:4px 8px;color:#dbdbe0;position:absolute;left:0;top:100%;white-space:nowrap;z-index:20;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:2px;-moz-box-shadow:0 0 4px #222;-webkit-box-shadow:0 0 4px #222;box-shadow:0 0 4px rgba(0,0,0,0.5);background-color:rgba(0,0,0,0.75);font-size:12px}.wdi_pro_only{font-style:italic;color:#4e4e4e !important;background-color:#ccc !important;text-decoration:none}.wdi_pro_only_op{opacity:.6}.wdi_pro_notice{text-align:right;color:#15699f;font-size:20px !important;padding:10px}.wdi_pro_only_btn{background-color:#c5c0c0 !important;border-top-color:#c5c0c0 !important}.wdi-pro-overlay img{opacity:.7}#wdi_feed_users{width:100%;margin-top:2px}#wdi_feed_tabs .wdi_feed_tabs{border:1px solid #f1f1f1;color:#444;cursor:pointer;font-size:13px;font-weight:bold;padding:12px;background:#fff;text-decoration:none;display:inline-block}#wdi_feed_tabs{margin:16px 0}#wdi_feed_tabs .wdi_feed_tab_active,#wdi_feed_tabs .wdi_feed_tabs:hover{background:none repeat scroll 0 0 #fff;color:#9a2465}#how_to_publish_tab .wdi_howto_container .wdi_howto_content .wdi_howto_wrapper{max-width:270px;margin:0 auto}#how_to_publish_tab .wdi_howto_container .wdi_howto_content .wdi_howto_wrapper img{max-width:100%}#wdi_feed_tabs .wdi_feed_tab_title{margin-top:1px;display:inline-block}.wdi_border_wrapper [scope='row']+td,.wdi_border_wrapper [scope='row']{padding:8px}.display_type_container.wdi_clear_tag{display:table;margin:10px auto}.display_type_container>div{float:left;margin-right:15px}.wdi_user{border:1px solid #b9b9b9;background-color:rgba(0,0,0,.05);margin:0 4px 0 0;border-radius:5px;height:28px;position:relative;display:inline-block}.wdi_user:hover{background-color:rgba(0,0,0,.08)}.wdi_user a{text-decoration:none;color:black;line-height:28px;width:70%;margin-left:12%;margin-right:18%;height:100%;display:table-row;padding-right:3px}.wdi_user .wdi_profile_pic{width:20px;height:20px;top:4px;left:30px;padding:5px;vertical-align:middle;display:table-cell}.wdi_user span{display:table-cell;vertical-align:middle;left:55px;font-weight:bold;font-size:14px}.wdi_user .wdi_remove_user,.wdi_user .wdi_check_thumb_user{position:absolute;right:4px;width:15px;height:15px;top:6.5px;transition:all .1s ease}.wdi_user .wdi_remove_user:hover{cursor:pointer;transform:rotate(180deg)}.wdi_user .wdi_check_thumb_user:hover{cursor:pointer}.wdi_user .wdi_check_thumb_user{left:4px}.wdi_border_wrapper [scope='row']{padding:2px;font-size:13px;min-width:250px}.wdi_border_wrapper [scope='row']+td,.wdi_border_wrapper [scope='row']{padding:2px}.small_input{width:60px;text-align:center}.display_type{text-align:center}.wdi_access_token_missing{font-size:14px;color:#000;clear:both;max-width:720px}.instagram-feed-wd_page_wdi_settings form{width:65%}.instagram-feed-wd_page_wdi_settings table td{padding-left:0;padding-right:0}.instagram-feed-wd_page_wdi_settings table th{padding-left:4px}.instagram-feed-wd_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_multiple_accounts_section tr:not(:first-child) th{font-style:italic}.wdi_multiple_accounts_section tr:not(:first-child) th,.wdi_multiple_accounts_section tr:not(:first-child) td{padding-top:2px;padding-bottom:0;font-weight:400}.wdi_multiple_accounts_section tr:first-child th{padding-bottom:20px}.wdi_multiple_accounts_section .wdi_username_tr td{padding-bottom:5px !important}.wdi_multiple_accounts_section .wdi_input_wrapper{width:100%;display:inline-block}.wdi_multiple_accounts_section .wdi_remove_auth_user{display:inline-block;float:right;color:#0075a5;cursor:pointer;font-weight:300;font-size:14px;margin-right:3px}#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-wd_page_wdi_settings table.wdi_advanced_option th{padding-left:12px}.instagram-feed-wd_page_wdi_settings table.wdi_advanced_option td .wdwt_param{margin-left:15px}.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-wd_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(3),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-wd_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(3){display:table-row !important}body.instagram-feed-wd_page_wdi_settings table:nth-of-type(1) tr:nth-of-type(4){display:table-row !important}
|
framework/WDILibrary.php
CHANGED
@@ -186,7 +186,6 @@ class WDILibrary {
|
|
186 |
}
|
187 |
}
|
188 |
|
189 |
-
|
190 |
public static function message($message, $type) {
|
191 |
return '<div style="width:99%"><div class="' . $type . '"><p><strong>' . $message . '</strong></p></div></div>';
|
192 |
}
|
@@ -389,6 +388,7 @@ class WDILibrary {
|
|
389 |
<input type="hidden" id="search_or_not" name="search_or_not" value="<?php echo ((isset($_POST['search_or_not'])) ? esc_html($_POST['search_or_not']) : ''); ?>"/>
|
390 |
<?php
|
391 |
}
|
|
|
392 |
public static function get_pagination_page($items_county, $x, $y){
|
393 |
switch ($y) {
|
394 |
case 1:
|
@@ -721,6 +721,7 @@ class WDILibrary {
|
|
721 |
wdi_spider_frontend_ajax('<?php echo $form_id; ?>', '<?php echo $current_view; ?>', '<?php echo $id; ?>', '<?php echo $album_gallery_id; ?>', '', '<?php echo $type; ?>', 0, '', '', load_more);
|
722 |
}
|
723 |
jQuery(document).ready(function() {
|
|
|
724 |
jQuery('.<?php echo $first_page; ?>').on('click', function() {
|
725 |
wdi_spider_page_<?php echo $current_view; ?>(this, <?php echo $page_number; ?>, -2);
|
726 |
});
|
@@ -976,6 +977,7 @@ class WDILibrary {
|
|
976 |
}
|
977 |
}
|
978 |
|
|
|
979 |
public static function keep_only_self_user($feed_row){
|
980 |
global $wdi_options;
|
981 |
|
@@ -986,10 +988,10 @@ class WDILibrary {
|
|
986 |
|
987 |
$users = json_decode($feed_row['feed_users']);
|
988 |
$new_users_list = array();
|
|
|
989 |
|
990 |
foreach($users as $i=>$user) {
|
991 |
-
|
992 |
-
if(substr($user->username,0,1) === '#' || $user->username === $wdi_options['wdi_user_name']){
|
993 |
$new_users_list[] = $user;
|
994 |
}
|
995 |
}
|
@@ -1001,7 +1003,6 @@ class WDILibrary {
|
|
1001 |
return $feed_row;
|
1002 |
}
|
1003 |
|
1004 |
-
|
1005 |
/*
|
1006 |
* @return color if valid color, otherwise return false
|
1007 |
*
|
@@ -1083,7 +1084,6 @@ class WDILibrary {
|
|
1083 |
}
|
1084 |
}
|
1085 |
|
1086 |
-
|
1087 |
public static function get_page_link($data){
|
1088 |
$page = WDILibrary::get('page');
|
1089 |
$url = add_query_arg(array( 'page' => $page, $data ), admin_url('admin.php'));
|
@@ -1114,6 +1114,45 @@ class WDILibrary {
|
|
1114 |
return json_encode($data);
|
1115 |
}
|
1116 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1117 |
////////////////////////////////////////////////////////////////////////////////////////
|
1118 |
// Private Methods //
|
1119 |
////////////////////////////////////////////////////////////////////////////////////////
|
186 |
}
|
187 |
}
|
188 |
|
|
|
189 |
public static function message($message, $type) {
|
190 |
return '<div style="width:99%"><div class="' . $type . '"><p><strong>' . $message . '</strong></p></div></div>';
|
191 |
}
|
388 |
<input type="hidden" id="search_or_not" name="search_or_not" value="<?php echo ((isset($_POST['search_or_not'])) ? esc_html($_POST['search_or_not']) : ''); ?>"/>
|
389 |
<?php
|
390 |
}
|
391 |
+
|
392 |
public static function get_pagination_page($items_county, $x, $y){
|
393 |
switch ($y) {
|
394 |
case 1:
|
721 |
wdi_spider_frontend_ajax('<?php echo $form_id; ?>', '<?php echo $current_view; ?>', '<?php echo $id; ?>', '<?php echo $album_gallery_id; ?>', '', '<?php echo $type; ?>', 0, '', '', load_more);
|
722 |
}
|
723 |
jQuery(document).ready(function() {
|
724 |
+
|
725 |
jQuery('.<?php echo $first_page; ?>').on('click', function() {
|
726 |
wdi_spider_page_<?php echo $current_view; ?>(this, <?php echo $page_number; ?>, -2);
|
727 |
});
|
977 |
}
|
978 |
}
|
979 |
|
980 |
+
|
981 |
public static function keep_only_self_user($feed_row){
|
982 |
global $wdi_options;
|
983 |
|
988 |
|
989 |
$users = json_decode($feed_row['feed_users']);
|
990 |
$new_users_list = array();
|
991 |
+
$users_list = self::get_users_list();
|
992 |
|
993 |
foreach($users as $i=>$user) {
|
994 |
+
if(substr($user->username,0,1) === '#' || $user->username === $wdi_options['wdi_user_name'] || !empty($users_list[$user->username])){
|
|
|
995 |
$new_users_list[] = $user;
|
996 |
}
|
997 |
}
|
1003 |
return $feed_row;
|
1004 |
}
|
1005 |
|
|
|
1006 |
/*
|
1007 |
* @return color if valid color, otherwise return false
|
1008 |
*
|
1084 |
}
|
1085 |
}
|
1086 |
|
|
|
1087 |
public static function get_page_link($data){
|
1088 |
$page = WDILibrary::get('page');
|
1089 |
$url = add_query_arg(array( 'page' => $page, $data ), admin_url('admin.php'));
|
1114 |
return json_encode($data);
|
1115 |
}
|
1116 |
|
1117 |
+
public static function add_auth_button($text = ""){
|
1118 |
+
$new_url = urlencode(admin_url('admin.php?page=wdi_settings')) . '&response_type=token';
|
1119 |
+
?>
|
1120 |
+
<a onclick="document.cookie = 'wdi_autofill=true'" class="wdi_sign_in_button"
|
1121 |
+
href="https://api.instagram.com/oauth/authorize/?client_id=54da896cf80343ecb0e356ac5479d9ec&scope=basic+public_content&redirect_uri=http://api.web-dorado.com/instagram/?return_url=<?php echo $new_url; ?>">
|
1122 |
+
<?php echo $text; ?>
|
1123 |
+
</a>
|
1124 |
+
<?php
|
1125 |
+
}
|
1126 |
+
|
1127 |
+
public static function get_users_list(){
|
1128 |
+
global $wdi_options;
|
1129 |
+
$users_list = array();
|
1130 |
+
if(!empty($wdi_options['wdi_authenticated_users_list'])){
|
1131 |
+
$users_list = json_decode($wdi_options['wdi_authenticated_users_list'], true);
|
1132 |
+
if(!is_array($users_list)){
|
1133 |
+
$users_list = array();
|
1134 |
+
}
|
1135 |
+
}
|
1136 |
+
return $users_list;
|
1137 |
+
}
|
1138 |
+
|
1139 |
+
public static function get_user_access_token($users){
|
1140 |
+
global $wdi_options;
|
1141 |
+
$users_list = self::get_users_list();
|
1142 |
+
|
1143 |
+
foreach($users as $user) {
|
1144 |
+
if(substr($user->username, 0, 1) === '#') {
|
1145 |
+
continue;
|
1146 |
+
}
|
1147 |
+
|
1148 |
+
if(!empty($users_list[$user->username])) {
|
1149 |
+
return $users_list[$user->username]['access_token'];
|
1150 |
+
}
|
1151 |
+
|
1152 |
+
}
|
1153 |
+
|
1154 |
+
return $wdi_options['wdi_access_token'];
|
1155 |
+
}
|
1156 |
////////////////////////////////////////////////////////////////////////////////////////
|
1157 |
// Private Methods //
|
1158 |
////////////////////////////////////////////////////////////////////////////////////////
|
framework/WDI_admin_view.php
CHANGED
@@ -18,6 +18,8 @@ class WDI_admin_view{
|
|
18 |
$this->params=$this->merge_params($defaults,$initial_params);
|
19 |
}
|
20 |
|
|
|
|
|
21 |
/**
|
22 |
* Displays a link like button
|
23 |
*
|
@@ -208,6 +210,29 @@ class WDI_admin_view{
|
|
208 |
}
|
209 |
|
210 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
|
212 |
|
213 |
/**
|
@@ -219,7 +244,6 @@ class WDI_admin_view{
|
|
219 |
*/
|
220 |
|
221 |
public function input($element, $context = 'option', $opt_val = '', $meta=array()){
|
222 |
-
|
223 |
$readonly = isset($element['readonly'])? 'readonly="'.esc_attr($element['readonly']).'"' : '';
|
224 |
|
225 |
if($context== 'meta'){
|
18 |
$this->params=$this->merge_params($defaults,$initial_params);
|
19 |
}
|
20 |
|
21 |
+
|
22 |
+
|
23 |
/**
|
24 |
* Displays a link like button
|
25 |
*
|
210 |
}
|
211 |
|
212 |
|
213 |
+
public function users_list($element){
|
214 |
+
global $wdi_options;
|
215 |
+
|
216 |
+
$readonly = isset($element['readonly']) ? 'readonly="' . esc_attr($element['readonly']) . '"' : '';
|
217 |
+
$input_size = isset($element["input_size"]) ? $element["input_size"] : $this->params["input_size"];
|
218 |
+
$optionname = WDI_OPT.'[' .$element['name']. ']';
|
219 |
+
|
220 |
+
?>
|
221 |
+
<div class="wdwt_param" id="wdwt_wrap_<?php echo $element['name']; ?>">
|
222 |
+
<div class="block">
|
223 |
+
<?php WDILibrary::add_auth_button(''); ?>
|
224 |
+
<div class="wdi_more_token_template" style="display: none;">
|
225 |
+
<input type="text" name="<?php echo $optionname . '[access_token][]'; ?>" class="wdi_more_access_token" disabled/>
|
226 |
+
<input type="text" name="<?php echo $optionname . '[user_name][]'; ?>" class="wdi_more_user_name" disabled/>
|
227 |
+
<input type="text" name="<?php echo $optionname . '[user_id][]'; ?>" class="wdi_more_user_id" disabled/>
|
228 |
+
</div>
|
229 |
+
</div>
|
230 |
+
</div>
|
231 |
+
<div style="text-align: right;font-style: italic;">
|
232 |
+
<p>Log out from the previous account before signing up.</p>
|
233 |
+
</div>
|
234 |
+
<?php
|
235 |
+
}
|
236 |
|
237 |
|
238 |
/**
|
244 |
*/
|
245 |
|
246 |
public function input($element, $context = 'option', $opt_val = '', $meta=array()){
|
|
|
247 |
$readonly = isset($element['readonly'])? 'readonly="'.esc_attr($element['readonly']).'"' : '';
|
248 |
|
249 |
if($context== 'meta'){
|
frontend/views/WDIViewImageBrowser_view.php
CHANGED
@@ -72,13 +72,18 @@ class WDIViewImageBrowser_view{
|
|
72 |
public function pass_feed_data_to_js(){
|
73 |
global $wdi_options;
|
74 |
$feed_row = $this->model->get_feed_row();
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
$wdi_feed_counter = $this->model->wdi_feed_counter;
|
76 |
-
|
77 |
$feed_row['wdi_feed_counter'] = $wdi_feed_counter;
|
78 |
|
79 |
-
|
80 |
wp_localize_script("wdi_frontend", 'wdi_feed_'.$wdi_feed_counter,array('feed_row'=>$feed_row,'data'=>array(),'usersData'=>array(),'dataCount'=>0));
|
81 |
-
|
82 |
wp_localize_script("wdi_frontend", 'wdi_front',array('feed_counter'=>$wdi_feed_counter));
|
83 |
}
|
84 |
|
72 |
public function pass_feed_data_to_js(){
|
73 |
global $wdi_options;
|
74 |
$feed_row = $this->model->get_feed_row();
|
75 |
+
|
76 |
+
$users = isset($feed_row['feed_users']) ? json_decode($feed_row['feed_users']) : null;
|
77 |
+
if($users === null) {
|
78 |
+
$users = array();
|
79 |
+
}
|
80 |
+
|
81 |
$wdi_feed_counter = $this->model->wdi_feed_counter;
|
82 |
+
$feed_row['access_token'] = WDILibrary::get_user_access_token($users);
|
83 |
$feed_row['wdi_feed_counter'] = $wdi_feed_counter;
|
84 |
|
|
|
85 |
wp_localize_script("wdi_frontend", 'wdi_feed_'.$wdi_feed_counter,array('feed_row'=>$feed_row,'data'=>array(),'usersData'=>array(),'dataCount'=>0));
|
86 |
+
wp_localize_script("wdi_frontend", 'wdi_theme_' . $this->model->theme_row['id'], $this->model->theme_row);
|
87 |
wp_localize_script("wdi_frontend", 'wdi_front',array('feed_counter'=>$wdi_feed_counter));
|
88 |
}
|
89 |
|
frontend/views/WDIViewThumbnails_view.php
CHANGED
@@ -121,9 +121,16 @@ class WDIViewThumbnails_view
|
|
121 |
public function pass_feed_data_to_js()
|
122 |
{
|
123 |
global $wdi_options;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
$feed_row = $this->model->get_feed_row();
|
125 |
$wdi_feed_counter = $this->model->wdi_feed_counter;
|
126 |
-
$feed_row['access_token'] = $
|
127 |
$feed_row['wdi_feed_counter'] = $wdi_feed_counter;
|
128 |
|
129 |
|
121 |
public function pass_feed_data_to_js()
|
122 |
{
|
123 |
global $wdi_options;
|
124 |
+
$feed_row = $this->model->get_feed_row();
|
125 |
+
|
126 |
+
$users = isset($feed_row['feed_users']) ? json_decode($feed_row['feed_users']) : null;
|
127 |
+
if($users === null) {
|
128 |
+
$users = array();
|
129 |
+
}
|
130 |
+
|
131 |
$feed_row = $this->model->get_feed_row();
|
132 |
$wdi_feed_counter = $this->model->wdi_feed_counter;
|
133 |
+
$feed_row['access_token'] = WDILibrary::get_user_access_token($users);
|
134 |
$feed_row['wdi_feed_counter'] = $wdi_feed_counter;
|
135 |
|
136 |
|
images/multiple_accounts.png
ADDED
Binary file
|
js/wdi_admin.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
jQuery(document).ready(function() {
|
|
|
2 |
jQuery("#wdi_reset_cache").click(function (e) {
|
3 |
jQuery(".wdi_reset_cache_success").remove();
|
4 |
e.preventDefault();
|
@@ -18,7 +19,8 @@ jQuery(document).ready(function() {
|
|
18 |
}
|
19 |
}
|
20 |
});
|
21 |
-
|
|
|
22 |
|
23 |
/*Feeds page*/
|
24 |
wdi_controller.bindSaveFeedEvent();
|
@@ -35,6 +37,7 @@ jQuery(document).ready(function() {
|
|
35 |
|
36 |
|
37 |
if(jQuery('body').hasClass('instagram-feed-wd_page_wdi_settings')){
|
|
|
38 |
wdi_advanced_option_controller();
|
39 |
}
|
40 |
|
@@ -42,6 +45,7 @@ jQuery(document).ready(function() {
|
|
42 |
wdi_show_hide_sections(jQuery(this));
|
43 |
});
|
44 |
wdi_show_hide_sections(false);
|
|
|
45 |
function wdi_show_hide_sections(element) {
|
46 |
if(element===false){
|
47 |
var wdi_hide_show_sections_list = {
|
@@ -115,13 +119,52 @@ jQuery(document).ready(function() {
|
|
115 |
element.removeClass("wdi_section_close");
|
116 |
element.addClass("wdi_section_open");
|
117 |
}
|
|
|
118 |
|
119 |
-
}
|
120 |
});
|
121 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
function wdi_advanced_option_controller() {
|
123 |
|
124 |
-
var $table = jQuery(jQuery('#wdi_user_id').closest('form').find('.form-table').get(
|
125 |
$table.addClass('wdi_advanced_option wdi_advanced_option_close');
|
126 |
var tr = "<tr class='wdi_advanced_option_head'><th>ADVANCED OPTIONS</th><td><div class='wdi_advanced_option_icon'></div></td></tr>";
|
127 |
$tr = jQuery(tr);
|
@@ -138,6 +181,7 @@ function wdi_advanced_option_controller() {
|
|
138 |
});
|
139 |
}
|
140 |
|
|
|
141 |
function wdi_controller() {};
|
142 |
|
143 |
/**
|
@@ -167,7 +211,12 @@ wdi_controller.apiRedirected = function() {
|
|
167 |
}
|
168 |
var access_token = arr.join('.');
|
169 |
jQuery(document).ready(function() {
|
|
|
170 |
jQuery('#wdi_access_token').attr('value', access_token);
|
|
|
|
|
|
|
|
|
171 |
});
|
172 |
|
173 |
//if access token is getted then overwrite it
|
@@ -186,8 +235,20 @@ wdi_controller.apiRedirected = function() {
|
|
186 |
wdi_controller.getUserInfo = function(access_token) {
|
187 |
this.instagram.getSelfInfo({
|
188 |
success: function(response) {
|
|
|
|
|
|
|
189 |
jQuery('#wdi_user_name').attr('value', response['data']['username']);
|
190 |
jQuery('#wdi_user_id').attr('value', response['data']['id']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
191 |
jQuery(document).trigger('wdi_settings_filled');
|
192 |
}
|
193 |
})
|
@@ -494,11 +555,29 @@ wdi_controller.makeInstagramUserRequest = function(user_input, ignoreConfirm) {
|
|
494 |
switch (input_type) {
|
495 |
case 'user':
|
496 |
{
|
497 |
-
|
498 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
499 |
return;
|
500 |
}
|
501 |
|
|
|
|
|
|
|
502 |
this.instagram.getSelfInfo({
|
503 |
success: function(response) {
|
504 |
|
1 |
jQuery(document).ready(function() {
|
2 |
+
|
3 |
jQuery("#wdi_reset_cache").click(function (e) {
|
4 |
jQuery(".wdi_reset_cache_success").remove();
|
5 |
e.preventDefault();
|
19 |
}
|
20 |
}
|
21 |
});
|
22 |
+
|
23 |
+
});
|
24 |
|
25 |
/*Feeds page*/
|
26 |
wdi_controller.bindSaveFeedEvent();
|
37 |
|
38 |
|
39 |
if(jQuery('body').hasClass('instagram-feed-wd_page_wdi_settings')){
|
40 |
+
wdi_multiple_accounts_option_controller();
|
41 |
wdi_advanced_option_controller();
|
42 |
}
|
43 |
|
45 |
wdi_show_hide_sections(jQuery(this));
|
46 |
});
|
47 |
wdi_show_hide_sections(false);
|
48 |
+
|
49 |
function wdi_show_hide_sections(element) {
|
50 |
if(element===false){
|
51 |
var wdi_hide_show_sections_list = {
|
119 |
element.removeClass("wdi_section_close");
|
120 |
element.addClass("wdi_section_open");
|
121 |
}
|
122 |
+
}
|
123 |
|
|
|
124 |
});
|
125 |
|
126 |
+
function wdi_multiple_accounts_option_controller(){
|
127 |
+
var $table = jQuery(jQuery('#wdi_user_id').closest('form').find('.form-table').get(1));
|
128 |
+
$table.addClass('wdi_multiple_accounts_section');
|
129 |
+
var html = '';
|
130 |
+
var users_list = JSON.parse(wdi_options.wdi_authenticated_users_list);
|
131 |
+
|
132 |
+
var index = 0;
|
133 |
+
for(var i in users_list){
|
134 |
+
|
135 |
+
html += "<tr data-multiple-account='" + index + "'>";
|
136 |
+
html += "<th>Access Token</th>";
|
137 |
+
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>';
|
138 |
+
html += "</tr>";
|
139 |
+
|
140 |
+
html += "<tr data-multiple-account='" + index + "' class='wdi_username_tr'>";
|
141 |
+
html += "<th>Username</th>";
|
142 |
+
html += '<td>' +
|
143 |
+
'<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>' +
|
144 |
+
'<div class="wdi_remove_auth_user">Delete</div>' +
|
145 |
+
'</td>';
|
146 |
+
html += '<input type="hidden" name="wdi_instagram_options[wdi_authenticated_users_list][user_id][]" size="53" required="" value="' + users_list[i].user_id + '">';
|
147 |
+
html += "</tr>";
|
148 |
+
index++;
|
149 |
+
}
|
150 |
+
|
151 |
+
$table.append(html);
|
152 |
+
|
153 |
+
|
154 |
+
jQuery('.wdi_remove_auth_user').on('click', function (e) {
|
155 |
+
e.preventDefault();
|
156 |
+
|
157 |
+
var data = jQuery(this).closest('.wdi_username_tr').data('multiple-account');
|
158 |
+
jQuery(this).closest('.wdi_multiple_accounts_section').find('tr[data-multiple-account="' + data + '"]').remove();
|
159 |
+
|
160 |
+
return false;
|
161 |
+
});
|
162 |
+
|
163 |
+
}
|
164 |
+
|
165 |
function wdi_advanced_option_controller() {
|
166 |
|
167 |
+
var $table = jQuery(jQuery('#wdi_user_id').closest('form').find('.form-table').get(2));
|
168 |
$table.addClass('wdi_advanced_option wdi_advanced_option_close');
|
169 |
var tr = "<tr class='wdi_advanced_option_head'><th>ADVANCED OPTIONS</th><td><div class='wdi_advanced_option_icon'></div></td></tr>";
|
170 |
$tr = jQuery(tr);
|
181 |
});
|
182 |
}
|
183 |
|
184 |
+
|
185 |
function wdi_controller() {};
|
186 |
|
187 |
/**
|
211 |
}
|
212 |
var access_token = arr.join('.');
|
213 |
jQuery(document).ready(function() {
|
214 |
+
if (wdi_options.wdi_access_token === "") {
|
215 |
jQuery('#wdi_access_token').attr('value', access_token);
|
216 |
+
} else {
|
217 |
+
jQuery('.wdi_more_token_template .wdi_more_access_token').prop('disabled', false);
|
218 |
+
jQuery('.wdi_more_token_template .wdi_more_access_token').attr('value', access_token);
|
219 |
+
}
|
220 |
});
|
221 |
|
222 |
//if access token is getted then overwrite it
|
235 |
wdi_controller.getUserInfo = function(access_token) {
|
236 |
this.instagram.getSelfInfo({
|
237 |
success: function(response) {
|
238 |
+
|
239 |
+
|
240 |
+
if (wdi_options.wdi_access_token === "") {
|
241 |
jQuery('#wdi_user_name').attr('value', response['data']['username']);
|
242 |
jQuery('#wdi_user_id').attr('value', response['data']['id']);
|
243 |
+
} else {
|
244 |
+
jQuery('.wdi_more_token_template .wdi_more_user_name').prop('disabled', false);
|
245 |
+
jQuery('.wdi_more_token_template .wdi_more_user_id').prop('disabled', false);
|
246 |
+
|
247 |
+
jQuery('.wdi_more_token_template .wdi_more_user_name').attr('value', response['data']['username']);
|
248 |
+
jQuery('.wdi_more_token_template .wdi_more_user_id').attr('value', response['data']['id']);
|
249 |
+
}
|
250 |
+
|
251 |
+
|
252 |
jQuery(document).trigger('wdi_settings_filled');
|
253 |
}
|
254 |
})
|
555 |
switch (input_type) {
|
556 |
case 'user':
|
557 |
{
|
558 |
+
|
559 |
+
if(_this.feed_users.length > 0){
|
560 |
+
for(var i in _this.feed_users){
|
561 |
+
if(_this.feed_users[i].username[0] !== '#'){
|
562 |
+
alert("You can add only one username");
|
563 |
+
return false;
|
564 |
+
}
|
565 |
+
}
|
566 |
+
}
|
567 |
+
|
568 |
+
var token = '';
|
569 |
+
if(user_input === wdi_options.wdi_user_name){
|
570 |
+
token = wdi_options.wdi_access_token;
|
571 |
+
}else if (typeof _this.users_list[user_input] !== 'undefined'){
|
572 |
+
token = _this.users_list[user_input].access_token;
|
573 |
+
}else{
|
574 |
+
alert("You can add only your usernames ( " + _this.usersnames.join(', ') + " )");
|
575 |
return;
|
576 |
}
|
577 |
|
578 |
+
this.instagram.resetTokens();
|
579 |
+
this.instagram.addToken(token);
|
580 |
+
|
581 |
this.instagram.getSelfInfo({
|
582 |
success: function(response) {
|
583 |
|
js/wdi_admin.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function(){jQuery("#wdi_reset_cache").click(function(c){jQuery(".wdi_reset_cache_success").remove();c.preventDefault();jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_nonce:wdi_ajax.wdi_nonce,action:"wdi_set_reset_cache"},success:function(d){if(d.success===false){jQuery("#wdi_reset_cache").before("<span class='wdi_reset_cache_success' style='color: #fc0000; margin-left: 15px; line-height: 2;'>Failed</span>")}else{jQuery("#wdi_reset_cache").before("<span class='wdi_reset_cache_success' style='color: #029117; margin-left: 15px; line-height: 2;'>Success</span>")}}})});wdi_controller.bindSaveFeedEvent();wdi_controller.bindAddNewUserOrHashtagEvent();jQuery(".display_type input").on("click",function(){wdi_controller.displaySettingsSection(jQuery(this))});wdi_controller.conditionalFiltersTabInit();wdi_controller.bindSaveThemeEvent();jQuery("#wdi_add_user_ajax").after(jQuery("<br><label class='wdi_pro_only' for='wdi_add_user_ajax_input'>"+wdi_messages.username_hashtag_multiple+"</label>"));if(jQuery("body").hasClass("instagram-feed-wd_page_wdi_settings")){wdi_advanced_option_controller()}jQuery(".wdi_section_name").click(function(){b(jQuery(this))});b(false);function b(f){if(f===false){var d={wdi_layout_section:"show",wdi_media:"show",wdi_layout:"hide",wdi_advanced:"hide",wdi_lightbox_general:"show",wdi_lightbox_advanced:"hide",wdi_conditional_filters:"show",wdi_how_to_publish:"show"};var g=JSON.parse(localStorage.getItem("wdi_sections"));if(g===null||g===false){g=d;localStorage.setItem("wdi_sections",JSON.stringify(g))}for(i in g){var j=jQuery("#wdi_save_feed").find("[data-section_name='"+i+"']");a(g[i],j)}}else{var c=jQuery(f).data("section_name");var h=null;if(f.hasClass("wdi_section_open")){a("show",f);h="show"}else{if(f.hasClass("wdi_section_close")){a("hide",f);h="hide"}}if(h!=null){var e=JSON.parse(localStorage.getItem("wdi_sections"))||{};e[c]=h;localStorage.setItem("wdi_sections",JSON.stringify(e))}}}function a(e,d){if(e==="show"){var c=d.closest(".wdi_section").find(".wdi_elements");if(c.data("display")==="table"){c.css({display:"table"})}else{c.css({display:"block"})}d.css({"border-bottom":"1px solid #f1f1f1",margin:"0 auto 15px"});d.removeClass("wdi_section_open");d.addClass("wdi_section_close")}else{d.closest(".wdi_section").find(".wdi_elements").css({display:"none"});d.css({"border-bottom":"0px",margin:"0 auto 0px"});d.removeClass("wdi_section_close");d.addClass("wdi_section_open")}}});function wdi_advanced_option_controller(){var a=jQuery(jQuery("#wdi_user_id").closest("form").find(".form-table").get(1));a.addClass("wdi_advanced_option wdi_advanced_option_close");var b="<tr class='wdi_advanced_option_head'><th>ADVANCED OPTIONS</th><td><div class='wdi_advanced_option_icon'></div></td></tr>";$tr=jQuery(b);a.prepend($tr);$tr.on("click",function(){if(a.hasClass("wdi_advanced_option_open")){a.removeClass("wdi_advanced_option_open");a.addClass("wdi_advanced_option_close")}else{a.removeClass("wdi_advanced_option_close");a.addClass("wdi_advanced_option_open")}})}function wdi_controller(){}wdi_controller.getParameterByName=function(a){a=a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var c=new RegExp("[\\?&]"+a+"=([^&#]*)"),b=c.exec(location.search);return b===null?"":decodeURIComponent(b[1].replace(/\+/g," "))};wdi_controller.apiRedirected=function(){var d=this.getParameterByName("access_token");var a=d.split(".");var b=/^[^\\\/&?><"']*$/;for(i=0;i<a.length;i++){if(a[i].match(b)===null){return}}var c=a.join(".");jQuery(document).ready(function(){jQuery("#wdi_access_token").attr("value",c)});wdi_controller.instagram.addToken(c);wdi_controller.getUserInfo(c)};wdi_controller.getUserInfo=function(a){this.instagram.getSelfInfo({success:function(b){jQuery("#wdi_user_name").attr("value",b.data["username"]);jQuery("#wdi_user_id").attr("value",b.data["id"]);jQuery(document).trigger("wdi_settings_filled")}})};wdi_controller.oldDisplayType={};wdi_controller.displayTypeMemory={};wdi_controller.switchFeedTabs=function(d,b){jQuery("#wdi_refresh_tab").attr("value",d);jQuery(".wdi_tab").hide();jQuery("#"+d+"_tab").show();jQuery(".display_type").css("display","none");jQuery('.display_type[tab="'+d+'"]').css("display","block");if(!jQuery('.display_type[tab="'+d+'"]').length){jQuery(".display_type_content").hide()}else{jQuery(".display_type_content").show()}jQuery(".wdi_feed_tabs").filter(".wdi_feed_tab_active").each(function(){jQuery(this).removeClass("wdi_feed_tab_active")});jQuery("#wdi_"+d).addClass("wdi_feed_tab_active");var a=jQuery();var c=false;if(b!=undefined&&b!=""){a=jQuery(".display_type #"+b).prop("checked",true);jQuery("#wdi_feed_type").attr("value",b)}if(!c){a=jQuery('.display_type[tab="'+d+'"] input[name="feed_type"]:checked');if(a.length!=0){c=true}}if(!c){a=jQuery('.display_type[tab="'+d+'"] #thumbnails');if(a.length!=0){c=true;a.prop("checked",true);jQuery("#wdi_feed_type").attr("value","thumbnails")}}if(c){wdi_controller.displaySettingsSection(a)}if(d!="conditional_filters"){jQuery("#wdi-conditional-filters-ui").addClass("wdi_hidden")}else{jQuery("#wdi-conditional-filters-ui").removeClass("wdi_hidden")}};wdi_controller.displaySettingsSection=function(h){var d=h.attr("id").toLowerCase().trim();var g=h.parent().parent().attr("tab");var a=jQuery("#wdi_refresh_section");wdi_controller.oldDisplayType={section:d,tab:g};wdi_controller.displayTypeMemory[g]=wdi_controller.oldDisplayType;if(a!=undefined){a.attr("value",d)}var f=jQuery(".wdi_border_wrapper .form-table");jQuery("#wdi_feed_type").attr("value",d);var e=0,c=0;var b=false;f.find(".wdi_element").each(function(){e++;var j=jQuery(this).find(".wdwt_param").children().children().children().attr("section");if(j!==undefined){b=false;var k=j.toLowerCase().trim().split(",");for(c=0;c<k.length;c++){if(k[c]===d){jQuery(this).css("display","block");b=true}}if(b===false){jQuery(this).css("display","none")}}})};wdi_controller.switchThemeTabs=function(b,a){jQuery(".wdi_feed_tabs").filter(".wdi_feed_tab_active").each(function(){jQuery(this).removeClass("wdi_feed_tab_active")});jQuery("#wdi_"+b).addClass("wdi_feed_tab_active");jQuery("[tab]").each(function(){if(jQuery(this).attr("tab")!=b){jQuery(this).parent().parent().parent().parent().parent().filter("tr").css("display","none")}else{jQuery(this).parent().parent().parent().parent().parent().filter("tr").css("display","block")}});jQuery(".display_type").css("display","none");jQuery('.display_type[tab="'+b+'"]').css("display","block");jQuery("#wdi_refresh_tab").attr("value",b);if(a!=undefined&&a!=""){jQuery("#wdi_refresh_section").attr("value",a)}if(a==undefined&&a!=""){if(wdi_controller.displayTypeMemory[b]!=undefined){jQuery(".display_type #"+wdi_controller.displayTypeMemory[b]["section"]).trigger("click")}else{jQuery('.display_type[tab="'+b+'"]').first().find("input").trigger("click")}}else{jQuery(".display_type #"+a).trigger("click")}};wdi_controller.bindSaveFeedEvent=function(){var a=this;jQuery("#wdi_save_feed_submit").on("click",function(){a.save_feed("save_feed")});jQuery("#wdi_save_feed_apply").on("click",function(){a.save_feed("apply_changes")});jQuery("#wdi_cancel_changes").on("click",function(){a.save_feed("cancel")})};wdi_controller.save_feed=function(d){if("cancel"==d){window.location=window.location.href}wdi_controller.checkIfUserNotSaved(d);if(wdi_controller.waitingAjaxRequestEnd.button!=0){return}jQuery("#task").attr("value",d);var a=this.feed_users,b,c,f,j,h,e={username:jQuery("#wdi_default_user").val(),id:jQuery("#wdi_default_user_id").val()};if(a.length==0){a.push(e);this.updateFeaturedImageSelect(e.username,"add","selected")}b=this.stringifyUserData(a);jQuery("#WDI_feed_users").val(b);if(d=="apply_changes"||d=="save_feed"){c=jQuery("#wdi_add_or_edit").attr("value");jQuery("#wdi_current_id").attr("value",c)}f=jQuery("#WDI_thumb_user").val();h=this.getUserProfilePic(f);if("false"==h||typeof h=="undefined"){var g=this;this.instagram.getSelfInfo({success:function(m){var l=g.isValidResponse(m),k=m.data,n;if(l.valid&&g.hasData(m)&&k){n=k.profile_picture}else{n=""}}});jQuery("#wdi_feed_thumb").attr("value",h);jQuery("#wdi_save_feed").submit()}else{jQuery("#wdi_feed_thumb").attr("value",h);jQuery("#wdi_save_feed").submit()}};wdi_controller.makeInstagramUserRequest=function(b,f){var a,c,g=this,d;c=this.getInputType(b);if(wdi_version.is_pro=="false"){if(jQuery(".wdi_user").length==1){alert(wdi_messages.only_one_user_or_hashtag);return}}switch(c){case"user":if(b!==wdi_options.wdi_user_name){alert("You can add only your username ( "+wdi_options.wdi_user_name+" )");return}this.instagram.getSelfInfo({success:function(k){var j=g.isValidResponse(k);if(j.valid==false){alert(j.msg);return}var h=k.data;if(j.valid&&g.hasData(k)){g.addUser(h)}else{if(!h){alert(wdi_messages.user_not_exist.replace("%s",'"'+b+'"'))}else{alert(j.msg)}}}});break;case"hashtag":var e=b.substr(1,b.length);e=e.replace(" ","");this.instagram.getTagRecentMedia(e,{success:function(j){var h=g.isValidResponse(j);if(h.valid&&g.hasData(j)){g.addHashtag(e,j);if(wdi_version.is_pro=="false"){if(jQuery(".wdi_user").length==1){jQuery("#wdi_add_user_ajax_input").attr("disabled","disabled");jQuery("#wdi_add_user_ajax_input").attr("placeholder",wdi_messages.available_in_pro)}}}else{if(!g.hasData(j)&&h.msg=="success"){if(f!=true){if(confirm(wdi_messages.hashtag_no_data)){g.addHashtag(e,j);if(wdi_version.is_pro=="false"){if(jQuery(".wdi_user").length==1){jQuery("#wdi_add_user_ajax_input").attr("disabled","disabled");jQuery("#wdi_add_user_ajax_input").attr("placeholder",wdi_messages.available_in_pro)}}}else{jQuery("#wdi_add_user_ajax_input").val("")}}else{g.addHashtag(e,j);if(wdi_version.is_pro=="false"){if(jQuery(".wdi_user").length==1){jQuery("#wdi_add_user_ajax_input").attr("disabled","disabled");jQuery("#wdi_add_user_ajax_input").attr("placeholder",wdi_messages.available_in_pro)}}}}else{alert(h.msg)}}}});break}};wdi_controller.checkForDuplicateUser=function(b){for(var a=0;a<this.feed_users.length;a++){if(b==this.feed_users[a]["username"]){return true}}return false};wdi_controller.getInputType=function(a){switch(a[0]){case"#":return"hashtag";break;case"%":return"location";break;default:return"user";break}};wdi_controller.stringifyUserData=function(a){var c=[];for(var b=0;b<a.length;b++){c.push({username:a[b]["username"],id:a[b]["id"]})}return JSON.stringify(c)};wdi_controller.bindAddNewUserOrHashtagEvent=function(){jQuery("#wdi_add_user_ajax").on("click",function(){var a=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase();wdi_controller.makeInstagramUserRequest(a)});jQuery("#wdi_add_user_ajax_input").on("keypress",function(b){if(b.keyCode==13){var a=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase();wdi_controller.makeInstagramUserRequest(a);return false}})};wdi_controller.removeFeedUser=function(b){var c=b.parent().find("a span").text();if(b.parent().find("a span").hasClass("wdi_hashtag")){c="#"+c}for(var a=0;a<this.feed_users.length;a++){if(this.feed_users[a]["username"]==c){this.feed_users.splice(a,1);break}}b.parent().remove();if(c!==jQuery("#wdi_default_user").val()){wdi_controller.updateFeaturedImageSelect(c,"remove")}if(wdi_version.is_pro=="false"){if(jQuery(".wdi_user").length==0){jQuery("#wdi_add_user_ajax_input").removeAttr("disabled");jQuery("#wdi_add_user_ajax_input").attr("placeholder","")}}};wdi_controller.updateFeaturedImageSelect=function(f,e,d){var a=jQuery("#WDI_thumb_user");if(d!="selected"){d=""}switch(e){case"add":var b=a.find('option[value="'+f+'"]').length;if(!b){var c=jQuery("<option "+d+' value="'+f+'">'+f+"</option>");a.append(c)}break;case"remove":a.find('option[value="'+f+'"]').remove();if(this.feed_users.length>0){a.val(this.feed_users[0].username)}break}};wdi_controller.bindSaveThemeEvent=function(){jQuery("#wdi_save_theme_submit").on("click",function(){jQuery("#task").attr("value","save_feed");jQuery("#wdi_save_feed").submit()});jQuery("#wdi_save_theme_apply").on("click",function(){jQuery("#task").attr("value","apply_changes");var a=jQuery("#wdi_add_or_edit").attr("value");jQuery("#wdi_current_id").attr("value",a);jQuery("#wdi_save_feed").submit()});jQuery("#wdi_save_theme_reset").on("click",function(){jQuery("#task").attr("value","reset_changes");var a=jQuery("#wdi_add_or_edit").attr("value");jQuery("#wdi_current_id").attr("value",a);jQuery("#wdi_save_feed").submit()})};wdi_controller.checkIfUserNotSaved=function(b){switch(b){case"save_feed":b="submit";break;case"apply_changes":b="apply";break;case"reset_changes":b="reset";break}if(jQuery("#wdi_add_user_ajax_input").val().trim()!=""){var a=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase();wdi_controller.waitingAjaxRequestEnd={button:b};wdi_controller.makeInstagramUserRequest(a);return 1}else{wdi_controller.waitingAjaxRequestEnd={button:0};return 0}};wdi_controller.saveFeedAfterAjaxWait=function(b){if(wdi_controller.waitingAjaxRequestEnd!=undefined){var a=wdi_controller.waitingAjaxRequestEnd.button;if(b&&a!=0){jQuery("#wdi_save_feed_"+a).trigger("click")}wdi_controller.waitingAjaxRequestEnd=undefined}};wdi_controller.getCookie=function(a){var b="; "+document.cookie;var c=b.split("; "+a+"=");if(c.length==2){return c.pop().split(";").shift()}};wdi_controller.isValidResponse=function(a){var b={};if(typeof a=="undefined"||typeof a.meta["code"]=="undefined"||a.meta["code"]!=200){b.valid=false;if(typeof a=="undefined"){b.msg=wdi_messages.instagram_server_error}else{if(a.meta["code"]!==200){b.msg=a.meta["error_message"]}else{b.msg=""}}}else{b.valid=true;b.msg="success"}return b};wdi_controller.hasData=function(a){if(typeof a!="undefined"&&typeof a.data!="undefined"&&a.data.length!=0){return true}else{return false}};wdi_controller.thumbUser=function(a){return(this.feed_users.length>0&&this.feed_users[0].username===a)};wdi_controller.findUser=function(d,a){var c=[];if(typeof a!="undefined"&&typeof a.data!="undefined"){c=a.data}for(var b=0;b<c.length;b++){if(c[b]["username"]==d){return c[b]}}return false};wdi_controller.addHashtag=function(e,c){if(e.match(/[~!@$%&*#^()<>?]/)==null){if(this.checkForDuplicateUser("#"+e)==false){var b=jQuery('<div class="wdi_user"><a target="_blank" href="https://instagram.com/explore/tags/'+e+'"><img class="wdi_profile_pic" src="'+wdi_url.plugin_url+'/images/hashtag.png"><span class="wdi_hashtag">'+e+'</span><i style="display:table-cell;width:25px;"></i></a><img class="wdi_remove_user" onclick="wdi_controller.removeFeedUser(jQuery(this))" src="'+wdi_url.plugin_url+'/images/delete_user.png"></div>');jQuery("#wdi_feed_users").append(b);jQuery("#wdi_add_user_ajax_input").attr("value","");var d;if(typeof c!="undefined"){d=(c.data.length!=0)?c.data[0]["images"]["thumbnail"]["url"]:""}else{d=""}this.feed_users.push({username:"#"+e,id:"#"+e,profile_picture:d});var a="#"+e;selected=this.thumbUser(a)?"selected":"";wdi_controller.updateFeaturedImageSelect(a,"add",selected)}else{alert("#"+e+" "+wdi_messages.already_added)}}else{alert(wdi_messages.invalid_hashtag)}this.updateConditionalFiltersUi();wdi_controller.saveFeedAfterAjaxWait(true)};wdi_controller.addUser=function(a){if(this.checkForDuplicateUser(a.username)==false){newUser=jQuery('<div class="wdi_user"><a target="_blank" href="http://www.instagram.com/'+a.username+'"><img class="wdi_profile_pic" src="'+a.profile_picture+'"><span class="wdi_username">'+a.username+'</span><i style="display:table-cell;width:25px;"></i></a><img class="wdi_remove_user" onclick="wdi_controller.removeFeedUser(jQuery(this))" src="'+wdi_url.plugin_url+'/images/delete_user.png"></div>');jQuery("#wdi_feed_users").append(newUser);jQuery("#wdi_add_user_ajax_input").attr("value","");this.feed_users.push({username:a.username,id:a.id,profile_picture:a.profile_picture})}else{alert(a.username+" "+wdi_messages.already_added)}selected=this.thumbUser(a.username)?"selected":"";this.updateFeaturedImageSelect(a.username,"add",selected);this.updateConditionalFiltersUi();wdi_controller.saveFeedAfterAjaxWait(true)};wdi_controller.getUserProfilePic=function(b){for(var a=0;a<this.feed_users.length;a++){if(b==this.feed_users[a]["username"]){return this.feed_users[a]["profile_picture"]}}return"false"};wdi_controller.conditionalFiltersTabInit=function(){this.setInitialFilters();this.updateFiltersUi();var b=this;jQuery("#wdi_add_filter").on("click",function(){b.addConditionalFilter();jQuery("#wdi_filter_input").val("")});jQuery(".wdi_filter_radio").on("click",function(){jQuery("#wdi_filter_input").trigger("focus")});jQuery("#wdi_filter_input").on("keypress",function(c){if(c.keyCode==13){b.addConditionalFilter();jQuery(this).val("");return false}});a();jQuery("#WDI_wrap_conditional_filter_enable input").on("change",function(){a()});function a(){switch(jQuery("#WDI_wrap_conditional_filter_enable input:checked").val()){case"0":jQuery("#WDI_conditional_filters").parent().parent().addClass("wdi_hidden");jQuery("#WDI_conditional_filter_type").parent().parent().parent().parent().parent().addClass("wdi_hidden");jQuery("#wdi_final_condition").addClass("wdi_hidden");jQuery("#WDI_filter_source").addClass("wdi_hidden");break;case"1":jQuery("#WDI_conditional_filters").parent().parent().removeClass("wdi_hidden");jQuery("#WDI_conditional_filter_type").parent().parent().parent().parent().parent().removeClass("wdi_hidden");jQuery("#wdi_final_condition").removeClass("wdi_hidden");jQuery("#WDI_filter_source").removeClass("wdi_hidden");break}}jQuery("#WDI_conditional_filter_type").on("change",function(){if(jQuery(this).val()=="none"){}else{jQuery("#WDI_conditional_filters").css("display","block")}jQuery(this).parent().find("label").css({"line-height":"24px",height:"24px",padding:"2px 5px",display:"inline-block","font-size":"15px",color:"black","font-weight":"500","-webkit-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","-o-user-select":"none","user-select":"none"});switch(jQuery(this).val()){case"AND":jQuery("#WDI_conditional_filters").css("display","block");jQuery(this).parent().find("label").html(wdi_messages.and_descr);break;case"OR":jQuery("#WDI_conditional_filters").css("display","block");jQuery(this).parent().find("label").html(wdi_messages.or_descr);break;case"NOR":jQuery("#WDI_conditional_filters").css("display","block");jQuery(this).parent().find("label").html(wdi_messages.nor_descr);break}wdi_controller.updateFiltersUi()});jQuery("#WDI_conditional_filter_type").trigger("change")};wdi_controller.addConditionalFilter=function(){var b=jQuery("#wdi_filter_input").val(),a=jQuery("#wdi_filter_type").val(),c={};if(b==""){return}b=b.trim();switch(a){case"username":if(b[0]=="@"){b=b.substr(1,b.length)}break;case"mention":if(b[0]=="@"){b=b.substr(1,b.length)}break;case"hashtag":if(b[0]=="#"){b=b.substr(1,b.length)}break;case"url":var d=/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i;if(!d.test(b)){alert(wdi_messages.invalid_url);return}break}c={filter_type:a,filter_by:b,id:this.randomId()};if(a!=null){if(!this.filterExists(c)){this.conditionalFilters.push(c);this.updateFiltersUi()}else{alert(b+" "+wdi_messages.already_added)}}else{alert(wdi_messages.selectConditionType)}};wdi_controller.filterExists=function(b){for(var a=0;a<this.conditionalFilters.length;a++){if(this.conditionalFilters[a].filter_type==b.filter_type&&this.conditionalFilters[a].filter_by==b.filter_by){return true}}return false};wdi_controller.updateFiltersUi=function(){var a=jQuery("#wdi_filters_ui").html("");for(var b=0;b<this.conditionalFilters.length;b++){if(b==0){if(this.conditionalFilters.length!=1){switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":break;case"OR":a.append(jQuery('<span class="wdi_logic">'+wdi_messages.either+"</span>"));break;case"NOR":a.append(jQuery('<span class="wdi_logic">'+wdi_messages.neither+"</span>"));break}}else{switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":break;case"OR":break;case"NOR":a.append(jQuery('<span class="wdi_logic">'+wdi_messages.not+"</span>"));break}}}var c;switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":c=wdi_messages.and;break;case"OR":c=wdi_messages.or;break;case"NOR":c=wdi_messages.nor;break}if(b>=1){a.append(jQuery('<span class="wdi_logic">'+c+"</span>"))}a.append(this.createUiElement(this.conditionalFilters[b]))}this.updateFilterTextarea()};wdi_controller.createUiElement=function(b){var c;switch(b.filter_type){case"mention":c="@";break;case"hashtag":c="#";break;case"location":c="%";break;default:c="";break}var a=jQuery('<span data-id="'+b.id+'" class="wdi_filter_item wdi_filter_by_'+b.filter_type+'"></span>').html(c+b.filter_by+'<span onclick="wdi_controller.removeConditionalFilter(jQuery(this));" class="wdi_remove_filter">X</span>');return a};wdi_controller.randomId=function(){var c="";var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(var b=0;b<5;b++){c+=a.charAt(Math.floor(Math.random()*a.length))}return c};wdi_controller.removeConditionalFilter=function(b){var c=b.parent().attr("data-id");for(var a=0;a<this.conditionalFilters.length;a++){if(this.conditionalFilters[a]["id"]==c){this.conditionalFilters.splice(a,1)}}this.updateFiltersUi()};wdi_controller.updateFilterTextarea=function(){var a,b=this.conditionalFilters;a=JSON.stringify(b);jQuery("#wdi_conditional_filters_textarea").val(a)};wdi_controller.setInitialFilters=function(){var b=[],a=jQuery("#wdi_conditional_filters_textarea").val();if(this.isJsonString(a)){b=JSON.parse(a)}this.conditionalFilters=b};wdi_controller.updateConditionalFiltersUi=function(){wdi_controller.updateFilterSource()};wdi_controller.updateFilterSource=function(){if(jQuery('input[name="wdi_feed_settings[liked_feed]"]:checked').val()=="liked"){var a=jQuery("#wdi_filter_source").html("");var d="<div class='wdi_source_user'><span class='wdi_source_username'>Media I liked</span></div>";a.html(a.html()+d);return}var f=[],e,c;jQuery(".wdi_user").each(function(){if(jQuery(this).find(".wdi_username").length!=0){e=jQuery(this).find(".wdi_username").text()}else{e=jQuery(this).find(".wdi_hashtag").text()}c=jQuery(this).find("img").attr("src");f.push({username:e,image:c})});var a=jQuery("#wdi_filter_source").html("");for(var b=0;b<f.length;b++){var d="<div class='wdi_source_user'><span class='wdi_source_img'><img src='"+f[b].image+"'></span><span class='wdi_source_username'>"+f[b].username+"</span></div>";a.html(a.html()+d)}};wdi_controller.isJsonString=function(b){try{JSON.parse(b)}catch(a){return false}return true};function wdi_spider_select_value(a){a.focus();a.select()}function wdi_spider_set_input_value(b,a){if(a==="add"){if(jQuery("#wdi_access_token").attr("value")==""){alert("Please get your access token")}}if(document.getElementById(b)){document.getElementById(b).value=a}}function wdi_spider_form_submit(b,a){if(document.getElementById(a)){document.getElementById(a).submit()}if(b.preventDefault){b.preventDefault()}else{b.returnValue=false}}function wdi_bulk_actions(a){var b=jQuery(a).val();if(b!=""){if(b=="delete_all"){if(!confirm(wdi_messages.do_you_want_to_delete_selected_items)){return false}}wdi_spider_set_input_value("task",b);jQuery("#wdi_feed_form").submit()}else{return false}return true}function wdi_spider_check_all_items(){wdi_spider_check_all_items_checkbox();jQuery("#check_all").trigger("click")}function wdi_spider_check_all_items_checkbox(){if(jQuery("#check_all_items").attr("checked")){jQuery("#check_all_items").attr("checked",false);jQuery("#draganddrop").hide()}else{var b=(parseInt(jQuery(".displaying-num").html())?parseInt(jQuery(".displaying-num").html()):0);var a=(jQuery('input[id^="check_pr_"]').length?parseInt(jQuery('input[id^="check_pr_"]').length):0);var c=a+b;jQuery("#check_all_items").attr("checked",true);if(c){jQuery("#draganddrop").html("<strong><p>Selected "+c+" item"+(c>1?"s":"")+".</p></strong>");jQuery("#draganddrop").show()}}}function wdi_spider_check_all(a){if(!jQuery(a).attr("checked")){jQuery("#check_all_items").attr("checked",false);jQuery("#draganddrop").hide()}}function wdi_spider_set_input_value(b,a){if(a==="add"){if(jQuery("#wdi_access_token").attr("value")==""){alert("Please get your access token")}}if(document.getElementById(b)){document.getElementById(b).value=a}};
|
1 |
+
jQuery(document).ready(function(){jQuery("#wdi_reset_cache").click(function(c){jQuery(".wdi_reset_cache_success").remove();c.preventDefault();jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_nonce:wdi_ajax.wdi_nonce,action:"wdi_set_reset_cache"},success:function(d){if(d.success===false){jQuery("#wdi_reset_cache").before("<span class='wdi_reset_cache_success' style='color: #fc0000; margin-left: 15px; line-height: 2;'>Failed</span>")}else{jQuery("#wdi_reset_cache").before("<span class='wdi_reset_cache_success' style='color: #029117; margin-left: 15px; line-height: 2;'>Success</span>")}}})});wdi_controller.bindSaveFeedEvent();wdi_controller.bindAddNewUserOrHashtagEvent();jQuery(".display_type input").on("click",function(){wdi_controller.displaySettingsSection(jQuery(this))});wdi_controller.conditionalFiltersTabInit();wdi_controller.bindSaveThemeEvent();jQuery("#wdi_add_user_ajax").after(jQuery("<br><label class='wdi_pro_only' for='wdi_add_user_ajax_input'>"+wdi_messages.username_hashtag_multiple+"</label>"));if(jQuery("body").hasClass("instagram-feed-wd_page_wdi_settings")){wdi_multiple_accounts_option_controller();wdi_advanced_option_controller()}jQuery(".wdi_section_name").click(function(){b(jQuery(this))});b(false);function b(f){if(f===false){var d={wdi_layout_section:"show",wdi_media:"show",wdi_layout:"hide",wdi_advanced:"hide",wdi_lightbox_general:"show",wdi_lightbox_advanced:"hide",wdi_conditional_filters:"show",wdi_how_to_publish:"show"};var g=JSON.parse(localStorage.getItem("wdi_sections"));if(g===null||g===false){g=d;localStorage.setItem("wdi_sections",JSON.stringify(g))}for(i in g){var j=jQuery("#wdi_save_feed").find("[data-section_name='"+i+"']");a(g[i],j)}}else{var c=jQuery(f).data("section_name");var h=null;if(f.hasClass("wdi_section_open")){a("show",f);h="show"}else{if(f.hasClass("wdi_section_close")){a("hide",f);h="hide"}}if(h!=null){var e=JSON.parse(localStorage.getItem("wdi_sections"))||{};e[c]=h;localStorage.setItem("wdi_sections",JSON.stringify(e))}}}function a(e,d){if(e==="show"){var c=d.closest(".wdi_section").find(".wdi_elements");if(c.data("display")==="table"){c.css({display:"table"})}else{c.css({display:"block"})}d.css({"border-bottom":"1px solid #f1f1f1",margin:"0 auto 15px"});d.removeClass("wdi_section_open");d.addClass("wdi_section_close")}else{d.closest(".wdi_section").find(".wdi_elements").css({display:"none"});d.css({"border-bottom":"0px",margin:"0 auto 0px"});d.removeClass("wdi_section_close");d.addClass("wdi_section_open")}}});function wdi_multiple_accounts_option_controller(){var b=jQuery(jQuery("#wdi_user_id").closest("form").find(".form-table").get(1));b.addClass("wdi_multiple_accounts_section");var d="";var e=JSON.parse(wdi_options.wdi_authenticated_users_list);var a=0;for(var c in e){d+="<tr data-multiple-account='"+a+"'>";d+="<th>Access Token</th>";d+='<td><input type="text" name="wdi_instagram_options[wdi_authenticated_users_list][access_token][]" size="53" required="" value="'+e[c].access_token+'"></td>';d+="</tr>";d+="<tr data-multiple-account='"+a+"' class='wdi_username_tr'>";d+="<th>Username</th>";d+='<td><div class="wdi_input_wrapper"><input type="text" name="wdi_instagram_options[wdi_authenticated_users_list][user_name][]" size="53" required="" value="'+e[c].user_name+'"></div><div class="wdi_remove_auth_user">Delete</div></td>';d+='<input type="hidden" name="wdi_instagram_options[wdi_authenticated_users_list][user_id][]" size="53" required="" value="'+e[c].user_id+'">';d+="</tr>";a++}b.append(d);jQuery(".wdi_remove_auth_user").on("click",function(g){g.preventDefault();var f=jQuery(this).closest(".wdi_username_tr").data("multiple-account");jQuery(this).closest(".wdi_multiple_accounts_section").find('tr[data-multiple-account="'+f+'"]').remove();return false})}function wdi_advanced_option_controller(){var a=jQuery(jQuery("#wdi_user_id").closest("form").find(".form-table").get(2));a.addClass("wdi_advanced_option wdi_advanced_option_close");var b="<tr class='wdi_advanced_option_head'><th>ADVANCED OPTIONS</th><td><div class='wdi_advanced_option_icon'></div></td></tr>";$tr=jQuery(b);a.prepend($tr);$tr.on("click",function(){if(a.hasClass("wdi_advanced_option_open")){a.removeClass("wdi_advanced_option_open");a.addClass("wdi_advanced_option_close")}else{a.removeClass("wdi_advanced_option_close");a.addClass("wdi_advanced_option_open")}})}function wdi_controller(){}wdi_controller.getParameterByName=function(a){a=a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var c=new RegExp("[\\?&]"+a+"=([^&#]*)"),b=c.exec(location.search);return b===null?"":decodeURIComponent(b[1].replace(/\+/g," "))};wdi_controller.apiRedirected=function(){var d=this.getParameterByName("access_token");var a=d.split(".");var b=/^[^\\\/&?><"']*$/;for(i=0;i<a.length;i++){if(a[i].match(b)===null){return}}var c=a.join(".");jQuery(document).ready(function(){if(wdi_options.wdi_access_token===""){jQuery("#wdi_access_token").attr("value",c)}else{jQuery(".wdi_more_token_template .wdi_more_access_token").prop("disabled",false);jQuery(".wdi_more_token_template .wdi_more_access_token").attr("value",c)}});wdi_controller.instagram.addToken(c);wdi_controller.getUserInfo(c)};wdi_controller.getUserInfo=function(a){this.instagram.getSelfInfo({success:function(b){if(wdi_options.wdi_access_token===""){jQuery("#wdi_user_name").attr("value",b.data["username"]);jQuery("#wdi_user_id").attr("value",b.data["id"])}else{jQuery(".wdi_more_token_template .wdi_more_user_name").prop("disabled",false);jQuery(".wdi_more_token_template .wdi_more_user_id").prop("disabled",false);jQuery(".wdi_more_token_template .wdi_more_user_name").attr("value",b.data["username"]);jQuery(".wdi_more_token_template .wdi_more_user_id").attr("value",b.data["id"])}jQuery(document).trigger("wdi_settings_filled")}})};wdi_controller.oldDisplayType={};wdi_controller.displayTypeMemory={};wdi_controller.switchFeedTabs=function(d,b){jQuery("#wdi_refresh_tab").attr("value",d);jQuery(".wdi_tab").hide();jQuery("#"+d+"_tab").show();jQuery(".display_type").css("display","none");jQuery('.display_type[tab="'+d+'"]').css("display","block");if(!jQuery('.display_type[tab="'+d+'"]').length){jQuery(".display_type_content").hide()}else{jQuery(".display_type_content").show()}jQuery(".wdi_feed_tabs").filter(".wdi_feed_tab_active").each(function(){jQuery(this).removeClass("wdi_feed_tab_active")});jQuery("#wdi_"+d).addClass("wdi_feed_tab_active");var a=jQuery();var c=false;if(b!=undefined&&b!=""){a=jQuery(".display_type #"+b).prop("checked",true);jQuery("#wdi_feed_type").attr("value",b)}if(!c){a=jQuery('.display_type[tab="'+d+'"] input[name="feed_type"]:checked');if(a.length!=0){c=true}}if(!c){a=jQuery('.display_type[tab="'+d+'"] #thumbnails');if(a.length!=0){c=true;a.prop("checked",true);jQuery("#wdi_feed_type").attr("value","thumbnails")}}if(c){wdi_controller.displaySettingsSection(a)}if(d!="conditional_filters"){jQuery("#wdi-conditional-filters-ui").addClass("wdi_hidden")}else{jQuery("#wdi-conditional-filters-ui").removeClass("wdi_hidden")}};wdi_controller.displaySettingsSection=function(h){var d=h.attr("id").toLowerCase().trim();var g=h.parent().parent().attr("tab");var a=jQuery("#wdi_refresh_section");wdi_controller.oldDisplayType={section:d,tab:g};wdi_controller.displayTypeMemory[g]=wdi_controller.oldDisplayType;if(a!=undefined){a.attr("value",d)}var f=jQuery(".wdi_border_wrapper .form-table");jQuery("#wdi_feed_type").attr("value",d);var e=0,c=0;var b=false;f.find(".wdi_element").each(function(){e++;var j=jQuery(this).find(".wdwt_param").children().children().children().attr("section");if(j!==undefined){b=false;var k=j.toLowerCase().trim().split(",");for(c=0;c<k.length;c++){if(k[c]===d){jQuery(this).css("display","block");b=true}}if(b===false){jQuery(this).css("display","none")}}})};wdi_controller.switchThemeTabs=function(b,a){jQuery(".wdi_feed_tabs").filter(".wdi_feed_tab_active").each(function(){jQuery(this).removeClass("wdi_feed_tab_active")});jQuery("#wdi_"+b).addClass("wdi_feed_tab_active");jQuery("[tab]").each(function(){if(jQuery(this).attr("tab")!=b){jQuery(this).parent().parent().parent().parent().parent().filter("tr").css("display","none")}else{jQuery(this).parent().parent().parent().parent().parent().filter("tr").css("display","block")}});jQuery(".display_type").css("display","none");jQuery('.display_type[tab="'+b+'"]').css("display","block");jQuery("#wdi_refresh_tab").attr("value",b);if(a!=undefined&&a!=""){jQuery("#wdi_refresh_section").attr("value",a)}if(a==undefined&&a!=""){if(wdi_controller.displayTypeMemory[b]!=undefined){jQuery(".display_type #"+wdi_controller.displayTypeMemory[b]["section"]).trigger("click")}else{jQuery('.display_type[tab="'+b+'"]').first().find("input").trigger("click")}}else{jQuery(".display_type #"+a).trigger("click")}};wdi_controller.bindSaveFeedEvent=function(){var a=this;jQuery("#wdi_save_feed_submit").on("click",function(){a.save_feed("save_feed")});jQuery("#wdi_save_feed_apply").on("click",function(){a.save_feed("apply_changes")});jQuery("#wdi_cancel_changes").on("click",function(){a.save_feed("cancel")})};wdi_controller.save_feed=function(d){if("cancel"==d){window.location=window.location.href}wdi_controller.checkIfUserNotSaved(d);if(wdi_controller.waitingAjaxRequestEnd.button!=0){return}jQuery("#task").attr("value",d);var a=this.feed_users,b,c,f,j,h,e={username:jQuery("#wdi_default_user").val(),id:jQuery("#wdi_default_user_id").val()};if(a.length==0){a.push(e);this.updateFeaturedImageSelect(e.username,"add","selected")}b=this.stringifyUserData(a);jQuery("#WDI_feed_users").val(b);if(d=="apply_changes"||d=="save_feed"){c=jQuery("#wdi_add_or_edit").attr("value");jQuery("#wdi_current_id").attr("value",c)}f=jQuery("#WDI_thumb_user").val();h=this.getUserProfilePic(f);if("false"==h||typeof h=="undefined"){var g=this;this.instagram.getSelfInfo({success:function(m){var l=g.isValidResponse(m),k=m.data,n;if(l.valid&&g.hasData(m)&&k){n=k.profile_picture}else{n=""}}});jQuery("#wdi_feed_thumb").attr("value",h);jQuery("#wdi_save_feed").submit()}else{jQuery("#wdi_feed_thumb").attr("value",h);jQuery("#wdi_save_feed").submit()}};wdi_controller.makeInstagramUserRequest=function(d,b){var j,a,g=this,e;a=this.getInputType(d);if(wdi_version.is_pro=="false"){if(jQuery(".wdi_user").length==1){alert(wdi_messages.only_one_user_or_hashtag);return}}switch(a){case"user":if(g.feed_users.length>0){for(var f in g.feed_users){if(g.feed_users[f].username[0]!=="#"){alert("You can add only one username");return false}}}var c="";if(d===wdi_options.wdi_user_name){c=wdi_options.wdi_access_token}else{if(typeof g.users_list[d]!=="undefined"){c=g.users_list[d].access_token}else{alert("You can add only your usernames ( "+g.usersnames.join(", ")+" )");return}}this.instagram.resetTokens();this.instagram.addToken(c);this.instagram.getSelfInfo({success:function(m){var l=g.isValidResponse(m);if(l.valid==false){alert(l.msg);return}var k=m.data;if(l.valid&&g.hasData(m)){g.addUser(k)}else{if(!k){alert(wdi_messages.user_not_exist.replace("%s",'"'+d+'"'))}else{alert(l.msg)}}}});break;case"hashtag":var h=d.substr(1,d.length);h=h.replace(" ","");this.instagram.getTagRecentMedia(h,{success:function(l){var k=g.isValidResponse(l);if(k.valid&&g.hasData(l)){g.addHashtag(h,l);if(wdi_version.is_pro=="false"){if(jQuery(".wdi_user").length==1){jQuery("#wdi_add_user_ajax_input").attr("disabled","disabled");jQuery("#wdi_add_user_ajax_input").attr("placeholder",wdi_messages.available_in_pro)}}}else{if(!g.hasData(l)&&k.msg=="success"){if(b!=true){if(confirm(wdi_messages.hashtag_no_data)){g.addHashtag(h,l);if(wdi_version.is_pro=="false"){if(jQuery(".wdi_user").length==1){jQuery("#wdi_add_user_ajax_input").attr("disabled","disabled");jQuery("#wdi_add_user_ajax_input").attr("placeholder",wdi_messages.available_in_pro)}}}else{jQuery("#wdi_add_user_ajax_input").val("")}}else{g.addHashtag(h,l);if(wdi_version.is_pro=="false"){if(jQuery(".wdi_user").length==1){jQuery("#wdi_add_user_ajax_input").attr("disabled","disabled");jQuery("#wdi_add_user_ajax_input").attr("placeholder",wdi_messages.available_in_pro)}}}}else{alert(k.msg)}}}});break}};wdi_controller.checkForDuplicateUser=function(b){for(var a=0;a<this.feed_users.length;a++){if(b==this.feed_users[a]["username"]){return true}}return false};wdi_controller.getInputType=function(a){switch(a[0]){case"#":return"hashtag";break;case"%":return"location";break;default:return"user";break}};wdi_controller.stringifyUserData=function(a){var c=[];for(var b=0;b<a.length;b++){c.push({username:a[b]["username"],id:a[b]["id"]})}return JSON.stringify(c)};wdi_controller.bindAddNewUserOrHashtagEvent=function(){jQuery("#wdi_add_user_ajax").on("click",function(){var a=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase();wdi_controller.makeInstagramUserRequest(a)});jQuery("#wdi_add_user_ajax_input").on("keypress",function(b){if(b.keyCode==13){var a=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase();wdi_controller.makeInstagramUserRequest(a);return false}})};wdi_controller.removeFeedUser=function(b){var c=b.parent().find("a span").text();if(b.parent().find("a span").hasClass("wdi_hashtag")){c="#"+c}for(var a=0;a<this.feed_users.length;a++){if(this.feed_users[a]["username"]==c){this.feed_users.splice(a,1);break}}b.parent().remove();if(c!==jQuery("#wdi_default_user").val()){wdi_controller.updateFeaturedImageSelect(c,"remove")}if(wdi_version.is_pro=="false"){if(jQuery(".wdi_user").length==0){jQuery("#wdi_add_user_ajax_input").removeAttr("disabled");jQuery("#wdi_add_user_ajax_input").attr("placeholder","")}}};wdi_controller.updateFeaturedImageSelect=function(f,e,d){var a=jQuery("#WDI_thumb_user");if(d!="selected"){d=""}switch(e){case"add":var b=a.find('option[value="'+f+'"]').length;if(!b){var c=jQuery("<option "+d+' value="'+f+'">'+f+"</option>");a.append(c)}break;case"remove":a.find('option[value="'+f+'"]').remove();if(this.feed_users.length>0){a.val(this.feed_users[0].username)}break}};wdi_controller.bindSaveThemeEvent=function(){jQuery("#wdi_save_theme_submit").on("click",function(){jQuery("#task").attr("value","save_feed");jQuery("#wdi_save_feed").submit()});jQuery("#wdi_save_theme_apply").on("click",function(){jQuery("#task").attr("value","apply_changes");var a=jQuery("#wdi_add_or_edit").attr("value");jQuery("#wdi_current_id").attr("value",a);jQuery("#wdi_save_feed").submit()});jQuery("#wdi_save_theme_reset").on("click",function(){jQuery("#task").attr("value","reset_changes");var a=jQuery("#wdi_add_or_edit").attr("value");jQuery("#wdi_current_id").attr("value",a);jQuery("#wdi_save_feed").submit()})};wdi_controller.checkIfUserNotSaved=function(b){switch(b){case"save_feed":b="submit";break;case"apply_changes":b="apply";break;case"reset_changes":b="reset";break}if(jQuery("#wdi_add_user_ajax_input").val().trim()!=""){var a=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase();wdi_controller.waitingAjaxRequestEnd={button:b};wdi_controller.makeInstagramUserRequest(a);return 1}else{wdi_controller.waitingAjaxRequestEnd={button:0};return 0}};wdi_controller.saveFeedAfterAjaxWait=function(b){if(wdi_controller.waitingAjaxRequestEnd!=undefined){var a=wdi_controller.waitingAjaxRequestEnd.button;if(b&&a!=0){jQuery("#wdi_save_feed_"+a).trigger("click")}wdi_controller.waitingAjaxRequestEnd=undefined}};wdi_controller.getCookie=function(a){var b="; "+document.cookie;var c=b.split("; "+a+"=");if(c.length==2){return c.pop().split(";").shift()}};wdi_controller.isValidResponse=function(a){var b={};if(typeof a=="undefined"||typeof a.meta["code"]=="undefined"||a.meta["code"]!=200){b.valid=false;if(typeof a=="undefined"){b.msg=wdi_messages.instagram_server_error}else{if(a.meta["code"]!==200){b.msg=a.meta["error_message"]}else{b.msg=""}}}else{b.valid=true;b.msg="success"}return b};wdi_controller.hasData=function(a){if(typeof a!="undefined"&&typeof a.data!="undefined"&&a.data.length!=0){return true}else{return false}};wdi_controller.thumbUser=function(a){return(this.feed_users.length>0&&this.feed_users[0].username===a)};wdi_controller.findUser=function(d,a){var c=[];if(typeof a!="undefined"&&typeof a.data!="undefined"){c=a.data}for(var b=0;b<c.length;b++){if(c[b]["username"]==d){return c[b]}}return false};wdi_controller.addHashtag=function(e,c){if(e.match(/[~!@$%&*#^()<>?]/)==null){if(this.checkForDuplicateUser("#"+e)==false){var b=jQuery('<div class="wdi_user"><a target="_blank" href="https://instagram.com/explore/tags/'+e+'"><img class="wdi_profile_pic" src="'+wdi_url.plugin_url+'/images/hashtag.png"><span class="wdi_hashtag">'+e+'</span><i style="display:table-cell;width:25px;"></i></a><img class="wdi_remove_user" onclick="wdi_controller.removeFeedUser(jQuery(this))" src="'+wdi_url.plugin_url+'/images/delete_user.png"></div>');jQuery("#wdi_feed_users").append(b);jQuery("#wdi_add_user_ajax_input").attr("value","");var d;if(typeof c!="undefined"){d=(c.data.length!=0)?c.data[0]["images"]["thumbnail"]["url"]:""}else{d=""}this.feed_users.push({username:"#"+e,id:"#"+e,profile_picture:d});var a="#"+e;selected=this.thumbUser(a)?"selected":"";wdi_controller.updateFeaturedImageSelect(a,"add",selected)}else{alert("#"+e+" "+wdi_messages.already_added)}}else{alert(wdi_messages.invalid_hashtag)}this.updateConditionalFiltersUi();wdi_controller.saveFeedAfterAjaxWait(true)};wdi_controller.addUser=function(a){if(this.checkForDuplicateUser(a.username)==false){newUser=jQuery('<div class="wdi_user"><a target="_blank" href="http://www.instagram.com/'+a.username+'"><img class="wdi_profile_pic" src="'+a.profile_picture+'"><span class="wdi_username">'+a.username+'</span><i style="display:table-cell;width:25px;"></i></a><img class="wdi_remove_user" onclick="wdi_controller.removeFeedUser(jQuery(this))" src="'+wdi_url.plugin_url+'/images/delete_user.png"></div>');jQuery("#wdi_feed_users").append(newUser);jQuery("#wdi_add_user_ajax_input").attr("value","");this.feed_users.push({username:a.username,id:a.id,profile_picture:a.profile_picture})}else{alert(a.username+" "+wdi_messages.already_added)}selected=this.thumbUser(a.username)?"selected":"";this.updateFeaturedImageSelect(a.username,"add",selected);this.updateConditionalFiltersUi();wdi_controller.saveFeedAfterAjaxWait(true)};wdi_controller.getUserProfilePic=function(b){for(var a=0;a<this.feed_users.length;a++){if(b==this.feed_users[a]["username"]){return this.feed_users[a]["profile_picture"]}}return"false"};wdi_controller.conditionalFiltersTabInit=function(){this.setInitialFilters();this.updateFiltersUi();var b=this;jQuery("#wdi_add_filter").on("click",function(){b.addConditionalFilter();jQuery("#wdi_filter_input").val("")});jQuery(".wdi_filter_radio").on("click",function(){jQuery("#wdi_filter_input").trigger("focus")});jQuery("#wdi_filter_input").on("keypress",function(c){if(c.keyCode==13){b.addConditionalFilter();jQuery(this).val("");return false}});a();jQuery("#WDI_wrap_conditional_filter_enable input").on("change",function(){a()});function a(){switch(jQuery("#WDI_wrap_conditional_filter_enable input:checked").val()){case"0":jQuery("#WDI_conditional_filters").parent().parent().addClass("wdi_hidden");jQuery("#WDI_conditional_filter_type").parent().parent().parent().parent().parent().addClass("wdi_hidden");jQuery("#wdi_final_condition").addClass("wdi_hidden");jQuery("#WDI_filter_source").addClass("wdi_hidden");break;case"1":jQuery("#WDI_conditional_filters").parent().parent().removeClass("wdi_hidden");jQuery("#WDI_conditional_filter_type").parent().parent().parent().parent().parent().removeClass("wdi_hidden");jQuery("#wdi_final_condition").removeClass("wdi_hidden");jQuery("#WDI_filter_source").removeClass("wdi_hidden");break}}jQuery("#WDI_conditional_filter_type").on("change",function(){if(jQuery(this).val()=="none"){}else{jQuery("#WDI_conditional_filters").css("display","block")}jQuery(this).parent().find("label").css({"line-height":"24px",height:"24px",padding:"2px 5px",display:"inline-block","font-size":"15px",color:"black","font-weight":"500","-webkit-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","-o-user-select":"none","user-select":"none"});switch(jQuery(this).val()){case"AND":jQuery("#WDI_conditional_filters").css("display","block");jQuery(this).parent().find("label").html(wdi_messages.and_descr);break;case"OR":jQuery("#WDI_conditional_filters").css("display","block");jQuery(this).parent().find("label").html(wdi_messages.or_descr);break;case"NOR":jQuery("#WDI_conditional_filters").css("display","block");jQuery(this).parent().find("label").html(wdi_messages.nor_descr);break}wdi_controller.updateFiltersUi()});jQuery("#WDI_conditional_filter_type").trigger("change")};wdi_controller.addConditionalFilter=function(){var b=jQuery("#wdi_filter_input").val(),a=jQuery("#wdi_filter_type").val(),c={};if(b==""){return}b=b.trim();switch(a){case"username":if(b[0]=="@"){b=b.substr(1,b.length)}break;case"mention":if(b[0]=="@"){b=b.substr(1,b.length)}break;case"hashtag":if(b[0]=="#"){b=b.substr(1,b.length)}break;case"url":var d=/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i;if(!d.test(b)){alert(wdi_messages.invalid_url);return}break}c={filter_type:a,filter_by:b,id:this.randomId()};if(a!=null){if(!this.filterExists(c)){this.conditionalFilters.push(c);this.updateFiltersUi()}else{alert(b+" "+wdi_messages.already_added)}}else{alert(wdi_messages.selectConditionType)}};wdi_controller.filterExists=function(b){for(var a=0;a<this.conditionalFilters.length;a++){if(this.conditionalFilters[a].filter_type==b.filter_type&&this.conditionalFilters[a].filter_by==b.filter_by){return true}}return false};wdi_controller.updateFiltersUi=function(){var a=jQuery("#wdi_filters_ui").html("");for(var b=0;b<this.conditionalFilters.length;b++){if(b==0){if(this.conditionalFilters.length!=1){switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":break;case"OR":a.append(jQuery('<span class="wdi_logic">'+wdi_messages.either+"</span>"));break;case"NOR":a.append(jQuery('<span class="wdi_logic">'+wdi_messages.neither+"</span>"));break}}else{switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":break;case"OR":break;case"NOR":a.append(jQuery('<span class="wdi_logic">'+wdi_messages.not+"</span>"));break}}}var c;switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":c=wdi_messages.and;break;case"OR":c=wdi_messages.or;break;case"NOR":c=wdi_messages.nor;break}if(b>=1){a.append(jQuery('<span class="wdi_logic">'+c+"</span>"))}a.append(this.createUiElement(this.conditionalFilters[b]))}this.updateFilterTextarea()};wdi_controller.createUiElement=function(b){var c;switch(b.filter_type){case"mention":c="@";break;case"hashtag":c="#";break;case"location":c="%";break;default:c="";break}var a=jQuery('<span data-id="'+b.id+'" class="wdi_filter_item wdi_filter_by_'+b.filter_type+'"></span>').html(c+b.filter_by+'<span onclick="wdi_controller.removeConditionalFilter(jQuery(this));" class="wdi_remove_filter">X</span>');return a};wdi_controller.randomId=function(){var c="";var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(var b=0;b<5;b++){c+=a.charAt(Math.floor(Math.random()*a.length))}return c};wdi_controller.removeConditionalFilter=function(b){var c=b.parent().attr("data-id");for(var a=0;a<this.conditionalFilters.length;a++){if(this.conditionalFilters[a]["id"]==c){this.conditionalFilters.splice(a,1)}}this.updateFiltersUi()};wdi_controller.updateFilterTextarea=function(){var a,b=this.conditionalFilters;a=JSON.stringify(b);jQuery("#wdi_conditional_filters_textarea").val(a)};wdi_controller.setInitialFilters=function(){var b=[],a=jQuery("#wdi_conditional_filters_textarea").val();if(this.isJsonString(a)){b=JSON.parse(a)}this.conditionalFilters=b};wdi_controller.updateConditionalFiltersUi=function(){wdi_controller.updateFilterSource()};wdi_controller.updateFilterSource=function(){if(jQuery('input[name="wdi_feed_settings[liked_feed]"]:checked').val()=="liked"){var a=jQuery("#wdi_filter_source").html("");var d="<div class='wdi_source_user'><span class='wdi_source_username'>Media I liked</span></div>";a.html(a.html()+d);return}var f=[],e,c;jQuery(".wdi_user").each(function(){if(jQuery(this).find(".wdi_username").length!=0){e=jQuery(this).find(".wdi_username").text()}else{e=jQuery(this).find(".wdi_hashtag").text()}c=jQuery(this).find("img").attr("src");f.push({username:e,image:c})});var a=jQuery("#wdi_filter_source").html("");for(var b=0;b<f.length;b++){var d="<div class='wdi_source_user'><span class='wdi_source_img'><img src='"+f[b].image+"'></span><span class='wdi_source_username'>"+f[b].username+"</span></div>";a.html(a.html()+d)}};wdi_controller.isJsonString=function(b){try{JSON.parse(b)}catch(a){return false}return true};function wdi_spider_select_value(a){a.focus();a.select()}function wdi_spider_set_input_value(b,a){if(a==="add"){if(jQuery("#wdi_access_token").attr("value")==""){alert("Please get your access token")}}if(document.getElementById(b)){document.getElementById(b).value=a}}function wdi_spider_form_submit(b,a){if(document.getElementById(a)){document.getElementById(a).submit()}if(b.preventDefault){b.preventDefault()}else{b.returnValue=false}}function wdi_bulk_actions(a){var b=jQuery(a).val();if(b!=""){if(b=="delete_all"){if(!confirm(wdi_messages.do_you_want_to_delete_selected_items)){return false}}wdi_spider_set_input_value("task",b);jQuery("#wdi_feed_form").submit()}else{return false}return true}function wdi_spider_check_all_items(){wdi_spider_check_all_items_checkbox();jQuery("#check_all").trigger("click")}function wdi_spider_check_all_items_checkbox(){if(jQuery("#check_all_items").attr("checked")){jQuery("#check_all_items").attr("checked",false);jQuery("#draganddrop").hide()}else{var b=(parseInt(jQuery(".displaying-num").html())?parseInt(jQuery(".displaying-num").html()):0);var a=(jQuery('input[id^="check_pr_"]').length?parseInt(jQuery('input[id^="check_pr_"]').length):0);var c=a+b;jQuery("#check_all_items").attr("checked",true);if(c){jQuery("#draganddrop").html("<strong><p>Selected "+c+" item"+(c>1?"s":"")+".</p></strong>");jQuery("#draganddrop").show()}}}function wdi_spider_check_all(a){if(!jQuery(a).attr("checked")){jQuery("#check_all_items").attr("checked",false);jQuery("#draganddrop").hide()}}function wdi_spider_set_input_value(b,a){if(a==="add"){if(jQuery("#wdi_access_token").attr("value")==""){alert("Please get your access token")}}if(document.getElementById(b)){document.getElementById(b).value=a}};
|
js/wdi_instagram.js
CHANGED
@@ -137,6 +137,11 @@ function WDIInstagram(args)
|
|
137 |
}
|
138 |
}
|
139 |
|
|
|
|
|
|
|
|
|
|
|
140 |
/**
|
141 |
* Gets recent media based on tagname
|
142 |
*
|
137 |
}
|
138 |
}
|
139 |
|
140 |
+
this.resetTokens = function ()
|
141 |
+
{
|
142 |
+
_this.access_tokens = [];
|
143 |
+
}
|
144 |
+
|
145 |
/**
|
146 |
* Gets recent media based on tagname
|
147 |
*
|
js/wdi_instagram.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
function WDIInstagram(a){this.access_tokens=[];this.filters=[];if(typeof a!="undefined"){if(typeof a.access_tokens!="undefined"){this.access_tokens=a.access_tokens}if(typeof a.filters!="undefined"){this.filters=a.filters}}var c=this;this.statusCode={429:function(){console.log(" 429: Too many requests. Try after one hour")}};this.getFilter=function(d){var f=c.filters;if(typeof f=="undefined"){return false}for(var e=0;e<f.length;e++){if(f[e].where==d){if(typeof f[e].what=="object"&&f[e].what.length==2){if(typeof window[f[e].what[0]]!="undefined"){if(typeof window[f[e].what[0]][f[e].what[1]]=="function"){return window[f[e].what[0]][f[e].what[1]]}}}else{if(typeof f[e].what=="string"){if(typeof window[f[e].what]=="function"){return window[f[e].what]}}else{if(typeof f[e].what=="function"){return f[e].what}else{return false}}}}}return false};function b(){var d=c.access_tokens,e=parseInt(Math.random(0,1)*d.length);return d[e]}this.addToken=function(d){if(typeof d=="string"){c.access_tokens.push(d)}};this.getTagRecentMedia=function(m,k){var l=this,n=false,e=false,h=this.statusCode,f=false,j=false,d=this.getFilter("getTagRecentMedia"),i="https://api.instagram.com/v1/tags/"+m+"/media/recent?access_token="+b();if(typeof k=="undefined"||k.length===0){n=true}else{if("success" in k){e=true}if("statusCode" in k){h=k.statusCode}if("error" in k){f=true}if("args" in k){j=true}else{k.args={}}if("count" in k){k.count=parseInt(k.count);if(!Number.isInteger(k.count)||k.count<=0){k.count=33}}else{k.count=33}i+="&count="+k.count;if("min_tag_id" in k){i+="&min_tag_id="+k.min_tag_id}if("max_tag_id" in k){i+="&max_tag_id="+k.max_tag_id}}var g=function(o){if(o===false){jQuery.ajax({type:"POST",url:i,dataType:"jsonp",success:function(q){c.setDataToCache(i,q);p(q)},error:function(q){if(f){if(typeof k.error=="object"&&k.error.length==2){if(typeof window[k.error[0]][k.error[1]]=="function"){window[k.error[0]][k.error[1]](q)}}else{if(typeof k.error=="string"){if(typeof window[k.error]=="function"){window[k.error](q)}}else{if(typeof k.error=="function"){k.error(q)}}}}},statusCode:h})}else{p(o)}function p(q){if(typeof q.data==="undefined"){q.data=[]}if(e){if(typeof k.success=="object"&&k.success.length==2){if(typeof window[k.success[0]]!="undefined"){if(typeof window[k.success[0]][k.success[1]]=="function"){if(d){q=d(q,l.filterArguments,k.args)}window[k.success[0]][k.success[1]](q)}}}else{if(typeof k.success=="string"){if(typeof window[k.success]=="function"){if(d){q=d(q,l.filterArguments,k.args)}window[k.success](q)}}else{if(typeof k.success=="function"){if(d){q=d(q,l.filterArguments,k.args)}k.success(q)}}}}}};c.getDataFromCache(g,i)};this.searchForTagsByName=function(k,i){var j=this,l=false,d=false,h=this.statusCode,e=false;filter=this.getFilter("searchForTagsByName");if(typeof i=="undefined"||i.length===0){l=true}else{if("success" in i){d=true}if("error" in i){e=true}if("statusCode" in i){h=i.statusCode}}var f="https://api.instagram.com/v1/tags/search?q="+k+"&access_token="+b();var g=function(m){if(m===false){jQuery.ajax({type:"POST",url:f,dataType:"jsonp",success:function(o){c.setDataToCache(f,o);n(o)},error:function(o){if(e){if(typeof i.error=="object"&&i.error.length==2){if(typeof window[i.error[0]][i.error[1]]=="function"){window[i.error[0]][i.error[1]](o)}}else{if(typeof i.error=="string"){if(typeof window[i.error]=="function"){window[i.error](o)}}else{if(typeof i.error=="function"){i.error(o)}}}}},statusCode:h})}else{n(m)}function n(o){if(d){if(typeof i.success=="object"&&i.success.length==2){if(typeof window[i.success[0]]!="undefined"){if(typeof window[i.success[0]][i.success[1]]=="function"){if(filter){o=filter(o,j.filterArguments)}window[i.success[0]][i.success[1]](o)}}}else{if(typeof i.success=="string"){if(typeof window[i.success]=="function"){if(filter){o=filter(o,j.filterArguments)}window[i.success](o)}}else{if(typeof i.success=="function"){if(filter){o=filter(o,j.filterArguments)}i.success(o)}}}}}};c.getDataFromCache(g,f)};this.searchForUsersByName=function(k,g){var d=this,j=false,e=false,i=this.statusCode,f=false,h=this.getFilter("searchForUsersByName");if(typeof g=="undefined"||g.length===0){j=true}else{if("success" in g){e=true}if("error" in g){f=true}if("statusCode" in g){i=g.statusCode}}jQuery.ajax({type:"POST",dataType:"jsonp",url:"https://api.instagram.com/v1/users/search?q="+k+"&access_token="+b(),success:function(l){if(e){if(typeof g.success=="object"&&g.success.length==2){if(typeof window[g.success[0]]!="undefined"){if(typeof window[g.success[0]][g.success[1]]=="function"){if(h){l=h(l,d.filterArguments)}l.args=g;window[g.success[0]][g.success[1]](l)}}}else{if(typeof g.success=="string"){if(typeof window[g.success]=="function"){if(h){l=h(l,d.filterArguments)}l.args=g;window[g.success](l)}}else{if(typeof g.success=="function"){if(h){l=h(l,d.filterArguments)}l.args=g;g.success(l)}}}}},error:function(l){if(f){if(typeof g.error=="object"&&g.error.length==2){if(typeof window[g.error[0]][g.error[1]]=="function"){window[g.error[0]][g.error[1]](l)}}else{if(typeof g.error=="string"){if(typeof window[g.error]=="function"){window[g.error](l)}}else{if(typeof g.error=="function"){g.error(l)}}}}},statusCode:this.statusCode})};this.getRecentLikedMedia=function(g){var d=this,k=false,e=false,i=this.statusCode,f=false,h=this.getFilter("getRecentLikedMedia"),j="https://api.instagram.com/v1/users/self/media/liked?access_token="+b();if(typeof g=="undefined"||g.length===0){k=true}else{if("success" in g){e=true}if("error" in g){f=true}if("statusCode" in g){i=g.statusCode}if("args" in g){argFlag=true}else{g.args={}}if("count" in g){g.count=parseInt(g.count);if(!Number.isInteger(g.count)||g.count<=0){g.count=20}}else{g.count=20}j+="&count="+g.count;if("next_max_like_id" in g){j+="&next_max_like_id="+g.next_max_like_id}}jQuery.ajax({type:"POST",dataType:"jsonp",url:j,success:function(l){if(e){if(typeof g.success=="object"&&g.success.length==2){if(typeof window[g.success[0]]!="undefined"){if(typeof window[g.success[0]][g.success[1]]=="function"){if(h){l=h(l,d.filterArguments,g.args)}window[g.success[0]][g.success[1]](l)}}}else{if(typeof g.success=="string"){if(typeof window[g.success]=="function"){if(h){l=h(l,d.filterArguments,g.args)}window[g.success](l)}}else{if(typeof g.success=="function"){if(h){l=h(l,d.filterArguments,g.args)}g.success(l)}}}}},error:function(l){if(f){if(typeof g.error=="object"&&g.error.length==2){if(typeof window[g.error[0]][g.error[1]]=="function"){window[g.error[0]][g.error[1]](l)}}else{if(typeof g.error=="string"){if(typeof window[g.error]=="function"){window[g.error](l)}}else{if(typeof g.error=="function"){g.error(l)}}}}},statusCode:i})};this.getUserRecentMedia=function(l,j){var k=this,m=false,e=false,i=false,g=this.statusCode,f=false,d=this.getFilter("getUserRecentMedia"),h="https://api.instagram.com/v1/users/"+l+"/media/recent/?access_token="+b();if(typeof j=="undefined"||j.length===0){m=true}else{if("success" in j){e=true}if("statusCode" in j){g=j.statusCode}if("args" in j){i=true}else{j.args={}}if("error" in j){f=true}if("count" in j){j.count=parseInt(j.count);if(!Number.isInteger(j.count)||j.count<=0){j.count=33}}else{j.count=33}h+="&count="+j.count;if("min_id" in j){h+="&min_id="+j.min_id}if("max_id" in j){h+="&max_id="+j.max_id}}jQuery.ajax({type:"POST",dataType:"jsonp",url:h,success:function(n){if(typeof n.data==="undefined"){n.data=[]}if(e){if(typeof j.success=="object"&&j.success.length==2){if(typeof window[j.success[0]]!="undefined"){if(typeof window[j.success[0]][j.success[1]]=="function"){if(d){n=d(n,k.filterArguments,j.args)}window[j.success[0]][j.success[1]](n)}}}else{if(typeof j.success=="string"){if(typeof window[j.success]=="function"){if(d){n=d(n,k.filterArguments,j.args)}window[j.success](n)}}else{if(typeof j.success=="function"){if(d){n=d(n,k.filterArguments,j.args)}j.success(n)}}}}},error:function(n){if(f){if(typeof j.error=="object"&&j.error.length==2){if(typeof window[j.error[0]][j.error[1]]=="function"){window[j.error[0]][j.error[1]](n)}}else{if(typeof j.error=="string"){if(typeof window[j.error]=="function"){window[j.error](n)}}else{if(typeof j.error=="function"){j.error(n)}}}}},statusCode:g})};this.getSelfRecentMedia=function(k){var l=this,m=false,e=false,h=this.statusCode,f=false,j=false,d=this.getFilter("getSelfRecentMedia"),i="https://api.instagram.com/v1/users/self/media/recent/?access_token="+b();if(typeof k=="undefined"||k.length===0){m=true}else{if("success" in k){e=true}if("error" in k){f=true}if("statusCode" in k){h=k.statusCode}if("args" in k){j=true}else{k.args={}}if("count" in k){k.count=parseInt(k.count);if(!Number.isInteger(k.count)||k.count<=0){k.count=20}}else{k.count=20}i+="&count="+k.count;if("min_id" in k){i+="&min_id="+k.min_id}if("max_id" in k){i+="&max_id="+k.max_id}}var g=function(n){if(n===false){jQuery.ajax({type:"POST",dataType:"jsonp",url:i,success:function(p){c.setDataToCache(i,p);o(p)},error:function(p){if(f){if(typeof k.error=="object"&&k.error.length==2){if(typeof window[k.error[0]][k.error[1]]=="function"){window[k.error[0]][k.error[1]](p)}}else{if(typeof k.error=="string"){if(typeof window[k.error]=="function"){window[k.error](p)}}else{if(typeof k.error=="function"){k.error(p)}}}}},statusCode:h})}else{o(n)}function o(p){if(e){if(typeof k.success=="object"&&k.success.length==2){if(typeof window[k.success[0]]!="undefined"){if(typeof window[k.success[0]][k.success[1]]=="function"){if(d){p=d(p,l.filterArguments,k)}window[k.success[0]][k.success[1]](p)}}}else{if(typeof k.success=="string"){if(typeof window[k.success]=="function"){if(d){p=d(p,l.filterArguments,k)}window[k.success](p)}}else{if(typeof k.success=="function"){if(d){p=d(p,l.filterArguments,k)}k.success(p)}}}}}};c.getDataFromCache(g,i)};this.getUserInfo=function(e,h){var d=this,k=false,f=false,j=this.statusCode,g=false,i=this.getFilter("getUserInfo");if(typeof h=="undefined"||h.length===0){k=true}else{if("success" in h){f=true}if("error" in h){g=true}if("statusCode" in h){j=h.statusCode}}jQuery.ajax({type:"POST",dataType:"jsonp",url:"https://api.instagram.com/v1/users/"+e+"/?access_token="+b(),success:function(l){if(f){if(typeof h.success=="object"&&h.success.length==2){if(typeof window[h.success[0]]!="undefined"){if(typeof window[h.success[0]][h.success[1]]=="function"){if(i){l=i(l,d.filterArguments)}window[h.success[0]][h.success[1]](l)}}}else{if(typeof h.success=="string"){if(typeof window[h.success]=="function"){if(i){l=i(l,d.filterArguments)}window[h.success](l)}}else{if(typeof h.success=="function"){if(i){l=i(l,d.filterArguments)}h.success(l)}}}}},error:function(l){if(g){if(typeof h.error=="object"&&h.error.length==2){if(typeof window[h.error[0]][h.error[1]]=="function"){window[h.error[0]][h.error[1]](l)}}else{if(typeof h.error=="string"){if(typeof window[h.error]=="function"){window[h.error](l)}}else{if(typeof h.error=="function"){h.error(l)}}}}},statusCode:j})};this.getSelfInfo=function(j){var k=this,l=false,e=false,i=this.statusCode,f=false,d=this.getFilter("getSelfInfo");if(typeof j=="undefined"||j.length===0){l=true}else{if("success" in j){e=true}if("error" in j){f=true}if("statusCode" in j){i=j.statusCode}}var g="https://api.instagram.com/v1/users/self/?access_token="+b();var h=function(m){if(m===false){jQuery.ajax({type:"POST",dataType:"jsonp",url:g,success:function(o){c.setDataToCache(g,o);if(e){if(typeof j.success=="object"&&j.success.length==2){if(typeof window[j.success[0]]!="undefined"){if(typeof window[j.success[0]][j.success[1]]=="function"){if(d){o=d(o,k.filterArguments)}window[j.success[0]][j.success[1]](o)}}}else{if(typeof j.success=="string"){if(typeof window[j.success]=="function"){if(d){o=d(o,k.filterArguments)}window[j.success](o)}}else{if(typeof j.success=="function"){if(d){o=d(o,k.filterArguments)}j.success(o)}}}}},error:function(o){if(f){if(typeof j.error=="object"&&j.error.length==2){if(typeof window[j.error[0]][j.error[1]]=="function"){window[j.error[0]][j.error[1]](o)}}else{if(typeof j.error=="string"){if(typeof window[j.error]=="function"){window[j.error](o)}}else{if(typeof j.error=="function"){j.error(o)}}}}},statusCode:i})}else{n(m)}function n(o){if(e){if(typeof j.success=="object"&&j.success.length==2){if(typeof window[j.success[0]]!="undefined"){if(typeof window[j.success[0]][j.success[1]]=="function"){if(d){o=d(o,k.filterArguments)}window[j.success[0]][j.success[1]](o)}}}else{if(typeof j.success=="string"){if(typeof window[j.success]=="function"){if(d){o=d(o,k.filterArguments)}window[j.success](o)}}else{if(typeof j.success=="function"){if(d){o=d(o,k.filterArguments)}j.success(o)}}}}}};c.getDataFromCache(h,g)};this.getRecentMediaComments=function(f,k){var l=this,m=false,e=false,j=this.statusCode,h=false,d=this.getFilter("getRecentMediaComments");if(typeof k=="undefined"||k.length===0){m=true}else{if("success" in k){e=true}if("error" in k){h=true}if("statusCode" in k){j=k.statusCode}}var g="https://api.instagram.com/v1/media/"+f+"/comments?access_token="+b();var i=function(n){if(n===false){jQuery.ajax({type:"POST",dataType:"jsonp",url:g,success:function(p){c.setDataToCache(g,p);o(p)},error:function(p){if(h){if(typeof k.error=="object"&&k.error.length==2){if(typeof window[k.error[0]][k.error[1]]=="function"){window[k.error[0]][k.error[1]](p)}}else{if(typeof k.error=="string"){if(typeof window[k.error]=="function"){window[k.error](p)}}else{if(typeof k.error=="function"){k.error(p)}}}}},statusCode:j})}else{o(n)}function o(p){if(e){if(typeof k.success=="object"&&k.success.length==2){if(typeof window[k.success[0]]!="undefined"){if(typeof window[k.success[0]][k.success[1]]=="function"){if(d){p=d(p,l.filterArguments)}window[k.success[0]][k.success[1]](p)}}}else{if(typeof k.success=="string"){if(typeof window[k.success]=="function"){if(d){p=d(p,l.filterArguments)}window[k.success](p)}}else{if(typeof k.success=="function"){if(d){p=d(p,l.filterArguments)}k.success(p)}}}}}};c.getDataFromCache(i,g)};this.getRecentMediaLikes=function(j,g){var d=this,k=false,e=false,i=this.statusCode,f=false,h=this.getFilter("getRecentMediaLikes");if(typeof g=="undefined"||g.length===0){k=true}else{if("success" in g){e=true}if("error" in g){f=true}if("statusCode" in g){i=g.statusCode}}jQuery.ajax({type:"POST",dataType:"jsonp",url:"https://api.instagram.com/v1/media/"+j+"/likes?access_token="+b(),success:function(l){if(e){if(typeof g.success=="object"&&g.success.length==2){if(typeof window[g.success[0]]!="undefined"){if(typeof window[g.success[0]][g.success[1]]=="function"){if(h){l=h(l,d.filterArguments)}window[g.success[0]][g.success[1]](l)}}}else{if(typeof g.success=="string"){if(typeof window[g.success]=="function"){if(h){l=h(l,d.filterArguments)}window[g.success](l)}}else{if(typeof g.success=="function"){if(h){l=h(l,d.filterArguments)}g.success(l)}}}}},error:function(l){if(f){if(typeof g.error=="object"&&g.error.length==2){if(typeof window[g.error[0]][g.error[1]]=="function"){window[g.error[0]][g.error[1]](l)}}else{if(typeof g.error=="string"){if(typeof window[g.error]=="function"){window[g.error](l)}}else{if(typeof g.error=="function"){g.error(l)}}}}},statusCode:i})};this.requestByUrl=function(o,n){var p=this,q=false,f=false,g=false,m=false,k=this.statusCode,e=this.getFilter("requestByUrl"),d,l;d=o.split("?")[1].split("&");for(var j=0;j<d.length;j++){d[j]=d[j].split("=");if(d[j][0]=="access_token"){d[j][1]=b()}d[j]=d[j].join("=")}d=d.join("&");o=o.split("?")[0]+"?"+d;if(typeof n=="undefined"||n.length===0){q=true}else{if("success" in n){f=true}if("args" in n){m=true}else{n.args={}}if("error" in n){g=true}if("statusCode" in n){k=n.statusCode}}var h=function(i){if(i===false){jQuery.ajax({type:"POST",dataType:"jsonp",url:o,success:function(s){c.setDataToCache(o,s);if(f){if(typeof n.success=="object"&&n.success.length==2){if(typeof window[n.success[0]]!="undefined"){if(typeof window[n.success[0]][n.success[1]]=="function"){if(e){s=e(s,p.filterArguments,n.args)}window[n.success[0]][n.success[1]](s)}}}else{if(typeof n.success=="string"){if(typeof window[n.success]=="function"){if(e){s=e(s,p.filterArguments,n.args)}window[n.success](s)}}else{if(typeof n.success=="function"){if(e){s=e(s,p.filterArguments,n.args)}n.success(s)}}}}},error:function(s){if(g){if(typeof n.error=="object"&&n.error.length==2){if(typeof window[n.error[0]][n.error[1]]=="function"){window[n.error[0]][n.error[1]](s)}}else{if(typeof n.error=="string"){if(typeof window[n.error]=="function"){window[n.error](s)}}else{if(typeof n.error=="function"){n.error(s)}}}}},statusCode:k})}else{r(i)}function r(s){if(f){if(typeof n.success=="object"&&n.success.length==2){if(typeof window[n.success[0]]!="undefined"){if(typeof window[n.success[0]][n.success[1]]=="function"){if(e){s=e(s,p.filterArguments,n.args)}window[n.success[0]][n.success[1]](s)}}}else{if(typeof n.success=="string"){if(typeof window[n.success]=="function"){if(e){s=e(s,p.filterArguments,n.args)}window[n.success](s)}}else{if(typeof n.success=="function"){if(e){s=e(s,p.filterArguments,n.args)}n.success(s)}}}}}};c.getDataFromCache(h,o)};this.getDataFromCache=function(e,d){jQuery.ajax({type:"POST",async:true,url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_cache_name:d,wdi_nonce:wdi_ajax.wdi_nonce,action:"wdi_get_cache_data"},success:function(g){if(g.success!=="false"){if(typeof g.cache_data!=="undefined"){var f=JSON.parse(g.cache_data);e(f)}}else{e(false)}}})};this.setDataToCache=function(e,d){jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_cache_name:e,wdi_cache_response:JSON.stringify(d),wdi_nonce:wdi_ajax.wdi_nonce,action:"wdi_set_cache_data"},success:function(f){console.log(f)}})}};
|
1 |
+
function WDIInstagram(a){this.access_tokens=[];this.filters=[];if(typeof a!="undefined"){if(typeof a.access_tokens!="undefined"){this.access_tokens=a.access_tokens}if(typeof a.filters!="undefined"){this.filters=a.filters}}var c=this;this.statusCode={429:function(){console.log(" 429: Too many requests. Try after one hour")}};this.getFilter=function(d){var f=c.filters;if(typeof f=="undefined"){return false}for(var e=0;e<f.length;e++){if(f[e].where==d){if(typeof f[e].what=="object"&&f[e].what.length==2){if(typeof window[f[e].what[0]]!="undefined"){if(typeof window[f[e].what[0]][f[e].what[1]]=="function"){return window[f[e].what[0]][f[e].what[1]]}}}else{if(typeof f[e].what=="string"){if(typeof window[f[e].what]=="function"){return window[f[e].what]}}else{if(typeof f[e].what=="function"){return f[e].what}else{return false}}}}}return false};function b(){var d=c.access_tokens,e=parseInt(Math.random(0,1)*d.length);return d[e]}this.addToken=function(d){if(typeof d=="string"){c.access_tokens.push(d)}};this.resetTokens=function(){c.access_tokens=[]};this.getTagRecentMedia=function(m,k){var l=this,n=false,e=false,h=this.statusCode,f=false,j=false,d=this.getFilter("getTagRecentMedia"),i="https://api.instagram.com/v1/tags/"+m+"/media/recent?access_token="+b();if(typeof k=="undefined"||k.length===0){n=true}else{if("success" in k){e=true}if("statusCode" in k){h=k.statusCode}if("error" in k){f=true}if("args" in k){j=true}else{k.args={}}if("count" in k){k.count=parseInt(k.count);if(!Number.isInteger(k.count)||k.count<=0){k.count=33}}else{k.count=33}i+="&count="+k.count;if("min_tag_id" in k){i+="&min_tag_id="+k.min_tag_id}if("max_tag_id" in k){i+="&max_tag_id="+k.max_tag_id}}var g=function(o){if(o===false){jQuery.ajax({type:"POST",url:i,dataType:"jsonp",success:function(q){c.setDataToCache(i,q);p(q)},error:function(q){if(f){if(typeof k.error=="object"&&k.error.length==2){if(typeof window[k.error[0]][k.error[1]]=="function"){window[k.error[0]][k.error[1]](q)}}else{if(typeof k.error=="string"){if(typeof window[k.error]=="function"){window[k.error](q)}}else{if(typeof k.error=="function"){k.error(q)}}}}},statusCode:h})}else{p(o)}function p(q){if(typeof q.data==="undefined"){q.data=[]}if(e){if(typeof k.success=="object"&&k.success.length==2){if(typeof window[k.success[0]]!="undefined"){if(typeof window[k.success[0]][k.success[1]]=="function"){if(d){q=d(q,l.filterArguments,k.args)}window[k.success[0]][k.success[1]](q)}}}else{if(typeof k.success=="string"){if(typeof window[k.success]=="function"){if(d){q=d(q,l.filterArguments,k.args)}window[k.success](q)}}else{if(typeof k.success=="function"){if(d){q=d(q,l.filterArguments,k.args)}k.success(q)}}}}}};c.getDataFromCache(g,i)};this.searchForTagsByName=function(k,i){var j=this,l=false,d=false,h=this.statusCode,e=false;filter=this.getFilter("searchForTagsByName");if(typeof i=="undefined"||i.length===0){l=true}else{if("success" in i){d=true}if("error" in i){e=true}if("statusCode" in i){h=i.statusCode}}var f="https://api.instagram.com/v1/tags/search?q="+k+"&access_token="+b();var g=function(m){if(m===false){jQuery.ajax({type:"POST",url:f,dataType:"jsonp",success:function(o){c.setDataToCache(f,o);n(o)},error:function(o){if(e){if(typeof i.error=="object"&&i.error.length==2){if(typeof window[i.error[0]][i.error[1]]=="function"){window[i.error[0]][i.error[1]](o)}}else{if(typeof i.error=="string"){if(typeof window[i.error]=="function"){window[i.error](o)}}else{if(typeof i.error=="function"){i.error(o)}}}}},statusCode:h})}else{n(m)}function n(o){if(d){if(typeof i.success=="object"&&i.success.length==2){if(typeof window[i.success[0]]!="undefined"){if(typeof window[i.success[0]][i.success[1]]=="function"){if(filter){o=filter(o,j.filterArguments)}window[i.success[0]][i.success[1]](o)}}}else{if(typeof i.success=="string"){if(typeof window[i.success]=="function"){if(filter){o=filter(o,j.filterArguments)}window[i.success](o)}}else{if(typeof i.success=="function"){if(filter){o=filter(o,j.filterArguments)}i.success(o)}}}}}};c.getDataFromCache(g,f)};this.searchForUsersByName=function(k,g){var d=this,j=false,e=false,i=this.statusCode,f=false,h=this.getFilter("searchForUsersByName");if(typeof g=="undefined"||g.length===0){j=true}else{if("success" in g){e=true}if("error" in g){f=true}if("statusCode" in g){i=g.statusCode}}jQuery.ajax({type:"POST",dataType:"jsonp",url:"https://api.instagram.com/v1/users/search?q="+k+"&access_token="+b(),success:function(l){if(e){if(typeof g.success=="object"&&g.success.length==2){if(typeof window[g.success[0]]!="undefined"){if(typeof window[g.success[0]][g.success[1]]=="function"){if(h){l=h(l,d.filterArguments)}l.args=g;window[g.success[0]][g.success[1]](l)}}}else{if(typeof g.success=="string"){if(typeof window[g.success]=="function"){if(h){l=h(l,d.filterArguments)}l.args=g;window[g.success](l)}}else{if(typeof g.success=="function"){if(h){l=h(l,d.filterArguments)}l.args=g;g.success(l)}}}}},error:function(l){if(f){if(typeof g.error=="object"&&g.error.length==2){if(typeof window[g.error[0]][g.error[1]]=="function"){window[g.error[0]][g.error[1]](l)}}else{if(typeof g.error=="string"){if(typeof window[g.error]=="function"){window[g.error](l)}}else{if(typeof g.error=="function"){g.error(l)}}}}},statusCode:this.statusCode})};this.getRecentLikedMedia=function(g){var d=this,k=false,e=false,i=this.statusCode,f=false,h=this.getFilter("getRecentLikedMedia"),j="https://api.instagram.com/v1/users/self/media/liked?access_token="+b();if(typeof g=="undefined"||g.length===0){k=true}else{if("success" in g){e=true}if("error" in g){f=true}if("statusCode" in g){i=g.statusCode}if("args" in g){argFlag=true}else{g.args={}}if("count" in g){g.count=parseInt(g.count);if(!Number.isInteger(g.count)||g.count<=0){g.count=20}}else{g.count=20}j+="&count="+g.count;if("next_max_like_id" in g){j+="&next_max_like_id="+g.next_max_like_id}}jQuery.ajax({type:"POST",dataType:"jsonp",url:j,success:function(l){if(e){if(typeof g.success=="object"&&g.success.length==2){if(typeof window[g.success[0]]!="undefined"){if(typeof window[g.success[0]][g.success[1]]=="function"){if(h){l=h(l,d.filterArguments,g.args)}window[g.success[0]][g.success[1]](l)}}}else{if(typeof g.success=="string"){if(typeof window[g.success]=="function"){if(h){l=h(l,d.filterArguments,g.args)}window[g.success](l)}}else{if(typeof g.success=="function"){if(h){l=h(l,d.filterArguments,g.args)}g.success(l)}}}}},error:function(l){if(f){if(typeof g.error=="object"&&g.error.length==2){if(typeof window[g.error[0]][g.error[1]]=="function"){window[g.error[0]][g.error[1]](l)}}else{if(typeof g.error=="string"){if(typeof window[g.error]=="function"){window[g.error](l)}}else{if(typeof g.error=="function"){g.error(l)}}}}},statusCode:i})};this.getUserRecentMedia=function(l,j){var k=this,m=false,e=false,i=false,g=this.statusCode,f=false,d=this.getFilter("getUserRecentMedia"),h="https://api.instagram.com/v1/users/"+l+"/media/recent/?access_token="+b();if(typeof j=="undefined"||j.length===0){m=true}else{if("success" in j){e=true}if("statusCode" in j){g=j.statusCode}if("args" in j){i=true}else{j.args={}}if("error" in j){f=true}if("count" in j){j.count=parseInt(j.count);if(!Number.isInteger(j.count)||j.count<=0){j.count=33}}else{j.count=33}h+="&count="+j.count;if("min_id" in j){h+="&min_id="+j.min_id}if("max_id" in j){h+="&max_id="+j.max_id}}jQuery.ajax({type:"POST",dataType:"jsonp",url:h,success:function(n){if(typeof n.data==="undefined"){n.data=[]}if(e){if(typeof j.success=="object"&&j.success.length==2){if(typeof window[j.success[0]]!="undefined"){if(typeof window[j.success[0]][j.success[1]]=="function"){if(d){n=d(n,k.filterArguments,j.args)}window[j.success[0]][j.success[1]](n)}}}else{if(typeof j.success=="string"){if(typeof window[j.success]=="function"){if(d){n=d(n,k.filterArguments,j.args)}window[j.success](n)}}else{if(typeof j.success=="function"){if(d){n=d(n,k.filterArguments,j.args)}j.success(n)}}}}},error:function(n){if(f){if(typeof j.error=="object"&&j.error.length==2){if(typeof window[j.error[0]][j.error[1]]=="function"){window[j.error[0]][j.error[1]](n)}}else{if(typeof j.error=="string"){if(typeof window[j.error]=="function"){window[j.error](n)}}else{if(typeof j.error=="function"){j.error(n)}}}}},statusCode:g})};this.getSelfRecentMedia=function(k){var l=this,m=false,e=false,h=this.statusCode,f=false,j=false,d=this.getFilter("getSelfRecentMedia"),i="https://api.instagram.com/v1/users/self/media/recent/?access_token="+b();if(typeof k=="undefined"||k.length===0){m=true}else{if("success" in k){e=true}if("error" in k){f=true}if("statusCode" in k){h=k.statusCode}if("args" in k){j=true}else{k.args={}}if("count" in k){k.count=parseInt(k.count);if(!Number.isInteger(k.count)||k.count<=0){k.count=20}}else{k.count=20}i+="&count="+k.count;if("min_id" in k){i+="&min_id="+k.min_id}if("max_id" in k){i+="&max_id="+k.max_id}}var g=function(n){if(n===false){jQuery.ajax({type:"POST",dataType:"jsonp",url:i,success:function(p){c.setDataToCache(i,p);o(p)},error:function(p){if(f){if(typeof k.error=="object"&&k.error.length==2){if(typeof window[k.error[0]][k.error[1]]=="function"){window[k.error[0]][k.error[1]](p)}}else{if(typeof k.error=="string"){if(typeof window[k.error]=="function"){window[k.error](p)}}else{if(typeof k.error=="function"){k.error(p)}}}}},statusCode:h})}else{o(n)}function o(p){if(e){if(typeof k.success=="object"&&k.success.length==2){if(typeof window[k.success[0]]!="undefined"){if(typeof window[k.success[0]][k.success[1]]=="function"){if(d){p=d(p,l.filterArguments,k)}window[k.success[0]][k.success[1]](p)}}}else{if(typeof k.success=="string"){if(typeof window[k.success]=="function"){if(d){p=d(p,l.filterArguments,k)}window[k.success](p)}}else{if(typeof k.success=="function"){if(d){p=d(p,l.filterArguments,k)}k.success(p)}}}}}};c.getDataFromCache(g,i)};this.getUserInfo=function(e,h){var d=this,k=false,f=false,j=this.statusCode,g=false,i=this.getFilter("getUserInfo");if(typeof h=="undefined"||h.length===0){k=true}else{if("success" in h){f=true}if("error" in h){g=true}if("statusCode" in h){j=h.statusCode}}jQuery.ajax({type:"POST",dataType:"jsonp",url:"https://api.instagram.com/v1/users/"+e+"/?access_token="+b(),success:function(l){if(f){if(typeof h.success=="object"&&h.success.length==2){if(typeof window[h.success[0]]!="undefined"){if(typeof window[h.success[0]][h.success[1]]=="function"){if(i){l=i(l,d.filterArguments)}window[h.success[0]][h.success[1]](l)}}}else{if(typeof h.success=="string"){if(typeof window[h.success]=="function"){if(i){l=i(l,d.filterArguments)}window[h.success](l)}}else{if(typeof h.success=="function"){if(i){l=i(l,d.filterArguments)}h.success(l)}}}}},error:function(l){if(g){if(typeof h.error=="object"&&h.error.length==2){if(typeof window[h.error[0]][h.error[1]]=="function"){window[h.error[0]][h.error[1]](l)}}else{if(typeof h.error=="string"){if(typeof window[h.error]=="function"){window[h.error](l)}}else{if(typeof h.error=="function"){h.error(l)}}}}},statusCode:j})};this.getSelfInfo=function(j){var k=this,l=false,e=false,i=this.statusCode,f=false,d=this.getFilter("getSelfInfo");if(typeof j=="undefined"||j.length===0){l=true}else{if("success" in j){e=true}if("error" in j){f=true}if("statusCode" in j){i=j.statusCode}}var g="https://api.instagram.com/v1/users/self/?access_token="+b();var h=function(m){if(m===false){jQuery.ajax({type:"POST",dataType:"jsonp",url:g,success:function(o){c.setDataToCache(g,o);if(e){if(typeof j.success=="object"&&j.success.length==2){if(typeof window[j.success[0]]!="undefined"){if(typeof window[j.success[0]][j.success[1]]=="function"){if(d){o=d(o,k.filterArguments)}window[j.success[0]][j.success[1]](o)}}}else{if(typeof j.success=="string"){if(typeof window[j.success]=="function"){if(d){o=d(o,k.filterArguments)}window[j.success](o)}}else{if(typeof j.success=="function"){if(d){o=d(o,k.filterArguments)}j.success(o)}}}}},error:function(o){if(f){if(typeof j.error=="object"&&j.error.length==2){if(typeof window[j.error[0]][j.error[1]]=="function"){window[j.error[0]][j.error[1]](o)}}else{if(typeof j.error=="string"){if(typeof window[j.error]=="function"){window[j.error](o)}}else{if(typeof j.error=="function"){j.error(o)}}}}},statusCode:i})}else{n(m)}function n(o){if(e){if(typeof j.success=="object"&&j.success.length==2){if(typeof window[j.success[0]]!="undefined"){if(typeof window[j.success[0]][j.success[1]]=="function"){if(d){o=d(o,k.filterArguments)}window[j.success[0]][j.success[1]](o)}}}else{if(typeof j.success=="string"){if(typeof window[j.success]=="function"){if(d){o=d(o,k.filterArguments)}window[j.success](o)}}else{if(typeof j.success=="function"){if(d){o=d(o,k.filterArguments)}j.success(o)}}}}}};c.getDataFromCache(h,g)};this.getRecentMediaComments=function(f,k){var l=this,m=false,e=false,j=this.statusCode,h=false,d=this.getFilter("getRecentMediaComments");if(typeof k=="undefined"||k.length===0){m=true}else{if("success" in k){e=true}if("error" in k){h=true}if("statusCode" in k){j=k.statusCode}}var g="https://api.instagram.com/v1/media/"+f+"/comments?access_token="+b();var i=function(n){if(n===false){jQuery.ajax({type:"POST",dataType:"jsonp",url:g,success:function(p){c.setDataToCache(g,p);o(p)},error:function(p){if(h){if(typeof k.error=="object"&&k.error.length==2){if(typeof window[k.error[0]][k.error[1]]=="function"){window[k.error[0]][k.error[1]](p)}}else{if(typeof k.error=="string"){if(typeof window[k.error]=="function"){window[k.error](p)}}else{if(typeof k.error=="function"){k.error(p)}}}}},statusCode:j})}else{o(n)}function o(p){if(e){if(typeof k.success=="object"&&k.success.length==2){if(typeof window[k.success[0]]!="undefined"){if(typeof window[k.success[0]][k.success[1]]=="function"){if(d){p=d(p,l.filterArguments)}window[k.success[0]][k.success[1]](p)}}}else{if(typeof k.success=="string"){if(typeof window[k.success]=="function"){if(d){p=d(p,l.filterArguments)}window[k.success](p)}}else{if(typeof k.success=="function"){if(d){p=d(p,l.filterArguments)}k.success(p)}}}}}};c.getDataFromCache(i,g)};this.getRecentMediaLikes=function(j,g){var d=this,k=false,e=false,i=this.statusCode,f=false,h=this.getFilter("getRecentMediaLikes");if(typeof g=="undefined"||g.length===0){k=true}else{if("success" in g){e=true}if("error" in g){f=true}if("statusCode" in g){i=g.statusCode}}jQuery.ajax({type:"POST",dataType:"jsonp",url:"https://api.instagram.com/v1/media/"+j+"/likes?access_token="+b(),success:function(l){if(e){if(typeof g.success=="object"&&g.success.length==2){if(typeof window[g.success[0]]!="undefined"){if(typeof window[g.success[0]][g.success[1]]=="function"){if(h){l=h(l,d.filterArguments)}window[g.success[0]][g.success[1]](l)}}}else{if(typeof g.success=="string"){if(typeof window[g.success]=="function"){if(h){l=h(l,d.filterArguments)}window[g.success](l)}}else{if(typeof g.success=="function"){if(h){l=h(l,d.filterArguments)}g.success(l)}}}}},error:function(l){if(f){if(typeof g.error=="object"&&g.error.length==2){if(typeof window[g.error[0]][g.error[1]]=="function"){window[g.error[0]][g.error[1]](l)}}else{if(typeof g.error=="string"){if(typeof window[g.error]=="function"){window[g.error](l)}}else{if(typeof g.error=="function"){g.error(l)}}}}},statusCode:i})};this.requestByUrl=function(o,n){var p=this,q=false,f=false,g=false,m=false,k=this.statusCode,e=this.getFilter("requestByUrl"),d,l;d=o.split("?")[1].split("&");for(var j=0;j<d.length;j++){d[j]=d[j].split("=");if(d[j][0]=="access_token"){d[j][1]=b()}d[j]=d[j].join("=")}d=d.join("&");o=o.split("?")[0]+"?"+d;if(typeof n=="undefined"||n.length===0){q=true}else{if("success" in n){f=true}if("args" in n){m=true}else{n.args={}}if("error" in n){g=true}if("statusCode" in n){k=n.statusCode}}var h=function(i){if(i===false){jQuery.ajax({type:"POST",dataType:"jsonp",url:o,success:function(s){c.setDataToCache(o,s);if(f){if(typeof n.success=="object"&&n.success.length==2){if(typeof window[n.success[0]]!="undefined"){if(typeof window[n.success[0]][n.success[1]]=="function"){if(e){s=e(s,p.filterArguments,n.args)}window[n.success[0]][n.success[1]](s)}}}else{if(typeof n.success=="string"){if(typeof window[n.success]=="function"){if(e){s=e(s,p.filterArguments,n.args)}window[n.success](s)}}else{if(typeof n.success=="function"){if(e){s=e(s,p.filterArguments,n.args)}n.success(s)}}}}},error:function(s){if(g){if(typeof n.error=="object"&&n.error.length==2){if(typeof window[n.error[0]][n.error[1]]=="function"){window[n.error[0]][n.error[1]](s)}}else{if(typeof n.error=="string"){if(typeof window[n.error]=="function"){window[n.error](s)}}else{if(typeof n.error=="function"){n.error(s)}}}}},statusCode:k})}else{r(i)}function r(s){if(f){if(typeof n.success=="object"&&n.success.length==2){if(typeof window[n.success[0]]!="undefined"){if(typeof window[n.success[0]][n.success[1]]=="function"){if(e){s=e(s,p.filterArguments,n.args)}window[n.success[0]][n.success[1]](s)}}}else{if(typeof n.success=="string"){if(typeof window[n.success]=="function"){if(e){s=e(s,p.filterArguments,n.args)}window[n.success](s)}}else{if(typeof n.success=="function"){if(e){s=e(s,p.filterArguments,n.args)}n.success(s)}}}}}};c.getDataFromCache(h,o)};this.getDataFromCache=function(e,d){jQuery.ajax({type:"POST",async:true,url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_cache_name:d,wdi_nonce:wdi_ajax.wdi_nonce,action:"wdi_get_cache_data"},success:function(g){if(g.success!=="false"){if(typeof g.cache_data!=="undefined"){var f=JSON.parse(g.cache_data);e(f)}}else{e(false)}}})};this.setDataToCache=function(e,d){jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_cache_name:e,wdi_cache_response:JSON.stringify(d),wdi_nonce:wdi_ajax.wdi_nonce,action:"wdi_set_cache_data"},success:function(f){console.log(f)}})}};
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: custom instagram feed, feed, instagram, hashtag, Instagram feed, instagram
|
|
4 |
Requires at least: 3.9
|
5 |
Requires PHP: 5.2
|
6 |
Tested up to: 4.9
|
7 |
-
Stable tag: 1.3.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -498,6 +498,10 @@ Please make sure you don't have any important information before you proceed.
|
|
498 |
|
499 |
== Changelog ==
|
500 |
|
|
|
|
|
|
|
|
|
501 |
= 1.3.1 =
|
502 |
Fixed: Security issues. Reported by Karan Saini https://www.karansaini.com/
|
503 |
|
4 |
Requires at least: 3.9
|
5 |
Requires PHP: 5.2
|
6 |
Tested up to: 4.9
|
7 |
+
Stable tag: 1.3.2
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
498 |
|
499 |
== Changelog ==
|
500 |
|
501 |
+
= 1.3.2 =
|
502 |
+
New: Signing up with multiple accounts
|
503 |
+
Fixed: Settings page layout when language is not English
|
504 |
+
|
505 |
= 1.3.1 =
|
506 |
Fixed: Security issues. Reported by Karan Saini https://www.karansaini.com/
|
507 |
|
wd-instagram-feed.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: WD Instagram Feed
|
4 |
Plugin URI: https://web-dorado.com/products/wordpress-instagram-feed-wd.html
|
5 |
Description: WD Instagram Feed is a user-friendly tool for displaying user or hashtag-based feeds on your website. You can create feeds with one of the available layouts. It allows displaying image metadata, open up images in lightbox, download them and even share in social networking websites.
|
6 |
-
Version: 1.3.
|
7 |
Author: WebDorado
|
8 |
Author URI: https://web-dorado.com/wordpress-plugins-bundle.html
|
9 |
License: GPLv2 or later
|
@@ -21,7 +21,7 @@ define("WDI_META", "_".WDI_VAR."_meta");
|
|
21 |
//define("wdi",'wdi');
|
22 |
define('WDI_FEED_TABLE','wdi_feeds');
|
23 |
define('WDI_THEME_TABLE','wdi_themes');
|
24 |
-
define('WDI_VERSION','1.3.
|
25 |
define('WDI_IS_PRO','false');
|
26 |
$wdi_minify = ((isset($_GET['wdi_no_minify']) && $_GET['wdi_no_minify'] == "true") ? false : true);
|
27 |
define('WDI_MINIFY', $wdi_minify);
|
@@ -193,6 +193,10 @@ add_filter('wdi_sanitize_options', 'wdi_create_sample_feed');
|
|
193 |
|
194 |
function wdi_create_sample_feed($new_options) {
|
195 |
|
|
|
|
|
|
|
|
|
196 |
//submit wdi options
|
197 |
if (!isset($_POST['option_page']) || $_POST['option_page'] != 'wdi_all_settings') {
|
198 |
return $new_options;
|
@@ -279,11 +283,13 @@ function wdi_register_settings(){
|
|
279 |
$settings = wdi_get_settings();
|
280 |
|
281 |
//adding configure section
|
282 |
-
add_settings_section('wdi_configure_section',
|
|
|
|
|
|
|
283 |
|
284 |
//adding customize section
|
285 |
-
|
286 |
-
add_settings_section('wdi_customize_section', __('', "wd-instagram-feed"), 'wdi_customize_section_callback', 'settings_wdi');
|
287 |
|
288 |
//adding settings fileds form getted settings
|
289 |
foreach($settings as $setting_name => $setting){
|
@@ -327,13 +333,13 @@ function WDI_instagram_menu() {
|
|
327 |
if((!isset($wdi_options['wdi_access_token']) || empty($wdi_options['wdi_access_token'])) && $wdi_uninstall) {
|
328 |
if( get_option( "wdi_subscribe_done" ) == 1 ) {
|
329 |
$parent_slug = "wdi_feeds";
|
330 |
-
$settings_page = add_menu_page(__('Instagram Feed WD', "wd-instagram-feed"),
|
331 |
add_submenu_page("wdi_settings", __('Settings', "wd-instagram-feed"), __('Settings', "wd-instagram-feed"), 'manage_options', 'wdi_settings', 'WDI_instagram_settings_page');
|
332 |
}
|
333 |
}else{
|
334 |
if( get_option( "wdi_subscribe_done" ) == 1 ){
|
335 |
$parent_slug = "wdi_feeds";
|
336 |
-
$settings_page = add_menu_page(__('Instagram Feed WD',"wd-instagram-feed"),
|
337 |
}
|
338 |
|
339 |
|
3 |
Plugin Name: WD Instagram Feed
|
4 |
Plugin URI: https://web-dorado.com/products/wordpress-instagram-feed-wd.html
|
5 |
Description: WD Instagram Feed is a user-friendly tool for displaying user or hashtag-based feeds on your website. You can create feeds with one of the available layouts. It allows displaying image metadata, open up images in lightbox, download them and even share in social networking websites.
|
6 |
+
Version: 1.3.2
|
7 |
Author: WebDorado
|
8 |
Author URI: https://web-dorado.com/wordpress-plugins-bundle.html
|
9 |
License: GPLv2 or later
|
21 |
//define("wdi",'wdi');
|
22 |
define('WDI_FEED_TABLE','wdi_feeds');
|
23 |
define('WDI_THEME_TABLE','wdi_themes');
|
24 |
+
define('WDI_VERSION','1.3.2');
|
25 |
define('WDI_IS_PRO','false');
|
26 |
$wdi_minify = ((isset($_GET['wdi_no_minify']) && $_GET['wdi_no_minify'] == "true") ? false : true);
|
27 |
define('WDI_MINIFY', $wdi_minify);
|
193 |
|
194 |
function wdi_create_sample_feed($new_options) {
|
195 |
|
196 |
+
if(empty($new_options['wdi_authenticated_users_list'])){
|
197 |
+
$new_options['wdi_authenticated_users_list'] = '[]';
|
198 |
+
}
|
199 |
+
|
200 |
//submit wdi options
|
201 |
if (!isset($_POST['option_page']) || $_POST['option_page'] != 'wdi_all_settings') {
|
202 |
return $new_options;
|
283 |
$settings = wdi_get_settings();
|
284 |
|
285 |
//adding configure section
|
286 |
+
add_settings_section('wdi_configure_section',"",'wdi_configure_section_callback','settings_wdi');
|
287 |
+
|
288 |
+
//multiple accounts
|
289 |
+
add_settings_section('wdi_multiple_accounts_section',"",'wdi_multiple_accounts_section_callback','settings_wdi');
|
290 |
|
291 |
//adding customize section
|
292 |
+
add_settings_section('wdi_customize_section',"",'wdi_customize_section_callback','settings_wdi');
|
|
|
293 |
|
294 |
//adding settings fileds form getted settings
|
295 |
foreach($settings as $setting_name => $setting){
|
333 |
if((!isset($wdi_options['wdi_access_token']) || empty($wdi_options['wdi_access_token'])) && $wdi_uninstall) {
|
334 |
if( get_option( "wdi_subscribe_done" ) == 1 ) {
|
335 |
$parent_slug = "wdi_feeds";
|
336 |
+
$settings_page = add_menu_page(__('Instagram Feed WD', "wd-instagram-feed"), 'Instagram Feed WD', $min_feeds_capability, 'wdi_settings', 'WDI_instagram_settings_page', $menu_icon);
|
337 |
add_submenu_page("wdi_settings", __('Settings', "wd-instagram-feed"), __('Settings', "wd-instagram-feed"), 'manage_options', 'wdi_settings', 'WDI_instagram_settings_page');
|
338 |
}
|
339 |
}else{
|
340 |
if( get_option( "wdi_subscribe_done" ) == 1 ){
|
341 |
$parent_slug = "wdi_feeds";
|
342 |
+
$settings_page = add_menu_page(__('Instagram Feed WD', "wd-instagram-feed"), 'Instagram Feed WD', $min_feeds_capability, 'wdi_feeds', 'WDI_instagram_feeds_page', $menu_icon);
|
343 |
}
|
344 |
|
345 |
|