var pgli = pgli || {}; pgli.App = gamecore.Base.extend("App", { // static }, { // instance project: null, moduleList: null, editor: null, diagram: null, preview: null, nodeCount: 0, console: null, debug: 2, // 0:none, 1:inapp, 2:console, 3:both init: function(domDiagram, domModuleList, domEditor, domPreview) { var self = this; this.moduleList = new pgli.ui.ModuleList(domModuleList); this.editor = ace.edit(domEditor); this.editor.setFontSize("16px"); this.editor.setTheme("ace/theme/monokai"); this.editor.getSession().setMode("ace/mode/json"); this.diagram = new pgli.diagram.Diagram(domDiagram, 30); this.preview = new pgli.render.CanvasRenderer(domPreview); this.console = $('#console-text'); this.bindEvents(); pgli.lang.Parser.debug = self.debug; window.trace = function(args) { if(!self.debug) return; for(var i=0, len=arguments.length; i