Beispiel #1
0
    hook : function(){
        var _self = this;

        this.nodes.push(
            mnuFile.insertBefore(new apf.item({
                caption : "Open...",
                onclick : function() {
                    _self.toggleDialog(true);
                }
            }), mnuFile.firstChild),

            ide.barTools.appendChild(new apf.button({
                id      : "btnOpen",
                icon    : "open.png",
                width   : 29,
                tooltip : "Open...",
                skin    : "c9-toolbarbutton",
                onclick : function() {
                    _self.toggleDialog(true);
                }
            }))
        );

        this.hotitems["gotofile"] = [this.nodes[0]];
    },
Beispiel #2
0
    init : function() {        
        ide.addEventListener("loadsettings", function(e) {
            settings.addSection("compiler", "LaTeX", "latex");
        });
        
        ide.addEventListener("init.ext/settings/settings", function(e) {
            barSettings.insertMarkup(settingsMarkup);
        });
        
        while(tbLatexCompile.childNodes.length) {
            var button = tbLatexCompile.firstChild;
            ide.barTools.appendChild(button);
            
            if (button.nodeType == 1)
                this.nodes.push(button);
        }
        
        this.hotitems["compile"] = [btnCompile];
        
       
        this.sideBySide = true;
        this.addTabs();
        
        this.setState("idle");
        
        mnuCtxTree.insertBefore(new apf.item({
            caption : "Set as main file",
            match   : "[file]",
            onclick : function() {
                var path = apf.activeElement.selected.getAttribute("path");
                path = path.slice(ide.davPrefix.length + 1, path.length);
                settings.model.queryNode("latex/compiler").setAttribute("main_path", path);
            }
        }), mnuCtxTree.childNodes[1]);
        
        var updateModifiedDate = function(e) {
            var node = e.node;
            var date = new Date();
            node.setAttribute("modifieddate", 
                date.toString("ddd, dd MMM yyyy HH:mm:ss") + " " + date.getUTCOffset()
            );
        }
        
        ide.addEventListener("afterfilesave", updateModifiedDate);

        this.view = new compileView();
        this.view.init();

    },
Beispiel #3
0
    init : function(amlPage){
	var dav_url = location.href.replace(location.hash, '');
        this.brView = amlPage.appendChild(new apf.vbox({
            anchors    : "0 0 0 0",
            childNodes : [new apf.browser({
                src  : "{dav_url + 'workspace/' + [@path]}",
                flex : 1
            })]
        }));

        //Append the button bar to the main toolbar
        var nodes = barBrowserTb.childNodes;
        for (var i = nodes.length - 1; i >= 0; i--) {
            this.nodes.push(ide.barTools.appendChild(nodes[0]));
        }
    },
Beispiel #4
0
    init : function(amlNode){
        while(tbRun.childNodes.length) {
            var button = tbRun.firstChild;

            ide.barTools.appendChild(button);
            if (button.nodeType == 1) {
                this.nodes.push(button);
            }
        }

        var _self = this;
        mdlRunConfigurations.addEventListener("afterload", function(e) {
            _self.$updateMenu();
        });
        mdlRunConfigurations.addEventListener("update", function(e) {
            settings.save();
            if (e.action == "add" || e.action == "redo-remove" || e.action == "attribute")
                _self.$updateMenu();
        });

        ide.addEventListener("loadsettings", function(e){
            var runConfigs = e.model.queryNode("auto/configurations");
            if (!runConfigs)
                runConfigs = apf.createNodeFromXpath(e.model.data, "auto/configurations");

            mdlRunConfigurations.load(runConfigs);
        });

        winRunCfgNew.addEventListener("hide", function() {
            mdlRunConfigurations.data.setAttribute("debug", "0");
        });
        
        stProcessRunning.addEventListener("deactivate", function(){
           dock.hideSection(["ext/run/run", "ext/debugger/debugger"]); 
        });
        stProcessRunning.addEventListener("activate", function(){
           dock.showSection(["ext/run/run", "ext/debugger/debugger"], true); 
        });
    },
