NoticeLon: 'notice_data-lon',
NoticeLocationId: 'notice_data-location_id',
NoticeLocationNs: 'notice_data-location_ns',
- NoticeLocationName: 'notice_data-location_name',
- NoticeLocationCookieName: 'location_enabled',
+ NoticeGeoName: 'notice_data-geo_name',
NoticeDataGeo: 'notice_data-geo',
NoticeDataGeoSelected: 'notice_data-geo_selected'
}
var NLon = $('#'+SN.C.S.NoticeLon).val();
var NLNS = $('#'+SN.C.S.NoticeLocationNs).val();
var NLID = $('#'+SN.C.S.NoticeLocationId).val();
- var NLN = $('#'+SN.C.S.NoticeLocationName).text();
+ var NLN = $('#'+SN.C.S.NoticeGeoName).text();
var NDGe = $('#'+SN.C.S.NoticeDataGeo);
function removeNoticeDataGeo() {
$('#'+SN.C.S.NoticeLocationId).val('');
$('#'+SN.C.S.NoticeDataGeo).attr('checked', false);
- $.cookie(SN.C.S.NoticeLocationCookieName, 'disabled');
+ $.cookie(SN.C.S.NoticeDataGeo, 'disabled');
}
function getJSONgeocodeURL(geocodeURL, data) {
NLN_text = location.name;
}
- $('#'+SN.C.S.NoticeLocationName)
- .replaceWith('<a id="notice_data-location_name"/>');
+ $('#'+SN.C.S.NoticeGeoName)
+ .replaceWith('<a id="notice_data-geo_name"/>');
- $('#'+SN.C.S.NoticeLocationName)
+ $('#'+SN.C.S.NoticeGeoName)
.attr('href', location.url)
.text(NLN_text)
.click(function() {
'NLNU': location.url,
'NDG': true
};
- $.cookie(SN.C.S.NoticeLocationCookieName, JSON.stringify(cookieValue));
+ $.cookie(SN.C.S.NoticeDataGeo, JSON.stringify(cookieValue));
});
}
if (NDGe.length > 0) {
- var cookieValue = $.cookie(SN.C.S.NoticeLocationCookieName);
- if (cookieValue == 'disabled') {
+ if ($.cookie(SN.C.S.NoticeDataGeo) == 'disabled') {
NDGe.attr('checked', false);
}
else {
NDGe.attr('checked', true);
}
- var NLE = $('#notice_data-location_wrap');
- var geocodeURL = NLE.attr('title');
- NLE.removeAttr('title');
+ var NGW = $('#notice_data-geo_wrap');
+ var geocodeURL = NGW.attr('title');
+ NGW.removeAttr('title');
$('label[for='+SN.C.S.NoticeDataGeo+']').attr('title', jQuery.trim($('label[for='+SN.C.S.NoticeDataGeo+']').text()));
NDGe.change(function() {
- var NLN = $('#'+SN.C.S.NoticeLocationName);
+ var NLN = $('#'+SN.C.S.NoticeGeoName);
if (NLN.length > 0) {
NLN.remove();
}
- if ($('#'+SN.C.S.NoticeDataGeo).attr('checked') === true || $.cookie(SN.C.S.NoticeLocationCookieName) === null) {
+ if ($('#'+SN.C.S.NoticeDataGeo).attr('checked') === true || $.cookie(SN.C.S.NoticeDataGeo) === null) {
$('label[for='+SN.C.S.NoticeDataGeo+']').addClass('checked');
var S = '<div id="'+SN.C.S.NoticeDataGeoSelected+'" class="'+SN.C.S.Success+'"/>';
}
NDGS = $('#'+SN.C.S.NoticeDataGeoSelected);
- NDGS.prepend('<span id="'+SN.C.S.NoticeLocationName+'">Geo</span> <button class="minimize">_</button> <button class="close">×</button>');
+ NDGS.prepend('<span id="'+SN.C.S.NoticeGeoName+'">Geo</span> <button class="minimize">_</button> <button class="close">×</button>');
- var NLN = $('#'+SN.C.S.NoticeLocationName);
+ var NLN = $('#'+SN.C.S.NoticeGeoName);
NLN.addClass('processing');
$('#'+SN.C.S.NoticeDataGeoSelected+' button.close').click(function(){
return false;
});
- if ($.cookie(SN.C.S.NoticeLocationCookieName) === null || $.cookie(SN.C.S.NoticeLocationCookieName) == 'disabled') {
+ if ($.cookie(SN.C.S.NoticeDataGeo) === null || $.cookie(SN.C.S.NoticeDataGeo) == 'disabled') {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(
function(position) {
}
}
else {
- var cookieValue = JSON.parse($.cookie(SN.C.S.NoticeLocationCookieName));
+ var cookieValue = JSON.parse($.cookie(SN.C.S.NoticeDataGeo));
$('#'+SN.C.S.NoticeLat).val(cookieValue.NLat);
$('#'+SN.C.S.NoticeLon).val(cookieValue.NLon);
$('#'+SN.C.S.NoticeLocationNs).val(cookieValue.NLNS);
$('#'+SN.C.S.NoticeLocationId).val(cookieValue.NLID);
$('#'+SN.C.S.NoticeDataGeo).attr('checked', cookieValue.NDG);
- $('#'+SN.C.S.NoticeLocationName)
- .replaceWith('<a id="notice_data-location_name"/>');
+ $('#'+SN.C.S.NoticeGeoName)
+ .replaceWith('<a id="notice_data-geo_name"/>');
- $('#'+SN.C.S.NoticeLocationName)
+ $('#'+SN.C.S.NoticeGeoName)
.attr('href', cookieValue.NLNU)
.text(cookieValue.NLN)
.click(function() {