diff --git a/src/locales/en.json b/src/locales/en.json index 9a5fe45f1..130b59cba 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -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", diff --git a/src/static/css/pad.css b/src/static/css/pad.css index c1035e8d5..f1f859c15 100644 --- a/src/static/css/pad.css +++ b/src/static/css/pad.css @@ -1086,6 +1086,10 @@ input[type=checkbox] { display:none; } +#noCookie{ + display:none; +} + /* gritter stuff */ #gritter-notice-wrapper { position:fixed; diff --git a/src/static/js/pad.js b/src/static/js/pad.js index 7bd7e3540..ff62f86cc 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -472,6 +472,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() diff --git a/src/templates/pad.html b/src/templates/pad.html index 2dd66aa90..e442ef00e 100644 --- a/src/templates/pad.html +++ b/src/templates/pad.html @@ -114,6 +114,9 @@

Your password was wrong

+
+

Cookie could not be found. Please allow cookies in your browser!

+
<% e.begin_block("loading"); %>

Loading...

<% e.end_block(); %>