Added timeout error handling for geo location

This commit is contained in:
Sarven Capadisli 2010-01-13 15:36:42 +00:00
parent 9b2fdefe39
commit 2000d2d36b
2 changed files with 13 additions and 3 deletions

View File

@ -632,9 +632,18 @@ var SN = { // StatusNet
}, },
function(error) { function(error) {
if (error.PERMISSION_DENIED == 1) { switch(error.code) {
removeNoticeDataGeo(); case error.PERMISSION_DENIED:
removeNoticeDataGeo();
break;
case error.TIMEOUT:
$('#'+SN.C.S.NoticeGeoName).text(NoticeDataGeo_text.ErrorTimeout).removeClass('processing');
break;
} }
},
{
timeout: 10000
} }
); );
} }

View File

@ -213,7 +213,8 @@ class NoticeForm extends Form
$this->out->elementEnd('div'); $this->out->elementEnd('div');
$this->out->inlineScript(' var NoticeDataGeo_text = {'. $this->out->inlineScript(' var NoticeDataGeo_text = {'.
'ShareDisable: "'._('Do not share my location').'",'. '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').'"'.
'}'); '}');
} }