forked from OpenNeo/impress
handle errors from neopia, finally!
This commit is contained in:
parent
d25d2b3398
commit
a375707e40
4 changed files with 19 additions and 0 deletions
|
@ -224,6 +224,18 @@ $(function () {
|
||||||
el.fadeIn('medium');
|
el.fadeIn('medium');
|
||||||
addDisqusCount();
|
addDisqusCount();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var neopiaError = document.location.search.match(/neopia%5Berror%5D=([^&]+)/);
|
||||||
|
if (neopiaError !== null) {
|
||||||
|
var message = decodeURI(neopiaError[1]).replace(/\+/g, ' ');
|
||||||
|
if (message === "pet not found") {
|
||||||
|
$('#pet-not-found').show();
|
||||||
|
} else {
|
||||||
|
var el = $('#neopia-error');
|
||||||
|
var text = el.text().replace('%{message}', message);
|
||||||
|
el.text(text).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function addDisqusCount() {
|
function addDisqusCount() {
|
||||||
|
|
|
@ -3,6 +3,9 @@
|
||||||
body.outfits-new
|
body.outfits-new
|
||||||
+campaign-progress
|
+campaign-progress
|
||||||
|
|
||||||
|
#pet-not-found, #neopia-error
|
||||||
|
display: none
|
||||||
|
|
||||||
#outfit-forms
|
#outfit-forms
|
||||||
+clearfix
|
+clearfix
|
||||||
+module
|
+module
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
= campaign_progress
|
= campaign_progress
|
||||||
|
|
||||||
|
%p#pet-not-found.alert= t 'pets.load.not_found'
|
||||||
|
%p#neopia-error.alert= t 'pets.load.neopia_error'
|
||||||
|
|
||||||
#outfit-forms
|
#outfit-forms
|
||||||
- localized_cache :action_suffix => 'outfit_forms_intro' do
|
- localized_cache :action_suffix => 'outfit_forms_intro' do
|
||||||
#pet-preview
|
#pet-preview
|
||||||
|
|
|
@ -801,6 +801,7 @@ en:
|
||||||
pet_download_error:
|
pet_download_error:
|
||||||
We couldn't connect to Neopets to look up the pet. Maybe they're down.
|
We couldn't connect to Neopets to look up the pet. Maybe they're down.
|
||||||
Please try again later!
|
Please try again later!
|
||||||
|
neopia_error: "We couldn't load that pet: \"%{message}\". Try again later?"
|
||||||
|
|
||||||
users:
|
users:
|
||||||
index:
|
index:
|
||||||
|
|
Loading…
Reference in a new issue