Changeset 22703 for trunk/admin
- Timestamp:
- May 16, 2013, 10:46:21 PM (11 years ago)
- Location:
- trunk/admin/themes/default
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/themes/default/js/jquery.geoip.js
r22683 r22703 10 10 if (cache) { 11 11 cache = JSON.parse(cache); 12 for (var ipin cache) {13 var data = cache[ ip];12 for (var key in cache) { 13 var data = cache[key]; 14 14 if ( (new Date()).getTime() - data.reqTime > 36 * 3600000) 15 delete cache[ ip];15 delete cache[key]; 16 16 } 17 17 GeoIp.cache = cache; … … 32 32 dataType: "jsonp", 33 33 cache: true, 34 timeout: 5000, 34 35 success: function(data) { 35 36 data.reqTime = (new Date()).getTime(); … … 48 49 49 50 error: function() { 50 var data = {ip:ip, fullName:"",reqTime: (new Date()).getTime()};51 var data = {ip:ip, reqTime: (new Date()).getTime()}; 51 52 52 53 GeoIp.cache[ip] = data; -
trunk/admin/themes/default/template/history.tpl
r22683 r22703 139 139 140 140 {footer_script}{literal} 141 jQuery(document).ready( function(){ 141 142 jQuery(".IP").one( "mouseenter", function(){ 142 143 var that = $(this); … … 148 149 GeoIp.get( that.text(), function(data) { 149 150 if (!data.fullName) return; 151 var content = data.fullName; 152 if (data.latitude && data.region_name) { 153 content += "<br><img width=300 height=220 src=\"http://maps.googleapis.com/maps/api/staticmap?sensor=false&size=300x220&zoom=6" 154 + "&markers=size:tiny%7C" + data.latitude + "," + data.longitude 155 + "\">"; 156 } 150 157 that.tipTip( { 151 content: data.fullName 158 content: content, 159 maxWidth: 320 152 160 } ); 153 161 if (that.data("isOver")) … … 155 163 }); 156 164 } ); 165 }); 157 166 {/literal}{/footer_script}
Note: See TracChangeset
for help on using the changeset viewer.