diff --git a/src/node/handler/PadMessageHandler.js b/src/node/handler/PadMessageHandler.js index 724ec7dae..8d2ca6cd3 100644 --- a/src/node/handler/PadMessageHandler.js +++ b/src/node/handler/PadMessageHandler.js @@ -848,6 +848,7 @@ function handleClientReady(client, message) "numConnectedUsers": pad2sessions[padIds.padId].length, "isProPad": false, "readOnlyId": padIds.readOnlyPadId, + "readonly": padIds.readonly, "serverTimestamp": new Date().getTime(), "globalPadId": message.padId, "userId": author, diff --git a/src/static/js/pad.js b/src/static/js/pad.js index 0087cbe72..2b30f0250 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -319,11 +319,15 @@ function handshake() clientVars = obj.data; clientVars.userAgent = "Anonymous"; clientVars.collab_client_vars.clientAgent = "Anonymous"; - + //initalize the pad pad._afterHandshake(); initalized = true; + padeditor.ace.callWithAce(function (ace) { + ace.ace_setEditable(!clientVars.readonly); + }); + // If the LineNumbersDisabled value is set to true then we need to hide the Line Numbers if (settings.LineNumbersDisabled == true) {