'
);
// Remove the UTM coordinates
// $('#ctl00_ContentBody_CacheInformationTable div.LocationData div.span-9 p.NoBottomSpacing br').remove();
$('#ctl00_ContentBody_LocationSubPanel').html();
// Remove ads
// PGC can't really do this officially
// $('#ctl00_ContentBody_uxBanManWidget').remove();
// Remove disclaimer
// PGC can't really do this officially
// $('#ctl00_divContentMain div.span-17 div.Note.Disclaimer').remove();
// Collapse download links
$('
▼Print and Downloads
').insertAfter('#ctl00_ContentBody_CacheInformationTable div.LocationData');
$('#ctl00_divContentMain div.DownloadLinks').hide();
// Resolve the coordinates into an address
var coordinates = $('#ctl00_ContentBody_lnkConversions').attr('href'),
latitude = coordinates.replace(/.*lat=([^&]*)&lon=.*/, "$1"),
longitude = coordinates.replace(/.*&lon=([^&]*)&.*/, "$1"),
url = 'http://maps.googleapis.com/maps/api/geocode/json?latlng=' + latitude + ',' + longitude + '&sensor=false';
GM_xmlhttpRequest({
method: "GET",
url: url,
onload: function(response) {
var result = JSON.parse(response.responseText);
if (result.status !== 'OK') {
return false;
}
var formattedAddress = result.results[0].formatted_address;
$('#ctl00_ContentBody_LocationSubPanel').html(formattedAddress + ' ');
}
});
// Add number of finds to the top
$('#cacheDetails').append('
');
// Add link to PGC gallery
if (subscription) {
var html = ' ';
$('.CacheDetailNavigation ul li:first').append(html);
}
// VGPS form
GM_xmlhttpRequest({
method: "GET",
url: pgcApiUrl + 'GetExistingVGPSLists',
onload: function(response) {
var result = JSON.parse(response.responseText),
vgpsLists = result.data.lists,
selected = result.data.selected,
selectedContent,
html = '
Add to VGPS ',
listId, list;
html += '';
html += ' ';
html += '
';
$('div.CacheDetailNavigation ul:first').append(html);
$('#btnaddToVGPS').click(function(event) {
event.preventDefault();
addToVGPS();
});
}
});
}
function CachePage_Logbook(jNode) {
// Add Profile stats and gallekry links after each user
var profileNameElm = $(jNode).find('p.logOwnerProfileName strong a');
var profileName = profileNameElm.html();
if (typeof profileName !== 'undefined') {
profileName = profileNameElm.append('')
.append('');
}
// Save to latest logs
if (latestLogs.length < 5) {
var logType = $(jNode).find('div.LogType strong img').attr('src');
// First entry is undefined, due to ajax
if(logType) {
latestLogs.push('');
// 2 = found, 3 = dnf, 4 = note, 5 = archive, 22 = disable, 24 = publish, 45 = nm, 46 = owner maintenance, 68 = reviewer note
var logTypeId = logType.replace(/.*logtypes\/(.*)\.png/, "$1");
if(latestLogs.length == 1) {
if(logTypeId == 3 || logTypeId == 5 || logTypeId == 22 || logTypeId == 45 || logTypeId == 68) {
latestLogsAlert = true;
}
}
}
// Show latest logs
if (latestLogs.length == 5) {
var images = latestLogs.join('');
$('#ctl00_ContentBody_size p').removeClass('AlignCenter').addClass('NoBottomSpacing');
if(latestLogsAlert) {
$('#ctl00_ContentBody_size').append('