Skip to content

Commit

Permalink
Merge pull request #155 from johnyma22/master
Browse files Browse the repository at this point in the history
Can pass a parameter to disable author Colors.
  • Loading branch information
JohnMcLear committed Sep 30, 2011
2 parents b6211ee + 1bfd0e4 commit fb158d2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
17 changes: 17 additions & 0 deletions static/js/pad2.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

var socket;
var LineNumbersDisabled = false;
var noColors = false;
var useMonospaceFontGlobal = false;
var globalUserName = false;

Expand Down Expand Up @@ -83,6 +84,15 @@ function getParams()
var userName = unescape(getUrlVars()["userName"]);
var showLineNumbers = getUrlVars()["showLineNumbers"];
var useMonospaceFont = getUrlVars()["useMonospaceFont"];
var IsnoColors = getUrlVars()["noColors"];

if(IsnoColors)
{
if(IsnoColors == "true")
{
noColors = true;
}
}
if(showControls)
{
if(showControls == "false")
Expand Down Expand Up @@ -236,6 +246,13 @@ function handshake()
{
pad.changeViewOption('showLineNumbers', false);
}

// If the noColors value is set to true then we need to hide the backround colors on the ace spans
if (noColors == true)
{
pad.changeViewOption('noColors', true);
}

// If the Monospacefont value is set to true then change it to monospace.
if (useMonospaceFontGlobal == true)
{
Expand Down
5 changes: 5 additions & 0 deletions static/js/pad_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ var padeditor = (function()
{
pad.changeViewOption('useMonospaceFont', $("#viewfontmenu").val() == 'monospace');
});

noColors = !noColors; // Inversed so we can pass it to showauthorcolors
},
setViewOptions: function(newOptions)
{
Expand All @@ -84,6 +86,9 @@ var padeditor = (function()
v = getOption('useMonospaceFont', false);
self.ace.setProperty("textface", (v ? "monospace" : "Arial, sans-serif"));
$("#viewfontmenu").val(v ? "monospace" : "normal");

self.ace.setProperty("showsauthorcolors", noColors);

},
initViewZoom: function()
{
Expand Down

0 comments on commit fb158d2

Please sign in to comment.