Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
showDebugFile : function(scriptId, row, column, text) {
var file = fs.model.queryNode("//file[@scriptid='" + scriptId + "']");
// check prerequisites
if (editors.currentEditor && !editors.currentEditor.amlEditor.$updateMarkerPrerequisite()) {
return;
}
if (file) {
editors.jump(file, row, column, text, null, true);
}
else {
var script = mdlDbgSources.queryNode("//file[@scriptid='" + scriptId + "']");
if (!script)
return;
var name = script.getAttribute("scriptname");
var value = name.split("/").pop();
if (name.indexOf(ide.workspaceDir) === 0) {
var path = ide.davPrefix + name.slice(ide.workspaceDir.length);
// -> if you're looking for disabled, check the init function :-)
// the moment that someone clicks this thing well call preinit
// (its already called if the user has it checked on IDE load)
"onprop.checked": function (ev) {
if (ev.value) {
_self.preinit();
}
// if weve already been loaded, then update the status here
// otherwise it'll be done in init
if (window.mdlStatusBar) {
apf.xmldb.setAttribute(mdlStatusBar.data.selectSingleNode("//state"), "showStatusbar", ev.value);
}
}
});
this.nodes.push(menus.addItemByPath("View/Status Bar", this.viewStatusBarMenuItem, 600));
},
updateSplitView: function(previous, next) {
var editor;
var doc = next.$doc;
var at = next.$at;
// check if this is a valid clone session
var split = Splits.get(next)[0];
// hide the previous split view
if (previous && previous.$model) {
var oldSplit = Splits.get(previous)[0];
//console.log("got old split?",oldSplit);
if (oldSplit && (!split || oldSplit.gridLayout != split.gridLayout))
Splits.hide(oldSplit);
}
// enable split view ONLY for code editors for now...
if (next.$editor.name.indexOf("Code Editor") > -1) {
mnuCloneView.enable();
mnuSplitAlign.enable();
}
else {
mnuCloneView.disable();
// ext.js - RegExp - Copyright TJ Holowaychuk (MIT Licensed)
require('ext').extend(RegExp, {
/**
* Escape RegExp _chars_ in _string_. Where _chars_
* defaults to regular expression special characters.
*
* _chars_ should be a space delimited list of characters,
* for example '[ ] ( )'.
*
* @param {string} str
* @param {string} chars
* @return {Type}
* @api public
*/
escape: function(str, chars) {
var specials = (chars || '/ . * + ? | ( ) [ ] { } \\ ^ ? ! = : $').split(' ').join('|\\')
// ext.js - RegExp - Copyright TJ Holowaychuk (MIT Licensed)
require('ext').extend(RegExp, {
/**
* Escape RegExp _chars_ in _string_. Where _chars_
* defaults to regular expression special characters.
*
* _chars_ should be a space delimited list of characters,
* for example '[ ] ( )'.
*
* @param {string} str
* @param {string} chars
* @return {Type}
* @api public
*/
escape: function(str, chars) {
var specials = (chars || '/ . * + ? | ( ) [ ] { } \\ ^ ? ! = : $').split(' ').join('|\\')
vbVersions.$ext.appendChild(this.timelineTooltip);
}
var _self = this;
var len = logData.length;
var tsBegin = logData[0].committer.timestamp;
var timeSpan = logData[len-1].committer.timestamp - tsBegin;
// Create all the points in time
for (var i = 0; i < len; i++) {
var ts = logData[i].committer.timestamp;
var tsDiff = ts - tsBegin;
var percentage = (tsDiff / timeSpan) * 100;
logData[i].dotEl = rutil.createElement("u", {
"style" : "left: " + percentage + "%",
"rel" : i,
"hash" : logData[i].commit
});
logData[i].dotEl.addEventListener("mouseover", logData[i].dotElMouseOver = function() {
var dotClass = this.getAttribute("class");
if(dotClass && dotClass.split(" ")[0] == "pop")
return;
var it = this.getAttribute("rel");
var output = rutil.formulateRevisionMetaData(logData[it], true, 30);
_self.timelineTooltip.innerHTML = output;
var pos = apf.getAbsolutePosition(this);
var sttWidth = apf.getHtmlInnerWidth(_self.timelineTooltip);
return ret;
}
else if (shiftKey) {
// enable split view ONLY for code editors for now...
if (!this.isSupportedEditor(activePage.$editor, page.$editor))
return;
// tabs can be merged into and unmerged from a splitview by clicking a
// tab while holding shift
//console.log("is clone?",apf.isTrue(page.$doc.getNode().getAttribute("clone")));
if (apf.isTrue(page.$doc.getNode().getAttribute("clone"))) {
tabs.remove(page, null, true);
ret = false;
}
else {
ret = !splits.mutate(split, page);
this.save();
}
return ret;
}
},
return;
// tabs can be merged into and unmerged from a splitview by clicking a
// tab while holding shift
//console.log("is clone?",apf.isTrue(page.$doc.getNode().getAttribute("clone")));
if (split && apf.isTrue(page.$doc.getNode().getAttribute("clone"))) {
// close the page that contains the clone editor
var cloneEditor = Splits.getCloneEditor(page);
for (i = 0, l = split.pairs.length; i < l; ++i) {
if (split.pairs[i].editor !== cloneEditor)
continue;
tabs.remove(split.pairs[i].page, null, true);
return false;
}
}
else {
ret = !Splits.mutate(split, page);
this.save();
}
return ret;
}
},
getAnnos: function(row){
var editor = editors.currentEditor.amlEditor.$editor;
var res = [];
editor.getSession().languageAnnos.forEach(function(anno, idx){
if (anno.row == row){
res.push(anno);
/* Select the annotation in the editor */
anno.select = function(){
if (!(anno.pos.sl && anno.pos.sc && anno.pos.el && anno.pos.ec)){
return;
}
var startPos = { row: anno.pos.sl, column: anno.pos.sc };
var endPos = { row: anno.pos.el, column: anno.pos.ec };
if (startPos.row < endPos.row || startPos.column < endPos.column){
editor.getSelection().setSelectionRange(
{start: startPos, end: endPos});
ide.dispatchEvent("track_action", {type: "gittools", cmd: this.command, subcommand: data.subcommand});
if (ext.execCommand(this.command, data) !== false) {
if (ide.dispatchEvent("consolecommand." + this.command, {
data: data
}) !== false) {
if (!ide.onLine) {
util.alert(
"Currently Offline",
"Currently Offline",
"This operation could not be completed because you are offline."
);
}
else {
ide.send(JSON.stringify(data));
if (!this.originalGutterWidth)
this.originalGutterWidth = editors.currentEditor.amlEditor.$editor.renderer.getGutterWidth();
// Set gutter width, arbitrary number based on 12/13px font
editors.currentEditor.amlEditor.$editor.renderer.setGutterWidth("300px");
}
}
}
},