Beispiel #5
0
    hook : function(){
        var _self = this;

        this.nodes.push(
            mnuFile.insertBefore(new apf.item({
                caption : "Open...",
                onclick : function() {
                    _self.toggleDialog(1);
                }
            }), mnuFile.firstChild),

            ide.barTools.appendChild(new apf.button({
                id      : "btnOpen",
                icon    : "open.png",
                width   : 29,
                tooltip : "Open...",
                skin    : "c9-toolbarbutton",
                onclick : function() {
                    _self.toggleDialog(1);
                }
            })),
            
            this.model = new apf.model(),
            this.modelCache = new apf.model()
        );
                
        ide.addEventListener("init.ext/editors/editors", function(){
            _self.markupInsertionPoint = tabEditors;
            //tabEditors.appendChild(winGoToFile);
        });
        
        ide.addEventListener("extload", function(){
            _self.updateFileCache();
        });

        this.hotitems["gotofile"] = [this.nodes[0]];
    },
Beispiel #6
0
    init : function(amlNode){
        var _self = this;

        while (tbDebug.childNodes.length) {
            var button = tbDebug.firstChild;

            if (button.nodeType == 1 && button.getAttribute("id") == "btnDebug")
                ide.barTools.insertBefore(button, btnRun);
            else
                ide.barTools.appendChild(button);
            
            //collect all the elements that are normal nodes
            if (button.nodeType == 1) {
                this.nodesAll.push(button);
            }
        }

        this.hotitems["resume"]   = [btnResume];
        this.hotitems["stepinto"] = [btnStepInto];
        this.hotitems["stepover"] = [btnStepOver];
        this.hotitems["stepout"]  = [btnStepOut];

        this.paths = {};

        mdlDbgSources.addEventListener("afterload", function() {
            _self.$syncTree();
        });
        mdlDbgSources.addEventListener("update", function(e) {
            if (e.action != "add")
                return;
            // TODO: optimize this!
            _self.$syncTree();
        });
        fs.model.addEventListener("update", function(e) {
            if (e.action != "insert")
                return;
            // TODO: optimize this!
            _self.$syncTree();
        });
        
        //@todo move this to noderunner...
        dbg.addEventListener("changeframe", function(e) {
            e.data && _self.showDebugFile(e.data.getAttribute("scriptid"));
        });
        
        dbgBreakpoints.addEventListener("afterrender", function(){
            lstBreakpoints.addEventListener("afterselect", function(e) {
                if (e.selected && e.selected.getAttribute("scriptid"))
                    _self.showDebugFile(e.selected.getAttribute("scriptid"), 
                        parseInt(e.selected.getAttribute("line"), 10) + 1);
                // TODO sometimes we don't have a scriptID
            });
        });

        dbgBreakpoints.addEventListener("dbInteractive", function(){
            lstScripts.addEventListener("afterselect", function(e) {
                e.selected && require("ext/debugger/debugger")
                    .showDebugFile(e.selected.getAttribute("scriptid"));
            });
        });
        
        mdlDbgBreakpoints.addEventListener("update", function(e) {
            // when the breakpoint model is updated
            // get the current IDE settings
            var settingsMdl = settings.model.data;
            // create a new element
            var node = settingsMdl.ownerDocument.createElement("breakpoints");
            
            // find out all the breakpoints in the breakpoint model and iterate over them
            var breakpoints = e.currentTarget.data.selectNodes("//breakpoint");
            for (var ix = 0; ix < breakpoints.length; ix++) {
                // clone and add to our new element
                var cln = breakpoints[ix].cloneNode();
                node.appendChild(cln);
            }
            
            // if there is already a breakpoints section in the IDE settings remove it
            var bpInSettingsFile = settingsMdl.selectSingleNode("//breakpoints");
            if (bpInSettingsFile) {
                bpInSettingsFile.parentNode.removeChild(bpInSettingsFile);
            }
            
            // then append the current breakpoints to the IDE settings, tah dah
            settingsMdl.appendChild(node);
        });

        ide.addEventListener("afterfilesave", function(e) {
            var node = e.node;
            var doc = e.doc;

            var scriptId = node.getAttribute("scriptid");
            if (!scriptId)
                return;

            var value = e.value || doc.getValue();
            var NODE_PREFIX = "(function (exports, require, module, __filename, __dirname) { ";
            var NODE_POSTFIX = "\n});";
            dbg.changeLive(scriptId, NODE_PREFIX + value + NODE_POSTFIX, false, function(e) {
                //console.log("v8 updated", e);
            });
        });
    },
