From 682025763ce238168792e52db2e86dc31d17f287 Mon Sep 17 00:00:00 2001 From: Dan Beard Date: Sun, 15 Sep 2013 18:54:19 -0700 Subject: [PATCH] Fix for Issue 10 in ep_tables In some cases (like when looking at the time slider) it turns out what etherpad says is a node, actually is just a normal javascript object with innerhtml defined. Trying to call DOM functions on this node will reveal it for the phony that it is, and it will throw an exception. --- static/js/datatables.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/static/js/datatables.js b/static/js/datatables.js index 06f83f6..26c6006 100644 --- a/static/js/datatables.js +++ b/static/js/datatables.js @@ -633,6 +633,10 @@ exports.aceInitialized = function (hook, context) { }; exports.acePostWriteDomLineHTML = function (hook_name, args, cb) { // Iterate through the child nodes (spans) and point SyntaxHighlighter at them + + //don't do this if the node given to us isn't really a DOM node. + //In the 'playback' tag, the node given here is a fake dictionary that looks like a node + if(!args.node.tagName) return; var children = args.node.children; for (var i = 0; i < children.length; i++) { if (args.node.children[i].className.indexOf("list") != -1 || args.node.children[i].className.indexOf("tag") != -1 || args.node.children[i].className.indexOf("url") != -1) continue;