mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
make error notification persistent, change text and make it translatable
This commit is contained in:
@@ -79,6 +79,7 @@
|
|||||||
"errorUpCase": "ERROR:",
|
"errorUpCase": "ERROR:",
|
||||||
"newPassSent": "New password sent.",
|
"newPassSent": "New password sent.",
|
||||||
"serverUnreach": "Server currently unreachable.",
|
"serverUnreach": "Server currently unreachable.",
|
||||||
|
"requestError": "Yikes, an error occurred! <strong>Please reload the page,</strong> your last action may not have been saved correctly.",
|
||||||
"seeConsole": "If the error persists, please report it at Help > Report a Bug. If you're familiar with your browser's console, please include any error messages.",
|
"seeConsole": "If the error persists, please report it at Help > Report a Bug. If you're familiar with your browser's console, please include any error messages.",
|
||||||
"error": "Error",
|
"error": "Error",
|
||||||
"menu": "Menu",
|
"menu": "Menu",
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ angular.module('habitrpg').config(['$httpProvider', function($httpProvider){
|
|||||||
|
|
||||||
// Error
|
// Error
|
||||||
} else {
|
} else {
|
||||||
var error = '<strong>Please reload</strong>, ' +
|
var error = window.env.t('requestError') + '<br><br>"' +
|
||||||
'"'+window.env.t('error')+' '+(response.data.err || response.data || 'something went wrong')+'" ' +
|
window.env.t('error') + ' ' + (response.data.err || response.data || 'something went wrong') +
|
||||||
window.env.t('seeConsole');
|
'" <br><br>' + window.env.t('seeConsole');
|
||||||
if (mobileApp) error = 'Error contacting the server. Please try again in a few minutes.';
|
if (mobileApp) error = 'Error contacting the server. Please try again in a few minutes.';
|
||||||
$rootScope.$broadcast('responseError', error);
|
$rootScope.$broadcast('responseError', error);
|
||||||
console.error(response);
|
console.error(response);
|
||||||
|
|||||||
@@ -108,13 +108,14 @@ angular.module("habitrpg").factory("Notification",
|
|||||||
var stack_topright = {"dir1": "down", "dir2": "left", "spacing1": 15, "spacing2": 15, "firstpos1": 60};
|
var stack_topright = {"dir1": "down", "dir2": "left", "spacing1": 15, "spacing2": 15, "firstpos1": 60};
|
||||||
|
|
||||||
function _notify(html, type, icon) {
|
function _notify(html, type, icon) {
|
||||||
|
console.log(type)
|
||||||
var notice = $.pnotify({
|
var notice = $.pnotify({
|
||||||
type: type || 'warning', //('info', 'text', 'warning', 'success', 'gp', 'xp', 'hp', 'lvl', 'death', 'mp', 'crit')
|
type: type || 'warning', //('info', 'text', 'warning', 'success', 'gp', 'xp', 'hp', 'lvl', 'death', 'mp', 'crit')
|
||||||
text: html,
|
text: html,
|
||||||
opacity: 1,
|
opacity: 1,
|
||||||
addclass: 'alert-' + type,
|
addclass: 'alert-' + type,
|
||||||
delay: 7000,
|
delay: 7000,
|
||||||
hide: (type == 'error') ? false : true,
|
hide: (type == 'error' || type == 'danger') ? false : true,
|
||||||
mouse_reset: false,
|
mouse_reset: false,
|
||||||
width: "250px",
|
width: "250px",
|
||||||
stack: stack_topright,
|
stack: stack_topright,
|
||||||
|
|||||||
Reference in New Issue
Block a user