Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F2752138
ext.centralNotice.freegeoipLookup.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
774 B
Referenced Files
None
Subscribers
None
ext.centralNotice.freegeoipLookup.js
View Options
/**
* Provides a callback that ext.centralNotice.geoIP can use to fetch geo data
* from freegeoip.net. Returns a promise that resolves with this data. If no
* GeoIP cookie is present, mw.geoIP may use the callback, if configured to do
* so.
* TODO Move this out of CentralNotice. See https://phabricator.wikimedia.org/T102848
*/
(
function
()
{
var
GEOIP_LOOKUP_URL
=
'//freegeoip.net/json/'
;
module
.
exports
=
function
()
{
return
$
.
ajax
(
{
url
:
GEOIP_LOOKUP_URL
,
dataType
:
'jsonp'
}
).
then
(
function
(
data
)
{
var
geo
=
{
country
:
data
.
country_code
,
region
:
data
.
region_code
,
city
:
data
.
city
,
lat
:
data
.
latitude
,
lon
:
data
.
longitude
};
// This value will be picked up by done() handlers
return
geo
;
}
);
};
}()
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jul 3, 19:37 (1 d, 2 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
12/6c/4a031d445831942d46223a63cc5c
Default Alt Text
ext.centralNotice.freegeoipLookup.js (774 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment