diff options
author | rvelices <rv-github@modusoptimus.com> | 2013-05-16 20:46:21 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2013-05-16 20:46:21 +0000 |
commit | 923ee0d25379d6556dc9b48f3df6762eee92516f (patch) | |
tree | 153110b9046ae0cf8abaa14271f650f185334799 /admin/themes/default/js/jquery.geoip.js | |
parent | 090b2e46a3ff3fc656d27b0580244f99c12f7e3c (diff) |
feature 2885: Add geoip info in the stats / history page - fixes and add a location map image
git-svn-id: http://piwigo.org/svn/trunk@22703 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/themes/default/js/jquery.geoip.js')
-rw-r--r-- | admin/themes/default/js/jquery.geoip.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/admin/themes/default/js/jquery.geoip.js b/admin/themes/default/js/jquery.geoip.js index eb4a58b4d..cba374ba5 100644 --- a/admin/themes/default/js/jquery.geoip.js +++ b/admin/themes/default/js/jquery.geoip.js @@ -9,10 +9,10 @@ GeoIp = { var cache = localStorage.getItem("freegeoip"); if (cache) { cache = JSON.parse(cache); - for (var ip in cache) { - var data = cache[ip]; + for (var key in cache) { + var data = cache[key]; if ( (new Date()).getTime() - data.reqTime > 36 * 3600000) - delete cache[ip]; + delete cache[key]; } GeoIp.cache = cache; } @@ -31,6 +31,7 @@ GeoIp = { url: "http://freegeoip.net/json/" + ip, dataType: "jsonp", cache: true, + timeout: 5000, success: function(data) { data.reqTime = (new Date()).getTime(); var res=[]; @@ -47,7 +48,7 @@ GeoIp = { }, error: function() { - var data = {ip:ip, fullName:"", reqTime: (new Date()).getTime()}; + var data = {ip:ip, reqTime: (new Date()).getTime()}; GeoIp.cache[ip] = data; var callbacks = GeoIp.pending[ip]; |