remove unused code, add todos, fix minor errors
This commit is contained in:
parent
8ba1f5dfc9
commit
2c5a2b6023
3 changed files with 6 additions and 17 deletions
|
@ -199,17 +199,5 @@ define([], function () {
|
||||||
} while (node && node !== parent);
|
} 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;
|
return tree;
|
||||||
});
|
});
|
||||||
|
|
|
@ -62,7 +62,7 @@ define([
|
||||||
|
|
||||||
var $inner = $('#inner');
|
var $inner = $('#inner');
|
||||||
|
|
||||||
window.makeRainbow = false
|
window.makeRainbow = false;
|
||||||
var makeRainbows = function () {
|
var makeRainbows = function () {
|
||||||
$inner
|
$inner
|
||||||
.find('*:not(.untouched)')
|
.find('*:not(.untouched)')
|
||||||
|
@ -75,10 +75,10 @@ define([
|
||||||
|
|
||||||
var redrawTimeout;
|
var redrawTimeout;
|
||||||
var lazyDraw = function (md) {
|
var lazyDraw = function (md) {
|
||||||
redrawTimeout && clearTimeout(redrawTimeout);
|
if (redrawTimeout) { clearTimeout(redrawTimeout); }
|
||||||
redrawTimeout = setTimeout(function () {
|
redrawTimeout = setTimeout(function () {
|
||||||
draw(md);
|
draw(md);
|
||||||
makeRainbow && makeRainbows();
|
if (makeRainbow) { makeRainbows(); }
|
||||||
}, 450);
|
}, 450);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -94,14 +94,14 @@ define([
|
||||||
},
|
},
|
||||||
// when your editor is ready
|
// when your editor is ready
|
||||||
onReady: function (info) {
|
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!");
|
console.log("Realtime is ready!");
|
||||||
$textarea.trigger('keyup');
|
$textarea.trigger('keyup');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$textarea.on('change keyup keydown', function () {
|
$textarea.on('change keyup keydown', function () {
|
||||||
redrawTimeout && clearTimeout(redrawTimeout);
|
if (redrawTimeout) { clearTimeout(redrawTimeout); }
|
||||||
redrawTimeout = setTimeout(function () {
|
redrawTimeout = setTimeout(function () {
|
||||||
lazyDraw($textarea.val());
|
lazyDraw($textarea.val());
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|
|
@ -6,6 +6,7 @@ define([
|
||||||
'/bower_components/jquery/dist/jquery.min.js',
|
'/bower_components/jquery/dist/jquery.min.js',
|
||||||
'/customize/pad.js'
|
'/customize/pad.js'
|
||||||
], function (Config, Realtime, Messages, Crypto) {
|
], function (Config, Realtime, Messages, Crypto) {
|
||||||
|
// TODO consider adding support for less.js
|
||||||
var $ = jQuery;
|
var $ = jQuery;
|
||||||
$(window).on('hashchange', function() {
|
$(window).on('hashchange', function() {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
|
|
Loading…
Reference in a new issue