Notify user if cookies can't be created

This commit is contained in:
Gared 2014-12-28 15:02:56 +01:00
parent a645aeef5c
commit 2307c6fbda
4 changed files with 18 additions and 0 deletions

View File

@ -24,6 +24,7 @@
"pad.colorpicker.cancel": "Cancel",
"pad.loading": "Loading...",
"pad.nocookie": "Cookie could not be found. Please allow cookies in your browser!",
"pad.passwordRequired": "You need a password to access this pad",
"pad.permissionDenied": "You do not have permission to access this pad",
"pad.wrongPassword": "Your password was wrong",

View File

@ -1086,6 +1086,10 @@ input[type=checkbox] {
display:none;
}
#nocookie{
display:none;
}
/* gritter stuff */
#gritter-notice-wrapper {
position:fixed;

View File

@ -442,6 +442,16 @@ var pad = {
if (typeof customStart == "function") customStart();
getParams();
handshake();
// To use etherpad you have to allow cookies.
// This will check if the creation of a test-cookie has success.
// Otherwise it shows up a message to the user.
createCookie("test", "test");
if (!readCookie("test"))
{
$('#loading').hide();
$('#nocookie').show();
}
});
},
_afterHandshake: function()

View File

@ -114,6 +114,9 @@
<div id="wrongPassword">
<p data-l10n-id="pad.wrongPassword">Your password was wrong</p>
</div>
<div id="nocookie">
<p data-l10n-id="pad.nocookie">Cookie could not be found. Please allow cookies in your browser!</p>
</div>
<% e.begin_block("loading"); %>
<p data-l10n-id="pad.loading" id="loading">Loading...</p>
<% e.end_block(); %>