widget.js
2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
jQuery(function() {
var ajaxurl = window.ajaxurl;
jQuery(document).ready(function() {
var forumLoading = jQuery('#w3tc_latest').find('div.inside:visible').find('.widget-loading');
if (forumLoading.length) {
var forumLoadingParent = forumLoading.parent();
setTimeout(function() {
forumLoadingParent.load(
ajaxurl + '?action=w3tc_widget_latest_ajax&_wpnonce=' +
jQuery(forumLoading).metadata().nonce,
function () {
forumLoadingParent.hide().slideDown('normal',
function() {
jQuery(this).css('display', '');
});
});
}, 500);
}
var newsLoading = jQuery('#w3tc_latest_news').find('div.inside:visible').find('.widget-loading');
if (newsLoading.length) {
var newsLoadingParent = newsLoading.parent();
setTimeout(function() {
newsLoadingParent.load(
ajaxurl + '?action=w3tc_widget_latest_news_ajax&_wpnonce=' +
jQuery(newsLoading).metadata().nonce,
function () {
newsLoadingParent.hide().slideDown('normal',
function() {
jQuery(this).css('display', '');
});
});
}, 500);
}
jQuery('.w3tc_generic_widgetservice_radio').click(function () {
var o = jQuery(this);
jQuery('#w3tc_generic_widgetservices_name').val(o.attr('data-name'));
jQuery('#w3tc_generic_widgetservices_value').val(o.attr('data-value'));
jQuery('#w3tc_generic_widgetservices_form_hash').val(o.attr('data-form_hash'));
});
jQuery('#buy-w3-service-cancel').live('click', function() {
jQuery('input:radio[name=service]:checked').prop('checked', false);
jQuery('#buy-w3-service-area').empty();
jQuery('#buy-w3-service').attr("disabled", "disabled");
});
});
});