diff --git a/src/static/css/pad.css b/src/static/css/pad.css index 01a195144..6f96b92d6 100644 --- a/src/static/css/pad.css +++ b/src/static/css/pad.css @@ -22,6 +22,7 @@ iframe { .readonly .acl-write { display: none; } + #users { background: #f7f7f7; background: -webkit-linear-gradient( #F7F7F7,#EEE); @@ -891,3 +892,15 @@ input[type=checkbox] { line-height: 24px } } + +#passwordRequired{ + display:none; +} + +#permissionDenied{ + display:none; +} + +#wrongPassword{ + display:none; +} diff --git a/src/static/js/pad.js b/src/static/js/pad.js index 936298abc..bfe8bf8c1 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -298,30 +298,39 @@ function handshake() //the access was not granted, give the user a message if(!receivedClientVars && obj.accessStatus) { + $('.passForm').submit(function(){ + // THIS BIT DOESNT WORK + alert("I AM BROKEN"); + padutils.escapeHtml('require('+JSON.stringify(module.id)).savePassword(); + }); + if(obj.accessStatus == "deny") { - $("#editorloadingbox").html("You do not have permission to access this pad"); + $('#loading').hide(); + $("#permissionDenied").show()); } else if(obj.accessStatus == "needPassword") { - $("#editorloadingbox").html("You need a password to access this pad
" + +/* $("#editorloadingbox").html("You need a password to access this pad
" + "
"+ ""); $("#passwordinput").focus(); $(".passForm").submit(function(){ $('.passForm button').click(); }); +*/ + $('#loading').hide(); + $('#passwordRequired').show(); + $("#passwordinput").focus(); } else if(obj.accessStatus == "wrongPassword") { - $("#editorloadingbox").html("Your password was wrong
" + - ""+ - ""); + $('#loading').hide(); + $('#wrongPassword').show(); $("#passwordinput").focus(); - $(".passForm").submit(function(){ - $('.passForm button').click(); - }); + } + } //if we haven't recieved the clientVars yet, then this message should it be diff --git a/src/templates/pad.html b/src/templates/pad.html index 3f3eee4f1..402d90034 100644 --- a/src/templates/pad.html +++ b/src/templates/pad.html @@ -184,7 +184,19 @@
-

Loading...

+
+

You need a password to access this pad

+ + + +
+
+

You do not have permission to access this pad

+
+
+

Your password was wrong

+
+

Loading...