Beispiel #7
0
    hook : function(){
        var _self = this;

        panels.register(this, {
            position : 3000,
            caption: "Run",
            "class": "rundebug"
        });

        apf.document.body.insertMarkup(buttonsMarkup);

        this.nodes.push(
            mnuRunCfg
        );

        while (tbRun.childNodes.length) {
            var button = tbRun.firstChild;

            ide.barTools.appendChild(button);
            if (button.nodeType == 1) {
                this.nodes.push(button);
            }
        }

        mdlRunConfigurations.addEventListener("afterload", function(e) {
            _self.$populateMenu();
        });

        //Settings Support
        ide.addEventListener("init.ext/settings/settings", function(e) {
            var heading = e.ext.getHeading("General");
            heading.insertMarkup(markupSettings);
        });

        ide.addEventListener("loadsettings", function(e){
            var runConfigs = e.model.queryNode("auto/configurations");
            if (!runConfigs) {
                runConfigs = apf.createNodeFromXpath(e.model.data, "auto/configurations");
                apf.xmldb.setAttribute(runConfigs, "debug", "true");

                e.model.setQueryValue("general/@saveallbeforerun", false);
            }
            if (!e.model.queryNode("auto/configurations/@debug"))
                e.model.setQueryValue("auto/configurations/@debug", true);
            if (!e.model.queryNode("auto/configurations/@autohide"))
                e.model.setQueryValue("auto/configurations/@autohide", true);

            if (!runConfigs.selectSingleNode("config[@curfile]")) {
                var setLast = false;
                if (!e.model.queryNode("auto/configurations/config[@last='true']")) {
                    var config = e.model.queryNode("auto/configurations/config")
                    if (config)
                        apf.xmldb.setAttribute(config, "last", "true");
                    else
                        setLast = true;
                }

                var cfg = apf.n("<config />")
                    .attr("name", " (active file)")
                    .attr("curfile", "1");
                if (setLast)
                    cfg.attr("last", "true");
                runConfigs.insertBefore(cfg.node(), runConfigs.firstChild);
            }

            mdlRunConfigurations.load(runConfigs);
        });

        var page = tabEditors.getPage();
        if (page && page.$model) {
            var path = page.$model.queryValue("@path").replace(ide.davPrefix, "");
            mdlRunConfigurations.setQueryValue("config[@curfile]/@path", path);
            mdlRunConfigurations.setQueryValue("config[@curfile]/@name",
                path.split("/").pop() + " (active file)");
        }

        tabEditors.addEventListener("afterswitch", function(e){
            var page = e.nextPage;
            var path = page.$model.queryValue("@path").replace(ide.davPrefix, "");
            mdlRunConfigurations.setQueryValue("config[@curfile]/@path", path);
            mdlRunConfigurations.setQueryValue("config[@curfile]/@name",
                path.split("/").pop() + " (active file)");
        });

        ide.addEventListener("afterfilesave", function(e){
            var page = tabEditors.getPage();
            if (page) {
                var path = page.$model.queryValue("@path").replace(ide.davPrefix, "");
                mdlRunConfigurations.setQueryValue("config[@curfile]/@path", path);
                mdlRunConfigurations.setQueryValue("config[@curfile]/@name",
                    path.split("/").pop() + " (active file)");
            }
        });

        var hasBreaked = false;
        stProcessRunning.addEventListener("deactivate", function(){
            if (!_self.autoHidePanel())
                return;

            var name = "ext/debugger/debugger";
            dock.hideSection(name, false);
            hasBreaked = false;

            /*var bar = dock.getBars("ext/debugger/debugger", "pgDebugNav")[0];
            if (!bar.extended)
                dock.hideBar(bar);*/
        });
        /*stProcessRunning.addEventListener("activate", function(){
            if (!_self.shouldRunInDebugMode() || !_self.autoHidePanel())
                return;

            var bar = dock.getBars("ext/debugger/debugger", "pgDebugNav")[0];
            if (!bar.extended)
                dock.showBar(bar);
        });*/
        ide.addEventListener("break", function(){
            if (!_self.shouldRunInDebugMode() || !_self.autoHidePanel() || hasBreaked)
                return;

            hasBreaked = true;

            var name = "ext/debugger/debugger";
            dock.showSection(name, false);

            var uId = dock.getButtons(name, "pgDebugNav")[0].uniqueId;
            if (dock.layout.isExpanded(uId) < 0)
                dock.layout.showMenu(uId);

            //var bar = dock.getBars("ext/debugger/debugger", "pgDebugNav")[0];
            //dock.expandBar(bar);
        });
//        ide.addEventListener("dockpanel.load.settings", function(e){
//            var state = e.state;
//
//            if (_self.autoHidePanel() && !stProcessRunning.active) {
//                var bar = dock.getBars("ext/debugger/debugger", "pgDebugNav", state)[0];
//                bar.sections.each(function(section){
//                    section.buttons.each(function(button){
//                        if (!button.hidden || button.hidden == -1)
//                            button.hidden = 1;
//                    });
//                });
//            }
//        });

        // When we are not in debug mode and we close a page it goes back to be
        // automatically opened when the debug process starts
        ide.addEventListener("init.ext/debugger/debugger", function(){
            tabDebug.getPages().concat(tabDebugButtons.getPages()).each(function(page){
                page.addEventListener("afterclose", function(e){
                    if (_self.autoHidePanel() && !stProcessRunning.active) {
                        this.$dockbutton.$dockData.hidden = 1;
                    }
                });
            });
        });

        this.hotitems["run"]  = [btnRun];
        this.hotitems["stop"] = [btnStop];
    },
