diff --git a/static/js/pad2.js b/static/js/pad2.js index 1fe56b12..7b27ecff 100644 --- a/static/js/pad2.js +++ b/static/js/pad2.js @@ -18,6 +18,7 @@ var socket; var LineNumbersDisabled = false; +var useMonospaceFontGlobal = false; var globalUserName = false; $(document).ready(function() @@ -77,6 +78,7 @@ function getParams() var showChat = getUrlVars()["showChat"]; var userName = getUrlVars()["userName"]; var showLineNumbers = getUrlVars()["showLineNumbers"]; + var useMonospaceFont = getUrlVars()["useMonospaceFont"]; if(showControls) { if(showControls == "false") @@ -102,6 +104,15 @@ function getParams() } } + if(useMonospaceFont) + { + if(useMonospaceFont == "true") + { + useMonospaceFontGlobal = true; + } + } + + if(userName) { // If the username is set as a parameter we should set a global value that we can call once we have initiated the pad. @@ -183,6 +194,12 @@ function handshake() pad.changeViewOption('showLineNumbers', false); } + // If the Monospacefont value is set to true then change it to monospace. + if (useMonospaceFontGlobal == true) + { + pad.changeViewOption('useMonospaceFont', true); + } + // if the globalUserName value is set we need to tell the server and the client about the new authorname if (globalUserName !== false) { @@ -403,7 +420,8 @@ var pad = { }; options.view[key] = value; pad.handleOptionsChange(options); - if (key != "showLineNumbers") + // if the request isn't to hide line numbers then broadcast this to other users + if (key != "showLineNumbers" && key != "useMonospaceFont") { pad.collabClient.sendClientMessage( {