| 1 |
/* ========= INFORMATION ============================ |
| 2 |
- author: Dmytro Lobov |
| 3 |
- url: https://wow-estore.com |
| 4 |
- email: givememoney1982@gmail.com |
| 5 |
==================================================== */ |
| 6 |
|
| 7 |
'use strict'; |
| 8 |
|
| 9 |
jQuery(document).ready(function ($) { |
| 10 |
//* Include colorpicker |
| 11 |
|
| 12 |
$('.wow-plugin .tab-nav li:first').addClass('select'); |
| 13 |
$('.wow-plugin .tab-panels>div').hide().filter(':first').show(); |
| 14 |
$('.wow-plugin .tab-nav a').click(function () { |
| 15 |
$('.wow-plugin .tab-panels>div').hide().filter(this.hash).show(); |
| 16 |
$('.wow-plugin .tab-nav li').removeClass('select'); |
| 17 |
$(this).parent().addClass('select'); |
| 18 |
return false; |
| 19 |
}); |
| 20 |
$('.wow-plugin input:checkbox:checked').each(function () { |
| 21 |
let str = $(this).attr("id"); |
| 22 |
let check = str.replace("wow_", ""); |
| 23 |
$("input[name='param[" + check + "]']").val(1); |
| 24 |
}); |
| 25 |
|
| 26 |
$('.wow-plugin input[type="checkbox"]').change(function () { |
| 27 |
let str = $(this).attr("id"); |
| 28 |
let check = str.replace("wow_", ""); |
| 29 |
if ($(this).prop('checked')) { |
| 30 |
$("input[name='param[" + check + "]']").val(1); |
| 31 |
} else { |
| 32 |
$("input[name='param[" + check + "]']").val(0); |
| 33 |
} |
| 34 |
}); |
| 35 |
|
| 36 |
$('.item-title').children('.faq-title').click(function () { |
| 37 |
let par = $(this).closest('.items'); |
| 38 |
$(par).children(".inside").toggle(500); |
| 39 |
if ($(this).hasClass('togglehide')) { |
| 40 |
$(this).removeClass('togglehide'); |
| 41 |
$(this).addClass("toggleshow"); |
| 42 |
$(this).attr('title', 'Show'); |
| 43 |
} else { |
| 44 |
$(this).removeClass('toggleshow'); |
| 45 |
$(this).addClass("togglehide"); |
| 46 |
$(this).attr('title', 'Hide'); |
| 47 |
} |
| 48 |
}); |
| 49 |
|
| 50 |
wow_attach_tooltips($(".wow-help")); |
| 51 |
|
| 52 |
$('[data-share]').on('click', function (event) { |
| 53 |
event.preventDefault(); |
| 54 |
let network = $(this).data('share'); |
| 55 |
let url = $('#wp-url').val(); |
| 56 |
let title = $('#wp-title').val(); |
| 57 |
|
| 58 |
let shareUrl; |
| 59 |
|
| 60 |
switch (network) { |
| 61 |
case 'facebook': |
| 62 |
shareUrl = 'https://www.facebook.com/sharer/sharer.php?u=' + url; |
| 63 |
break; |
| 64 |
case 'vk': |
| 65 |
shareUrl = 'http://vk.com/share.php?url=' + url; |
| 66 |
break; |
| 67 |
case 'twitter': |
| 68 |
shareUrl = 'https://twitter.com/share?url=' + url + '&text=' + title; |
| 69 |
break; |
| 70 |
case 'linkedin': |
| 71 |
shareUrl = 'https://www.linkedin.com/shareArticle?url=' + url + '&title=' + title; |
| 72 |
break; |
| 73 |
case 'pinterest': |
| 74 |
shareUrl = 'https://pinterest.com/pin/create/button/?url=' + url; |
| 75 |
break; |
| 76 |
case 'xing': |
| 77 |
shareUrl = 'https://www.xing.com/spi/shares/new?url=' + url; |
| 78 |
break; |
| 79 |
case 'reddit': |
| 80 |
shareUrl = 'http://www.reddit.com/submit?url=' + url + '&title=' + title; |
| 81 |
break; |
| 82 |
case 'blogger': |
| 83 |
shareUrl = 'https://www.blogger.com/blog-this.g?u=' + url + '&n=' + title; |
| 84 |
break; |
| 85 |
case 'telegram': |
| 86 |
shareUrl = 'https://telegram.me/share/url?url=' + url + '&text=' + title; |
| 87 |
break; |
| 88 |
|
| 89 |
|
| 90 |
default: |
| 91 |
shareUrl = ''; |
| 92 |
} |
| 93 |
|
| 94 |
let popupWidth = 550; |
| 95 |
let popupHeight = 450; |
| 96 |
let topPosition = (screen.height - popupHeight) / 2; |
| 97 |
let leftPosition = (screen.width - popupWidth) / 2; |
| 98 |
let popup = 'width=' + popupWidth + ', height=' + popupHeight + ', top=' + topPosition + ', left=' + leftPosition + |
| 99 |
', scrollbars=0, resizable=1, menubar=0, toolbar=0, status=0'; |
| 100 |
|
| 101 |
window.open(shareUrl, null, popup); |
| 102 |
|
| 103 |
}); |
| 104 |
|
| 105 |
$(document).on('click', '.wow-plugin-message .notice-dismiss', function() { |
| 106 |
$.ajax({ |
| 107 |
url: ajaxurl, data: { |
| 108 |
action: 'wp_coder_message', |
| 109 |
}, |
| 110 |
}); |
| 111 |
}); |
| 112 |
|
| 113 |
}); |
| 114 |
|
| 115 |
|
| 116 |
function wow_attach_tooltips(selector) { |
| 117 |
selector.tooltip({ |
| 118 |
content: function () { |
| 119 |
return jQuery(this).prop("title") |
| 120 |
}, |
| 121 |
tooltipClass: "wow-ui-tooltip", |
| 122 |
position: { |
| 123 |
my: "center top", |
| 124 |
at: "center bottom+10", |
| 125 |
collision: "flipfit" |
| 126 |
}, |
| 127 |
hide: { |
| 128 |
duration: 200 |
| 129 |
}, |
| 130 |
show: { |
| 131 |
duration: 200 |
| 132 |
} |
| 133 |
}) |
| 134 |
} |
| 135 |
|
| 136 |
|