diff --git a/src/locales/en.json b/src/locales/en.json index 9a5fe45f1..cea312633 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..b163a9a49 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 89ebfa764..6ca9e1424 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -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() diff --git a/src/templates/pad.html b/src/templates/pad.html index 2dd66aa90..c6d48cd33 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(); %>