diff --git a/client/script.js b/client/script.js index 28960ef..bdec55a 100644 --- a/client/script.js +++ b/client/script.js @@ -1,7 +1,7 @@ var cards = {}; var totalcolumns = 0; var columns = []; -var currentStyle = "bigcards"; +var currentTheme = "bigcards"; var socket = new io.Socket( ); @@ -448,6 +448,7 @@ function initColumns( columnArray ) function changeThemeTo( theme ) { + currentTheme = theme; $("link[title=cardsize]").attr("href", "/css/" + theme + ".css"); } @@ -556,23 +557,21 @@ $(function() { // Style changer $("#smallify").click(function(){ - if (currentStyle == "bigcards") + if (currentTheme == "bigcards") { - currentStyle = "smallcards"; changeThemeTo('smallcards'); } - else if (currentStyle == "smallcards") + else if (currentTheme == "smallcards") { - currentStyle = "bigcards"; changeThemeTo('bigcards'); } - /*else if (currentStyle == "nocards") + /*else if (currentTheme == "nocards") { - currentStyle = "bigcards"; + currentTheme = "bigcards"; $("link[title=cardsize]").attr("href", "css/bigcards.css"); }*/ - sendAction('changeTheme', currentStyle); + sendAction('changeTheme', currentTheme); return false; diff --git a/forever.sh b/forever.sh old mode 100644 new mode 100755 diff --git a/server.js b/server.js index d04c5b3..0e624e2 100644 --- a/server.js +++ b/server.js @@ -106,14 +106,21 @@ socket.on('connection', function(client){ //santizes text function scrub( text ) { - - //clip the string if it is too long - if (text.length > 65535) + if (typeof text != "undefined" && text !== null) { - text = text.substr(0,65535); - } - return sanitizer.sanitize(text); + //clip the string if it is too long + if (text.length > 65535) + { + text = text.substr(0,65535); + } + + return sanitizer.sanitize(text); + } + else + { + return null; + } }