From a151c207c2d14b7900191737e601ea883db8c423 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sat, 27 Dec 2014 15:08:54 +0100 Subject: [PATCH] set prefs and get prefs --- src/static/js/pad.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/static/js/pad.js b/src/static/js/pad.js index 89ebfa76..846b54ad 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -525,6 +525,15 @@ var pad = { if(padcookie.getPref("showAuthorshipColors") == false){ pad.changeViewOption('showAuthorColors', false); } + if(padcookie.getPref("showLineNumbers") == false){ + pad.changeViewOption('showLineNumbers', false); + } + if(padcookie.getPref("rtlIsTrue") == true){ + pad.changeViewOption('rtlIsTrue', true); + } + if(padcookie.getPref("useMonospaceFont") == true){ + pad.changeViewOption('useMonospaceFont', true); + } hooks.aCallAll("postAceInit", {ace: padeditor.ace, pad: pad}); } }, @@ -575,6 +584,7 @@ var pad = { for (var k in opts.view) { pad.padOptions.view[k] = opts.view[k]; + padcookie.setPref(k, opts.view[k]); } padeditor.setViewOptions(pad.padOptions.view); } @@ -728,10 +738,8 @@ var pad = { }, handleIsFullyConnected: function(isConnected, isInitialConnect) { - pad.determineChatVisibility(isConnected && !isInitialConnect); pad.determineAuthorshipColorsVisibility(); - }, determineChatVisibility: function(asNowConnectedFeedback){ var chatVisCookie = padcookie.getPref('chatAlwaysVisible');