Beispiel #8
0
    init : function(amlNode){
        var _self = this;

        while (tbDebug.childNodes.length) {
            var button = tbDebug.firstChild;

            if (button.nodeType == 1 && button.getAttribute("id") == "btnDebug")
                ide.barTools.insertBefore(button, btnRun);
            else
                ide.barTools.appendChild(button);
        }

        this.hotitems["resume"]   = [btnResume];
        this.hotitems["stepinto"] = [btnStepInto];
        this.hotitems["stepover"] = [btnStepOver];
        this.hotitems["stepout"]  = [btnStepOut];

        this.paths = {};

        mdlDbgSources.addEventListener("afterload", function() {
            _self.$syncTree();
        });
        mdlDbgSources.addEventListener("update", function(e) {
            if (e.action != "add")
                return;
            // TODO: optimize this!
            _self.$syncTree();
        });
        fs.model.addEventListener("update", function(e) {
            if (e.action != "insert")
                return;
            // TODO: optimize this!
            _self.$syncTree();
        });
        
        //@todo move this to noderunner...
        dbg.addEventListener("changeframe", function(e) {
            e.data && _self.showDebugFile(e.data.getAttribute("scriptid"));
        });
        
        dbgBreakpoints.addEventListener("afterrender", function(){
            lstBreakpoints.addEventListener("afterselect", function(e) {
                if (e.selected && e.selected.getAttribute("scriptid"))
                    _self.showDebugFile(e.selected.getAttribute("scriptid"), 
                        parseInt(e.selected.getAttribute("line")) + 1);
                // TODO sometimes we don't have a scriptID
            });
        });

        dbgBreakpoints.addEventListener("dbInteractive", function(){
            lstScripts.addEventListener("afterselect", function(e) {
                e.selected && require("ext/debugger/debugger")
                    .showDebugFile(e.selected.getAttribute("scriptid"));
            });
        });

        ide.addEventListener("afterfilesave", function(e) {
            var node = e.node;
            var doc = e.doc;

            var scriptId = node.getAttribute("scriptid");
            if (!scriptId)
                return;

            var value = e.value || doc.getValue();
            var NODE_PREFIX = "(function (exports, require, module, __filename, __dirname) { ";
            var NODE_POSTFIX = "\n});";
            dbg.changeLive(scriptId, NODE_PREFIX + value + NODE_POSTFIX, false, function(e) {
                //console.log("v8 updated", e);
            });
        });
    },
