Bug 1135595 - Warn the user when they are offline

This commit is contained in:
Anthony Ricaud 2015-07-06 18:40:43 +02:00
Родитель 55dd793c42
Коммит e6259df28b
3 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -21,6 +21,11 @@
});
}
var generic_msg = generic_error.querySelector('.js-generic-msg');
var offline_msg = generic_error.querySelector('.js-offline-msg');
generic_msg.classList.toggle('hide', !navigator.onLine);
offline_msg.classList.toggle('hide', navigator.onLine);
generic_error.classList.remove('hide');
});
}

Просмотреть файл

@ -80,7 +80,7 @@ var lineno = null;
var colno = null;
var output = "";
try {
output += "<form id=\"generic_error\" role=\"dialog\" data-type=\"confirm\">\n <section>\n <h1>Whoops!</h1>\n <p>There was a problem with Buddy Up, please try again.</p>\n </section>\n <menu>\n <button class=\"recommend\">OK</button>\n </menu>\n</form>\n";
output += "<form id=\"generic_error\" role=\"dialog\" data-type=\"confirm\">\n <section>\n <h1>Whoops!</h1>\n <p class=\"js-generic-msg hide\">There was a problem with Buddy Up, please try again.</p>\n <p class=\"js-offline-msg hide\">You are not online, please check your connection.</p>\n </section>\n <menu>\n <button class=\"recommend\">OK</button>\n </menu>\n</form>\n";
cb(null, output);
;
} catch (e) {

Просмотреть файл

@ -1,7 +1,8 @@
<form id="generic_error" role="dialog" data-type="confirm">
<section>
<h1>Whoops!</h1>
<p>There was a problem with Buddy Up, please try again.</p>
<p class="js-generic-msg hide">There was a problem with Buddy Up, please try again.</p>
<p class="js-offline-msg hide">You are not online, please check your connection.</p>
</section>
<menu>
<button class="recommend">OK</button>