From fc946ffc33dfc7b184539417617c0338a1d0aa66 Mon Sep 17 00:00:00 2001 From: Egil Moeller Date: Thu, 17 May 2012 12:03:38 +0200 Subject: [PATCH] Hide editing buttons when in readonly mode --- src/static/css/pad.css | 5 ++++- src/static/js/pad.js | 2 ++ src/templates/pad.html | 36 ++++++++++++++++++------------------ 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/src/static/css/pad.css b/src/static/css/pad.css index 2ce8dbb66..76a263eca 100644 --- a/src/static/css/pad.css +++ b/src/static/css/pad.css @@ -19,6 +19,9 @@ textarea { iframe { position: absolute } +.readonly .acl-write { + display: none; +} #users { position: absolute; z-index: 500; @@ -1560,4 +1563,4 @@ input[type=checkbox] { #online_count { line-height: 24px } -} \ No newline at end of file +} diff --git a/src/static/js/pad.js b/src/static/js/pad.js index 436f8bf0f..c0c92d9cf 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -325,6 +325,8 @@ function handshake() pad._afterHandshake(); initalized = true; + $("body").addClass(clientVars.readonly ? "readonly" : "readwrite") + padeditor.ace.callWithAce(function (ace) { ace.ace_setEditable(!clientVars.readonly); }); diff --git a/src/templates/pad.html b/src/templates/pad.html index 3eced909f..dd15148fb 100644 --- a/src/templates/pad.html +++ b/src/templates/pad.html @@ -21,47 +21,47 @@