From 9b2fdefe3925ca807ccf80339bef019306096cc6 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Wed, 13 Jan 2010 15:21:43 +0000 Subject: Using a JSON object for NoticeDataGeo text instead --- js/util.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/util.js') diff --git a/js/util.js b/js/util.js index 43f492274..0ee3d53bd 100644 --- a/js/util.js +++ b/js/util.js @@ -567,7 +567,7 @@ var SN = { // StatusNet } if ($('#'+SN.C.S.NoticeDataGeo).attr('checked') === true || $.cookie(SN.C.S.NoticeDataGeoCookie) === null) { - $('label[for='+SN.C.S.NoticeDataGeo+']').addClass('checked').attr('title', NoticeDataGeoShareDisable_text); + $('label[for='+SN.C.S.NoticeDataGeo+']').addClass('checked').attr('title', NoticeDataGeo_text.ShareDisable); var S = '
'; var NDGS = $('#'+SN.C.S.NoticeDataGeoSelected); @@ -580,7 +580,7 @@ var SN = { // StatusNet } NDGS = $('#'+SN.C.S.NoticeDataGeoSelected); - NDGS.prepend('Geo '); + NDGS.prepend('Geo '); var NLN = $('#'+SN.C.S.NoticeGeoName); NLN.addClass('processing'); -- cgit v1.2.3-54-g00ecf From 2000d2d36b466615e3867f0002ddeaf793cf666f Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Wed, 13 Jan 2010 15:36:42 +0000 Subject: Added timeout error handling for geo location --- js/util.js | 13 +++++++++++-- lib/noticeform.php | 3 ++- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'js/util.js') diff --git a/js/util.js b/js/util.js index 0ee3d53bd..b56410e62 100644 --- a/js/util.js +++ b/js/util.js @@ -632,9 +632,18 @@ var SN = { // StatusNet }, function(error) { - if (error.PERMISSION_DENIED == 1) { - removeNoticeDataGeo(); + switch(error.code) { + case error.PERMISSION_DENIED: + removeNoticeDataGeo(); + break; + case error.TIMEOUT: + $('#'+SN.C.S.NoticeGeoName).text(NoticeDataGeo_text.ErrorTimeout).removeClass('processing'); + break; } + }, + + { + timeout: 10000 } ); } diff --git a/lib/noticeform.php b/lib/noticeform.php index 41504b735..a00615ce7 100644 --- a/lib/noticeform.php +++ b/lib/noticeform.php @@ -213,7 +213,8 @@ class NoticeForm extends Form $this->out->elementEnd('div'); $this->out->inlineScript(' var NoticeDataGeo_text = {'. 'ShareDisable: "'._('Do not share my location').'",'. - 'InfoMinimize: "'._('Hide this info').'"'. + 'InfoMinimize: "'._('Hide this info').'",'. + 'ErrorTimeout: "'._('Sorry, retrieving your geo location is taking longer than expected, please try again later').'"'. '}'); } -- cgit v1.2.3-54-g00ecf From 8887d7a314bdbf4e4fc6ca26addf5ce28284d697 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Wed, 13 Jan 2010 15:48:26 +0000 Subject: Unchecks location sharing for geo location if it timesout --- js/util.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'js/util.js') diff --git a/js/util.js b/js/util.js index b56410e62..e269798d8 100644 --- a/js/util.js +++ b/js/util.js @@ -638,12 +638,13 @@ var SN = { // StatusNet break; case error.TIMEOUT: $('#'+SN.C.S.NoticeGeoName).text(NoticeDataGeo_text.ErrorTimeout).removeClass('processing'); + $('#'+SN.C.S.NoticeDataGeo).attr('checked', false); break; } }, { - timeout: 10000 + timeout: 10 } ); } -- cgit v1.2.3-54-g00ecf From af97a14f7cbe9a5b28ba3371c0e0324ce5c5d691 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Wed, 13 Jan 2010 15:50:45 +0000 Subject: Timeout should be 10000, not 10 Revert "Unchecks location sharing for geo location if it timesout" This reverts commit 8887d7a314bdbf4e4fc6ca26addf5ce28284d697. --- js/util.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'js/util.js') diff --git a/js/util.js b/js/util.js index e269798d8..b56410e62 100644 --- a/js/util.js +++ b/js/util.js @@ -638,13 +638,12 @@ var SN = { // StatusNet break; case error.TIMEOUT: $('#'+SN.C.S.NoticeGeoName).text(NoticeDataGeo_text.ErrorTimeout).removeClass('processing'); - $('#'+SN.C.S.NoticeDataGeo).attr('checked', false); break; } }, { - timeout: 10 + timeout: 10000 } ); } -- cgit v1.2.3-54-g00ecf From d84c33c3282523ea3553fa36ccd2aef39e4dcbad Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Wed, 13 Jan 2010 15:51:32 +0000 Subject: Unchecks location sharing for geo location if it timesout --- js/util.js | 1 + 1 file changed, 1 insertion(+) (limited to 'js/util.js') diff --git a/js/util.js b/js/util.js index b56410e62..2cff4afc2 100644 --- a/js/util.js +++ b/js/util.js @@ -638,6 +638,7 @@ var SN = { // StatusNet break; case error.TIMEOUT: $('#'+SN.C.S.NoticeGeoName).text(NoticeDataGeo_text.ErrorTimeout).removeClass('processing'); + $('#'+SN.C.S.NoticeDataGeo).attr('checked', false); break; } }, -- cgit v1.2.3-54-g00ecf