id int32 0 58k | repo stringlengths 5 67 | path stringlengths 4 116 | func_name stringlengths 0 58 | original_string stringlengths 52 373k | language stringclasses 1
value | code stringlengths 52 373k | code_tokens list | docstring stringlengths 4 11.8k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 86 226 |
|---|---|---|---|---|---|---|---|---|---|---|---|
2,400 | adobe/brackets | src/language/HTMLDOMDiff.js | function () {
var prev = prevNode();
if (prev && !prev.children) {
newEdit = {
type: "textReplace",
content: prev.content
};
} else {
newEdit = {
type: "textDelete"
... | javascript | function () {
var prev = prevNode();
if (prev && !prev.children) {
newEdit = {
type: "textReplace",
content: prev.content
};
} else {
newEdit = {
type: "textDelete"
... | [
"function",
"(",
")",
"{",
"var",
"prev",
"=",
"prevNode",
"(",
")",
";",
"if",
"(",
"prev",
"&&",
"!",
"prev",
".",
"children",
")",
"{",
"newEdit",
"=",
"{",
"type",
":",
"\"textReplace\"",
",",
"content",
":",
"prev",
".",
"content",
"}",
";",
... | Adds a textDelete edit for text node that is not in the new tree.
Note that we actually create a textReplace rather than a textDelete
if the previous node in current tree was a text node. We do this because
text nodes are not individually addressable and a delete event would
end up clearing out both that previous text ... | [
"Adds",
"a",
"textDelete",
"edit",
"for",
"text",
"node",
"that",
"is",
"not",
"in",
"the",
"new",
"tree",
".",
"Note",
"that",
"we",
"actually",
"create",
"a",
"textReplace",
"rather",
"than",
"a",
"textDelete",
"if",
"the",
"previous",
"node",
"in",
"c... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/HTMLDOMDiff.js#L266-L309 | |
2,401 | adobe/brackets | src/language/HTMLDOMDiff.js | function () {
// This check looks a little strange, but it suits what we're trying
// to do: as we're walking through the children, a child node that has moved
// from one parent to another will be found but would look like some kind
// of insert. The check that we're do... | javascript | function () {
// This check looks a little strange, but it suits what we're trying
// to do: as we're walking through the children, a child node that has moved
// from one parent to another will be found but would look like some kind
// of insert. The check that we're do... | [
"function",
"(",
")",
"{",
"// This check looks a little strange, but it suits what we're trying",
"// to do: as we're walking through the children, a child node that has moved",
"// from one parent to another will be found but would look like some kind",
"// of insert. The check that we're doing here... | Adds an elementMove edit if the parent has changed between the old and new trees.
These are fairly infrequent and generally occur if you make a change across
tag boundaries.
@return {boolean} true if an elementMove was generated | [
"Adds",
"an",
"elementMove",
"edit",
"if",
"the",
"parent",
"has",
"changed",
"between",
"the",
"old",
"and",
"new",
"trees",
".",
"These",
"are",
"fairly",
"infrequent",
"and",
"generally",
"occur",
"if",
"you",
"make",
"a",
"change",
"across",
"tag",
"bo... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/HTMLDOMDiff.js#L318-L343 | |
2,402 | adobe/brackets | src/language/HTMLDOMDiff.js | function (oldChild) {
var oldChildInNewTree = newNodeMap[oldChild.tagID];
return oldChild.children && oldChildInNewTree && getParentID(oldChild) !== getParentID(oldChildInNewTree);
} | javascript | function (oldChild) {
var oldChildInNewTree = newNodeMap[oldChild.tagID];
return oldChild.children && oldChildInNewTree && getParentID(oldChild) !== getParentID(oldChildInNewTree);
} | [
"function",
"(",
"oldChild",
")",
"{",
"var",
"oldChildInNewTree",
"=",
"newNodeMap",
"[",
"oldChild",
".",
"tagID",
"]",
";",
"return",
"oldChild",
".",
"children",
"&&",
"oldChildInNewTree",
"&&",
"getParentID",
"(",
"oldChild",
")",
"!==",
"getParentID",
"(... | Looks to see if the element in the old tree has moved by checking its
current and former parents.
@return {boolean} true if the element has moved | [
"Looks",
"to",
"see",
"if",
"the",
"element",
"in",
"the",
"old",
"tree",
"has",
"moved",
"by",
"checking",
"its",
"current",
"and",
"former",
"parents",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/HTMLDOMDiff.js#L351-L355 | |
2,403 | adobe/brackets | src/language/HTMLDOMDiff.js | function (delta) {
edits.push.apply(edits, delta.edits);
moves.push.apply(moves, delta.moves);
queue.push.apply(queue, delta.newElements);
} | javascript | function (delta) {
edits.push.apply(edits, delta.edits);
moves.push.apply(moves, delta.moves);
queue.push.apply(queue, delta.newElements);
} | [
"function",
"(",
"delta",
")",
"{",
"edits",
".",
"push",
".",
"apply",
"(",
"edits",
",",
"delta",
".",
"edits",
")",
";",
"moves",
".",
"push",
".",
"apply",
"(",
"moves",
",",
"delta",
".",
"moves",
")",
";",
"queue",
".",
"push",
".",
"apply"... | Aggregates the child edits in the proper data structures.
@param {Object} delta edits, moves and newElements to add | [
"Aggregates",
"the",
"child",
"edits",
"in",
"the",
"proper",
"data",
"structures",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/HTMLDOMDiff.js#L561-L565 | |
2,404 | adobe/brackets | src/editor/ImageViewer.js | _handleFileSystemChange | function _handleFileSystemChange(event, entry, added, removed) {
// this may have been called because files were added
// or removed to the file system. We don't care about those
if (!entry || entry.isDirectory) {
return;
}
// Look for a viewer for the changed file... | javascript | function _handleFileSystemChange(event, entry, added, removed) {
// this may have been called because files were added
// or removed to the file system. We don't care about those
if (!entry || entry.isDirectory) {
return;
}
// Look for a viewer for the changed file... | [
"function",
"_handleFileSystemChange",
"(",
"event",
",",
"entry",
",",
"added",
",",
"removed",
")",
"{",
"// this may have been called because files were added",
"// or removed to the file system. We don't care about those",
"if",
"(",
"!",
"entry",
"||",
"entry",
".",
... | Handles file system change events so we can refresh
image viewers for the files that changed on disk due to external editors
@param {jQuery.event} event - event object
@param {?File} file - file object that changed
@param {Array.<FileSystemEntry>=} added If entry is a Directory, contains zero or more added children
@pa... | [
"Handles",
"file",
"system",
"change",
"events",
"so",
"we",
"can",
"refresh",
"image",
"viewers",
"for",
"the",
"files",
"that",
"changed",
"on",
"disk",
"due",
"to",
"external",
"editors"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/ImageViewer.js#L437-L451 |
2,405 | adobe/brackets | src/view/ViewCommandHandlers.js | setFontSize | function setFontSize(fontSize) {
if (currFontSize === fontSize) {
return;
}
_removeDynamicFontSize();
if (fontSize) {
_addDynamicFontSize(fontSize);
}
// Update scroll metrics in viewed editors
_.forEach(MainViewManager.getPaneIdList(), f... | javascript | function setFontSize(fontSize) {
if (currFontSize === fontSize) {
return;
}
_removeDynamicFontSize();
if (fontSize) {
_addDynamicFontSize(fontSize);
}
// Update scroll metrics in viewed editors
_.forEach(MainViewManager.getPaneIdList(), f... | [
"function",
"setFontSize",
"(",
"fontSize",
")",
"{",
"if",
"(",
"currFontSize",
"===",
"fontSize",
")",
"{",
"return",
";",
"}",
"_removeDynamicFontSize",
"(",
")",
";",
"if",
"(",
"fontSize",
")",
"{",
"_addDynamicFontSize",
"(",
"fontSize",
")",
";",
"}... | Font size setter to set the font size for the document editor
@param {string} fontSize The font size with size unit as 'px' or 'em' | [
"Font",
"size",
"setter",
"to",
"set",
"the",
"font",
"size",
"for",
"the",
"document",
"editor"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/ViewCommandHandlers.js#L236-L258 |
2,406 | adobe/brackets | src/view/ViewCommandHandlers.js | setFontFamily | function setFontFamily(fontFamily) {
var editor = EditorManager.getCurrentFullEditor();
if (currFontFamily === fontFamily) {
return;
}
_removeDynamicFontFamily();
if (fontFamily) {
_addDynamicFontFamily(fontFamily);
}
exports.trigger("fo... | javascript | function setFontFamily(fontFamily) {
var editor = EditorManager.getCurrentFullEditor();
if (currFontFamily === fontFamily) {
return;
}
_removeDynamicFontFamily();
if (fontFamily) {
_addDynamicFontFamily(fontFamily);
}
exports.trigger("fo... | [
"function",
"setFontFamily",
"(",
"fontFamily",
")",
"{",
"var",
"editor",
"=",
"EditorManager",
".",
"getCurrentFullEditor",
"(",
")",
";",
"if",
"(",
"currFontFamily",
"===",
"fontFamily",
")",
"{",
"return",
";",
"}",
"_removeDynamicFontFamily",
"(",
")",
"... | Font family setter to set the font family for the document editor
@param {string} fontFamily The font family to be set. It can be a string with multiple comma separated fonts | [
"Font",
"family",
"setter",
"to",
"set",
"the",
"font",
"family",
"for",
"the",
"document",
"editor"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/ViewCommandHandlers.js#L273-L292 |
2,407 | adobe/brackets | src/view/ViewCommandHandlers.js | init | function init() {
currFontFamily = prefs.get("fontFamily");
_addDynamicFontFamily(currFontFamily);
currFontSize = prefs.get("fontSize");
_addDynamicFontSize(currFontSize);
_updateUI();
} | javascript | function init() {
currFontFamily = prefs.get("fontFamily");
_addDynamicFontFamily(currFontFamily);
currFontSize = prefs.get("fontSize");
_addDynamicFontSize(currFontSize);
_updateUI();
} | [
"function",
"init",
"(",
")",
"{",
"currFontFamily",
"=",
"prefs",
".",
"get",
"(",
"\"fontFamily\"",
")",
";",
"_addDynamicFontFamily",
"(",
"currFontFamily",
")",
";",
"currFontSize",
"=",
"prefs",
".",
"get",
"(",
"\"fontSize\"",
")",
";",
"_addDynamicFontS... | Initializes the different settings that need to loaded | [
"Initializes",
"the",
"different",
"settings",
"that",
"need",
"to",
"loaded"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/ViewCommandHandlers.js#L393-L399 |
2,408 | adobe/brackets | src/view/ViewCommandHandlers.js | restoreFontSize | function restoreFontSize() {
var fsStyle = prefs.get("fontSize"),
fsAdjustment = PreferencesManager.getViewState("fontSizeAdjustment");
if (fsAdjustment) {
// Always remove the old view state even if we also have the new view state.
PreferencesManager.setViewSta... | javascript | function restoreFontSize() {
var fsStyle = prefs.get("fontSize"),
fsAdjustment = PreferencesManager.getViewState("fontSizeAdjustment");
if (fsAdjustment) {
// Always remove the old view state even if we also have the new view state.
PreferencesManager.setViewSta... | [
"function",
"restoreFontSize",
"(",
")",
"{",
"var",
"fsStyle",
"=",
"prefs",
".",
"get",
"(",
"\"fontSize\"",
")",
",",
"fsAdjustment",
"=",
"PreferencesManager",
".",
"getViewState",
"(",
"\"fontSizeAdjustment\"",
")",
";",
"if",
"(",
"fsAdjustment",
")",
"{... | Restores the font size using the saved style and migrates the old fontSizeAdjustment
view state to the new fontSize, when required | [
"Restores",
"the",
"font",
"size",
"using",
"the",
"saved",
"style",
"and",
"migrates",
"the",
"old",
"fontSizeAdjustment",
"view",
"state",
"to",
"the",
"new",
"fontSize",
"when",
"required"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/ViewCommandHandlers.js#L405-L424 |
2,409 | adobe/brackets | src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js | CubicBezier | function CubicBezier(coordinates) {
if (typeof coordinates === "string") {
this.coordinates = coordinates.split(",");
} else {
this.coordinates = coordinates;
}
if (!this.coordinates) {
throw "No offsets were defined";
}
this.coordina... | javascript | function CubicBezier(coordinates) {
if (typeof coordinates === "string") {
this.coordinates = coordinates.split(",");
} else {
this.coordinates = coordinates;
}
if (!this.coordinates) {
throw "No offsets were defined";
}
this.coordina... | [
"function",
"CubicBezier",
"(",
"coordinates",
")",
"{",
"if",
"(",
"typeof",
"coordinates",
"===",
"\"string\"",
")",
"{",
"this",
".",
"coordinates",
"=",
"coordinates",
".",
"split",
"(",
"\",\"",
")",
";",
"}",
"else",
"{",
"this",
".",
"coordinates",
... | CubicBezier object constructor
@param {string|Array.number[4]} coordinates Four parameters passes to cubic-bezier()
either in string or array format. | [
"CubicBezier",
"object",
"constructor"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js#L50-L70 |
2,410 | adobe/brackets | src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js | BezierCanvas | function BezierCanvas(canvas, bezier, padding) {
this.canvas = canvas;
this.bezier = bezier;
this.padding = this.getPadding(padding);
// Convert to a cartesian coordinate system with axes from 0 to 1
var ctx = this.canvas.getContext("2d"),
p = this.padding;
... | javascript | function BezierCanvas(canvas, bezier, padding) {
this.canvas = canvas;
this.bezier = bezier;
this.padding = this.getPadding(padding);
// Convert to a cartesian coordinate system with axes from 0 to 1
var ctx = this.canvas.getContext("2d"),
p = this.padding;
... | [
"function",
"BezierCanvas",
"(",
"canvas",
",",
"bezier",
",",
"padding",
")",
"{",
"this",
".",
"canvas",
"=",
"canvas",
";",
"this",
".",
"bezier",
"=",
"bezier",
";",
"this",
".",
"padding",
"=",
"this",
".",
"getPadding",
"(",
"padding",
")",
";",
... | BezierCanvas object constructor
@param {Element} canvas Inline editor <canvas> element
@param {CubicBezier} bezier Associated CubicBezier object
@param {number|Array.number} padding Element padding | [
"BezierCanvas",
"object",
"constructor"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js#L79-L90 |
2,411 | adobe/brackets | src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js | function (element) {
var p = this.padding,
w = this.canvas.width,
h = this.canvas.height * 0.5;
// Convert padding percentage to actual padding
p = p.map(function (a, i) {
return a * ((i % 2) ? w : h);
});
retu... | javascript | function (element) {
var p = this.padding,
w = this.canvas.width,
h = this.canvas.height * 0.5;
// Convert padding percentage to actual padding
p = p.map(function (a, i) {
return a * ((i % 2) ? w : h);
});
retu... | [
"function",
"(",
"element",
")",
"{",
"var",
"p",
"=",
"this",
".",
"padding",
",",
"w",
"=",
"this",
".",
"canvas",
".",
"width",
",",
"h",
"=",
"this",
".",
"canvas",
".",
"height",
"*",
"0.5",
";",
"// Convert padding percentage to actual padding",
"p... | Get CSS left, top offsets for endpoint handle
@param {Element} element Endpoint handle <button> element
@return {Array.string[2]} | [
"Get",
"CSS",
"left",
"top",
"offsets",
"for",
"endpoint",
"handle"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js#L129-L143 | |
2,412 | adobe/brackets | src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js | function (padding) {
var p = (typeof padding === "number") ? [padding] : padding;
if (p.length === 1) {
p[1] = p[0];
}
if (p.length === 2) {
p[2] = p[0];
}
if (p.length === 3) {
p[3] = p[1];
... | javascript | function (padding) {
var p = (typeof padding === "number") ? [padding] : padding;
if (p.length === 1) {
p[1] = p[0];
}
if (p.length === 2) {
p[2] = p[0];
}
if (p.length === 3) {
p[3] = p[1];
... | [
"function",
"(",
"padding",
")",
"{",
"var",
"p",
"=",
"(",
"typeof",
"padding",
"===",
"\"number\"",
")",
"?",
"[",
"padding",
"]",
":",
"padding",
";",
"if",
"(",
"p",
".",
"length",
"===",
"1",
")",
"{",
"p",
"[",
"1",
"]",
"=",
"p",
"[",
... | Convert CSS padding shorthand to longhand
@param {number|Array.number} padding Element padding
@return {Array.number} | [
"Convert",
"CSS",
"padding",
"shorthand",
"to",
"longhand"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js#L218-L232 | |
2,413 | adobe/brackets | src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js | handlePointMove | function handlePointMove(e, x, y) {
var self = e.target,
bezierEditor = self.bezierEditor;
// Helper function to redraw curve
function mouseMoveRedraw() {
if (!bezierEditor.dragElement) {
animationRequest = null;
return;
}
... | javascript | function handlePointMove(e, x, y) {
var self = e.target,
bezierEditor = self.bezierEditor;
// Helper function to redraw curve
function mouseMoveRedraw() {
if (!bezierEditor.dragElement) {
animationRequest = null;
return;
}
... | [
"function",
"handlePointMove",
"(",
"e",
",",
"x",
",",
"y",
")",
"{",
"var",
"self",
"=",
"e",
".",
"target",
",",
"bezierEditor",
"=",
"self",
".",
"bezierEditor",
";",
"// Helper function to redraw curve",
"function",
"mouseMoveRedraw",
"(",
")",
"{",
"if... | Helper function for handling point move
@param {Event} e Mouse move event
@param {number} x New horizontal position
@param {number} y New vertical position | [
"Helper",
"function",
"for",
"handling",
"point",
"move"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js#L286-L334 |
2,414 | adobe/brackets | src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js | mouseMoveRedraw | function mouseMoveRedraw() {
if (!bezierEditor.dragElement) {
animationRequest = null;
return;
}
// Update code
bezierEditor._commitTimingFunction();
bezierEditor._updateCanvas();
animationRequest = window.requestA... | javascript | function mouseMoveRedraw() {
if (!bezierEditor.dragElement) {
animationRequest = null;
return;
}
// Update code
bezierEditor._commitTimingFunction();
bezierEditor._updateCanvas();
animationRequest = window.requestA... | [
"function",
"mouseMoveRedraw",
"(",
")",
"{",
"if",
"(",
"!",
"bezierEditor",
".",
"dragElement",
")",
"{",
"animationRequest",
"=",
"null",
";",
"return",
";",
"}",
"// Update code",
"bezierEditor",
".",
"_commitTimingFunction",
"(",
")",
";",
"bezierEditor",
... | Helper function to redraw curve | [
"Helper",
"function",
"to",
"redraw",
"curve"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js#L291-L302 |
2,415 | adobe/brackets | src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js | BezierCurveEditor | function BezierCurveEditor($parent, bezierCurve, callback) {
// Create the DOM structure, filling in localized strings via Mustache
this.$element = $(Mustache.render(BezierCurveEditorTemplate, Strings));
$parent.append(this.$element);
this._callback = callback;
this.dragElement ... | javascript | function BezierCurveEditor($parent, bezierCurve, callback) {
// Create the DOM structure, filling in localized strings via Mustache
this.$element = $(Mustache.render(BezierCurveEditorTemplate, Strings));
$parent.append(this.$element);
this._callback = callback;
this.dragElement ... | [
"function",
"BezierCurveEditor",
"(",
"$parent",
",",
"bezierCurve",
",",
"callback",
")",
"{",
"// Create the DOM structure, filling in localized strings via Mustache",
"this",
".",
"$element",
"=",
"$",
"(",
"Mustache",
".",
"render",
"(",
"BezierCurveEditorTemplate",
"... | Constructor for BezierCurveEditor Object. This control may be used standalone
or within an InlineTimingFunctionEditor inline widget.
@param {!jQuery} $parent DOM node into which to append the root of the bezier curve editor UI
@param {!RegExpMatch} bezierCurve RegExp match object of initially selected bezierCurve
@p... | [
"Constructor",
"for",
"BezierCurveEditor",
"Object",
".",
"This",
"control",
"may",
"be",
"used",
"standalone",
"or",
"within",
"an",
"InlineTimingFunctionEditor",
"inline",
"widget",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js#L515-L560 |
2,416 | adobe/brackets | src/extensions/default/InlineTimingFunctionEditor/StepEditor.js | StepCanvas | function StepCanvas(canvas, stepParams, padding) {
this.canvas = canvas;
this.stepParams = stepParams;
this.padding = this.getPadding(padding);
// Convert to a cartesian coordinate system with axes from 0 to 1
var ctx = this.canvas.getContext("2d"),
p = this.p... | javascript | function StepCanvas(canvas, stepParams, padding) {
this.canvas = canvas;
this.stepParams = stepParams;
this.padding = this.getPadding(padding);
// Convert to a cartesian coordinate system with axes from 0 to 1
var ctx = this.canvas.getContext("2d"),
p = this.p... | [
"function",
"StepCanvas",
"(",
"canvas",
",",
"stepParams",
",",
"padding",
")",
"{",
"this",
".",
"canvas",
"=",
"canvas",
";",
"this",
".",
"stepParams",
"=",
"stepParams",
";",
"this",
".",
"padding",
"=",
"this",
".",
"getPadding",
"(",
"padding",
")... | StepCanvas object constructor
@param {Element} canvas Inline editor <canvas> element
@param {StepParameters} stepParams Associated StepParameters object
@param {number|Array.number} padding Element padding | [
"StepCanvas",
"object",
"constructor"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/StepEditor.js#L62-L73 |
2,417 | adobe/brackets | src/extensions/default/InlineTimingFunctionEditor/StepEditor.js | StepEditor | function StepEditor($parent, stepMatch, callback) {
// Create the DOM structure, filling in localized strings via Mustache
this.$element = $(Mustache.render(StepEditorTemplate, Strings));
$parent.append(this.$element);
this._callback = callback;
// current step function params
... | javascript | function StepEditor($parent, stepMatch, callback) {
// Create the DOM structure, filling in localized strings via Mustache
this.$element = $(Mustache.render(StepEditorTemplate, Strings));
$parent.append(this.$element);
this._callback = callback;
// current step function params
... | [
"function",
"StepEditor",
"(",
"$parent",
",",
"stepMatch",
",",
"callback",
")",
"{",
"// Create the DOM structure, filling in localized strings via Mustache",
"this",
".",
"$element",
"=",
"$",
"(",
"Mustache",
".",
"render",
"(",
"StepEditorTemplate",
",",
"Strings",... | Constructor for StepEditor Object. This control may be used standalone
or within an InlineTimingFunctionEditor inline widget.
@param {!jQuery} $parent DOM node into which to append the root of the step editor UI
@param {!RegExpMatch} stepMatch RegExp match object of initially selected step function
@param {!function... | [
"Constructor",
"for",
"StepEditor",
"Object",
".",
"This",
"control",
"may",
"be",
"used",
"standalone",
"or",
"within",
"an",
"InlineTimingFunctionEditor",
"inline",
"widget",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/StepEditor.js#L295-L328 |
2,418 | adobe/brackets | src/editor/CodeHintList.js | CodeHintList | function CodeHintList(editor, insertHintOnTab, maxResults) {
/**
* The list of hints to display
*
* @type {Array.<string|jQueryObject>}
*/
this.hints = [];
/**
* The selected position in the list; otherwise -1.
*
* @type {number}
... | javascript | function CodeHintList(editor, insertHintOnTab, maxResults) {
/**
* The list of hints to display
*
* @type {Array.<string|jQueryObject>}
*/
this.hints = [];
/**
* The selected position in the list; otherwise -1.
*
* @type {number}
... | [
"function",
"CodeHintList",
"(",
"editor",
",",
"insertHintOnTab",
",",
"maxResults",
")",
"{",
"/**\n * The list of hints to display\n *\n * @type {Array.<string|jQueryObject>}\n */",
"this",
".",
"hints",
"=",
"[",
"]",
";",
"/**\n * The ... | Displays a popup list of hints for a given editor context.
@constructor
@param {Editor} editor
@param {boolean} insertHintOnTab Whether pressing tab inserts the selected hint
@param {number} maxResults Maximum hints displayed at once. Defaults to 50 | [
"Displays",
"a",
"popup",
"list",
"of",
"hints",
"for",
"a",
"given",
"editor",
"context",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/CodeHintList.js#L47-L124 |
2,419 | adobe/brackets | src/editor/CodeHintList.js | _itemsPerPage | function _itemsPerPage() {
var itemsPerPage = 1,
$items = self.$hintMenu.find("li"),
$view = self.$hintMenu.find("ul.dropdown-menu"),
itemHeight;
if ($items.length !== 0) {
itemHeight = $($items[0]).height();
if (it... | javascript | function _itemsPerPage() {
var itemsPerPage = 1,
$items = self.$hintMenu.find("li"),
$view = self.$hintMenu.find("ul.dropdown-menu"),
itemHeight;
if ($items.length !== 0) {
itemHeight = $($items[0]).height();
if (it... | [
"function",
"_itemsPerPage",
"(",
")",
"{",
"var",
"itemsPerPage",
"=",
"1",
",",
"$items",
"=",
"self",
".",
"$hintMenu",
".",
"find",
"(",
"\"li\"",
")",
",",
"$view",
"=",
"self",
".",
"$hintMenu",
".",
"find",
"(",
"\"ul.dropdown-menu\"",
")",
",",
... | Calculate the number of items per scroll page. | [
"Calculate",
"the",
"number",
"of",
"items",
"per",
"scroll",
"page",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/CodeHintList.js#L389-L405 |
2,420 | adobe/brackets | src/language/JSONUtils.js | stripQuotes | function stripQuotes(string) {
if (string) {
if (/^['"]$/.test(string.charAt(0))) {
string = string.substr(1);
}
if (/^['"]$/.test(string.substr(-1, 1))) {
string = string.substr(0, string.length - 1);
}
}
return str... | javascript | function stripQuotes(string) {
if (string) {
if (/^['"]$/.test(string.charAt(0))) {
string = string.substr(1);
}
if (/^['"]$/.test(string.substr(-1, 1))) {
string = string.substr(0, string.length - 1);
}
}
return str... | [
"function",
"stripQuotes",
"(",
"string",
")",
"{",
"if",
"(",
"string",
")",
"{",
"if",
"(",
"/",
"^['\"]$",
"/",
".",
"test",
"(",
"string",
".",
"charAt",
"(",
"0",
")",
")",
")",
"{",
"string",
"=",
"string",
".",
"substr",
"(",
"1",
")",
"... | Removes the quotes around a string
@param {!String} string
@return {String} | [
"Removes",
"the",
"quotes",
"around",
"a",
"string"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/JSONUtils.js#L75-L85 |
2,421 | adobe/brackets | src/extensions/default/RecentProjects/main.js | add | function add() {
var root = FileUtils.stripTrailingSlash(ProjectManager.getProjectRoot().fullPath),
recentProjects = getRecentProjects(),
index = recentProjects.indexOf(root);
if (index !== -1) {
recentProjects.splice(index, 1);
}
recentProjects.unshi... | javascript | function add() {
var root = FileUtils.stripTrailingSlash(ProjectManager.getProjectRoot().fullPath),
recentProjects = getRecentProjects(),
index = recentProjects.indexOf(root);
if (index !== -1) {
recentProjects.splice(index, 1);
}
recentProjects.unshi... | [
"function",
"add",
"(",
")",
"{",
"var",
"root",
"=",
"FileUtils",
".",
"stripTrailingSlash",
"(",
"ProjectManager",
".",
"getProjectRoot",
"(",
")",
".",
"fullPath",
")",
",",
"recentProjects",
"=",
"getRecentProjects",
"(",
")",
",",
"index",
"=",
"recentP... | Add a project to the stored list of recent projects, up to MAX_PROJECTS. | [
"Add",
"a",
"project",
"to",
"the",
"stored",
"list",
"of",
"recent",
"projects",
"up",
"to",
"MAX_PROJECTS",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/RecentProjects/main.js#L78-L91 |
2,422 | adobe/brackets | src/extensions/default/RecentProjects/main.js | checkHovers | function checkHovers(pageX, pageY) {
$dropdown.children().each(function () {
var offset = $(this).offset(),
width = $(this).outerWidth(),
height = $(this).outerHeight();
if (pageX >= offset.left && pageX <= offset.left + width &&
page... | javascript | function checkHovers(pageX, pageY) {
$dropdown.children().each(function () {
var offset = $(this).offset(),
width = $(this).outerWidth(),
height = $(this).outerHeight();
if (pageX >= offset.left && pageX <= offset.left + width &&
page... | [
"function",
"checkHovers",
"(",
"pageX",
",",
"pageY",
")",
"{",
"$dropdown",
".",
"children",
"(",
")",
".",
"each",
"(",
"function",
"(",
")",
"{",
"var",
"offset",
"=",
"$",
"(",
"this",
")",
".",
"offset",
"(",
")",
",",
"width",
"=",
"$",
"(... | Check the list of items to see if any of them are hovered, and if so trigger a mouseenter.
Normally the mouseenter event handles this, but when a previous item is deleted and the next
item moves up to be underneath the mouse, we don't get a mouseenter event for that item. | [
"Check",
"the",
"list",
"of",
"items",
"to",
"see",
"if",
"any",
"of",
"them",
"are",
"hovered",
"and",
"if",
"so",
"trigger",
"a",
"mouseenter",
".",
"Normally",
"the",
"mouseenter",
"event",
"handles",
"this",
"but",
"when",
"a",
"previous",
"item",
"i... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/RecentProjects/main.js#L98-L109 |
2,423 | adobe/brackets | src/extensions/default/RecentProjects/main.js | renderDelete | function renderDelete() {
return $("<div id='recent-folder-delete' class='trash-icon'>×</div>")
.mouseup(function (e) {
// Don't let the click bubble upward.
e.stopPropagation();
// Remove the project from the preferences.
var re... | javascript | function renderDelete() {
return $("<div id='recent-folder-delete' class='trash-icon'>×</div>")
.mouseup(function (e) {
// Don't let the click bubble upward.
e.stopPropagation();
// Remove the project from the preferences.
var re... | [
"function",
"renderDelete",
"(",
")",
"{",
"return",
"$",
"(",
"\"<div id='recent-folder-delete' class='trash-icon'>×</div>\"",
")",
".",
"mouseup",
"(",
"function",
"(",
"e",
")",
"{",
"// Don't let the click bubble upward.",
"e",
".",
"stopPropagation",
"(",
")"... | Create the "delete" button that shows up when you hover over a project. | [
"Create",
"the",
"delete",
"button",
"that",
"shows",
"up",
"when",
"you",
"hover",
"over",
"a",
"project",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/RecentProjects/main.js#L114-L138 |
2,424 | adobe/brackets | src/extensions/default/RecentProjects/main.js | selectNextItem | function selectNextItem(direction) {
var $links = $dropdown.find("a"),
index = $dropdownItem ? $links.index($dropdownItem) : (direction > 0 ? -1 : 0),
$newItem = $links.eq((index + direction) % $links.length);
if ($dropdownItem) {
$dropdownItem.removeClass("sele... | javascript | function selectNextItem(direction) {
var $links = $dropdown.find("a"),
index = $dropdownItem ? $links.index($dropdownItem) : (direction > 0 ? -1 : 0),
$newItem = $links.eq((index + direction) % $links.length);
if ($dropdownItem) {
$dropdownItem.removeClass("sele... | [
"function",
"selectNextItem",
"(",
"direction",
")",
"{",
"var",
"$links",
"=",
"$dropdown",
".",
"find",
"(",
"\"a\"",
")",
",",
"index",
"=",
"$dropdownItem",
"?",
"$links",
".",
"index",
"(",
"$dropdownItem",
")",
":",
"(",
"direction",
">",
"0",
"?",... | Selects the next or previous item in the list
@param {number} direction +1 for next, -1 for prev | [
"Selects",
"the",
"next",
"or",
"previous",
"item",
"in",
"the",
"list"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/RecentProjects/main.js#L162-L174 |
2,425 | adobe/brackets | src/extensions/default/RecentProjects/main.js | removeSelectedItem | function removeSelectedItem(e) {
var recentProjects = getRecentProjects(),
$cacheItem = $dropdownItem,
index = recentProjects.indexOf($cacheItem.data("path"));
// When focus is not on project item
if (index === -1) {
return false;
}
// remove... | javascript | function removeSelectedItem(e) {
var recentProjects = getRecentProjects(),
$cacheItem = $dropdownItem,
index = recentProjects.indexOf($cacheItem.data("path"));
// When focus is not on project item
if (index === -1) {
return false;
}
// remove... | [
"function",
"removeSelectedItem",
"(",
"e",
")",
"{",
"var",
"recentProjects",
"=",
"getRecentProjects",
"(",
")",
",",
"$cacheItem",
"=",
"$dropdownItem",
",",
"index",
"=",
"recentProjects",
".",
"indexOf",
"(",
"$cacheItem",
".",
"data",
"(",
"\"path\"",
")... | Deletes the selected item and
move the focus to next item in list.
@return {boolean} TRUE if project is removed | [
"Deletes",
"the",
"selected",
"item",
"and",
"move",
"the",
"focus",
"to",
"next",
"item",
"in",
"list",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/RecentProjects/main.js#L182-L203 |
2,426 | adobe/brackets | src/extensions/default/RecentProjects/main.js | keydownHook | function keydownHook(event) {
var keyHandled = false;
switch (event.keyCode) {
case KeyEvent.DOM_VK_UP:
selectNextItem(-1);
keyHandled = true;
break;
case KeyEvent.DOM_VK_DOWN:
selectNextItem(+1);
keyHandled = true;
... | javascript | function keydownHook(event) {
var keyHandled = false;
switch (event.keyCode) {
case KeyEvent.DOM_VK_UP:
selectNextItem(-1);
keyHandled = true;
break;
case KeyEvent.DOM_VK_DOWN:
selectNextItem(+1);
keyHandled = true;
... | [
"function",
"keydownHook",
"(",
"event",
")",
"{",
"var",
"keyHandled",
"=",
"false",
";",
"switch",
"(",
"event",
".",
"keyCode",
")",
"{",
"case",
"KeyEvent",
".",
"DOM_VK_UP",
":",
"selectNextItem",
"(",
"-",
"1",
")",
";",
"keyHandled",
"=",
"true",
... | Handles the Key Down events
@param {KeyboardEvent} event
@return {boolean} True if the key was handled | [
"Handles",
"the",
"Key",
"Down",
"events"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/RecentProjects/main.js#L210-L243 |
2,427 | adobe/brackets | src/extensions/default/RecentProjects/main.js | cleanupDropdown | function cleanupDropdown() {
$("html").off("click", closeDropdown);
$("#project-files-container").off("scroll", closeDropdown);
$("#titlebar .nav").off("click", closeDropdown);
$dropdown = null;
MainViewManager.focusActivePane();
$(window).off("keydown", keydownHook);
... | javascript | function cleanupDropdown() {
$("html").off("click", closeDropdown);
$("#project-files-container").off("scroll", closeDropdown);
$("#titlebar .nav").off("click", closeDropdown);
$dropdown = null;
MainViewManager.focusActivePane();
$(window).off("keydown", keydownHook);
... | [
"function",
"cleanupDropdown",
"(",
")",
"{",
"$",
"(",
"\"html\"",
")",
".",
"off",
"(",
"\"click\"",
",",
"closeDropdown",
")",
";",
"$",
"(",
"\"#project-files-container\"",
")",
".",
"off",
"(",
"\"scroll\"",
",",
"closeDropdown",
")",
";",
"$",
"(",
... | Remove the various event handlers that close the dropdown. This is called by the
PopUpManager when the dropdown is closed. | [
"Remove",
"the",
"various",
"event",
"handlers",
"that",
"close",
"the",
"dropdown",
".",
"This",
"is",
"called",
"by",
"the",
"PopUpManager",
"when",
"the",
"dropdown",
"is",
"closed",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/RecentProjects/main.js#L262-L271 |
2,428 | adobe/brackets | src/extensions/default/RecentProjects/main.js | parsePath | function parsePath(path) {
var lastSlash = path.lastIndexOf("/"), folder, rest;
if (lastSlash === path.length - 1) {
lastSlash = path.slice(0, path.length - 1).lastIndexOf("/");
}
if (lastSlash >= 0) {
rest = " - " + (lastSlash ? path.slice(0, lastSlash) : "/");
... | javascript | function parsePath(path) {
var lastSlash = path.lastIndexOf("/"), folder, rest;
if (lastSlash === path.length - 1) {
lastSlash = path.slice(0, path.length - 1).lastIndexOf("/");
}
if (lastSlash >= 0) {
rest = " - " + (lastSlash ? path.slice(0, lastSlash) : "/");
... | [
"function",
"parsePath",
"(",
"path",
")",
"{",
"var",
"lastSlash",
"=",
"path",
".",
"lastIndexOf",
"(",
"\"/\"",
")",
",",
"folder",
",",
"rest",
";",
"if",
"(",
"lastSlash",
"===",
"path",
".",
"length",
"-",
"1",
")",
"{",
"lastSlash",
"=",
"path... | Parses the path and returns an object with the full path, the folder name and the path without the folder.
@param {string} path The full path to the folder.
@return {{path: string, folder: string, rest: string}} | [
"Parses",
"the",
"path",
"and",
"returns",
"an",
"object",
"with",
"the",
"full",
"path",
"the",
"folder",
"name",
"and",
"the",
"path",
"without",
"the",
"folder",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/RecentProjects/main.js#L334-L348 |
2,429 | adobe/brackets | src/extensions/default/RecentProjects/main.js | renderList | function renderList() {
var recentProjects = getRecentProjects(),
currentProject = FileUtils.stripTrailingSlash(ProjectManager.getProjectRoot().fullPath),
templateVars = {
projectList : [],
Strings : Strings
};
recentProjects.for... | javascript | function renderList() {
var recentProjects = getRecentProjects(),
currentProject = FileUtils.stripTrailingSlash(ProjectManager.getProjectRoot().fullPath),
templateVars = {
projectList : [],
Strings : Strings
};
recentProjects.for... | [
"function",
"renderList",
"(",
")",
"{",
"var",
"recentProjects",
"=",
"getRecentProjects",
"(",
")",
",",
"currentProject",
"=",
"FileUtils",
".",
"stripTrailingSlash",
"(",
"ProjectManager",
".",
"getProjectRoot",
"(",
")",
".",
"fullPath",
")",
",",
"template... | Create the list of projects in the dropdown menu.
@return {string} The html content | [
"Create",
"the",
"list",
"of",
"projects",
"in",
"the",
"dropdown",
"menu",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/RecentProjects/main.js#L354-L369 |
2,430 | adobe/brackets | src/extensions/default/RecentProjects/main.js | showDropdown | function showDropdown(position) {
// If the dropdown is already visible, just return (so the root click handler on html
// will close it).
if ($dropdown) {
return;
}
Menus.closeAll();
$dropdown = $(renderList())
.css({
left: posit... | javascript | function showDropdown(position) {
// If the dropdown is already visible, just return (so the root click handler on html
// will close it).
if ($dropdown) {
return;
}
Menus.closeAll();
$dropdown = $(renderList())
.css({
left: posit... | [
"function",
"showDropdown",
"(",
"position",
")",
"{",
"// If the dropdown is already visible, just return (so the root click handler on html",
"// will close it).",
"if",
"(",
"$dropdown",
")",
"{",
"return",
";",
"}",
"Menus",
".",
"closeAll",
"(",
")",
";",
"$dropdown"... | Show or hide the recent projects dropdown.
@param {{pageX:number, pageY:number}} position - the absolute position where to open the dropdown | [
"Show",
"or",
"hide",
"the",
"recent",
"projects",
"dropdown",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/RecentProjects/main.js#L376-L414 |
2,431 | adobe/brackets | src/extensions/default/RecentProjects/main.js | handleKeyEvent | function handleKeyEvent() {
if (!$dropdown) {
if (!SidebarView.isVisible()) {
SidebarView.show();
}
$("#project-dropdown-toggle").trigger("click");
$dropdown.focus();
$links = $dropdown.find("a");
// By default, select the... | javascript | function handleKeyEvent() {
if (!$dropdown) {
if (!SidebarView.isVisible()) {
SidebarView.show();
}
$("#project-dropdown-toggle").trigger("click");
$dropdown.focus();
$links = $dropdown.find("a");
// By default, select the... | [
"function",
"handleKeyEvent",
"(",
")",
"{",
"if",
"(",
"!",
"$dropdown",
")",
"{",
"if",
"(",
"!",
"SidebarView",
".",
"isVisible",
"(",
")",
")",
"{",
"SidebarView",
".",
"show",
"(",
")",
";",
"}",
"$",
"(",
"\"#project-dropdown-toggle\"",
")",
".",... | Show or hide the recent projects dropdown from the toogle command. | [
"Show",
"or",
"hide",
"the",
"recent",
"projects",
"dropdown",
"from",
"the",
"toogle",
"command",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/RecentProjects/main.js#L420-L440 |
2,432 | adobe/brackets | src/extensions/default/NavigationAndHistory/NavigationProvider.js | _validateFrame | function _validateFrame(entry) {
var deferred = new $.Deferred(),
fileEntry = FileSystem.getFileForPath(entry.filePath);
if (entry.inMem) {
var indexInWS = MainViewManager.findInWorkingSet(entry.paneId, entry.filePath);
// Remove entry if InMemoryFile is not found in... | javascript | function _validateFrame(entry) {
var deferred = new $.Deferred(),
fileEntry = FileSystem.getFileForPath(entry.filePath);
if (entry.inMem) {
var indexInWS = MainViewManager.findInWorkingSet(entry.paneId, entry.filePath);
// Remove entry if InMemoryFile is not found in... | [
"function",
"_validateFrame",
"(",
"entry",
")",
"{",
"var",
"deferred",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
",",
"fileEntry",
"=",
"FileSystem",
".",
"getFileForPath",
"(",
"entry",
".",
"filePath",
")",
";",
"if",
"(",
"entry",
".",
"inMem",
... | Function to check existence of a file entry, validity of markers
@private | [
"Function",
"to",
"check",
"existence",
"of",
"a",
"file",
"entry",
"validity",
"of",
"markers"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/NavigationProvider.js#L98-L128 |
2,433 | adobe/brackets | src/extensions/default/NavigationAndHistory/NavigationProvider.js | _navigateBack | function _navigateBack() {
if (!jumpForwardStack.length) {
if (activePosNotSynced) {
currentEditPos = new NavigationFrame(EditorManager.getCurrentFullEditor(), {ranges: EditorManager.getCurrentFullEditor()._codeMirror.listSelections()});
jumpForwardStack.push(currentE... | javascript | function _navigateBack() {
if (!jumpForwardStack.length) {
if (activePosNotSynced) {
currentEditPos = new NavigationFrame(EditorManager.getCurrentFullEditor(), {ranges: EditorManager.getCurrentFullEditor()._codeMirror.listSelections()});
jumpForwardStack.push(currentE... | [
"function",
"_navigateBack",
"(",
")",
"{",
"if",
"(",
"!",
"jumpForwardStack",
".",
"length",
")",
"{",
"if",
"(",
"activePosNotSynced",
")",
"{",
"currentEditPos",
"=",
"new",
"NavigationFrame",
"(",
"EditorManager",
".",
"getCurrentFullEditor",
"(",
")",
",... | Command handler to navigate backward | [
"Command",
"handler",
"to",
"navigate",
"backward"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/NavigationProvider.js#L339-L371 |
2,434 | adobe/brackets | src/extensions/default/NavigationAndHistory/NavigationProvider.js | _navigateForward | function _navigateForward() {
var navFrame = jumpForwardStack.pop();
if (!navFrame) {
return;
}
// Check if the poped frame is the current active frame or doesn't have any valid marker information
// if true, jump again
if (navFrame === curre... | javascript | function _navigateForward() {
var navFrame = jumpForwardStack.pop();
if (!navFrame) {
return;
}
// Check if the poped frame is the current active frame or doesn't have any valid marker information
// if true, jump again
if (navFrame === curre... | [
"function",
"_navigateForward",
"(",
")",
"{",
"var",
"navFrame",
"=",
"jumpForwardStack",
".",
"pop",
"(",
")",
";",
"if",
"(",
"!",
"navFrame",
")",
"{",
"return",
";",
"}",
"// Check if the poped frame is the current active frame or doesn't have any valid marker info... | Command handler to navigate forward | [
"Command",
"handler",
"to",
"navigate",
"forward"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/NavigationProvider.js#L376-L405 |
2,435 | adobe/brackets | src/extensions/default/NavigationAndHistory/NavigationProvider.js | _initNavigationMenuItems | function _initNavigationMenuItems() {
var menu = Menus.getMenu(Menus.AppMenuBar.NAVIGATE_MENU);
menu.addMenuItem(NAVIGATION_JUMP_BACK, "", Menus.AFTER, Commands.NAVIGATE_PREV_DOC);
menu.addMenuItem(NAVIGATION_JUMP_FWD, "", Menus.AFTER, NAVIGATION_JUMP_BACK);
} | javascript | function _initNavigationMenuItems() {
var menu = Menus.getMenu(Menus.AppMenuBar.NAVIGATE_MENU);
menu.addMenuItem(NAVIGATION_JUMP_BACK, "", Menus.AFTER, Commands.NAVIGATE_PREV_DOC);
menu.addMenuItem(NAVIGATION_JUMP_FWD, "", Menus.AFTER, NAVIGATION_JUMP_BACK);
} | [
"function",
"_initNavigationMenuItems",
"(",
")",
"{",
"var",
"menu",
"=",
"Menus",
".",
"getMenu",
"(",
"Menus",
".",
"AppMenuBar",
".",
"NAVIGATE_MENU",
")",
";",
"menu",
".",
"addMenuItem",
"(",
"NAVIGATION_JUMP_BACK",
",",
"\"\"",
",",
"Menus",
".",
"AFT... | Function to initialize navigation menu items.
@private | [
"Function",
"to",
"initialize",
"navigation",
"menu",
"items",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/NavigationProvider.js#L411-L415 |
2,436 | adobe/brackets | src/extensions/default/NavigationAndHistory/NavigationProvider.js | _initNavigationCommands | function _initNavigationCommands() {
CommandManager.register(Strings.CMD_NAVIGATE_BACKWARD, NAVIGATION_JUMP_BACK, _navigateBack);
CommandManager.register(Strings.CMD_NAVIGATE_FORWARD, NAVIGATION_JUMP_FWD, _navigateForward);
commandJumpBack = CommandManager.get(NAVIGATION_JUMP_BACK);
comm... | javascript | function _initNavigationCommands() {
CommandManager.register(Strings.CMD_NAVIGATE_BACKWARD, NAVIGATION_JUMP_BACK, _navigateBack);
CommandManager.register(Strings.CMD_NAVIGATE_FORWARD, NAVIGATION_JUMP_FWD, _navigateForward);
commandJumpBack = CommandManager.get(NAVIGATION_JUMP_BACK);
comm... | [
"function",
"_initNavigationCommands",
"(",
")",
"{",
"CommandManager",
".",
"register",
"(",
"Strings",
".",
"CMD_NAVIGATE_BACKWARD",
",",
"NAVIGATION_JUMP_BACK",
",",
"_navigateBack",
")",
";",
"CommandManager",
".",
"register",
"(",
"Strings",
".",
"CMD_NAVIGATE_FO... | Function to initialize navigation commands and it's keyboard shortcuts.
@private | [
"Function",
"to",
"initialize",
"navigation",
"commands",
"and",
"it",
"s",
"keyboard",
"shortcuts",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/NavigationProvider.js#L421-L431 |
2,437 | adobe/brackets | src/extensions/default/NavigationAndHistory/NavigationProvider.js | _captureFrame | function _captureFrame(editor) {
// Capture the active position now if it was not captured earlier
if ((activePosNotSynced || !jumpBackwardStack.length) && !jumpInProgress) {
jumpBackwardStack.push(new NavigationFrame(editor, {ranges: editor._codeMirror.listSelections()}));
}
} | javascript | function _captureFrame(editor) {
// Capture the active position now if it was not captured earlier
if ((activePosNotSynced || !jumpBackwardStack.length) && !jumpInProgress) {
jumpBackwardStack.push(new NavigationFrame(editor, {ranges: editor._codeMirror.listSelections()}));
}
} | [
"function",
"_captureFrame",
"(",
"editor",
")",
"{",
"// Capture the active position now if it was not captured earlier",
"if",
"(",
"(",
"activePosNotSynced",
"||",
"!",
"jumpBackwardStack",
".",
"length",
")",
"&&",
"!",
"jumpInProgress",
")",
"{",
"jumpBackwardStack",... | Function to request a navigation frame creation explicitly.
@private | [
"Function",
"to",
"request",
"a",
"navigation",
"frame",
"creation",
"explicitly",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/NavigationProvider.js#L437-L442 |
2,438 | adobe/brackets | src/extensions/default/NavigationAndHistory/NavigationProvider.js | _backupLiveMarkers | function _backupLiveMarkers(frames, editor) {
var index, frame;
for (index in frames) {
frame = frames[index];
if (frame.cm === editor._codeMirror) {
frame._handleEditorDestroy();
}
}
} | javascript | function _backupLiveMarkers(frames, editor) {
var index, frame;
for (index in frames) {
frame = frames[index];
if (frame.cm === editor._codeMirror) {
frame._handleEditorDestroy();
}
}
} | [
"function",
"_backupLiveMarkers",
"(",
"frames",
",",
"editor",
")",
"{",
"var",
"index",
",",
"frame",
";",
"for",
"(",
"index",
"in",
"frames",
")",
"{",
"frame",
"=",
"frames",
"[",
"index",
"]",
";",
"if",
"(",
"frame",
".",
"cm",
"===",
"editor"... | Create snapshot of last known live markers.
@private | [
"Create",
"snapshot",
"of",
"last",
"known",
"live",
"markers",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/NavigationProvider.js#L448-L456 |
2,439 | adobe/brackets | src/extensions/default/NavigationAndHistory/NavigationProvider.js | _handleExternalChange | function _handleExternalChange(evt, doc) {
if (doc) {
_removeBackwardFramesForFile(doc.file);
_removeForwardFramesForFile(doc.file);
_validateNavigationCmds();
}
} | javascript | function _handleExternalChange(evt, doc) {
if (doc) {
_removeBackwardFramesForFile(doc.file);
_removeForwardFramesForFile(doc.file);
_validateNavigationCmds();
}
} | [
"function",
"_handleExternalChange",
"(",
"evt",
",",
"doc",
")",
"{",
"if",
"(",
"doc",
")",
"{",
"_removeBackwardFramesForFile",
"(",
"doc",
".",
"file",
")",
";",
"_removeForwardFramesForFile",
"(",
"doc",
".",
"file",
")",
";",
"_validateNavigationCmds",
"... | Handles explicit content reset for a document caused by external changes
@private | [
"Handles",
"explicit",
"content",
"reset",
"for",
"a",
"document",
"caused",
"by",
"external",
"changes"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/NavigationProvider.js#L491-L497 |
2,440 | adobe/brackets | src/extensions/default/NavigationAndHistory/NavigationProvider.js | _reinstateMarkers | function _reinstateMarkers(editor, frames) {
var index, frame;
for (index in frames) {
frame = frames[index];
if (!frame.cm && frame.filePath === editor.document.file._path) {
frame._reinstateMarkers(editor);
}
}
} | javascript | function _reinstateMarkers(editor, frames) {
var index, frame;
for (index in frames) {
frame = frames[index];
if (!frame.cm && frame.filePath === editor.document.file._path) {
frame._reinstateMarkers(editor);
}
}
} | [
"function",
"_reinstateMarkers",
"(",
"editor",
",",
"frames",
")",
"{",
"var",
"index",
",",
"frame",
";",
"for",
"(",
"index",
"in",
"frames",
")",
"{",
"frame",
"=",
"frames",
"[",
"index",
"]",
";",
"if",
"(",
"!",
"frame",
".",
"cm",
"&&",
"fr... | Required to make offline markers alive again to track document mutation
@private | [
"Required",
"to",
"make",
"offline",
"markers",
"alive",
"again",
"to",
"track",
"document",
"mutation"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/NavigationProvider.js#L508-L516 |
2,441 | adobe/brackets | src/extensions/default/NavigationAndHistory/NavigationProvider.js | _handleActiveEditorChange | function _handleActiveEditorChange(event, current, previous) {
if (previous && previous._paneId) { // Handle only full editors
previous.off("beforeSelectionChange", _recordJumpDef);
_captureFrame(previous);
_validateNavigationCmds();
}
if (current && ... | javascript | function _handleActiveEditorChange(event, current, previous) {
if (previous && previous._paneId) { // Handle only full editors
previous.off("beforeSelectionChange", _recordJumpDef);
_captureFrame(previous);
_validateNavigationCmds();
}
if (current && ... | [
"function",
"_handleActiveEditorChange",
"(",
"event",
",",
"current",
",",
"previous",
")",
"{",
"if",
"(",
"previous",
"&&",
"previous",
".",
"_paneId",
")",
"{",
"// Handle only full editors",
"previous",
".",
"off",
"(",
"\"beforeSelectionChange\"",
",",
"_rec... | Handle Active Editor change to update navigation information
@private | [
"Handle",
"Active",
"Editor",
"change",
"to",
"update",
"navigation",
"information"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/NavigationProvider.js#L522-L536 |
2,442 | adobe/brackets | src/utils/Resizer.js | repositionResizer | function repositionResizer(elementSize) {
var resizerPosition = elementSize || 1;
if (position === POSITION_RIGHT || position === POSITION_BOTTOM) {
$resizer.css(resizerCSSPosition, resizerPosition);
}
} | javascript | function repositionResizer(elementSize) {
var resizerPosition = elementSize || 1;
if (position === POSITION_RIGHT || position === POSITION_BOTTOM) {
$resizer.css(resizerCSSPosition, resizerPosition);
}
} | [
"function",
"repositionResizer",
"(",
"elementSize",
")",
"{",
"var",
"resizerPosition",
"=",
"elementSize",
"||",
"1",
";",
"if",
"(",
"position",
"===",
"POSITION_RIGHT",
"||",
"position",
"===",
"POSITION_BOTTOM",
")",
"{",
"$resizer",
".",
"css",
"(",
"res... | If the resizer is positioned right or bottom of the panel, we need to listen to reposition it if the element size changes externally | [
"If",
"the",
"resizer",
"is",
"positioned",
"right",
"or",
"bottom",
"of",
"the",
"panel",
"we",
"need",
"to",
"listen",
"to",
"reposition",
"it",
"if",
"the",
"element",
"size",
"changes",
"externally"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/Resizer.js#L291-L296 |
2,443 | adobe/brackets | src/filesystem/impls/appshell/AppshellFileSystem.js | _enqueueChange | function _enqueueChange(changedPath, stats) {
_pendingChanges[changedPath] = stats;
if (!_changeTimeout) {
_changeTimeout = window.setTimeout(function () {
if (_changeCallback) {
Object.keys(_pendingChanges).forEach(function (path) {
... | javascript | function _enqueueChange(changedPath, stats) {
_pendingChanges[changedPath] = stats;
if (!_changeTimeout) {
_changeTimeout = window.setTimeout(function () {
if (_changeCallback) {
Object.keys(_pendingChanges).forEach(function (path) {
... | [
"function",
"_enqueueChange",
"(",
"changedPath",
",",
"stats",
")",
"{",
"_pendingChanges",
"[",
"changedPath",
"]",
"=",
"stats",
";",
"if",
"(",
"!",
"_changeTimeout",
")",
"{",
"_changeTimeout",
"=",
"window",
".",
"setTimeout",
"(",
"function",
"(",
")"... | Enqueue a file change event for eventual reporting back to the FileSystem.
@param {string} changedPath The path that was changed
@param {object} stats Stats coming from the underlying watcher, if available
@private | [
"Enqueue",
"a",
"file",
"change",
"event",
"for",
"eventual",
"reporting",
"back",
"to",
"the",
"FileSystem",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/filesystem/impls/appshell/AppshellFileSystem.js#L84-L98 |
2,444 | adobe/brackets | src/filesystem/impls/appshell/AppshellFileSystem.js | _fileWatcherChange | function _fileWatcherChange(evt, event, parentDirPath, entryName, statsObj) {
var change;
switch (event) {
case "changed":
// an existing file/directory was modified; stats are passed if available
var fsStats;
if (statsObj) {
fsStats = new File... | javascript | function _fileWatcherChange(evt, event, parentDirPath, entryName, statsObj) {
var change;
switch (event) {
case "changed":
// an existing file/directory was modified; stats are passed if available
var fsStats;
if (statsObj) {
fsStats = new File... | [
"function",
"_fileWatcherChange",
"(",
"evt",
",",
"event",
",",
"parentDirPath",
",",
"entryName",
",",
"statsObj",
")",
"{",
"var",
"change",
";",
"switch",
"(",
"event",
")",
"{",
"case",
"\"changed\"",
":",
"// an existing file/directory was modified; stats are ... | Event handler for the Node fileWatcher domain's change event.
@param {jQuery.Event} The underlying change event
@param {string} event The type of the event: "changed", "created" or "deleted"
@param {string} parentDirPath The path to the directory holding entry that has changed
@param {string=} entryName The name of th... | [
"Event",
"handler",
"for",
"the",
"Node",
"fileWatcher",
"domain",
"s",
"change",
"event",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/filesystem/impls/appshell/AppshellFileSystem.js#L110-L131 |
2,445 | adobe/brackets | src/filesystem/impls/appshell/AppshellFileSystem.js | _mapError | function _mapError(err) {
if (!err) {
return null;
}
switch (err) {
case appshell.fs.ERR_INVALID_PARAMS:
return FileSystemError.INVALID_PARAMS;
case appshell.fs.ERR_NOT_FOUND:
return FileSystemError.NOT_FOUND;
case appshell.fs.ERR_CANT... | javascript | function _mapError(err) {
if (!err) {
return null;
}
switch (err) {
case appshell.fs.ERR_INVALID_PARAMS:
return FileSystemError.INVALID_PARAMS;
case appshell.fs.ERR_NOT_FOUND:
return FileSystemError.NOT_FOUND;
case appshell.fs.ERR_CANT... | [
"function",
"_mapError",
"(",
"err",
")",
"{",
"if",
"(",
"!",
"err",
")",
"{",
"return",
"null",
";",
"}",
"switch",
"(",
"err",
")",
"{",
"case",
"appshell",
".",
"fs",
".",
"ERR_INVALID_PARAMS",
":",
"return",
"FileSystemError",
".",
"INVALID_PARAMS",... | Convert appshell error codes to FileSystemError values.
@param {?number} err An appshell error code
@return {?string} A FileSystemError string, or null if there was no error code.
@private | [
"Convert",
"appshell",
"error",
"codes",
"to",
"FileSystemError",
"values",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/filesystem/impls/appshell/AppshellFileSystem.js#L143-L171 |
2,446 | adobe/brackets | src/filesystem/impls/appshell/AppshellFileSystem.js | showOpenDialog | function showOpenDialog(allowMultipleSelection, chooseDirectories, title, initialPath, fileTypes, callback) {
appshell.fs.showOpenDialog(allowMultipleSelection, chooseDirectories, title, initialPath, fileTypes, _wrap(callback));
} | javascript | function showOpenDialog(allowMultipleSelection, chooseDirectories, title, initialPath, fileTypes, callback) {
appshell.fs.showOpenDialog(allowMultipleSelection, chooseDirectories, title, initialPath, fileTypes, _wrap(callback));
} | [
"function",
"showOpenDialog",
"(",
"allowMultipleSelection",
",",
"chooseDirectories",
",",
"title",
",",
"initialPath",
",",
"fileTypes",
",",
"callback",
")",
"{",
"appshell",
".",
"fs",
".",
"showOpenDialog",
"(",
"allowMultipleSelection",
",",
"chooseDirectories",... | Display an open-files dialog to the user and call back asynchronously with
either a FileSystmError string or an array of path strings, which indicate
the entry or entries selected.
@param {boolean} allowMultipleSelection
@param {boolean} chooseDirectories
@param {string} title
@param {string} initialPath
@param {Array... | [
"Display",
"an",
"open",
"-",
"files",
"dialog",
"to",
"the",
"user",
"and",
"call",
"back",
"asynchronously",
"with",
"either",
"a",
"FileSystmError",
"string",
"or",
"an",
"array",
"of",
"path",
"strings",
"which",
"indicate",
"the",
"entry",
"or",
"entrie... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/filesystem/impls/appshell/AppshellFileSystem.js#L201-L203 |
2,447 | adobe/brackets | src/filesystem/impls/appshell/AppshellFileSystem.js | showSaveDialog | function showSaveDialog(title, initialPath, proposedNewFilename, callback) {
appshell.fs.showSaveDialog(title, initialPath, proposedNewFilename, _wrap(callback));
} | javascript | function showSaveDialog(title, initialPath, proposedNewFilename, callback) {
appshell.fs.showSaveDialog(title, initialPath, proposedNewFilename, _wrap(callback));
} | [
"function",
"showSaveDialog",
"(",
"title",
",",
"initialPath",
",",
"proposedNewFilename",
",",
"callback",
")",
"{",
"appshell",
".",
"fs",
".",
"showSaveDialog",
"(",
"title",
",",
"initialPath",
",",
"proposedNewFilename",
",",
"_wrap",
"(",
"callback",
")",... | Display a save-file dialog and call back asynchronously with either a
FileSystemError string or the path to which the user has chosen to save
the file. If the dialog is cancelled, the path string will be empty.
@param {string} title
@param {string} initialPath
@param {string} proposedNewFilename
@param {function(?stri... | [
"Display",
"a",
"save",
"-",
"file",
"dialog",
"and",
"call",
"back",
"asynchronously",
"with",
"either",
"a",
"FileSystemError",
"string",
"or",
"the",
"path",
"to",
"which",
"the",
"user",
"has",
"chosen",
"to",
"save",
"the",
"file",
".",
"If",
"the",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/filesystem/impls/appshell/AppshellFileSystem.js#L215-L217 |
2,448 | adobe/brackets | src/filesystem/impls/appshell/AppshellFileSystem.js | stat | function stat(path, callback) {
appshell.fs.stat(path, function (err, stats) {
if (err) {
callback(_mapError(err));
} else {
var options = {
isFile: stats.isFile(),
mtime: stats.mtime,
size: stats... | javascript | function stat(path, callback) {
appshell.fs.stat(path, function (err, stats) {
if (err) {
callback(_mapError(err));
} else {
var options = {
isFile: stats.isFile(),
mtime: stats.mtime,
size: stats... | [
"function",
"stat",
"(",
"path",
",",
"callback",
")",
"{",
"appshell",
".",
"fs",
".",
"stat",
"(",
"path",
",",
"function",
"(",
"err",
",",
"stats",
")",
"{",
"if",
"(",
"err",
")",
"{",
"callback",
"(",
"_mapError",
"(",
"err",
")",
")",
";",... | Stat the file or directory at the given path, calling back
asynchronously with either a FileSystemError string or the entry's
associated FileSystemStats object.
@param {string} path
@param {function(?string, FileSystemStats=)} callback | [
"Stat",
"the",
"file",
"or",
"directory",
"at",
"the",
"given",
"path",
"calling",
"back",
"asynchronously",
"with",
"either",
"a",
"FileSystemError",
"string",
"or",
"the",
"entry",
"s",
"associated",
"FileSystemStats",
"object",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/filesystem/impls/appshell/AppshellFileSystem.js#L227-L245 |
2,449 | adobe/brackets | src/filesystem/impls/appshell/AppshellFileSystem.js | exists | function exists(path, callback) {
stat(path, function (err) {
if (err) {
if (err === FileSystemError.NOT_FOUND) {
callback(null, false);
} else {
callback(err);
}
return;
}
... | javascript | function exists(path, callback) {
stat(path, function (err) {
if (err) {
if (err === FileSystemError.NOT_FOUND) {
callback(null, false);
} else {
callback(err);
}
return;
}
... | [
"function",
"exists",
"(",
"path",
",",
"callback",
")",
"{",
"stat",
"(",
"path",
",",
"function",
"(",
"err",
")",
"{",
"if",
"(",
"err",
")",
"{",
"if",
"(",
"err",
"===",
"FileSystemError",
".",
"NOT_FOUND",
")",
"{",
"callback",
"(",
"null",
"... | Determine whether a file or directory exists at the given path by calling
back asynchronously with either a FileSystemError string or a boolean,
which is true if the file exists and false otherwise. The error will never
be FileSystemError.NOT_FOUND; in that case, there will be no error and the
boolean parameter will be... | [
"Determine",
"whether",
"a",
"file",
"or",
"directory",
"exists",
"at",
"the",
"given",
"path",
"by",
"calling",
"back",
"asynchronously",
"with",
"either",
"a",
"FileSystemError",
"string",
"or",
"a",
"boolean",
"which",
"is",
"true",
"if",
"the",
"file",
"... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/filesystem/impls/appshell/AppshellFileSystem.js#L257-L270 |
2,450 | adobe/brackets | src/filesystem/impls/appshell/AppshellFileSystem.js | mkdir | function mkdir(path, mode, callback) {
if (typeof mode === "function") {
callback = mode;
mode = parseInt("0755", 8);
}
appshell.fs.makedir(path, mode, function (err) {
if (err) {
callback(_mapError(err));
} else {
s... | javascript | function mkdir(path, mode, callback) {
if (typeof mode === "function") {
callback = mode;
mode = parseInt("0755", 8);
}
appshell.fs.makedir(path, mode, function (err) {
if (err) {
callback(_mapError(err));
} else {
s... | [
"function",
"mkdir",
"(",
"path",
",",
"mode",
",",
"callback",
")",
"{",
"if",
"(",
"typeof",
"mode",
"===",
"\"function\"",
")",
"{",
"callback",
"=",
"mode",
";",
"mode",
"=",
"parseInt",
"(",
"\"0755\"",
",",
"8",
")",
";",
"}",
"appshell",
".",
... | Create a directory at the given path, and call back asynchronously with
either a FileSystemError string or a stats object for the newly created
directory. The octal mode parameter is optional; if unspecified, the mode
of the created directory is implementation dependent.
@param {string} path
@param {number=} mode The ... | [
"Create",
"a",
"directory",
"at",
"the",
"given",
"path",
"and",
"call",
"back",
"asynchronously",
"with",
"either",
"a",
"FileSystemError",
"string",
"or",
"a",
"stats",
"object",
"for",
"the",
"newly",
"created",
"directory",
".",
"The",
"octal",
"mode",
"... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/filesystem/impls/appshell/AppshellFileSystem.js#L319-L333 |
2,451 | adobe/brackets | src/filesystem/impls/appshell/AppshellFileSystem.js | rename | function rename(oldPath, newPath, callback) {
appshell.fs.rename(oldPath, newPath, _wrap(callback));
} | javascript | function rename(oldPath, newPath, callback) {
appshell.fs.rename(oldPath, newPath, _wrap(callback));
} | [
"function",
"rename",
"(",
"oldPath",
",",
"newPath",
",",
"callback",
")",
"{",
"appshell",
".",
"fs",
".",
"rename",
"(",
"oldPath",
",",
"newPath",
",",
"_wrap",
"(",
"callback",
")",
")",
";",
"}"
] | Rename the file or directory at oldPath to newPath, and call back
asynchronously with a possibly null FileSystemError string.
@param {string} oldPath
@param {string} newPath
@param {function(?string)=} callback | [
"Rename",
"the",
"file",
"or",
"directory",
"at",
"oldPath",
"to",
"newPath",
"and",
"call",
"back",
"asynchronously",
"with",
"a",
"possibly",
"null",
"FileSystemError",
"string",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/filesystem/impls/appshell/AppshellFileSystem.js#L343-L345 |
2,452 | adobe/brackets | src/filesystem/impls/appshell/AppshellFileSystem.js | doReadFile | function doReadFile(stat) {
if (stat.size > (FileUtils.MAX_FILE_SIZE)) {
callback(FileSystemError.EXCEEDS_MAX_FILE_SIZE);
} else {
appshell.fs.readFile(path, encoding, function (_err, _data, encoding, preserveBOM) {
if (_err) {
... | javascript | function doReadFile(stat) {
if (stat.size > (FileUtils.MAX_FILE_SIZE)) {
callback(FileSystemError.EXCEEDS_MAX_FILE_SIZE);
} else {
appshell.fs.readFile(path, encoding, function (_err, _data, encoding, preserveBOM) {
if (_err) {
... | [
"function",
"doReadFile",
"(",
"stat",
")",
"{",
"if",
"(",
"stat",
".",
"size",
">",
"(",
"FileUtils",
".",
"MAX_FILE_SIZE",
")",
")",
"{",
"callback",
"(",
"FileSystemError",
".",
"EXCEEDS_MAX_FILE_SIZE",
")",
";",
"}",
"else",
"{",
"appshell",
".",
"f... | callback to be executed when the call to stat completes or immediately if a stat object was passed as an argument | [
"callback",
"to",
"be",
"executed",
"when",
"the",
"call",
"to",
"stat",
"completes",
"or",
"immediately",
"if",
"a",
"stat",
"object",
"was",
"passed",
"as",
"an",
"argument"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/filesystem/impls/appshell/AppshellFileSystem.js#L368-L380 |
2,453 | adobe/brackets | src/filesystem/impls/appshell/AppshellFileSystem.js | moveToTrash | function moveToTrash(path, callback) {
appshell.fs.moveToTrash(path, function (err) {
callback(_mapError(err));
});
} | javascript | function moveToTrash(path, callback) {
appshell.fs.moveToTrash(path, function (err) {
callback(_mapError(err));
});
} | [
"function",
"moveToTrash",
"(",
"path",
",",
"callback",
")",
"{",
"appshell",
".",
"fs",
".",
"moveToTrash",
"(",
"path",
",",
"function",
"(",
"err",
")",
"{",
"callback",
"(",
"_mapError",
"(",
"err",
")",
")",
";",
"}",
")",
";",
"}"
] | Move the file or directory at the given path to a system dependent trash
location, calling back asynchronously with a possibly null FileSystemError
string. Directories will be moved even when non-empty.
@param {string} path
@param {function(string)=} callback | [
"Move",
"the",
"file",
"or",
"directory",
"at",
"the",
"given",
"path",
"to",
"a",
"system",
"dependent",
"trash",
"location",
"calling",
"back",
"asynchronously",
"with",
"a",
"possibly",
"null",
"FileSystemError",
"string",
".",
"Directories",
"will",
"be",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/filesystem/impls/appshell/AppshellFileSystem.js#L484-L488 |
2,454 | adobe/brackets | src/filesystem/impls/appshell/AppshellFileSystem.js | watchPath | function watchPath(path, ignored, callback) {
if (_isRunningOnWindowsXP) {
callback(FileSystemError.NOT_SUPPORTED);
return;
}
appshell.fs.isNetworkDrive(path, function (err, isNetworkDrive) {
if (err || isNetworkDrive) {
if (isNetworkDrive) {
... | javascript | function watchPath(path, ignored, callback) {
if (_isRunningOnWindowsXP) {
callback(FileSystemError.NOT_SUPPORTED);
return;
}
appshell.fs.isNetworkDrive(path, function (err, isNetworkDrive) {
if (err || isNetworkDrive) {
if (isNetworkDrive) {
... | [
"function",
"watchPath",
"(",
"path",
",",
"ignored",
",",
"callback",
")",
"{",
"if",
"(",
"_isRunningOnWindowsXP",
")",
"{",
"callback",
"(",
"FileSystemError",
".",
"NOT_SUPPORTED",
")",
";",
"return",
";",
"}",
"appshell",
".",
"fs",
".",
"isNetworkDrive... | Start providing change notifications for the file or directory at the
given path, calling back asynchronously with a possibly null FileSystemError
string when the initialization is complete. Notifications are provided
using the changeCallback function provided by the initWatchers method.
Note that change notifications ... | [
"Start",
"providing",
"change",
"notifications",
"for",
"the",
"file",
"or",
"directory",
"at",
"the",
"given",
"path",
"calling",
"back",
"asynchronously",
"with",
"a",
"possibly",
"null",
"FileSystemError",
"string",
"when",
"the",
"initialization",
"is",
"compl... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/filesystem/impls/appshell/AppshellFileSystem.js#L527-L544 |
2,455 | adobe/brackets | src/filesystem/impls/appshell/AppshellFileSystem.js | unwatchPath | function unwatchPath(path, ignored, callback) {
_nodeDomain.exec("unwatchPath", path)
.then(callback, callback);
} | javascript | function unwatchPath(path, ignored, callback) {
_nodeDomain.exec("unwatchPath", path)
.then(callback, callback);
} | [
"function",
"unwatchPath",
"(",
"path",
",",
"ignored",
",",
"callback",
")",
"{",
"_nodeDomain",
".",
"exec",
"(",
"\"unwatchPath\"",
",",
"path",
")",
".",
"then",
"(",
"callback",
",",
"callback",
")",
";",
"}"
] | Stop providing change notifications for the file or directory at the
given path, calling back asynchronously with a possibly null FileSystemError
string when the operation is complete.
This function needs to mirror the signature of watchPath
because of FileSystem.prototype._watchOrUnwatchEntry implementation.
@param {... | [
"Stop",
"providing",
"change",
"notifications",
"for",
"the",
"file",
"or",
"directory",
"at",
"the",
"given",
"path",
"calling",
"back",
"asynchronously",
"with",
"a",
"possibly",
"null",
"FileSystemError",
"string",
"when",
"the",
"operation",
"is",
"complete",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/filesystem/impls/appshell/AppshellFileSystem.js#L556-L559 |
2,456 | adobe/brackets | src/project/FileSyncManager.js | reloadDoc | function reloadDoc(doc) {
var promise = FileUtils.readAsText(doc.file);
promise.done(function (text, readTimestamp) {
doc.refreshText(text, readTimestamp);
});
promise.fail(function (error) {
console.log("Error reloading contents of " + doc.file.fullPath, error)... | javascript | function reloadDoc(doc) {
var promise = FileUtils.readAsText(doc.file);
promise.done(function (text, readTimestamp) {
doc.refreshText(text, readTimestamp);
});
promise.fail(function (error) {
console.log("Error reloading contents of " + doc.file.fullPath, error)... | [
"function",
"reloadDoc",
"(",
"doc",
")",
"{",
"var",
"promise",
"=",
"FileUtils",
".",
"readAsText",
"(",
"doc",
".",
"file",
")",
";",
"promise",
".",
"done",
"(",
"function",
"(",
"text",
",",
"readTimestamp",
")",
"{",
"doc",
".",
"refreshText",
"(... | Reloads the Document's contents from disk, discarding any unsaved changes in the editor.
@param {!Document} doc
@return {$.Promise} Resolved after editor has been refreshed; rejected if unable to load the
file's new content. Errors are logged but no UI is shown. | [
"Reloads",
"the",
"Document",
"s",
"contents",
"from",
"disk",
"discarding",
"any",
"unsaved",
"changes",
"in",
"the",
"editor",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileSyncManager.js#L218-L229 |
2,457 | adobe/brackets | src/extensibility/node/package-validator.js | parsePersonString | function parsePersonString(obj) {
if (typeof (obj) === "string") {
var parts = _personRegex.exec(obj);
// No regex match, so we just synthesize an object with an opaque name string
if (!parts) {
return {
name: obj
};
} else {
var r... | javascript | function parsePersonString(obj) {
if (typeof (obj) === "string") {
var parts = _personRegex.exec(obj);
// No regex match, so we just synthesize an object with an opaque name string
if (!parts) {
return {
name: obj
};
} else {
var r... | [
"function",
"parsePersonString",
"(",
"obj",
")",
"{",
"if",
"(",
"typeof",
"(",
"obj",
")",
"===",
"\"string\"",
")",
"{",
"var",
"parts",
"=",
"_personRegex",
".",
"exec",
"(",
"obj",
")",
";",
"// No regex match, so we just synthesize an object with an opaque n... | Normalizes person fields from package.json.
These fields can be an object with name, email and url properties or a
string of the form "name <email> <url>". This does a tolerant parsing of
the data to try to return an object with name and optional email and url.
If the string does not match the format, the string is re... | [
"Normalizes",
"person",
"fields",
"from",
"package",
".",
"json",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/node/package-validator.js#L97-L122 |
2,458 | adobe/brackets | src/extensibility/node/package-validator.js | containsWords | function containsWords(wordlist, str) {
var i;
var matches = [];
for (i = 0; i < wordlist.length; i++) {
var re = new RegExp("\\b" + wordlist[i] + "\\b", "i");
if (re.exec(str)) {
matches.push(wordlist[i]);
}
}
return matches;
} | javascript | function containsWords(wordlist, str) {
var i;
var matches = [];
for (i = 0; i < wordlist.length; i++) {
var re = new RegExp("\\b" + wordlist[i] + "\\b", "i");
if (re.exec(str)) {
matches.push(wordlist[i]);
}
}
return matches;
} | [
"function",
"containsWords",
"(",
"wordlist",
",",
"str",
")",
"{",
"var",
"i",
";",
"var",
"matches",
"=",
"[",
"]",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"wordlist",
".",
"length",
";",
"i",
"++",
")",
"{",
"var",
"re",
"=",
"new",
... | Determines if any of the words in wordlist appear in str.
@param {String[]} wordlist list of words to check
@param {String} str to check for words
@return {String[]} words that matched | [
"Determines",
"if",
"any",
"of",
"the",
"words",
"in",
"wordlist",
"appear",
"in",
"str",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/node/package-validator.js#L131-L141 |
2,459 | adobe/brackets | src/extensibility/node/package-validator.js | findCommonPrefix | function findCommonPrefix(extractDir, callback) {
fs.readdir(extractDir, function (err, files) {
ignoredFolders.forEach(function (folder) {
var index = files.indexOf(folder);
if (index !== -1) {
files.splice(index, 1);
}
});
if (err) {
... | javascript | function findCommonPrefix(extractDir, callback) {
fs.readdir(extractDir, function (err, files) {
ignoredFolders.forEach(function (folder) {
var index = files.indexOf(folder);
if (index !== -1) {
files.splice(index, 1);
}
});
if (err) {
... | [
"function",
"findCommonPrefix",
"(",
"extractDir",
",",
"callback",
")",
"{",
"fs",
".",
"readdir",
"(",
"extractDir",
",",
"function",
"(",
"err",
",",
"files",
")",
"{",
"ignoredFolders",
".",
"forEach",
"(",
"function",
"(",
"folder",
")",
"{",
"var",
... | Finds the common prefix, if any, for the files in a package file.
In some package files, all of the files are contained in a subdirectory, and this function
will identify that directory if it exists.
@param {string} extractDir directory into which the package was extracted
@param {function(Error, string)} callback fu... | [
"Finds",
"the",
"common",
"prefix",
"if",
"any",
"for",
"the",
"files",
"in",
"a",
"package",
"file",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/node/package-validator.js#L152-L173 |
2,460 | adobe/brackets | src/extensibility/node/package-validator.js | validatePackageJSON | function validatePackageJSON(path, packageJSON, options, callback) {
var errors = [];
if (fs.existsSync(packageJSON)) {
fs.readFile(packageJSON, {
encoding: "utf8"
}, function (err, data) {
if (err) {
callback(err, null, null);
return;
... | javascript | function validatePackageJSON(path, packageJSON, options, callback) {
var errors = [];
if (fs.existsSync(packageJSON)) {
fs.readFile(packageJSON, {
encoding: "utf8"
}, function (err, data) {
if (err) {
callback(err, null, null);
return;
... | [
"function",
"validatePackageJSON",
"(",
"path",
",",
"packageJSON",
",",
"options",
",",
"callback",
")",
"{",
"var",
"errors",
"=",
"[",
"]",
";",
"if",
"(",
"fs",
".",
"existsSync",
"(",
"packageJSON",
")",
")",
"{",
"fs",
".",
"readFile",
"(",
"pack... | Validates the contents of package.json.
@param {string} path path to package file (used in error reporting)
@param {string} packageJSON path to the package.json file to check
@param {Object} options validation options passed to `validate()`
@param {function(Error, Array.<Array.<string, ...>>, Object)} callback functio... | [
"Validates",
"the",
"contents",
"of",
"package",
".",
"json",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/node/package-validator.js#L183-L258 |
2,461 | adobe/brackets | src/extensibility/node/package-validator.js | extractAndValidateFiles | function extractAndValidateFiles(zipPath, extractDir, options, callback) {
var unzipper = new DecompressZip(zipPath);
unzipper.on("error", function (err) {
// General error to report for problems reading the file
callback(null, {
errors: [[Errors.INVALID_ZIP_FILE, zipPath, err]]
... | javascript | function extractAndValidateFiles(zipPath, extractDir, options, callback) {
var unzipper = new DecompressZip(zipPath);
unzipper.on("error", function (err) {
// General error to report for problems reading the file
callback(null, {
errors: [[Errors.INVALID_ZIP_FILE, zipPath, err]]
... | [
"function",
"extractAndValidateFiles",
"(",
"zipPath",
",",
"extractDir",
",",
"options",
",",
"callback",
")",
"{",
"var",
"unzipper",
"=",
"new",
"DecompressZip",
"(",
"zipPath",
")",
";",
"unzipper",
".",
"on",
"(",
"\"error\"",
",",
"function",
"(",
"err... | Extracts the package into the given directory and then validates it.
@param {string} zipPath path to package zip file
@param {string} extractDir directory to extract package into
@param {Object} options validation options
@param {function(Error, {errors: Array, metadata: Object, commonPrefix: string, extractDir: strin... | [
"Extracts",
"the",
"package",
"into",
"the",
"given",
"directory",
"and",
"then",
"validates",
"it",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/node/package-validator.js#L268-L327 |
2,462 | adobe/brackets | src/extensibility/node/package-validator.js | validate | function validate(path, options, callback) {
options = options || {};
fs.exists(path, function (doesExist) {
if (!doesExist) {
callback(null, {
errors: [[Errors.NOT_FOUND_ERR, path]]
});
return;
}
temp.mkdir("bracketsPackage_", function... | javascript | function validate(path, options, callback) {
options = options || {};
fs.exists(path, function (doesExist) {
if (!doesExist) {
callback(null, {
errors: [[Errors.NOT_FOUND_ERR, path]]
});
return;
}
temp.mkdir("bracketsPackage_", function... | [
"function",
"validate",
"(",
"path",
",",
"options",
",",
"callback",
")",
"{",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"fs",
".",
"exists",
"(",
"path",
",",
"function",
"(",
"doesExist",
")",
"{",
"if",
"(",
"!",
"doesExist",
")",
"{",
"c... | Implements the "validate" command in the "extensions" domain.
Validates the zipped package at path.
The "err" parameter of the callback is only set if there was an
unexpected error. Otherwise, errors are reported in the result.
The result object has an "errors" property. It is an array of
arrays of strings. Each arra... | [
"Implements",
"the",
"validate",
"command",
"in",
"the",
"extensions",
"domain",
".",
"Validates",
"the",
"zipped",
"package",
"at",
"path",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/node/package-validator.js#L348-L365 |
2,463 | adobe/brackets | src/extensions/default/CodeFolding/foldhelpers/foldSelected.js | SelectionFold | function SelectionFold(cm, start) {
if (!cm.somethingSelected()) {
return;
}
var from = cm.getCursor("from"),
to = cm.getCursor("to");
if (from.line === start.line) {
return {from: from, to: to};
}
} | javascript | function SelectionFold(cm, start) {
if (!cm.somethingSelected()) {
return;
}
var from = cm.getCursor("from"),
to = cm.getCursor("to");
if (from.line === start.line) {
return {from: from, to: to};
}
} | [
"function",
"SelectionFold",
"(",
"cm",
",",
"start",
")",
"{",
"if",
"(",
"!",
"cm",
".",
"somethingSelected",
"(",
")",
")",
"{",
"return",
";",
"}",
"var",
"from",
"=",
"cm",
".",
"getCursor",
"(",
"\"from\"",
")",
",",
"to",
"=",
"cm",
".",
"... | This helper returns the start and end range representing the current selection in the editor.
@param {Object} cm The Codemirror instance
@param {Object} start A Codemirror.Pos object {line, ch} representing the current line we are
checking for fold ranges
@returns {Object} The fold range, {from, to} representing... | [
"This",
"helper",
"returns",
"the",
"start",
"and",
"end",
"range",
"representing",
"the",
"current",
"selection",
"in",
"the",
"editor",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/foldhelpers/foldSelected.js#L17-L27 |
2,464 | adobe/brackets | src/LiveDevelopment/Inspector/Inspector.js | _send | function _send(method, signature, varargs) {
if (!_socket) {
console.log("You must connect to the WebSocket before sending messages.");
// FUTURE: Our current implementation closes and re-opens an inspector connection whenever
// a new HTML file is selected. If done quickly ... | javascript | function _send(method, signature, varargs) {
if (!_socket) {
console.log("You must connect to the WebSocket before sending messages.");
// FUTURE: Our current implementation closes and re-opens an inspector connection whenever
// a new HTML file is selected. If done quickly ... | [
"function",
"_send",
"(",
"method",
",",
"signature",
",",
"varargs",
")",
"{",
"if",
"(",
"!",
"_socket",
")",
"{",
"console",
".",
"log",
"(",
"\"You must connect to the WebSocket before sending messages.\"",
")",
";",
"// FUTURE: Our current implementation closes and... | Send a message to the remote debugger
All passed arguments after the signature are passed on as parameters.
If the last argument is a function, it is used as the callback function.
@param {string} remote method
@param {object} the method signature | [
"Send",
"a",
"message",
"to",
"the",
"remote",
"debugger",
"All",
"passed",
"arguments",
"after",
"the",
"signature",
"are",
"passed",
"on",
"as",
"parameters",
".",
"If",
"the",
"last",
"argument",
"is",
"a",
"function",
"it",
"is",
"used",
"as",
"the",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Inspector/Inspector.js#L117-L166 |
2,465 | adobe/brackets | src/LiveDevelopment/Inspector/Inspector.js | _onError | function _onError(error) {
if (_connectDeferred) {
_connectDeferred.reject();
_connectDeferred = null;
}
exports.trigger("error", error);
} | javascript | function _onError(error) {
if (_connectDeferred) {
_connectDeferred.reject();
_connectDeferred = null;
}
exports.trigger("error", error);
} | [
"function",
"_onError",
"(",
"error",
")",
"{",
"if",
"(",
"_connectDeferred",
")",
"{",
"_connectDeferred",
".",
"reject",
"(",
")",
";",
"_connectDeferred",
"=",
"null",
";",
"}",
"exports",
".",
"trigger",
"(",
"\"error\"",
",",
"error",
")",
";",
"}"... | WebSocket reported an error | [
"WebSocket",
"reported",
"an",
"error"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Inspector/Inspector.js#L186-L192 |
2,466 | adobe/brackets | src/LiveDevelopment/Inspector/Inspector.js | disconnect | function disconnect() {
var deferred = new $.Deferred(),
promise = deferred.promise();
if (_socket && (_socket.readyState === WebSocket.OPEN)) {
_socket.onclose = function () {
// trigger disconnect event
_onDisconnect();
deferred... | javascript | function disconnect() {
var deferred = new $.Deferred(),
promise = deferred.promise();
if (_socket && (_socket.readyState === WebSocket.OPEN)) {
_socket.onclose = function () {
// trigger disconnect event
_onDisconnect();
deferred... | [
"function",
"disconnect",
"(",
")",
"{",
"var",
"deferred",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
",",
"promise",
"=",
"deferred",
".",
"promise",
"(",
")",
";",
"if",
"(",
"_socket",
"&&",
"(",
"_socket",
".",
"readyState",
"===",
"WebSocket",
... | Disconnect from the remote debugger WebSocket
@return {jQuery.Promise} Promise that is resolved immediately if not
currently connected or asynchronously when the socket is closed. | [
"Disconnect",
"from",
"the",
"remote",
"debugger",
"WebSocket"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Inspector/Inspector.js#L272-L301 |
2,467 | adobe/brackets | src/LiveDevelopment/Inspector/Inspector.js | connect | function connect(socketURL) {
disconnect().done(function () {
_socket = new WebSocket(socketURL);
_socket.onmessage = _onMessage;
_socket.onopen = _onConnect;
_socket.onclose = _onDisconnect;
_socket.onerror = _onError;
});
} | javascript | function connect(socketURL) {
disconnect().done(function () {
_socket = new WebSocket(socketURL);
_socket.onmessage = _onMessage;
_socket.onopen = _onConnect;
_socket.onclose = _onDisconnect;
_socket.onerror = _onError;
});
} | [
"function",
"connect",
"(",
"socketURL",
")",
"{",
"disconnect",
"(",
")",
".",
"done",
"(",
"function",
"(",
")",
"{",
"_socket",
"=",
"new",
"WebSocket",
"(",
"socketURL",
")",
";",
"_socket",
".",
"onmessage",
"=",
"_onMessage",
";",
"_socket",
".",
... | Connect to the remote debugger WebSocket at the given URL.
Clients must listen for the `connect` event.
@param {string} WebSocket URL | [
"Connect",
"to",
"the",
"remote",
"debugger",
"WebSocket",
"at",
"the",
"given",
"URL",
".",
"Clients",
"must",
"listen",
"for",
"the",
"connect",
"event",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Inspector/Inspector.js#L308-L316 |
2,468 | adobe/brackets | src/LiveDevelopment/Inspector/Inspector.js | connectToURL | function connectToURL(url) {
if (_connectDeferred) {
// reject an existing connection attempt
_connectDeferred.reject("CANCEL");
}
var deferred = new $.Deferred();
_connectDeferred = deferred;
var promise = getDebuggableWindows();
promise.done(func... | javascript | function connectToURL(url) {
if (_connectDeferred) {
// reject an existing connection attempt
_connectDeferred.reject("CANCEL");
}
var deferred = new $.Deferred();
_connectDeferred = deferred;
var promise = getDebuggableWindows();
promise.done(func... | [
"function",
"connectToURL",
"(",
"url",
")",
"{",
"if",
"(",
"_connectDeferred",
")",
"{",
"// reject an existing connection attempt",
"_connectDeferred",
".",
"reject",
"(",
"\"CANCEL\"",
")",
";",
"}",
"var",
"deferred",
"=",
"new",
"$",
".",
"Deferred",
"(",
... | Connect to the remote debugger of the page that is at the given URL
@param {string} url | [
"Connect",
"to",
"the",
"remote",
"debugger",
"of",
"the",
"page",
"that",
"is",
"at",
"the",
"given",
"URL"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Inspector/Inspector.js#L321-L345 |
2,469 | adobe/brackets | src/widgets/StatusBar.js | showBusyIndicator | function showBusyIndicator(updateCursor) {
if (!_init) {
console.error("StatusBar API invoked before status bar created");
return;
}
if (updateCursor) {
_busyCursor = true;
$("*").addClass("busyCursor");
}
$busyIndicator.addClass(... | javascript | function showBusyIndicator(updateCursor) {
if (!_init) {
console.error("StatusBar API invoked before status bar created");
return;
}
if (updateCursor) {
_busyCursor = true;
$("*").addClass("busyCursor");
}
$busyIndicator.addClass(... | [
"function",
"showBusyIndicator",
"(",
"updateCursor",
")",
"{",
"if",
"(",
"!",
"_init",
")",
"{",
"console",
".",
"error",
"(",
"\"StatusBar API invoked before status bar created\"",
")",
";",
"return",
";",
"}",
"if",
"(",
"updateCursor",
")",
"{",
"_busyCurso... | Shows the 'busy' indicator
@param {boolean} updateCursor Sets the cursor to "wait" | [
"Shows",
"the",
"busy",
"indicator"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/widgets/StatusBar.js#L58-L70 |
2,470 | adobe/brackets | src/widgets/StatusBar.js | addIndicator | function addIndicator(id, indicator, visible, style, tooltip, insertBefore) {
if (!_init) {
console.error("StatusBar API invoked before status bar created");
return;
}
indicator = indicator || window.document.createElement("div");
tooltip = tooltip || "";
... | javascript | function addIndicator(id, indicator, visible, style, tooltip, insertBefore) {
if (!_init) {
console.error("StatusBar API invoked before status bar created");
return;
}
indicator = indicator || window.document.createElement("div");
tooltip = tooltip || "";
... | [
"function",
"addIndicator",
"(",
"id",
",",
"indicator",
",",
"visible",
",",
"style",
",",
"tooltip",
",",
"insertBefore",
")",
"{",
"if",
"(",
"!",
"_init",
")",
"{",
"console",
".",
"error",
"(",
"\"StatusBar API invoked before status bar created\"",
")",
"... | Registers a new status indicator
@param {string} id Registration id of the indicator to be updated.
@param {(DOMNode|jQueryObject)=} indicator Optional DOMNode for the indicator
@param {boolean=} visible Shows or hides the indicator over the statusbar.
@param {string=} style Sets the attribute "class" of the indicator.... | [
"Registers",
"a",
"new",
"status",
"indicator"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/widgets/StatusBar.js#L102-L135 |
2,471 | adobe/brackets | src/widgets/StatusBar.js | updateIndicator | function updateIndicator(id, visible, style, tooltip) {
if (!_init && !!brackets.test) {
console.error("StatusBar API invoked before status bar created");
return;
}
var $indicator = $("#" + id.replace(_indicatorIDRegexp, "-"));
if ($indicator) {
if ... | javascript | function updateIndicator(id, visible, style, tooltip) {
if (!_init && !!brackets.test) {
console.error("StatusBar API invoked before status bar created");
return;
}
var $indicator = $("#" + id.replace(_indicatorIDRegexp, "-"));
if ($indicator) {
if ... | [
"function",
"updateIndicator",
"(",
"id",
",",
"visible",
",",
"style",
",",
"tooltip",
")",
"{",
"if",
"(",
"!",
"_init",
"&&",
"!",
"!",
"brackets",
".",
"test",
")",
"{",
"console",
".",
"error",
"(",
"\"StatusBar API invoked before status bar created\"",
... | Updates a status indicator
@param {string} id Registration id of the indicator to be updated.
@param {boolean} visible Shows or hides the indicator over the statusbar.
@param {string=} style Sets the attribute "class" of the indicator.
@param {string=} tooltip Sets the attribute "title" of the indicator. | [
"Updates",
"a",
"status",
"indicator"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/widgets/StatusBar.js#L144-L172 |
2,472 | adobe/brackets | src/view/ThemeView.js | updateScrollbars | function updateScrollbars(theme) {
theme = theme || {};
if (prefs.get("themeScrollbars")) {
var scrollbar = (theme.scrollbar || []).join(" ");
$scrollbars.text(scrollbar || "");
} else {
$scrollbars.text("");
}
} | javascript | function updateScrollbars(theme) {
theme = theme || {};
if (prefs.get("themeScrollbars")) {
var scrollbar = (theme.scrollbar || []).join(" ");
$scrollbars.text(scrollbar || "");
} else {
$scrollbars.text("");
}
} | [
"function",
"updateScrollbars",
"(",
"theme",
")",
"{",
"theme",
"=",
"theme",
"||",
"{",
"}",
";",
"if",
"(",
"prefs",
".",
"get",
"(",
"\"themeScrollbars\"",
")",
")",
"{",
"var",
"scrollbar",
"=",
"(",
"theme",
".",
"scrollbar",
"||",
"[",
"]",
")... | Load scrollbar styling based on whether or not theme scrollbars are enabled.
@param {ThemeManager.Theme} theme Is the theme object with the corresponding scrollbar style
to be updated | [
"Load",
"scrollbar",
"styling",
"based",
"on",
"whether",
"or",
"not",
"theme",
"scrollbars",
"are",
"enabled",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/ThemeView.js#L40-L48 |
2,473 | adobe/brackets | src/view/ThemeView.js | updateThemes | function updateThemes(cm) {
var newTheme = prefs.get("theme"),
cmTheme = (cm.getOption("theme") || "").replace(/[\s]*/, ""); // Normalize themes string
// Check if the editor already has the theme applied...
if (cmTheme === newTheme) {
return;
}
// Setu... | javascript | function updateThemes(cm) {
var newTheme = prefs.get("theme"),
cmTheme = (cm.getOption("theme") || "").replace(/[\s]*/, ""); // Normalize themes string
// Check if the editor already has the theme applied...
if (cmTheme === newTheme) {
return;
}
// Setu... | [
"function",
"updateThemes",
"(",
"cm",
")",
"{",
"var",
"newTheme",
"=",
"prefs",
".",
"get",
"(",
"\"theme\"",
")",
",",
"cmTheme",
"=",
"(",
"cm",
".",
"getOption",
"(",
"\"theme\"",
")",
"||",
"\"\"",
")",
".",
"replace",
"(",
"/",
"[\\s]*",
"/",
... | Handles updating codemirror with the current selection of themes.
@param {CodeMirror} cm is the CodeMirror instance currently loaded | [
"Handles",
"updating",
"codemirror",
"with",
"the",
"current",
"selection",
"of",
"themes",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/ThemeView.js#L56-L68 |
2,474 | adobe/brackets | src/project/ProjectManager.js | getSelectedItem | function getSelectedItem() {
// Prefer file tree context, then file tree selection, else use working set
var selectedEntry = getFileTreeContext();
if (!selectedEntry) {
selectedEntry = model.getSelected();
}
if (!selectedEntry) {
selectedEntry = MainViewMa... | javascript | function getSelectedItem() {
// Prefer file tree context, then file tree selection, else use working set
var selectedEntry = getFileTreeContext();
if (!selectedEntry) {
selectedEntry = model.getSelected();
}
if (!selectedEntry) {
selectedEntry = MainViewMa... | [
"function",
"getSelectedItem",
"(",
")",
"{",
"// Prefer file tree context, then file tree selection, else use working set",
"var",
"selectedEntry",
"=",
"getFileTreeContext",
"(",
")",
";",
"if",
"(",
"!",
"selectedEntry",
")",
"{",
"selectedEntry",
"=",
"model",
".",
... | Returns the File or Directory corresponding to the item selected in the sidebar panel, whether in
the file tree OR in the working set; or null if no item is selected anywhere in the sidebar.
May NOT be identical to the current Document - a folder may be selected in the sidebar, or the sidebar may not
have the current d... | [
"Returns",
"the",
"File",
"or",
"Directory",
"corresponding",
"to",
"the",
"item",
"selected",
"in",
"the",
"sidebar",
"panel",
"whether",
"in",
"the",
"file",
"tree",
"OR",
"in",
"the",
"working",
"set",
";",
"or",
"null",
"if",
"no",
"item",
"is",
"sel... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/ProjectManager.js#L441-L451 |
2,475 | adobe/brackets | src/project/ProjectManager.js | setBaseUrl | function setBaseUrl(projectBaseUrl) {
var context = _getProjectViewStateContext();
projectBaseUrl = model.setBaseUrl(projectBaseUrl);
PreferencesManager.setViewState("project.baseUrl", projectBaseUrl, context);
} | javascript | function setBaseUrl(projectBaseUrl) {
var context = _getProjectViewStateContext();
projectBaseUrl = model.setBaseUrl(projectBaseUrl);
PreferencesManager.setViewState("project.baseUrl", projectBaseUrl, context);
} | [
"function",
"setBaseUrl",
"(",
"projectBaseUrl",
")",
"{",
"var",
"context",
"=",
"_getProjectViewStateContext",
"(",
")",
";",
"projectBaseUrl",
"=",
"model",
".",
"setBaseUrl",
"(",
"projectBaseUrl",
")",
";",
"PreferencesManager",
".",
"setViewState",
"(",
"\"p... | Sets the encoded Base URL of the currently loaded project.
@param {String} | [
"Sets",
"the",
"encoded",
"Base",
"URL",
"of",
"the",
"currently",
"loaded",
"project",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/ProjectManager.js#L514-L520 |
2,476 | adobe/brackets | src/project/ProjectManager.js | addWelcomeProjectPath | function addWelcomeProjectPath(path) {
var welcomeProjects = ProjectModel._addWelcomeProjectPath(path,
PreferencesManager.getViewState("welcomeProjects"));
PreferencesManager.setViewState("welcomeProjects", welcomeProjects);
} | javascript | function addWelcomeProjectPath(path) {
var welcomeProjects = ProjectModel._addWelcomeProjectPath(path,
PreferencesManager.getViewState("welcomeProjects"));
PreferencesManager.setViewState("welcomeProjects", welcomeProjects);
} | [
"function",
"addWelcomeProjectPath",
"(",
"path",
")",
"{",
"var",
"welcomeProjects",
"=",
"ProjectModel",
".",
"_addWelcomeProjectPath",
"(",
"path",
",",
"PreferencesManager",
".",
"getViewState",
"(",
"\"welcomeProjects\"",
")",
")",
";",
"PreferencesManager",
".",... | Adds the path to the list of welcome projects we've ever seen, if not on the list already.
@param {string} path Path to possibly add | [
"Adds",
"the",
"path",
"to",
"the",
"list",
"of",
"welcome",
"projects",
"we",
"ve",
"ever",
"seen",
"if",
"not",
"on",
"the",
"list",
"already",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/ProjectManager.js#L700-L704 |
2,477 | adobe/brackets | src/project/ProjectManager.js | _getFallbackProjectPath | function _getFallbackProjectPath() {
var fallbackPaths = [],
recentProjects = PreferencesManager.getViewState("recentProjects") || [],
deferred = new $.Deferred();
// Build ordered fallback path array
if (recentProjects.length > 1) {
// *Most* recent project ... | javascript | function _getFallbackProjectPath() {
var fallbackPaths = [],
recentProjects = PreferencesManager.getViewState("recentProjects") || [],
deferred = new $.Deferred();
// Build ordered fallback path array
if (recentProjects.length > 1) {
// *Most* recent project ... | [
"function",
"_getFallbackProjectPath",
"(",
")",
"{",
"var",
"fallbackPaths",
"=",
"[",
"]",
",",
"recentProjects",
"=",
"PreferencesManager",
".",
"getViewState",
"(",
"\"recentProjects\"",
")",
"||",
"[",
"]",
",",
"deferred",
"=",
"new",
"$",
".",
"Deferred... | After failing to load a project, this function determines which project path to fallback to.
@return {$.Promise} Promise that resolves to a project path {string} | [
"After",
"failing",
"to",
"load",
"a",
"project",
"this",
"function",
"determines",
"which",
"project",
"path",
"to",
"fallback",
"to",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/ProjectManager.js#L733-L774 |
2,478 | adobe/brackets | src/project/ProjectManager.js | openProject | function openProject(path) {
var result = new $.Deferred();
// Confirm any unsaved changes first. We run the command in "prompt-only" mode, meaning it won't
// actually close any documents even on success; we'll do that manually after the user also oks
// the folder-browse dialog.
... | javascript | function openProject(path) {
var result = new $.Deferred();
// Confirm any unsaved changes first. We run the command in "prompt-only" mode, meaning it won't
// actually close any documents even on success; we'll do that manually after the user also oks
// the folder-browse dialog.
... | [
"function",
"openProject",
"(",
"path",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"// Confirm any unsaved changes first. We run the command in \"prompt-only\" mode, meaning it won't",
"// actually close any documents even on success; we'll do that ... | Open a new project. Currently, Brackets must always have a project open, so
this method handles both closing the current project and opening a new project.
@param {string=} path Optional absolute path to the root folder of the project.
If path is undefined or null, displays a dialog where the user can choose a
folder ... | [
"Open",
"a",
"new",
"project",
".",
"Currently",
"Brackets",
"must",
"always",
"have",
"a",
"project",
"open",
"so",
"this",
"method",
"handles",
"both",
"closing",
"the",
"current",
"project",
"and",
"opening",
"a",
"new",
"project",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/ProjectManager.js#L1056-L1092 |
2,479 | adobe/brackets | src/project/ProjectManager.js | createNewItem | function createNewItem(baseDir, initialName, skipRename, isFolder) {
baseDir = model.getDirectoryInProject(baseDir);
if (skipRename) {
if(isFolder) {
return model.createAtPath(baseDir + initialName + "/");
}
return model.createAtPath(baseDir + initial... | javascript | function createNewItem(baseDir, initialName, skipRename, isFolder) {
baseDir = model.getDirectoryInProject(baseDir);
if (skipRename) {
if(isFolder) {
return model.createAtPath(baseDir + initialName + "/");
}
return model.createAtPath(baseDir + initial... | [
"function",
"createNewItem",
"(",
"baseDir",
",",
"initialName",
",",
"skipRename",
",",
"isFolder",
")",
"{",
"baseDir",
"=",
"model",
".",
"getDirectoryInProject",
"(",
"baseDir",
")",
";",
"if",
"(",
"skipRename",
")",
"{",
"if",
"(",
"isFolder",
")",
"... | Create a new item in the current project.
@param baseDir {string|Directory} Full path of the directory where the item should go.
Defaults to the project root if the entry is not valid or not within the project.
@param initialName {string} Initial name for the item
@param skipRename {boolean} If true, don't allow the u... | [
"Create",
"a",
"new",
"item",
"in",
"the",
"current",
"project",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/ProjectManager.js#L1114-L1124 |
2,480 | adobe/brackets | src/project/ProjectManager.js | deleteItem | function deleteItem(entry) {
var result = new $.Deferred();
entry.moveToTrash(function (err) {
if (!err) {
DocumentManager.notifyPathDeleted(entry.fullPath);
result.resolve();
} else {
_showErrorDialog(ERR_TYPE_DELETE, entry.isDire... | javascript | function deleteItem(entry) {
var result = new $.Deferred();
entry.moveToTrash(function (err) {
if (!err) {
DocumentManager.notifyPathDeleted(entry.fullPath);
result.resolve();
} else {
_showErrorDialog(ERR_TYPE_DELETE, entry.isDire... | [
"function",
"deleteItem",
"(",
"entry",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"entry",
".",
"moveToTrash",
"(",
"function",
"(",
"err",
")",
"{",
"if",
"(",
"!",
"err",
")",
"{",
"DocumentManager",
".",
"notifyPa... | Delete file or directore from project
@param {!(File|Directory)} entry File or Directory to delete | [
"Delete",
"file",
"or",
"directore",
"from",
"project"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/ProjectManager.js#L1130-L1145 |
2,481 | adobe/brackets | src/editor/EditorStatusBar.js | _formatCountable | function _formatCountable(number, singularStr, pluralStr) {
return StringUtils.format(number > 1 ? pluralStr : singularStr, number);
} | javascript | function _formatCountable(number, singularStr, pluralStr) {
return StringUtils.format(number > 1 ? pluralStr : singularStr, number);
} | [
"function",
"_formatCountable",
"(",
"number",
",",
"singularStr",
",",
"pluralStr",
")",
"{",
"return",
"StringUtils",
".",
"format",
"(",
"number",
">",
"1",
"?",
"pluralStr",
":",
"singularStr",
",",
"number",
")",
";",
"}"
] | Determine string based on count
@param {number} number Count
@param {string} singularStr Singular string
@param {string} pluralStr Plural string
@return {string} Proper string to use for count | [
"Determine",
"string",
"based",
"on",
"count"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/EditorStatusBar.js#L80-L82 |
2,482 | adobe/brackets | src/editor/EditorStatusBar.js | _updateLanguageInfo | function _updateLanguageInfo(editor) {
var doc = editor.document,
lang = doc.getLanguage();
// Show the current language as button title
languageSelect.$button.text(lang.getName());
} | javascript | function _updateLanguageInfo(editor) {
var doc = editor.document,
lang = doc.getLanguage();
// Show the current language as button title
languageSelect.$button.text(lang.getName());
} | [
"function",
"_updateLanguageInfo",
"(",
"editor",
")",
"{",
"var",
"doc",
"=",
"editor",
".",
"document",
",",
"lang",
"=",
"doc",
".",
"getLanguage",
"(",
")",
";",
"// Show the current language as button title",
"languageSelect",
".",
"$button",
".",
"text",
"... | Update file mode
@param {Editor} editor Current editor | [
"Update",
"file",
"mode"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/EditorStatusBar.js#L88-L94 |
2,483 | adobe/brackets | src/editor/EditorStatusBar.js | _updateFileInfo | function _updateFileInfo(editor) {
var lines = editor.lineCount();
$fileInfo.text(_formatCountable(lines, Strings.STATUSBAR_LINE_COUNT_SINGULAR, Strings.STATUSBAR_LINE_COUNT_PLURAL));
} | javascript | function _updateFileInfo(editor) {
var lines = editor.lineCount();
$fileInfo.text(_formatCountable(lines, Strings.STATUSBAR_LINE_COUNT_SINGULAR, Strings.STATUSBAR_LINE_COUNT_PLURAL));
} | [
"function",
"_updateFileInfo",
"(",
"editor",
")",
"{",
"var",
"lines",
"=",
"editor",
".",
"lineCount",
"(",
")",
";",
"$fileInfo",
".",
"text",
"(",
"_formatCountable",
"(",
"lines",
",",
"Strings",
".",
"STATUSBAR_LINE_COUNT_SINGULAR",
",",
"Strings",
".",
... | Update file information
@param {Editor} editor Current editor | [
"Update",
"file",
"information"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/EditorStatusBar.js#L114-L117 |
2,484 | adobe/brackets | src/editor/EditorStatusBar.js | _updateIndentType | function _updateIndentType(fullPath) {
var indentWithTabs = Editor.getUseTabChar(fullPath);
$indentType.text(indentWithTabs ? Strings.STATUSBAR_TAB_SIZE : Strings.STATUSBAR_SPACES);
$indentType.attr("title", indentWithTabs ? Strings.STATUSBAR_INDENT_TOOLTIP_SPACES : Strings.STATUSBAR_INDENT_TOOL... | javascript | function _updateIndentType(fullPath) {
var indentWithTabs = Editor.getUseTabChar(fullPath);
$indentType.text(indentWithTabs ? Strings.STATUSBAR_TAB_SIZE : Strings.STATUSBAR_SPACES);
$indentType.attr("title", indentWithTabs ? Strings.STATUSBAR_INDENT_TOOLTIP_SPACES : Strings.STATUSBAR_INDENT_TOOL... | [
"function",
"_updateIndentType",
"(",
"fullPath",
")",
"{",
"var",
"indentWithTabs",
"=",
"Editor",
".",
"getUseTabChar",
"(",
"fullPath",
")",
";",
"$indentType",
".",
"text",
"(",
"indentWithTabs",
"?",
"Strings",
".",
"STATUSBAR_TAB_SIZE",
":",
"Strings",
"."... | Update indent type and size
@param {string} fullPath Path to file in current editor | [
"Update",
"indent",
"type",
"and",
"size"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/EditorStatusBar.js#L123-L128 |
2,485 | adobe/brackets | src/editor/EditorStatusBar.js | _toggleIndentType | function _toggleIndentType() {
var current = EditorManager.getActiveEditor(),
fullPath = current && current.document.file.fullPath;
Editor.setUseTabChar(!Editor.getUseTabChar(fullPath), fullPath);
_updateIndentType(fullPath);
_updateIndentSize(fullPath);
} | javascript | function _toggleIndentType() {
var current = EditorManager.getActiveEditor(),
fullPath = current && current.document.file.fullPath;
Editor.setUseTabChar(!Editor.getUseTabChar(fullPath), fullPath);
_updateIndentType(fullPath);
_updateIndentSize(fullPath);
} | [
"function",
"_toggleIndentType",
"(",
")",
"{",
"var",
"current",
"=",
"EditorManager",
".",
"getActiveEditor",
"(",
")",
",",
"fullPath",
"=",
"current",
"&&",
"current",
".",
"document",
".",
"file",
".",
"fullPath",
";",
"Editor",
".",
"setUseTabChar",
"(... | Toggle indent type | [
"Toggle",
"indent",
"type"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/EditorStatusBar.js#L152-L159 |
2,486 | adobe/brackets | src/editor/EditorStatusBar.js | _changeIndentWidth | function _changeIndentWidth(fullPath, value) {
$indentWidthLabel.removeClass("hidden");
$indentWidthInput.addClass("hidden");
// remove all event handlers from the input field
$indentWidthInput.off("blur keyup");
// restore focus to the editor
MainViewManager.focusActiv... | javascript | function _changeIndentWidth(fullPath, value) {
$indentWidthLabel.removeClass("hidden");
$indentWidthInput.addClass("hidden");
// remove all event handlers from the input field
$indentWidthInput.off("blur keyup");
// restore focus to the editor
MainViewManager.focusActiv... | [
"function",
"_changeIndentWidth",
"(",
"fullPath",
",",
"value",
")",
"{",
"$indentWidthLabel",
".",
"removeClass",
"(",
"\"hidden\"",
")",
";",
"$indentWidthInput",
".",
"addClass",
"(",
"\"hidden\"",
")",
";",
"// remove all event handlers from the input field",
"$ind... | Change indent size
@param {string} fullPath Path to file in current editor
@param {string} value Size entered into status bar | [
"Change",
"indent",
"size"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/EditorStatusBar.js#L207-L233 |
2,487 | adobe/brackets | src/editor/EditorStatusBar.js | _onActiveEditorChange | function _onActiveEditorChange(event, current, previous) {
if (previous) {
previous.off(".statusbar");
previous.document.off(".statusbar");
previous.document.releaseRef();
}
if (!current) {
StatusBar.hideAllPanes();
} else {
va... | javascript | function _onActiveEditorChange(event, current, previous) {
if (previous) {
previous.off(".statusbar");
previous.document.off(".statusbar");
previous.document.releaseRef();
}
if (!current) {
StatusBar.hideAllPanes();
} else {
va... | [
"function",
"_onActiveEditorChange",
"(",
"event",
",",
"current",
",",
"previous",
")",
"{",
"if",
"(",
"previous",
")",
"{",
"previous",
".",
"off",
"(",
"\".statusbar\"",
")",
";",
"previous",
".",
"document",
".",
"off",
"(",
"\".statusbar\"",
")",
";"... | Handle active editor change event
@param {Event} event (unused)
@param {Editor} current Current editor
@param {Editor} previous Previous editor | [
"Handle",
"active",
"editor",
"change",
"event"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/EditorStatusBar.js#L283-L320 |
2,488 | adobe/brackets | src/editor/EditorStatusBar.js | _populateLanguageDropdown | function _populateLanguageDropdown() {
// Get all non-binary languages
var languages = _.values(LanguageManager.getLanguages()).filter(function (language) {
return !language.isBinary();
});
// sort dropdown alphabetically
languages.sort(function (a, b) {
... | javascript | function _populateLanguageDropdown() {
// Get all non-binary languages
var languages = _.values(LanguageManager.getLanguages()).filter(function (language) {
return !language.isBinary();
});
// sort dropdown alphabetically
languages.sort(function (a, b) {
... | [
"function",
"_populateLanguageDropdown",
"(",
")",
"{",
"// Get all non-binary languages",
"var",
"languages",
"=",
"_",
".",
"values",
"(",
"LanguageManager",
".",
"getLanguages",
"(",
")",
")",
".",
"filter",
"(",
"function",
"(",
"language",
")",
"{",
"return... | Populate the languageSelect DropdownButton's menu with all registered Languages | [
"Populate",
"the",
"languageSelect",
"DropdownButton",
"s",
"menu",
"with",
"all",
"registered",
"Languages"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/EditorStatusBar.js#L325-L341 |
2,489 | adobe/brackets | src/editor/EditorStatusBar.js | _changeEncodingAndReloadDoc | function _changeEncodingAndReloadDoc(document) {
var promise = document.reload();
promise.done(function (text, readTimestamp) {
encodingSelect.$button.text(document.file._encoding);
// Store the preferred encoding in the state
var projectRoot = ProjectManager.getProje... | javascript | function _changeEncodingAndReloadDoc(document) {
var promise = document.reload();
promise.done(function (text, readTimestamp) {
encodingSelect.$button.text(document.file._encoding);
// Store the preferred encoding in the state
var projectRoot = ProjectManager.getProje... | [
"function",
"_changeEncodingAndReloadDoc",
"(",
"document",
")",
"{",
"var",
"promise",
"=",
"document",
".",
"reload",
"(",
")",
";",
"promise",
".",
"done",
"(",
"function",
"(",
"text",
",",
"readTimestamp",
")",
"{",
"encodingSelect",
".",
"$button",
"."... | Change the encoding and reload the current document.
If passed then save the preferred encoding in state. | [
"Change",
"the",
"encoding",
"and",
"reload",
"the",
"current",
"document",
".",
"If",
"passed",
"then",
"save",
"the",
"preferred",
"encoding",
"in",
"state",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/EditorStatusBar.js#L347-L367 |
2,490 | adobe/brackets | src/extensions/default/QuickOpenJavaScript/main.js | createFunctionList | function createFunctionList() {
var doc = DocumentManager.getCurrentDocument();
if (!doc) {
return;
}
var functionList = [];
var docText = doc.getText();
var lines = docText.split("\n");
var functions = JSUtils.findAllMatchingFunctionsInText(docText, ... | javascript | function createFunctionList() {
var doc = DocumentManager.getCurrentDocument();
if (!doc) {
return;
}
var functionList = [];
var docText = doc.getText();
var lines = docText.split("\n");
var functions = JSUtils.findAllMatchingFunctionsInText(docText, ... | [
"function",
"createFunctionList",
"(",
")",
"{",
"var",
"doc",
"=",
"DocumentManager",
".",
"getCurrentDocument",
"(",
")",
";",
"if",
"(",
"!",
"doc",
")",
"{",
"return",
";",
"}",
"var",
"functionList",
"=",
"[",
"]",
";",
"var",
"docText",
"=",
"doc... | Contains a list of information about functions for a single document.
@return {?Array.<FileLocation>} | [
"Contains",
"a",
"list",
"of",
"information",
"about",
"functions",
"for",
"a",
"single",
"document",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/QuickOpenJavaScript/main.js#L57-L71 |
2,491 | adobe/brackets | src/extensions/default/CodeFolding/main.js | rangeEqualsSelection | function rangeEqualsSelection(range, selection) {
return range.from.line === selection.start.line && range.from.ch === selection.start.ch &&
range.to.line === selection.end.line && range.to.ch === selection.end.ch;
} | javascript | function rangeEqualsSelection(range, selection) {
return range.from.line === selection.start.line && range.from.ch === selection.start.ch &&
range.to.line === selection.end.line && range.to.ch === selection.end.ch;
} | [
"function",
"rangeEqualsSelection",
"(",
"range",
",",
"selection",
")",
"{",
"return",
"range",
".",
"from",
".",
"line",
"===",
"selection",
".",
"start",
".",
"line",
"&&",
"range",
".",
"from",
".",
"ch",
"===",
"selection",
".",
"start",
".",
"ch",
... | Checks if the range from and to Pos is the same as the selection start and end Pos
@param {Object} range {from, to} where from and to are CodeMirror.Pos objects
@param {Object} selection {start, end} where start and end are CodeMirror.Pos objects
@returns {Boolean} true if the range and selection span the sam... | [
"Checks",
"if",
"the",
"range",
"from",
"and",
"to",
"Pos",
"is",
"the",
"same",
"as",
"the",
"selection",
"start",
"and",
"end",
"Pos"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/main.js#L98-L101 |
2,492 | adobe/brackets | src/extensions/default/CodeFolding/main.js | isInViewStateSelection | function isInViewStateSelection(range, viewState) {
if (!viewState || !viewState.selections) {
return false;
}
return viewState.selections.some(function (selection) {
return rangeEqualsSelection(range, selection);
});
} | javascript | function isInViewStateSelection(range, viewState) {
if (!viewState || !viewState.selections) {
return false;
}
return viewState.selections.some(function (selection) {
return rangeEqualsSelection(range, selection);
});
} | [
"function",
"isInViewStateSelection",
"(",
"range",
",",
"viewState",
")",
"{",
"if",
"(",
"!",
"viewState",
"||",
"!",
"viewState",
".",
"selections",
")",
"{",
"return",
"false",
";",
"}",
"return",
"viewState",
".",
"selections",
".",
"some",
"(",
"func... | Checks if the range is equal to one of the selections in the viewState
@param {Object} range {from, to} where from and to are CodeMirror.Pos objects.
@param {Object} viewState The current editor's ViewState object
@returns {Boolean} true if the range is found in the list of selections or false if not. | [
"Checks",
"if",
"the",
"range",
"is",
"equal",
"to",
"one",
"of",
"the",
"selections",
"in",
"the",
"viewState"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/main.js#L109-L117 |
2,493 | adobe/brackets | src/extensions/default/CodeFolding/main.js | saveLineFolds | function saveLineFolds(editor) {
var saveFolds = prefs.getSetting("saveFoldStates");
if (!editor || !saveFolds) {
return;
}
var folds = editor._codeMirror._lineFolds || {};
var path = editor.document.file.fullPath;
if (Object.keys(folds).length) {
... | javascript | function saveLineFolds(editor) {
var saveFolds = prefs.getSetting("saveFoldStates");
if (!editor || !saveFolds) {
return;
}
var folds = editor._codeMirror._lineFolds || {};
var path = editor.document.file.fullPath;
if (Object.keys(folds).length) {
... | [
"function",
"saveLineFolds",
"(",
"editor",
")",
"{",
"var",
"saveFolds",
"=",
"prefs",
".",
"getSetting",
"(",
"\"saveFoldStates\"",
")",
";",
"if",
"(",
"!",
"editor",
"||",
"!",
"saveFolds",
")",
"{",
"return",
";",
"}",
"var",
"folds",
"=",
"editor",... | Saves the line folds in the editor using the preference storage
@param {Editor} editor the editor whose line folds should be saved | [
"Saves",
"the",
"line",
"folds",
"in",
"the",
"editor",
"using",
"the",
"preference",
"storage"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/main.js#L159-L171 |
2,494 | adobe/brackets | src/extensions/default/CodeFolding/main.js | collapseCurrent | function collapseCurrent() {
var editor = EditorManager.getFocusedEditor();
if (!editor) {
return;
}
var cm = editor._codeMirror;
var cursor = editor.getCursorPos(), i;
// Move cursor up until a collapsible line is found
for (i = cursor.line; i >= 0; i... | javascript | function collapseCurrent() {
var editor = EditorManager.getFocusedEditor();
if (!editor) {
return;
}
var cm = editor._codeMirror;
var cursor = editor.getCursorPos(), i;
// Move cursor up until a collapsible line is found
for (i = cursor.line; i >= 0; i... | [
"function",
"collapseCurrent",
"(",
")",
"{",
"var",
"editor",
"=",
"EditorManager",
".",
"getFocusedEditor",
"(",
")",
";",
"if",
"(",
"!",
"editor",
")",
"{",
"return",
";",
"}",
"var",
"cm",
"=",
"editor",
".",
"_codeMirror",
";",
"var",
"cursor",
"... | Collapses the code region nearest the current cursor position.
Nearest is found by searching from the current line and moving up the document until an
opening code-folding region is found. | [
"Collapses",
"the",
"code",
"region",
"nearest",
"the",
"current",
"cursor",
"position",
".",
"Nearest",
"is",
"found",
"by",
"searching",
"from",
"the",
"current",
"line",
"and",
"moving",
"up",
"the",
"document",
"until",
"an",
"opening",
"code",
"-",
"fol... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/main.js#L211-L225 |
2,495 | adobe/brackets | src/extensions/default/CodeFolding/main.js | expandCurrent | function expandCurrent() {
var editor = EditorManager.getFocusedEditor();
if (editor) {
var cursor = editor.getCursorPos(), cm = editor._codeMirror;
cm.unfoldCode(cursor.line);
}
} | javascript | function expandCurrent() {
var editor = EditorManager.getFocusedEditor();
if (editor) {
var cursor = editor.getCursorPos(), cm = editor._codeMirror;
cm.unfoldCode(cursor.line);
}
} | [
"function",
"expandCurrent",
"(",
")",
"{",
"var",
"editor",
"=",
"EditorManager",
".",
"getFocusedEditor",
"(",
")",
";",
"if",
"(",
"editor",
")",
"{",
"var",
"cursor",
"=",
"editor",
".",
"getCursorPos",
"(",
")",
",",
"cm",
"=",
"editor",
".",
"_co... | Expands the code region at the current cursor position. | [
"Expands",
"the",
"code",
"region",
"at",
"the",
"current",
"cursor",
"position",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/main.js#L230-L236 |
2,496 | adobe/brackets | src/extensions/default/CodeFolding/main.js | expandAll | function expandAll() {
var editor = EditorManager.getFocusedEditor();
if (editor) {
var cm = editor._codeMirror;
CodeMirror.commands.unfoldAll(cm);
}
} | javascript | function expandAll() {
var editor = EditorManager.getFocusedEditor();
if (editor) {
var cm = editor._codeMirror;
CodeMirror.commands.unfoldAll(cm);
}
} | [
"function",
"expandAll",
"(",
")",
"{",
"var",
"editor",
"=",
"EditorManager",
".",
"getFocusedEditor",
"(",
")",
";",
"if",
"(",
"editor",
")",
"{",
"var",
"cm",
"=",
"editor",
".",
"_codeMirror",
";",
"CodeMirror",
".",
"commands",
".",
"unfoldAll",
"(... | Expands all folded regions in the current document | [
"Expands",
"all",
"folded",
"regions",
"in",
"the",
"current",
"document"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/main.js#L262-L268 |
2,497 | adobe/brackets | src/extensions/default/CodeFolding/main.js | setupGutterEventListeners | function setupGutterEventListeners(editor) {
var cm = editor._codeMirror;
$(editor.getRootElement()).addClass("folding-enabled");
cm.setOption("foldGutter", {onGutterClick: onGutterClick});
$(cm.getGutterElement()).on({
mouseenter: function () {
if (prefs.get... | javascript | function setupGutterEventListeners(editor) {
var cm = editor._codeMirror;
$(editor.getRootElement()).addClass("folding-enabled");
cm.setOption("foldGutter", {onGutterClick: onGutterClick});
$(cm.getGutterElement()).on({
mouseenter: function () {
if (prefs.get... | [
"function",
"setupGutterEventListeners",
"(",
"editor",
")",
"{",
"var",
"cm",
"=",
"editor",
".",
"_codeMirror",
";",
"$",
"(",
"editor",
".",
"getRootElement",
"(",
")",
")",
".",
"addClass",
"(",
"\"folding-enabled\"",
")",
";",
"cm",
".",
"setOption",
... | Renders and sets up event listeners the code-folding gutter.
@param {Editor} editor the editor on which to initialise the fold gutter | [
"Renders",
"and",
"sets",
"up",
"event",
"listeners",
"the",
"code",
"-",
"folding",
"gutter",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/main.js#L288-L309 |
2,498 | adobe/brackets | src/extensions/default/CodeFolding/main.js | removeGutters | function removeGutters(editor) {
Editor.unregisterGutter(GUTTER_NAME);
$(editor.getRootElement()).removeClass("folding-enabled");
CodeMirror.defineOption("foldGutter", false, null);
} | javascript | function removeGutters(editor) {
Editor.unregisterGutter(GUTTER_NAME);
$(editor.getRootElement()).removeClass("folding-enabled");
CodeMirror.defineOption("foldGutter", false, null);
} | [
"function",
"removeGutters",
"(",
"editor",
")",
"{",
"Editor",
".",
"unregisterGutter",
"(",
"GUTTER_NAME",
")",
";",
"$",
"(",
"editor",
".",
"getRootElement",
"(",
")",
")",
".",
"removeClass",
"(",
"\"folding-enabled\"",
")",
";",
"CodeMirror",
".",
"def... | Remove the fold gutter for a given CodeMirror instance.
@param {Editor} editor the editor instance whose gutter should be removed | [
"Remove",
"the",
"fold",
"gutter",
"for",
"a",
"given",
"CodeMirror",
"instance",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/main.js#L315-L319 |
2,499 | adobe/brackets | src/extensions/default/CodeFolding/main.js | onActiveEditorChanged | function onActiveEditorChanged(event, current, previous) {
if (current && !current._codeMirror._lineFolds) {
enableFoldingInEditor(current);
}
if (previous) {
saveLineFolds(previous);
}
} | javascript | function onActiveEditorChanged(event, current, previous) {
if (current && !current._codeMirror._lineFolds) {
enableFoldingInEditor(current);
}
if (previous) {
saveLineFolds(previous);
}
} | [
"function",
"onActiveEditorChanged",
"(",
"event",
",",
"current",
",",
"previous",
")",
"{",
"if",
"(",
"current",
"&&",
"!",
"current",
".",
"_codeMirror",
".",
"_lineFolds",
")",
"{",
"enableFoldingInEditor",
"(",
"current",
")",
";",
"}",
"if",
"(",
"p... | When a brand new editor is seen, initialise fold-gutter and restore line folds in it.
Save line folds in departing editor in case it's getting closed.
@param {object} event the event object
@param {Editor} current the current editor
@param {Editor} previous the previous editor | [
"When",
"a",
"brand",
"new",
"editor",
"is",
"seen",
"initialise",
"fold",
"-",
"gutter",
"and",
"restore",
"line",
"folds",
"in",
"it",
".",
"Save",
"line",
"folds",
"in",
"departing",
"editor",
"in",
"case",
"it",
"s",
"getting",
"closed",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/main.js#L338-L345 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.