Beispiel #9
0
    hook : function(){
        if (!self.tabEditors) return;

        var _self = this;

        tabEditors.addEventListener("close", this.$close = function(e) {
            var at = e.page.$at;
            if (!at.undo_ptr)
                at.undo_ptr = at.$undostack[0];
            if (at.undo_ptr && at.$undostack[at.$undostack.length-1] !== at.undo_ptr
              || !at.undo_ptr && e.page.$doc.getNode().getAttribute("changed") == 1
              && e.page.$doc.getValue()) {
                ext.initExtension(_self);

                winCloseConfirm.page = e.page;
                winCloseConfirm.all  = -100;
                winCloseConfirm.show();

                winCloseConfirm.addEventListener("hide", function(){
                    if (winCloseConfirm.all != -100) {
                        var f = function(resetUndo){
                            tabEditors.remove(winCloseConfirm.page, true);
                            if (resetUndo)
                                winCloseConfirm.page.$at.undo(-1);
                            delete winCloseConfirm.page;
                        };

                        if (winCloseConfirm.all == -200)
                            _self.quicksave(winCloseConfirm.page, f);
                        else
                            f(true);
                        /*winSaveAs.page = winCloseConfirm.page;*/
                    }
                    winCloseConfirm.removeEventListener("hide", arguments.callee);
                });

                btnYesAll.hide();
                btnNoAll.hide();

                e.preventDefault();
            }
        });

        this.nodes.push(ide.barTools.appendChild(new apf.button({
            id       : "btnSave",
            caption  : "Save",
            icon     : "save.png",
            tooltip  : "Save",
            skin     : "c9-toolbarbutton",
            disabled : "{!!!tabEditors.activepage}",
            onclick  : this.quicksave.bind(this)
        })));

        var saveItem, saveAsItem;
        this.nodes.push(
            ide.mnuFile.insertBefore(new apf.divider(), ide.mnuFile.firstChild),

            ide.mnuFile.insertBefore(new apf.item({
                caption : "Save All",
                onclick : function(){
                    _self.saveall();
                },
                disabled : "{!!!tabEditors.activepage}"
            }), ide.mnuFile.firstChild),

            saveAsItem = ide.mnuFile.insertBefore(new apf.item({
                caption : "Save As...",
                onclick : function () {
                    _self.saveas();
                },
                disabled : "{!!!tabEditors.activepage}"
            }), ide.mnuFile.firstChild),

            saveItem = ide.mnuFile.insertBefore(new apf.item({
                caption : "Save",
                onclick : this.quicksave.bind(this),
                disabled : "{!!!tabEditors.activepage}"
            }), ide.mnuFile.firstChild),

            ide.mnuFile.insertBefore(new apf.divider(), ide.mnuFile.firstChild),

            ide.mnuFile.insertBefore(new apf.item({
                caption : "Revert to Saved",
                onclick : function(){
                    _self.reverttosaved();
                },
                disabled : "{!!!tabEditors.activepage}"
            }), ide.mnuFile.firstChild)
        );

        this.hotitems.quicksave = [saveItem];
        this.hotitems.saveas = [saveAsItem];
    },
Beispiel #10
0
    hook : function(){
        if (!self.tabEditors) return;

        var _self = this;

        tabEditors.addEventListener("close", this.$close = function(e) {
            var at = e.page.$at;
            if (!at.undo_ptr)
                at.undo_ptr = at.$undostack[0];
            var node = e.page.$doc.getNode();
            if (node && at.undo_ptr && at.$undostack[at.$undostack.length-1] !== at.undo_ptr
              || !at.undo_ptr && node.getAttribute("changed") == 1
              && e.page.$doc.getValue()) {
                ext.initExtension(_self);

                var pages   = tabEditors.getPages(),
                currIdx = pages.indexOf(e.page);
                tabEditors.set(pages[currIdx].id); //jump to file

                var filename = node.getAttribute("path").replace(ide.workspaceDir, "").replace(ide.davPrefix, "");

                winCloseConfirm.page = e.page;
                winCloseConfirm.all  = -100;
                winCloseConfirm.show();

                fileDesc.replaceMarkup("<div><h3>Save " + apf.escapeXML(filename) + "?</h3><div>This file has unsaved changes. Your changes will be lost if you don't save them.</div></div>", {"noLoadingMsg": false});

                winCloseConfirm.addEventListener("hide", function(){
                    if (winCloseConfirm.all != -100) {
                        var f = function(resetUndo){
                            var page;
                            if (!(page=winCloseConfirm.page))
                                return;

                            tabEditors.remove(page, true, page.noAnim);
                            delete page.noAnim;
                            if (resetUndo)
                                page.$at.undo(-1);
                            delete winCloseConfirm.page;
                            page.dispatchEvent("aftersavedialogclosed");
                        };

                        if (winCloseConfirm.all == -200)
                            _self.quicksave(winCloseConfirm.page, f);
                        else
                            f(true);
                        /*winSaveAs.page = winCloseConfirm.page;*/
                    }
                    else
                        tabEditors.dispatchEvent("aftersavedialogcancel");

                    winCloseConfirm.removeEventListener("hide", arguments.callee);
                });

                btnYesAll.hide();
                btnNoAll.hide();

                e.preventDefault();
            }
        });

        this.nodes.push(ide.barTools.appendChild(new apf.button({
            id       : "btnSave",
            icon     : "save.png",
            tooltip  : "Save",
            skin     : "c9-toolbarbutton",
            disabled : "{!!!tabEditors.activepage}",
            onclick  : this.quicksave.bind(this)
        })));

        var saveItem, saveAsItem;
        this.nodes.push(
            ide.mnuFile.insertBefore(new apf.divider(), ide.mnuFile.firstChild),

            ide.mnuFile.insertBefore(new apf.item({
                caption : "Save All",
                onclick : function(){
                    _self.saveall();
                },
                disabled : "{!!!tabEditors.activepage}"
            }), ide.mnuFile.firstChild),

            saveAsItem = ide.mnuFile.insertBefore(new apf.item({
                caption : "Save As...",
                onclick : function () {
                    _self.saveas();
                },
                disabled : "{!!!tabEditors.activepage}"
            }), ide.mnuFile.firstChild),

            saveItem = ide.mnuFile.insertBefore(new apf.item({
                caption : "Save",
                onclick : this.quicksave.bind(this),
                disabled : "{!!!tabEditors.activepage}"
            }), ide.mnuFile.firstChild),

            ide.mnuFile.insertBefore(new apf.divider(), ide.mnuFile.firstChild),

            ide.mnuFile.insertBefore(new apf.item({
                caption : "Revert to Saved",
                onclick : function(){
                    _self.reverttosaved();
                },
                disabled : "{!!!tabEditors.activepage}"
            }), ide.mnuFile.firstChild)
        );

        this.hotitems.quicksave = [saveItem];
        this.hotitems.saveas = [saveAsItem];
    },
