forked from GNUsocial/gnu-social
Quick hack to avoid breaking with geonames off when there's some old cookie state. This code's a little rough and tumble; any breakage halts JS execution and leaves the spinner going and no message submitted.
This commit is contained in:
parent
a35c52b6be
commit
a7a0041a11
@ -205,9 +205,11 @@ var SN = { // StatusNet
|
|||||||
cookieValue = JSON.parse(cookieValue);
|
cookieValue = JSON.parse(cookieValue);
|
||||||
NLat = $('#'+SN.C.S.NoticeLat).val(cookieValue.NLat).val();
|
NLat = $('#'+SN.C.S.NoticeLat).val(cookieValue.NLat).val();
|
||||||
NLon = $('#'+SN.C.S.NoticeLon).val(cookieValue.NLon).val();
|
NLon = $('#'+SN.C.S.NoticeLon).val(cookieValue.NLon).val();
|
||||||
|
if ($('#'+SN.C.S.NoticeLocationNs).val(cookieValue.NLNS)) {
|
||||||
NLNS = $('#'+SN.C.S.NoticeLocationNs).val(cookieValue.NLNS).val();
|
NLNS = $('#'+SN.C.S.NoticeLocationNs).val(cookieValue.NLNS).val();
|
||||||
NLID = $('#'+SN.C.S.NoticeLocationId).val(cookieValue.NLID).val();
|
NLID = $('#'+SN.C.S.NoticeLocationId).val(cookieValue.NLID).val();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (cookieValue == 'disabled') {
|
if (cookieValue == 'disabled') {
|
||||||
NDG = $('#'+SN.C.S.NoticeDataGeo).attr('checked', false).attr('checked');
|
NDG = $('#'+SN.C.S.NoticeDataGeo).attr('checked', false).attr('checked');
|
||||||
}
|
}
|
||||||
@ -301,8 +303,10 @@ var SN = { // StatusNet
|
|||||||
|
|
||||||
$('#'+SN.C.S.NoticeLat).val(NLat);
|
$('#'+SN.C.S.NoticeLat).val(NLat);
|
||||||
$('#'+SN.C.S.NoticeLon).val(NLon);
|
$('#'+SN.C.S.NoticeLon).val(NLon);
|
||||||
|
if ($('#'+SN.C.S.NoticeLocationNs)) {
|
||||||
$('#'+SN.C.S.NoticeLocationNs).val(NLNS);
|
$('#'+SN.C.S.NoticeLocationNs).val(NLNS);
|
||||||
$('#'+SN.C.S.NoticeLocationId).val(NLID);
|
$('#'+SN.C.S.NoticeLocationId).val(NLID);
|
||||||
|
}
|
||||||
$('#'+SN.C.S.NoticeDataGeo).attr('checked', NDG);
|
$('#'+SN.C.S.NoticeDataGeo).attr('checked', NDG);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user