| Server IP : 87.98.154.146 / Your IP : 216.73.216.165 Web Server : Apache System : Linux webm004.cluster126.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : ohklomafyi ( 52085) PHP Version : 7.4.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/ohklomafyi/www/wp-content/plugins/jetpack/modules/widgets/milestone/ |
Upload File : |
/* global MilestoneConfig */
var Milestone = ( function () {
var Milestone = function ( args ) {
var widget_content = document.getElementById( args.content_id ),
id = args.id,
refresh = args.refresh * 1000;
this.timer = function () {
var instance = this;
var xhr = new XMLHttpRequest();
xhr.onload = function () {
var response = JSON.parse( xhr.responseText ),
httpCheck = xhr.status >= 200 && xhr.status < 300,
responseCheck =
'undefined' !== typeof response.message && 'undefined' !== typeof response.refresh;
if ( httpCheck && responseCheck ) {
var countdownElement = widget_content.querySelector( '.milestone-countdown' );
countdownElement.outerHTML = response.message;
refresh = response.refresh * 1000;
if ( ! refresh ) {
return;
}
setTimeout( function () {
instance.timer();
}, refresh );
}
};
xhr.open( 'GET', MilestoneConfig.api_root + 'jetpack/v4/widgets/' + id );
xhr.send();
};
if ( refresh > 0 ) {
this.timer();
}
};
return function ( args ) {
return new Milestone( args );
};
} )();
( function () {
var i,
MilestoneInstances = {};
if ( typeof MilestoneConfig === 'undefined' ) {
return;
}
for ( i = 0; i < MilestoneConfig.instances.length; i++ ) {
MilestoneInstances[ i ] = new Milestone( MilestoneConfig.instances[ i ] );
}
} )();