From 4d0ee6a41f3cfb2e99dcb92e7b14f3183393f1a5 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Sat, 30 Jan 2010 15:28:31 +0100 Subject: [PATCH] Globalized form notice data geo values --- js/util.js | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/js/util.js b/js/util.js index 4818be47e0..bbc6fdb288 100644 --- a/js/util.js +++ b/js/util.js @@ -178,7 +178,7 @@ var SN = { // StatusNet }, FormNoticeXHR: function(form) { - var NDG, NLat, NLon, NLNS, NLID; + SN.C.I.NoticeDataGeo = {}; form_id = form.attr('id'); form.append(''); form.ajaxForm({ @@ -195,28 +195,28 @@ var SN = { // StatusNet .addClass(SN.C.S.Disabled) .attr(SN.C.S.Disabled, SN.C.S.Disabled); - NLat = $('#'+SN.C.S.NoticeLat).val(); - NLon = $('#'+SN.C.S.NoticeLon).val(); - NLNS = $('#'+SN.C.S.NoticeLocationNs).val(); - NLID = $('#'+SN.C.S.NoticeLocationId).val(); - NDG = $('#'+SN.C.S.NoticeDataGeo).attr('checked'); + SN.C.I.NoticeDataGeo.NLat = $('#'+SN.C.S.NoticeLat).val(); + SN.C.I.NoticeDataGeo.NLon = $('#'+SN.C.S.NoticeLon).val(); + SN.C.I.NoticeDataGeo.NLNS = $('#'+SN.C.S.NoticeLocationNs).val(); + SN.C.I.NoticeDataGeo.NLID = $('#'+SN.C.S.NoticeLocationId).val(); + SN.C.I.NoticeDataGeo.NDG = $('#'+SN.C.S.NoticeDataGeo).attr('checked'); cookieValue = $.cookie(SN.C.S.NoticeDataGeoCookie); if (cookieValue !== null && cookieValue != 'disabled') { cookieValue = JSON.parse(cookieValue); - NLat = $('#'+SN.C.S.NoticeLat).val(cookieValue.NLat).val(); - NLon = $('#'+SN.C.S.NoticeLon).val(cookieValue.NLon).val(); + SN.C.I.NoticeDataGeo.NLat = $('#'+SN.C.S.NoticeLat).val(cookieValue.NLat).val(); + SN.C.I.NoticeDataGeo.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(); - NLID = $('#'+SN.C.S.NoticeLocationId).val(cookieValue.NLID).val(); + SN.C.I.NoticeDataGeo.NLNS = $('#'+SN.C.S.NoticeLocationNs).val(cookieValue.NLNS).val(); + SN.C.I.NoticeDataGeo.NLID = $('#'+SN.C.S.NoticeLocationId).val(cookieValue.NLID).val(); } } if (cookieValue == 'disabled') { - NDG = $('#'+SN.C.S.NoticeDataGeo).attr('checked', false).attr('checked'); + SN.C.I.NoticeDataGeo.NDG = $('#'+SN.C.S.NoticeDataGeo).attr('checked', false).attr('checked'); } else { - NDG = $('#'+SN.C.S.NoticeDataGeo).attr('checked', true).attr('checked'); + SN.C.I.NoticeDataGeo.NDG = $('#'+SN.C.S.NoticeDataGeo).attr('checked', true).attr('checked'); } return true; @@ -309,13 +309,13 @@ var SN = { // StatusNet .removeAttr(SN.C.S.Disabled) .removeClass(SN.C.S.Disabled); - $('#'+SN.C.S.NoticeLat).val(NLat); - $('#'+SN.C.S.NoticeLon).val(NLon); + $('#'+SN.C.S.NoticeLat).val(SN.C.I.NoticeDataGeo.NLat); + $('#'+SN.C.S.NoticeLon).val(SN.C.I.NoticeDataGeo.NLon); if ($('#'+SN.C.S.NoticeLocationNs)) { - $('#'+SN.C.S.NoticeLocationNs).val(NLNS); - $('#'+SN.C.S.NoticeLocationId).val(NLID); + $('#'+SN.C.S.NoticeLocationNs).val(SN.C.I.NoticeDataGeo.NLNS); + $('#'+SN.C.S.NoticeLocationId).val(SN.C.I.NoticeDataGeo.NLID); } - $('#'+SN.C.S.NoticeDataGeo).attr('checked', NDG); + $('#'+SN.C.S.NoticeDataGeo).attr('checked', SN.C.I.NoticeDataGeo.NDG); } }); }, -- 2.39.2