From 1e7f5479203a90474f3ec6ef530dde6c3131cdae Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Fri, 26 Aug 2011 17:05:17 -0700 Subject: [PATCH] Add panes like this --- HTML/lib/osx.coffee | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/HTML/lib/osx.coffee b/HTML/lib/osx.coffee index 247502d45..2d8fd71e3 100644 --- a/HTML/lib/osx.coffee +++ b/HTML/lib/osx.coffee @@ -5,7 +5,30 @@ # Handles the UI chrome Chrome = init: -> - console.log = OSX.NSLog + oldLog = console.log + console.log = (output) -> + oldLog(output) + OSX.NSLog("" + output) + + addPane: (position, html) -> + verticalDiv = $('#app-vertical') + horizontalDiv = $('#app-horizontal') + + el = document.createElement("div") + el.setAttribute('class', "pane " + position) + el.innerHTML = html + + switch position + when 'top', 'main' + verticalDiv.prepend(el) + when 'left' + horizontalDiv.prepend(el) + when 'bottom' + verticalDiv.append(el) + when 'right' + horizontalDiv.append(el) + else + NSLog("I DON'T KNOW HOW TO DEAL WITH #{position}") # path - Optional. The String path to the file to base it on. createWindow: (path) ->