| Server IP : 10.19.1.101 / Your IP : 216.73.216.158 Web Server : Apache System : Linux web1f13.kinghost.net 5.4.282-1.el8.elrepo.x86_64 #1 SMP Mon Aug 19 18:33:22 EDT 2024 x86_64 User : schererimoveisrs ( 170628) PHP Version : 7.4.33 Disable Function : apache_child_terminate,c99_buff_prepare,c99_sess_put,dl,exec,leak,link,myshellexec,openlog,passthru,pclose,pcntl_exec,php_check_syntax,php_strip_whitespace,popen,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,symlink,system,socket_listen,socket_create_listen,putenv MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/schererimoveisrs/www/pre backup/wp-content/plugins/wp-forecast/ |
Upload File : |
/*
javascript for ajax like request to update the weather location
and corresponding data on the fly
*/
/* load widget for the first time on this page */
function wpf_load()
{
// get cookie
if(document.cookie){
a = document.cookie;
cookiename = a.substring(0,a.indexOf('='));
if(a.indexOf(';') != -1){
cookiewert = a.substring(a.indexOf('=')+1,a.indexOf(';'));
} else {
cookiewert = a.substr(a.indexOf('=')+1,a.length);
}
// set selected location
if (cookiename == 'location')
document.getElementById("wpf_selector").value = cookiewert;
}
// update widget
wpf_update();
}
/* get the data for the new location */
function wpf_update()
{
var newloc = document.getElementById("wpf_selector").value;
var siteuri = document.getElementById("wpf_selector_site").value;
var language = document.getElementById("wpf_language").value;
// set cookie with newloc
var expire = new Date();
expire = new Date(expire.getTime() +1000*60*60*24*365);
document.cookie = escape("location=" + newloc) +
'; expires='+expire.toGMTString()+';';
jQuery.get(siteuri + "/wp-forecast-show.php",
{ wpfcid: newloc, header: "0" , selector: "1" , language_override: language },
function(data){
/*
var b = data.indexOf(">");
var e = data.lastIndexOf("<");
data = data.substring(b + 1, e - 1);
*/
jQuery("div#wp-forecastA").html(data);
});
}
/* javascript to rebuild the onLoad event for triggering
the first wpf_update call */
//create onDomReady Event
window.onDomReady = initReady;
// Initialize event depending on browser
function initReady(fn)
{
//W3C-compliant browser
if(document.addEventListener) {
document.addEventListener("DOMContentLoaded", fn, false);
}
//IE
else {
document.onreadystatechange = function(){readyState(fn);};
}
}
//IE execute function
function readyState(func)
{
// DOM is ready
if(document.readyState == "interactive" || document.readyState == "complete")
{
func();
}
}