From 8a234075071697a5e2b9955abc18e5712c5b52b8 Mon Sep 17 00:00:00 2001 From: Rehno Lindeque Date: Tue, 5 Jun 2012 02:17:10 -0700 Subject: [PATCH] Start adding a syntax-highlighter to the project --- client/src/editor.highlight.js | 14 ++++++++++++++ src/TestInspectorPage.hs | 2 ++ 2 files changed, 16 insertions(+) create mode 100644 client/src/editor.highlight.js diff --git a/client/src/editor.highlight.js b/client/src/editor.highlight.js new file mode 100644 index 0000000..52700f4 --- /dev/null +++ b/client/src/editor.highlight.js @@ -0,0 +1,14 @@ +var Editor = Editor || {}; +(function(html){ + var processElement = adt({ + _: function(attributes) { console.log("Unknown DOM element ", this._tag, this._datatype, attributes); } + }); + + Editor.highlight = function(domElement) { + var child = domElement.firstChild; + while (child) { + processElement(child); + child = child.nextSibling; + } + }; +})(html.evalCons); \ No newline at end of file diff --git a/src/TestInspectorPage.hs b/src/TestInspectorPage.hs index 00ecd90..e3ecc12 100644 --- a/src/TestInspectorPage.hs +++ b/src/TestInspectorPage.hs @@ -66,6 +66,7 @@ jsFiles = [ $(jsFile "client/src/header.js"), $(jsFile "client/src/core.js"), $(jsFile "client/src/state.js"), + $(jsFile "client/src/editor.highlight.js"), $(jsFile "client/src/statusbar.message.js"), $(jsFile "client/src/websocket.service.js"), $(jsFile "client/src/message.js"), @@ -81,6 +82,7 @@ jsFiles = [ $(jsFileReload "client/src/header.js"), $(jsFileReload "client/src/core.js"), $(jsFileReload "client/src/state.js"), + $(jsFileReload "client/src/editor.highlight.js"), $(jsFileReload "client/src/statusbar.message.js"), $(jsFileReload "client/src/websocket.service.js"), $(jsFileReload "client/src/message.js"),