From 2c5a2b60237c66ac0fbf6bd2801b4536552552b1 Mon Sep 17 00:00:00 2001 From: ansuz Date: Fri, 12 Feb 2016 12:03:15 +0100 Subject: [PATCH] remove unused code, add todos, fix minor errors --- www/common/treesome.js | 12 ------------ www/render/main.js | 10 +++++----- www/style/main.js | 1 + 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/www/common/treesome.js b/www/common/treesome.js index 0bf912b5d..06201bf6d 100644 --- a/www/common/treesome.js +++ b/www/common/treesome.js @@ -199,17 +199,5 @@ define([], function () { } while (node && node !== parent); }; - // FIXME remove - tree.flatten = function (el, ancestor, cursorContainer) { - var list = []; - for (var el = ancestor; el = tree.getNext(next, ancestor);) { - if (cf || el === cursorContainer) { - cf = true; - list.push(el.tagName); - } - } - return list; - }; - return tree; }); diff --git a/www/render/main.js b/www/render/main.js index 0f7e3e7fd..c238d86fc 100644 --- a/www/render/main.js +++ b/www/render/main.js @@ -62,7 +62,7 @@ define([ var $inner = $('#inner'); - window.makeRainbow = false + window.makeRainbow = false; var makeRainbows = function () { $inner .find('*:not(.untouched)') @@ -75,10 +75,10 @@ define([ var redrawTimeout; var lazyDraw = function (md) { - redrawTimeout && clearTimeout(redrawTimeout); + if (redrawTimeout) { clearTimeout(redrawTimeout); } redrawTimeout = setTimeout(function () { draw(md); - makeRainbow && makeRainbows(); + if (makeRainbow) { makeRainbows(); } }, 450); }; @@ -94,14 +94,14 @@ define([ }, // when your editor is ready onReady: function (info) { - info.userList && console.log("Userlist: [%s]", info.userList.join(',')); + if (info.userList) { console.log("Userlist: [%s]", info.userList.join(',')); } console.log("Realtime is ready!"); $textarea.trigger('keyup'); } }); $textarea.on('change keyup keydown', function () { - redrawTimeout && clearTimeout(redrawTimeout); + if (redrawTimeout) { clearTimeout(redrawTimeout); } redrawTimeout = setTimeout(function () { lazyDraw($textarea.val()); }, 500); diff --git a/www/style/main.js b/www/style/main.js index e8b621cc1..c5308c017 100644 --- a/www/style/main.js +++ b/www/style/main.js @@ -6,6 +6,7 @@ define([ '/bower_components/jquery/dist/jquery.min.js', '/customize/pad.js' ], function (Config, Realtime, Messages, Crypto) { + // TODO consider adding support for less.js var $ = jQuery; $(window).on('hashchange', function() { window.location.reload();