Beispiel #11
0
    init : function(amlNode){
        var _self = this;

        while (tbDebug.childNodes.length) {
            var button = tbDebug.firstChild;

            if (button.nodeType == 1 && button.getAttribute("id") == "btnDebug")
                ide.barTools.insertBefore(button, btnRun);
            else
                ide.barTools.appendChild(button);
            
            //collect all the elements that are normal nodes
            if (button.nodeType == 1) {
                this.nodesAll.push(button);
            }
        }

        this.hotitems["resume"]   = [btnResume];
        this.hotitems["stepinto"] = [btnStepInto];
        this.hotitems["stepover"] = [btnStepOver];
        this.hotitems["stepout"]  = [btnStepOut];

        this.paths = {};

        mdlDbgSources.addEventListener("afterload", function() {
            _self.$syncTree();
        });
        mdlDbgSources.addEventListener("update", function(e) {
            if (e.action !== "add") return;
            
            // TODO: optimize this!
            _self.$syncTree();
        });
        fs.model.addEventListener("update", function(e) {
            if (e.action != "insert")
                return;
            // TODO: optimize this!
            _self.$syncTree();
        });
        
        //@todo move this to noderunner...
        dbg.addEventListener("changeframe", function(e) {
            e.data && _self.showDebugFile(e.data.getAttribute("scriptid"));
        });
        
        dbgBreakpoints.addEventListener("afterrender", function(){
            lstBreakpoints.addEventListener("afterselect", function(e) {
                if (e.selected && e.selected.getAttribute("scriptid"))
                    _self.showDebugFile(e.selected.getAttribute("scriptid"), 
                        parseInt(e.selected.getAttribute("line"), 10) + 1);
                // TODO sometimes we don't have a scriptID
            });
        });

        dbgBreakpoints.addEventListener("dbInteractive", function(){
            lstScripts.addEventListener("afterselect", function(e) {
                e.selected && require("ext/debugger/debugger")
                    .showDebugFile(e.selected.getAttribute("scriptid"));
            });
        });

        ide.addEventListener("afterfilesave", function(e) {
            var node = e.node;
            var doc = e.doc;

            var scriptId = node.getAttribute("scriptid");
            if (!scriptId)
                return;

            var value = e.value || doc.getValue();
            var NODE_PREFIX = "(function (exports, require, module, __filename, __dirname) { ";
            var NODE_POSTFIX = "\n});";
            dbg.changeLive(scriptId, NODE_PREFIX + value + NODE_POSTFIX, false, function(e) {
                //console.log("v8 updated", e);
            });
        });
        
        // we're subsribing to the 'running active' prop
        // this property indicates whether the debugger is actually running (when on a break this value is false)
        stRunning.addEventListener("prop.active", function (e) {
            // if we are really running (so not on a break or something)
            if (e.value) {
                // we clear out mdlDbgStack
                mdlDbgStack.load("<frames></frames>");
            }
        });
    },