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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
1,800 | adobe/brackets | src/language/CodeInspection.js | getProvidersForLanguageId | function getProvidersForLanguageId(languageId) {
var result = [];
if (_providers[languageId]) {
result = result.concat(_providers[languageId]);
}
if (_providers['*']) {
result = result.concat(_providers['*']);
}
return result;
} | javascript | function getProvidersForLanguageId(languageId) {
var result = [];
if (_providers[languageId]) {
result = result.concat(_providers[languageId]);
}
if (_providers['*']) {
result = result.concat(_providers['*']);
}
return result;
} | [
"function",
"getProvidersForLanguageId",
"(",
"languageId",
")",
"{",
"var",
"result",
"=",
"[",
"]",
";",
"if",
"(",
"_providers",
"[",
"languageId",
"]",
")",
"{",
"result",
"=",
"result",
".",
"concat",
"(",
"_providers",
"[",
"languageId",
"]",
")",
... | Returns a list of providers registered for given languageId through register function | [
"Returns",
"a",
"list",
"of",
"providers",
"registered",
"for",
"given",
"languageId",
"through",
"register",
"function"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/CodeInspection.js#L519-L528 |
1,801 | adobe/brackets | src/language/CodeInspection.js | updateListeners | function updateListeners() {
if (_enabled) {
// register our event listeners
MainViewManager
.on("currentFileChange.codeInspection", function () {
run();
});
DocumentManager
.on("currentDocumentLanguageChange... | javascript | function updateListeners() {
if (_enabled) {
// register our event listeners
MainViewManager
.on("currentFileChange.codeInspection", function () {
run();
});
DocumentManager
.on("currentDocumentLanguageChange... | [
"function",
"updateListeners",
"(",
")",
"{",
"if",
"(",
"_enabled",
")",
"{",
"// register our event listeners",
"MainViewManager",
".",
"on",
"(",
"\"currentFileChange.codeInspection\"",
",",
"function",
"(",
")",
"{",
"run",
"(",
")",
";",
"}",
")",
";",
"D... | Update DocumentManager listeners. | [
"Update",
"DocumentManager",
"listeners",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/CodeInspection.js#L533-L553 |
1,802 | adobe/brackets | src/language/CodeInspection.js | toggleEnabled | function toggleEnabled(enabled, doNotSave) {
if (enabled === undefined) {
enabled = !_enabled;
}
// Take no action when there is no change.
if (enabled === _enabled) {
return;
}
_enabled = enabled;
CommandManager.get(Commands.VIEW_TOGGLE... | javascript | function toggleEnabled(enabled, doNotSave) {
if (enabled === undefined) {
enabled = !_enabled;
}
// Take no action when there is no change.
if (enabled === _enabled) {
return;
}
_enabled = enabled;
CommandManager.get(Commands.VIEW_TOGGLE... | [
"function",
"toggleEnabled",
"(",
"enabled",
",",
"doNotSave",
")",
"{",
"if",
"(",
"enabled",
"===",
"undefined",
")",
"{",
"enabled",
"=",
"!",
"_enabled",
";",
"}",
"// Take no action when there is no change.",
"if",
"(",
"enabled",
"===",
"_enabled",
")",
... | Enable or disable all inspection.
@param {?boolean} enabled Enabled state. If omitted, the state is toggled.
@param {?boolean} doNotSave true if the preference should not be saved to user settings. This is generally for events triggered by project-level settings. | [
"Enable",
"or",
"disable",
"all",
"inspection",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/CodeInspection.js#L560-L581 |
1,803 | adobe/brackets | src/editor/EditorCommandHandlers.js | _firstNotWs | function _firstNotWs(doc, lineNum) {
var text = doc.getLine(lineNum);
if (text === null || text === undefined) {
return 0;
}
return text.search(/\S|$/);
} | javascript | function _firstNotWs(doc, lineNum) {
var text = doc.getLine(lineNum);
if (text === null || text === undefined) {
return 0;
}
return text.search(/\S|$/);
} | [
"function",
"_firstNotWs",
"(",
"doc",
",",
"lineNum",
")",
"{",
"var",
"text",
"=",
"doc",
".",
"getLine",
"(",
"lineNum",
")",
";",
"if",
"(",
"text",
"===",
"null",
"||",
"text",
"===",
"undefined",
")",
"{",
"return",
"0",
";",
"}",
"return",
"... | Return the column of the first non whitespace char in the given line.
@private
@param {!Document} doc
@param {number} lineNum
@returns {number} the column index or null | [
"Return",
"the",
"column",
"of",
"the",
"first",
"non",
"whitespace",
"char",
"in",
"the",
"given",
"line",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/EditorCommandHandlers.js#L308-L315 |
1,804 | adobe/brackets | src/extensions/default/InlineTimingFunctionEditor/main.js | prepareEditorForProvider | function prepareEditorForProvider(hostEditor, pos) {
var cursorLine, sel, startPos, endPos, startBookmark, endBookmark, currentMatch,
cm = hostEditor._codeMirror;
sel = hostEditor.getSelection();
if (sel.start.line !== sel.end.line) {
return {timingFunction: null, reason... | javascript | function prepareEditorForProvider(hostEditor, pos) {
var cursorLine, sel, startPos, endPos, startBookmark, endBookmark, currentMatch,
cm = hostEditor._codeMirror;
sel = hostEditor.getSelection();
if (sel.start.line !== sel.end.line) {
return {timingFunction: null, reason... | [
"function",
"prepareEditorForProvider",
"(",
"hostEditor",
",",
"pos",
")",
"{",
"var",
"cursorLine",
",",
"sel",
",",
"startPos",
",",
"endPos",
",",
"startBookmark",
",",
"endBookmark",
",",
"currentMatch",
",",
"cm",
"=",
"hostEditor",
".",
"_codeMirror",
"... | Functions
Prepare hostEditor for an InlineTimingFunctionEditor at pos if possible.
Return editor context if so; otherwise null.
@param {Editor} hostEditor
@param {{line:Number, ch:Number}} pos
@return {timingFunction:{?string}, reason:{?string}, start:{?TextMarker}, end:{?TextMarker}} | [
"Functions",
"Prepare",
"hostEditor",
"for",
"an",
"InlineTimingFunctionEditor",
"at",
"pos",
"if",
"possible",
".",
"Return",
"editor",
"context",
"if",
"so",
";",
"otherwise",
"null",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/main.js#L68-L122 |
1,805 | adobe/brackets | src/project/WorkingSetView.js | refresh | function refresh(rebuild) {
_.forEach(_views, function (view) {
var top = view.$openFilesContainer.scrollTop();
if (rebuild) {
view._rebuildViewList(true);
} else {
view._redraw();
}
view.$openFilesContainer.scrollTop(to... | javascript | function refresh(rebuild) {
_.forEach(_views, function (view) {
var top = view.$openFilesContainer.scrollTop();
if (rebuild) {
view._rebuildViewList(true);
} else {
view._redraw();
}
view.$openFilesContainer.scrollTop(to... | [
"function",
"refresh",
"(",
"rebuild",
")",
"{",
"_",
".",
"forEach",
"(",
"_views",
",",
"function",
"(",
"view",
")",
"{",
"var",
"top",
"=",
"view",
".",
"$openFilesContainer",
".",
"scrollTop",
"(",
")",
";",
"if",
"(",
"rebuild",
")",
"{",
"view... | Refreshes all Pane View List Views | [
"Refreshes",
"all",
"Pane",
"View",
"List",
"Views"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/WorkingSetView.js#L120-L130 |
1,806 | adobe/brackets | src/project/WorkingSetView.js | _updateListItemSelection | function _updateListItemSelection(listItem, selectedFile) {
var shouldBeSelected = (selectedFile && $(listItem).data(_FILE_KEY).fullPath === selectedFile.fullPath);
ViewUtils.toggleClass($(listItem), "selected", shouldBeSelected);
} | javascript | function _updateListItemSelection(listItem, selectedFile) {
var shouldBeSelected = (selectedFile && $(listItem).data(_FILE_KEY).fullPath === selectedFile.fullPath);
ViewUtils.toggleClass($(listItem), "selected", shouldBeSelected);
} | [
"function",
"_updateListItemSelection",
"(",
"listItem",
",",
"selectedFile",
")",
"{",
"var",
"shouldBeSelected",
"=",
"(",
"selectedFile",
"&&",
"$",
"(",
"listItem",
")",
".",
"data",
"(",
"_FILE_KEY",
")",
".",
"fullPath",
"===",
"selectedFile",
".",
"full... | Updates the appearance of the list element based on the parameters provided.
@private
@param {!HTMLLIElement} listElement
@param {?File} selectedFile | [
"Updates",
"the",
"appearance",
"of",
"the",
"list",
"element",
"based",
"on",
"the",
"parameters",
"provided",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/WorkingSetView.js#L147-L150 |
1,807 | adobe/brackets | src/project/WorkingSetView.js | _isOpenAndDirty | function _isOpenAndDirty(file) {
// working set item might never have been opened; if so, then it's definitely not dirty
var docIfOpen = DocumentManager.getOpenDocumentForPath(file.fullPath);
return (docIfOpen && docIfOpen.isDirty);
} | javascript | function _isOpenAndDirty(file) {
// working set item might never have been opened; if so, then it's definitely not dirty
var docIfOpen = DocumentManager.getOpenDocumentForPath(file.fullPath);
return (docIfOpen && docIfOpen.isDirty);
} | [
"function",
"_isOpenAndDirty",
"(",
"file",
")",
"{",
"// working set item might never have been opened; if so, then it's definitely not dirty",
"var",
"docIfOpen",
"=",
"DocumentManager",
".",
"getOpenDocumentForPath",
"(",
"file",
".",
"fullPath",
")",
";",
"return",
"(",
... | Determines if a file is dirty
@private
@param {!File} file - file to test
@return {boolean} true if the file is dirty, false otherwise | [
"Determines",
"if",
"a",
"file",
"is",
"dirty"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/WorkingSetView.js#L158-L162 |
1,808 | adobe/brackets | src/project/WorkingSetView.js | _suppressScrollShadowsOnAllViews | function _suppressScrollShadowsOnAllViews(disable) {
_.forEach(_views, function (view) {
if (disable) {
ViewUtils.removeScrollerShadow(view.$openFilesContainer[0], null);
} else if (view.$openFilesContainer[0].scrollHeight > view.$openFilesContainer[0].clientHeight) {
... | javascript | function _suppressScrollShadowsOnAllViews(disable) {
_.forEach(_views, function (view) {
if (disable) {
ViewUtils.removeScrollerShadow(view.$openFilesContainer[0], null);
} else if (view.$openFilesContainer[0].scrollHeight > view.$openFilesContainer[0].clientHeight) {
... | [
"function",
"_suppressScrollShadowsOnAllViews",
"(",
"disable",
")",
"{",
"_",
".",
"forEach",
"(",
"_views",
",",
"function",
"(",
"view",
")",
"{",
"if",
"(",
"disable",
")",
"{",
"ViewUtils",
".",
"removeScrollerShadow",
"(",
"view",
".",
"$openFilesContain... | turns off the scroll shadow on view containers so they don't interfere with dragging
@private
@param {Boolean} disable - true to disable, false to enable | [
"turns",
"off",
"the",
"scroll",
"shadow",
"on",
"view",
"containers",
"so",
"they",
"don",
"t",
"interfere",
"with",
"dragging"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/WorkingSetView.js#L188-L196 |
1,809 | adobe/brackets | src/project/WorkingSetView.js | _deactivateAllViews | function _deactivateAllViews(deactivate) {
_.forEach(_views, function (view) {
if (deactivate) {
if (view.$el.hasClass("active")) {
view.$el.removeClass("active").addClass("reactivate");
view.$openFilesList.trigger("selectionHide");
... | javascript | function _deactivateAllViews(deactivate) {
_.forEach(_views, function (view) {
if (deactivate) {
if (view.$el.hasClass("active")) {
view.$el.removeClass("active").addClass("reactivate");
view.$openFilesList.trigger("selectionHide");
... | [
"function",
"_deactivateAllViews",
"(",
"deactivate",
")",
"{",
"_",
".",
"forEach",
"(",
"_views",
",",
"function",
"(",
"view",
")",
"{",
"if",
"(",
"deactivate",
")",
"{",
"if",
"(",
"view",
".",
"$el",
".",
"hasClass",
"(",
"\"active\"",
")",
")",
... | Deactivates all views so the selection marker does not show
@private
@param {Boolean} deactivate - true to deactivate, false to reactivate | [
"Deactivates",
"all",
"views",
"so",
"the",
"selection",
"marker",
"does",
"not",
"show"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/WorkingSetView.js#L203-L218 |
1,810 | adobe/brackets | src/project/WorkingSetView.js | _viewFromEl | function _viewFromEl($el) {
if (!$el.hasClass("working-set-view")) {
$el = $el.parents(".working-set-view");
}
var id = $el.attr("id").match(/working\-set\-list\-([\w]+[\w\d\-\.\:\_]*)/).pop();
return _views[id];
} | javascript | function _viewFromEl($el) {
if (!$el.hasClass("working-set-view")) {
$el = $el.parents(".working-set-view");
}
var id = $el.attr("id").match(/working\-set\-list\-([\w]+[\w\d\-\.\:\_]*)/).pop();
return _views[id];
} | [
"function",
"_viewFromEl",
"(",
"$el",
")",
"{",
"if",
"(",
"!",
"$el",
".",
"hasClass",
"(",
"\"working-set-view\"",
")",
")",
"{",
"$el",
"=",
"$el",
".",
"parents",
"(",
"\".working-set-view\"",
")",
";",
"}",
"var",
"id",
"=",
"$el",
".",
"attr",
... | Finds the WorkingSetView object for the specified element
@private
@param {jQuery} $el - the element to find the view for
@return {View} view object | [
"Finds",
"the",
"WorkingSetView",
"object",
"for",
"the",
"specified",
"element"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/WorkingSetView.js#L226-L233 |
1,811 | adobe/brackets | src/project/WorkingSetView.js | scroll | function scroll($container, $el, dir, callback) {
var container = $container[0],
maxScroll = container.scrollHeight - container.clientHeight;
if (maxScroll && dir && !interval) {
// Scroll view if the mouse is over the first or last pixels of the container
... | javascript | function scroll($container, $el, dir, callback) {
var container = $container[0],
maxScroll = container.scrollHeight - container.clientHeight;
if (maxScroll && dir && !interval) {
// Scroll view if the mouse is over the first or last pixels of the container
... | [
"function",
"scroll",
"(",
"$container",
",",
"$el",
",",
"dir",
",",
"callback",
")",
"{",
"var",
"container",
"=",
"$container",
"[",
"0",
"]",
",",
"maxScroll",
"=",
"container",
".",
"scrollHeight",
"-",
"container",
".",
"clientHeight",
";",
"if",
"... | We scroll the list while hovering over the first or last visible list element in the working set, so that positioning a working set item before or after one that has been scrolled out of view can be performed. This function will call the drag interface repeatedly on an interval to allow the item to be dragged while sc... | [
"We",
"scroll",
"the",
"list",
"while",
"hovering",
"over",
"the",
"first",
"or",
"last",
"visible",
"list",
"element",
"in",
"the",
"working",
"set",
"so",
"that",
"positioning",
"a",
"working",
"set",
"item",
"before",
"or",
"after",
"one",
"that",
"has"... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/WorkingSetView.js#L259-L274 |
1,812 | adobe/brackets | src/project/WorkingSetView.js | preDropCleanup | function preDropCleanup() {
window.onmousewheel = window.document.onmousewheel = null;
$(window).off(".wsvdragging");
if (dragged) {
$workingFilesContainer.removeClass("dragging");
$workingFilesContainer.find(".drag-show-as-selected... | javascript | function preDropCleanup() {
window.onmousewheel = window.document.onmousewheel = null;
$(window).off(".wsvdragging");
if (dragged) {
$workingFilesContainer.removeClass("dragging");
$workingFilesContainer.find(".drag-show-as-selected... | [
"function",
"preDropCleanup",
"(",
")",
"{",
"window",
".",
"onmousewheel",
"=",
"window",
".",
"document",
".",
"onmousewheel",
"=",
"null",
";",
"$",
"(",
"window",
")",
".",
"off",
"(",
"\".wsvdragging\"",
")",
";",
"if",
"(",
"dragged",
")",
"{",
"... | Close down the drag operation | [
"Close",
"down",
"the",
"drag",
"operation"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/WorkingSetView.js#L722-L739 |
1,813 | adobe/brackets | src/project/WorkingSetView.js | createWorkingSetViewForPane | function createWorkingSetViewForPane($container, paneId) {
var view = _views[paneId];
if (!view) {
view = new WorkingSetView($container, paneId);
_views[view.paneId] = view;
}
} | javascript | function createWorkingSetViewForPane($container, paneId) {
var view = _views[paneId];
if (!view) {
view = new WorkingSetView($container, paneId);
_views[view.paneId] = view;
}
} | [
"function",
"createWorkingSetViewForPane",
"(",
"$container",
",",
"paneId",
")",
"{",
"var",
"view",
"=",
"_views",
"[",
"paneId",
"]",
";",
"if",
"(",
"!",
"view",
")",
"{",
"view",
"=",
"new",
"WorkingSetView",
"(",
"$container",
",",
"paneId",
")",
"... | Creates a new WorkingSetView object for the specified pane
@param {!jQuery} $container - the WorkingSetView's DOM parent node
@param {!string} paneId - the id of the pane the view is being created for | [
"Creates",
"a",
"new",
"WorkingSetView",
"object",
"for",
"the",
"specified",
"pane"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/WorkingSetView.js#L1427-L1433 |
1,814 | adobe/brackets | src/search/QuickOpen.js | _getPluginsForCurrentContext | function _getPluginsForCurrentContext() {
var curDoc = DocumentManager.getCurrentDocument();
if (curDoc) {
var languageId = curDoc.getLanguage().getId();
return _providerRegistrationHandler.getProvidersForLanguageId(languageId);
}
return _providerRegistrationHan... | javascript | function _getPluginsForCurrentContext() {
var curDoc = DocumentManager.getCurrentDocument();
if (curDoc) {
var languageId = curDoc.getLanguage().getId();
return _providerRegistrationHandler.getProvidersForLanguageId(languageId);
}
return _providerRegistrationHan... | [
"function",
"_getPluginsForCurrentContext",
"(",
")",
"{",
"var",
"curDoc",
"=",
"DocumentManager",
".",
"getCurrentDocument",
"(",
")",
";",
"if",
"(",
"curDoc",
")",
"{",
"var",
"languageId",
"=",
"curDoc",
".",
"getLanguage",
"(",
")",
".",
"getId",
"(",
... | Helper function to get the plugins based on the type of the current document.
@private
@returns {Array} Returns the plugings based on the languageId of the current document. | [
"Helper",
"function",
"to",
"get",
"the",
"plugins",
"based",
"on",
"the",
"type",
"of",
"the",
"current",
"document",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/QuickOpen.js#L111-L120 |
1,815 | adobe/brackets | src/search/QuickOpen.js | QuickOpenPlugin | function QuickOpenPlugin(name, languageIds, done, search, match, itemFocus, itemSelect, resultsFormatter, matcherOptions, label) {
this.name = name;
this.languageIds = languageIds;
this.done = done;
this.search = search;
this.match = match;
this.itemFocus = itemFocus;
... | javascript | function QuickOpenPlugin(name, languageIds, done, search, match, itemFocus, itemSelect, resultsFormatter, matcherOptions, label) {
this.name = name;
this.languageIds = languageIds;
this.done = done;
this.search = search;
this.match = match;
this.itemFocus = itemFocus;
... | [
"function",
"QuickOpenPlugin",
"(",
"name",
",",
"languageIds",
",",
"done",
",",
"search",
",",
"match",
",",
"itemFocus",
",",
"itemSelect",
",",
"resultsFormatter",
",",
"matcherOptions",
",",
"label",
")",
"{",
"this",
".",
"name",
"=",
"name",
";",
"t... | Defines API for new QuickOpen plug-ins | [
"Defines",
"API",
"for",
"new",
"QuickOpen",
"plug",
"-",
"ins"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/QuickOpen.js#L125-L136 |
1,816 | adobe/brackets | src/search/QuickOpen.js | addQuickOpenPlugin | function addQuickOpenPlugin(pluginDef) {
var quickOpenProvider = new QuickOpenPlugin(
pluginDef.name,
pluginDef.languageIds,
pluginDef.done,
pluginDef.search,
pluginDef.match,
pluginDef.itemFocus,
plu... | javascript | function addQuickOpenPlugin(pluginDef) {
var quickOpenProvider = new QuickOpenPlugin(
pluginDef.name,
pluginDef.languageIds,
pluginDef.done,
pluginDef.search,
pluginDef.match,
pluginDef.itemFocus,
plu... | [
"function",
"addQuickOpenPlugin",
"(",
"pluginDef",
")",
"{",
"var",
"quickOpenProvider",
"=",
"new",
"QuickOpenPlugin",
"(",
"pluginDef",
".",
"name",
",",
"pluginDef",
".",
"languageIds",
",",
"pluginDef",
".",
"done",
",",
"pluginDef",
".",
"search",
",",
"... | Creates and registers a new QuickOpenPlugin
@param { name: string,
languageIds: !Array.<string>,
done: ?function(),
search: function(string, !StringMatch.StringMatcher):(!Array.<SearchResult|string>|$.Promise),
match: function(string):boolean,
itemFocus: ?function(?SearchResult|string, string, boolean),
itemSelect: fu... | [
"Creates",
"and",
"registers",
"a",
"new",
"QuickOpenPlugin"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/QuickOpen.js#L176-L193 |
1,817 | adobe/brackets | src/search/QuickOpen.js | _filter | function _filter(file) {
return !LanguageManager.getLanguageForPath(file.fullPath).isBinary() ||
MainViewFactory.findSuitableFactoryForPath(file.fullPath);
} | javascript | function _filter(file) {
return !LanguageManager.getLanguageForPath(file.fullPath).isBinary() ||
MainViewFactory.findSuitableFactoryForPath(file.fullPath);
} | [
"function",
"_filter",
"(",
"file",
")",
"{",
"return",
"!",
"LanguageManager",
".",
"getLanguageForPath",
"(",
"file",
".",
"fullPath",
")",
".",
"isBinary",
"(",
")",
"||",
"MainViewFactory",
".",
"findSuitableFactoryForPath",
"(",
"file",
".",
"fullPath",
"... | Return files that are non-binary, or binary files that have a custom viewer | [
"Return",
"files",
"that",
"are",
"non",
"-",
"binary",
"or",
"binary",
"files",
"that",
"have",
"a",
"custom",
"viewer"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/QuickOpen.js#L708-L711 |
1,818 | adobe/brackets | src/JSUtils/node/TernNodeDomain.js | handleGetFile | function handleGetFile(file, text) {
var next = fileCallBacks[file];
if (next) {
try {
next(null, text);
} catch (e) {
_reportError(e, file);
}
}
delete fileCallBacks[file];
} | javascript | function handleGetFile(file, text) {
var next = fileCallBacks[file];
if (next) {
try {
next(null, text);
} catch (e) {
_reportError(e, file);
}
}
delete fileCallBacks[file];
} | [
"function",
"handleGetFile",
"(",
"file",
",",
"text",
")",
"{",
"var",
"next",
"=",
"fileCallBacks",
"[",
"file",
"]",
";",
"if",
"(",
"next",
")",
"{",
"try",
"{",
"next",
"(",
"null",
",",
"text",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
... | Handle a response from the main thread providing the contents of a file
@param {string} file - the name of the file
@param {string} text - the contents of the file | [
"Handle",
"a",
"response",
"from",
"the",
"main",
"thread",
"providing",
"the",
"contents",
"of",
"a",
"file"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/node/TernNodeDomain.js#L90-L100 |
1,819 | adobe/brackets | src/JSUtils/node/TernNodeDomain.js | getFile | function getFile(name, next) {
// save the callback
fileCallBacks[name] = next;
setImmediate(function () {
try {
ExtractContent.extractContent(name, handleGetFile, _requestFileContent);
} catch (error) {
console.log(error);
}
});
} | javascript | function getFile(name, next) {
// save the callback
fileCallBacks[name] = next;
setImmediate(function () {
try {
ExtractContent.extractContent(name, handleGetFile, _requestFileContent);
} catch (error) {
console.log(error);
}
});
} | [
"function",
"getFile",
"(",
"name",
",",
"next",
")",
"{",
"// save the callback",
"fileCallBacks",
"[",
"name",
"]",
"=",
"next",
";",
"setImmediate",
"(",
"function",
"(",
")",
"{",
"try",
"{",
"ExtractContent",
".",
"extractContent",
"(",
"name",
",",
"... | Provide the contents of the requested file to tern
@param {string} name - the name of the file
@param {Function} next - the function to call with the text of the file
once it has been read in. | [
"Provide",
"the",
"contents",
"of",
"the",
"requested",
"file",
"to",
"tern"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/node/TernNodeDomain.js#L133-L144 |
1,820 | adobe/brackets | src/JSUtils/node/TernNodeDomain.js | resetTernServer | function resetTernServer() {
// If a server is already created just reset the analysis data
if (ternServer) {
ternServer.reset();
Infer.resetGuessing();
// tell the main thread we're ready to start processing again
self.postMessage({type: MessageIds.TERN_WORKER_READY});
}
} | javascript | function resetTernServer() {
// If a server is already created just reset the analysis data
if (ternServer) {
ternServer.reset();
Infer.resetGuessing();
// tell the main thread we're ready to start processing again
self.postMessage({type: MessageIds.TERN_WORKER_READY});
}
} | [
"function",
"resetTernServer",
"(",
")",
"{",
"// If a server is already created just reset the analysis data ",
"if",
"(",
"ternServer",
")",
"{",
"ternServer",
".",
"reset",
"(",
")",
";",
"Infer",
".",
"resetGuessing",
"(",
")",
";",
"// tell the main thread we're re... | Resets an existing tern server. | [
"Resets",
"an",
"existing",
"tern",
"server",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/node/TernNodeDomain.js#L179-L187 |
1,821 | adobe/brackets | src/JSUtils/node/TernNodeDomain.js | buildRequest | function buildRequest(fileInfo, query, offset) {
query = {type: query};
query.start = offset;
query.end = offset;
query.file = (fileInfo.type === MessageIds.TERN_FILE_INFO_TYPE_PART) ? "#0" : fileInfo.name;
query.filter = false;
query.sort = false;
query.depths = true;
query.guess = true... | javascript | function buildRequest(fileInfo, query, offset) {
query = {type: query};
query.start = offset;
query.end = offset;
query.file = (fileInfo.type === MessageIds.TERN_FILE_INFO_TYPE_PART) ? "#0" : fileInfo.name;
query.filter = false;
query.sort = false;
query.depths = true;
query.guess = true... | [
"function",
"buildRequest",
"(",
"fileInfo",
",",
"query",
",",
"offset",
")",
"{",
"query",
"=",
"{",
"type",
":",
"query",
"}",
";",
"query",
".",
"start",
"=",
"offset",
";",
"query",
".",
"end",
"=",
"offset",
";",
"query",
".",
"file",
"=",
"(... | Build an object that can be used as a request to tern.
@param {{type: string, name: string, offsetLines: number, text: string}} fileInfo
- type of update, name of file, and the text of the update.
For "full" updates, the whole text of the file is present. For "part" updates,
the changed portion of the text. For "empty... | [
"Build",
"an",
"object",
"that",
"can",
"be",
"used",
"as",
"a",
"request",
"to",
"tern",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/node/TernNodeDomain.js#L215-L239 |
1,822 | adobe/brackets | src/JSUtils/node/TernNodeDomain.js | getRefs | function getRefs(fileInfo, offset) {
var request = buildRequest(fileInfo, "refs", offset);
try {
ternServer.request(request, function (error, data) {
if (error) {
_log("Error returned from Tern 'refs' request: " + error);
var response = {
t... | javascript | function getRefs(fileInfo, offset) {
var request = buildRequest(fileInfo, "refs", offset);
try {
ternServer.request(request, function (error, data) {
if (error) {
_log("Error returned from Tern 'refs' request: " + error);
var response = {
t... | [
"function",
"getRefs",
"(",
"fileInfo",
",",
"offset",
")",
"{",
"var",
"request",
"=",
"buildRequest",
"(",
"fileInfo",
",",
"\"refs\"",
",",
"offset",
")",
";",
"try",
"{",
"ternServer",
".",
"request",
"(",
"request",
",",
"function",
"(",
"error",
",... | Get all References location
@param {{type: string, name: string, offsetLines: number, text: string}} fileInfo
- type of update, name of file, and the text of the update.
For "full" updates, the whole text of the file is present. For "part" updates,
the changed portion of the text. For "empty" updates, the file has not ... | [
"Get",
"all",
"References",
"location"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/node/TernNodeDomain.js#L252-L277 |
1,823 | adobe/brackets | src/JSUtils/node/TernNodeDomain.js | getScopeData | function getScopeData(fileInfo, offset) {
// Create a new tern Server
// Existing tern server resolves all the required modules which might take time
// We only need to analyze single file for getting the scope
ternOptions.plugins = {};
var ternServer = new Tern.Server(ternOptions);
ternServer.a... | javascript | function getScopeData(fileInfo, offset) {
// Create a new tern Server
// Existing tern server resolves all the required modules which might take time
// We only need to analyze single file for getting the scope
ternOptions.plugins = {};
var ternServer = new Tern.Server(ternOptions);
ternServer.a... | [
"function",
"getScopeData",
"(",
"fileInfo",
",",
"offset",
")",
"{",
"// Create a new tern Server",
"// Existing tern server resolves all the required modules which might take time",
"// We only need to analyze single file for getting the scope",
"ternOptions",
".",
"plugins",
"=",
"{... | Get scope at the offset in the file
@param {{type: string, name: string, offsetLines: number, text: string}} fileInfo
- type of update, name of file, and the text of the update.
For "full" updates, the whole text of the file is present. For "part" updates,
the changed portion of the text. For "empty" updates, the file ... | [
"Get",
"scope",
"at",
"the",
"offset",
"in",
"the",
"file"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/node/TernNodeDomain.js#L289-L354 |
1,824 | adobe/brackets | src/JSUtils/node/TernNodeDomain.js | getTernProperties | function getTernProperties(fileInfo, offset, type) {
var request = buildRequest(fileInfo, "properties", offset),
i;
//_log("tern properties: request " + request.type + dir + " " + file);
try {
ternServer.request(request, function (error, data) {
var properties = [];
... | javascript | function getTernProperties(fileInfo, offset, type) {
var request = buildRequest(fileInfo, "properties", offset),
i;
//_log("tern properties: request " + request.type + dir + " " + file);
try {
ternServer.request(request, function (error, data) {
var properties = [];
... | [
"function",
"getTernProperties",
"(",
"fileInfo",
",",
"offset",
",",
"type",
")",
"{",
"var",
"request",
"=",
"buildRequest",
"(",
"fileInfo",
",",
"\"properties\"",
",",
"offset",
")",
",",
"i",
";",
"//_log(\"tern properties: request \" + request.type + dir + \" \"... | Get all the known properties for guessing.
@param {{type: string, name: string, offsetLines: number, text: string}} fileInfo
- type of update, name of file, and the text of the update.
For "full" updates, the whole text of the file is present. For "part" updates,
the changed portion of the text. For "empty" updates, t... | [
"Get",
"all",
"the",
"known",
"properties",
"for",
"guessing",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/node/TernNodeDomain.js#L416-L442 |
1,825 | adobe/brackets | src/JSUtils/node/TernNodeDomain.js | getTernHints | function getTernHints(fileInfo, offset, isProperty) {
var request = buildRequest(fileInfo, "completions", offset),
i;
//_log("request " + dir + " " + file + " " + offset /*+ " " + text */);
try {
ternServer.request(request, function (error, data) {
var completions = [];
... | javascript | function getTernHints(fileInfo, offset, isProperty) {
var request = buildRequest(fileInfo, "completions", offset),
i;
//_log("request " + dir + " " + file + " " + offset /*+ " " + text */);
try {
ternServer.request(request, function (error, data) {
var completions = [];
... | [
"function",
"getTernHints",
"(",
"fileInfo",
",",
"offset",
",",
"isProperty",
")",
"{",
"var",
"request",
"=",
"buildRequest",
"(",
"fileInfo",
",",
"\"completions\"",
",",
"offset",
")",
",",
"i",
";",
"//_log(\"request \" + dir + \" \" + file + \" \" + offset /*+ \... | Get the completions for the given offset
@param {{type: string, name: string, offsetLines: number, text: string}} fileInfo
- type of update, name of file, and the text of the update.
For "full" updates, the whole text of the file is present. For "part" updates,
the changed portion of the text. For "empty" updates, the... | [
"Get",
"the",
"completions",
"for",
"the",
"given",
"offset"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/node/TernNodeDomain.js#L457-L489 |
1,826 | adobe/brackets | src/JSUtils/node/TernNodeDomain.js | inferArrTypeToString | function inferArrTypeToString(inferArrType) {
var result = "Array.<";
result += inferArrType.props["<i>"].types.map(inferTypeToString).join(", ");
// workaround case where types is zero length
if (inferArrType.props["<i>"].types.length === 0) {
result += "Object";
}... | javascript | function inferArrTypeToString(inferArrType) {
var result = "Array.<";
result += inferArrType.props["<i>"].types.map(inferTypeToString).join(", ");
// workaround case where types is zero length
if (inferArrType.props["<i>"].types.length === 0) {
result += "Object";
}... | [
"function",
"inferArrTypeToString",
"(",
"inferArrType",
")",
"{",
"var",
"result",
"=",
"\"Array.<\"",
";",
"result",
"+=",
"inferArrType",
".",
"props",
"[",
"\"<i>\"",
"]",
".",
"types",
".",
"map",
"(",
"inferTypeToString",
")",
".",
"join",
"(",
"\", \"... | Convert an infer array type to a string.
Formatted using google closure style. For example:
"Array.<string, number>"
@param {Infer.Arr} inferArrType
@return {string} - array formatted in google closure style. | [
"Convert",
"an",
"infer",
"array",
"type",
"to",
"a",
"string",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/node/TernNodeDomain.js#L515-L527 |
1,827 | adobe/brackets | src/JSUtils/node/TernNodeDomain.js | handleFunctionType | function handleFunctionType(fileInfo, offset) {
var request = buildRequest(fileInfo, "type", offset),
error;
request.query.preferFunction = true;
var fnType = "";
try {
ternServer.request(request, function (ternError, data) {
if (ternError) {
_log("Error fo... | javascript | function handleFunctionType(fileInfo, offset) {
var request = buildRequest(fileInfo, "type", offset),
error;
request.query.preferFunction = true;
var fnType = "";
try {
ternServer.request(request, function (ternError, data) {
if (ternError) {
_log("Error fo... | [
"function",
"handleFunctionType",
"(",
"fileInfo",
",",
"offset",
")",
"{",
"var",
"request",
"=",
"buildRequest",
"(",
"fileInfo",
",",
"\"type\"",
",",
"offset",
")",
",",
"error",
";",
"request",
".",
"query",
".",
"preferFunction",
"=",
"true",
";",
"v... | Get the function type for the given offset
@param {{type: string, name: string, offsetLines: number, text: string}} fileInfo
- type of update, name of file, and the text of the update.
For "full" updates, the whole text of the file is present. For "part" updates,
the changed portion of the text. For "empty" updates, t... | [
"Get",
"the",
"function",
"type",
"for",
"the",
"given",
"offset"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/node/TernNodeDomain.js#L728-L776 |
1,828 | adobe/brackets | src/JSUtils/node/TernNodeDomain.js | handleUpdateFile | function handleUpdateFile(path, text) {
ternServer.addFile(path, text);
self.postMessage({type: MessageIds.TERN_UPDATE_FILE_MSG,
path: path
});
// reset to get the best hints with the updated file.
ternServer.reset();
Infer.resetGuessing();
} | javascript | function handleUpdateFile(path, text) {
ternServer.addFile(path, text);
self.postMessage({type: MessageIds.TERN_UPDATE_FILE_MSG,
path: path
});
// reset to get the best hints with the updated file.
ternServer.reset();
Infer.resetGuessing();
} | [
"function",
"handleUpdateFile",
"(",
"path",
",",
"text",
")",
"{",
"ternServer",
".",
"addFile",
"(",
"path",
",",
"text",
")",
";",
"self",
".",
"postMessage",
"(",
"{",
"type",
":",
"MessageIds",
".",
"TERN_UPDATE_FILE_MSG",
",",
"path",
":",
"path",
... | Update the context of a file in tern.
@param {string} path - full path of file.
@param {string} text - content of the file. | [
"Update",
"the",
"context",
"of",
"a",
"file",
"in",
"tern",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/node/TernNodeDomain.js#L796-L807 |
1,829 | adobe/brackets | src/JSUtils/node/TernNodeDomain.js | handlePrimePump | function handlePrimePump(path) {
var fileName = _getDenormalizedFilename(path);
var fileInfo = createEmptyUpdate(fileName),
request = buildRequest(fileInfo, "completions", {line: 0, ch: 0});
try {
ternServer.request(request, function (error, data) {
// Post a message back to the... | javascript | function handlePrimePump(path) {
var fileName = _getDenormalizedFilename(path);
var fileInfo = createEmptyUpdate(fileName),
request = buildRequest(fileInfo, "completions", {line: 0, ch: 0});
try {
ternServer.request(request, function (error, data) {
// Post a message back to the... | [
"function",
"handlePrimePump",
"(",
"path",
")",
"{",
"var",
"fileName",
"=",
"_getDenormalizedFilename",
"(",
"path",
")",
";",
"var",
"fileInfo",
"=",
"createEmptyUpdate",
"(",
"fileName",
")",
",",
"request",
"=",
"buildRequest",
"(",
"fileInfo",
",",
"\"co... | Make a completions request to tern to force tern to resolve files
and create a fast first lookup for the user.
@param {string} path - the path of the file | [
"Make",
"a",
"completions",
"request",
"to",
"tern",
"to",
"force",
"tern",
"to",
"resolve",
"files",
"and",
"create",
"a",
"fast",
"first",
"lookup",
"for",
"the",
"user",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/node/TernNodeDomain.js#L814-L829 |
1,830 | adobe/brackets | src/utils/ViewUtils.js | _updateScrollerShadow | function _updateScrollerShadow($displayElement, $scrollElement, $shadowTop, $shadowBottom, isPositionFixed) {
var offsetTop = 0,
scrollElement = $scrollElement.get(0),
scrollTop = scrollElement.scrollTop,
topShadowOffset = Math.min(scrollTop - SC... | javascript | function _updateScrollerShadow($displayElement, $scrollElement, $shadowTop, $shadowBottom, isPositionFixed) {
var offsetTop = 0,
scrollElement = $scrollElement.get(0),
scrollTop = scrollElement.scrollTop,
topShadowOffset = Math.min(scrollTop - SC... | [
"function",
"_updateScrollerShadow",
"(",
"$displayElement",
",",
"$scrollElement",
",",
"$shadowTop",
",",
"$shadowBottom",
",",
"isPositionFixed",
")",
"{",
"var",
"offsetTop",
"=",
"0",
",",
"scrollElement",
"=",
"$scrollElement",
".",
"get",
"(",
"0",
")",
"... | Positions shadow background elements to indicate vertical scrolling.
@param {!DOMElement} $displayElement the DOMElement that displays the shadow
@param {!Object} $scrollElement the object that is scrolled
@param {!DOMElement} $shadowTop div .scroller-shadow.top
@param {!DOMElement} $shadowBottom div .scroller-shadow.b... | [
"Positions",
"shadow",
"background",
"elements",
"to",
"indicate",
"vertical",
"scrolling",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/ViewUtils.js#L45-L79 |
1,831 | adobe/brackets | src/utils/ViewUtils.js | addScrollerShadow | function addScrollerShadow(displayElement, scrollElement, showBottom) {
// use fixed positioning when the display and scroll elements are the same
var isPositionFixed = false;
if (!scrollElement) {
scrollElement = displayElement;
isPositionFixed = true;
}
... | javascript | function addScrollerShadow(displayElement, scrollElement, showBottom) {
// use fixed positioning when the display and scroll elements are the same
var isPositionFixed = false;
if (!scrollElement) {
scrollElement = displayElement;
isPositionFixed = true;
}
... | [
"function",
"addScrollerShadow",
"(",
"displayElement",
",",
"scrollElement",
",",
"showBottom",
")",
"{",
"// use fixed positioning when the display and scroll elements are the same",
"var",
"isPositionFixed",
"=",
"false",
";",
"if",
"(",
"!",
"scrollElement",
")",
"{",
... | Installs event handlers for updatng shadow background elements to indicate vertical scrolling.
@param {!DOMElement} displayElement the DOMElement that displays the shadow. Must fire
"contentChanged" events when the element is resized or repositioned.
@param {?Object} scrollElement the object that is scrolled. Must fire... | [
"Installs",
"event",
"handlers",
"for",
"updatng",
"shadow",
"background",
"elements",
"to",
"indicate",
"vertical",
"scrolling",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/ViewUtils.js#L106-L136 |
1,832 | adobe/brackets | src/utils/ViewUtils.js | removeScrollerShadow | function removeScrollerShadow(displayElement, scrollElement) {
if (!scrollElement) {
scrollElement = displayElement;
}
var $displayElement = $(displayElement),
$scrollElement = $(scrollElement);
// remove scrollerShadow elements from DOM
$displayElement.... | javascript | function removeScrollerShadow(displayElement, scrollElement) {
if (!scrollElement) {
scrollElement = displayElement;
}
var $displayElement = $(displayElement),
$scrollElement = $(scrollElement);
// remove scrollerShadow elements from DOM
$displayElement.... | [
"function",
"removeScrollerShadow",
"(",
"displayElement",
",",
"scrollElement",
")",
"{",
"if",
"(",
"!",
"scrollElement",
")",
"{",
"scrollElement",
"=",
"displayElement",
";",
"}",
"var",
"$displayElement",
"=",
"$",
"(",
"displayElement",
")",
",",
"$scrollE... | Remove scroller-shadow effect.
@param {!DOMElement} displayElement the DOMElement that displays the shadow
@param {?Object} scrollElement the object that is scrolled | [
"Remove",
"scroller",
"-",
"shadow",
"effect",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/ViewUtils.js#L143-L158 |
1,833 | adobe/brackets | src/utils/ViewUtils.js | getElementClipSize | function getElementClipSize($view, elementRect) {
var delta,
clip = { top: 0, right: 0, bottom: 0, left: 0 },
viewOffset = $view.offset() || { top: 0, left: 0};
// Check if element extends below viewport
delta = (elementRect.top + elementRect.height) - (viewOffset.top + ... | javascript | function getElementClipSize($view, elementRect) {
var delta,
clip = { top: 0, right: 0, bottom: 0, left: 0 },
viewOffset = $view.offset() || { top: 0, left: 0};
// Check if element extends below viewport
delta = (elementRect.top + elementRect.height) - (viewOffset.top + ... | [
"function",
"getElementClipSize",
"(",
"$view",
",",
"elementRect",
")",
"{",
"var",
"delta",
",",
"clip",
"=",
"{",
"top",
":",
"0",
",",
"right",
":",
"0",
",",
"bottom",
":",
"0",
",",
"left",
":",
"0",
"}",
",",
"viewOffset",
"=",
"$view",
".",... | Determine how much of an element rect is clipped in view.
@param {!DOMElement} $view - A jQuery scrolling container
@param {!{top: number, left: number, height: number, width: number}}
elementRect - rectangle of element's default position/size
@return {{top: number, right: number, bottom: number, left: number}}
amount... | [
"Determine",
"how",
"much",
"of",
"an",
"element",
"rect",
"is",
"clipped",
"in",
"view",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/ViewUtils.js#L313-L343 |
1,834 | adobe/brackets | src/utils/ViewUtils.js | scrollElementIntoView | function scrollElementIntoView($view, $element, scrollHorizontal) {
var elementOffset = $element.offset();
// scroll minimum amount
var elementRect = {
top: elementOffset.top,
left: elementOffset.left,
height: $element.height(),
... | javascript | function scrollElementIntoView($view, $element, scrollHorizontal) {
var elementOffset = $element.offset();
// scroll minimum amount
var elementRect = {
top: elementOffset.top,
left: elementOffset.left,
height: $element.height(),
... | [
"function",
"scrollElementIntoView",
"(",
"$view",
",",
"$element",
",",
"scrollHorizontal",
")",
"{",
"var",
"elementOffset",
"=",
"$element",
".",
"offset",
"(",
")",
";",
"// scroll minimum amount",
"var",
"elementRect",
"=",
"{",
"top",
":",
"elementOffset",
... | Within a scrolling DOMElement, if necessary, scroll element into viewport.
To Perform the minimum amount of scrolling necessary, cases should be handled as follows:
- element already completely in view : no scrolling
- element above viewport : scroll view so element is at top
- element left of viewport ... | [
"Within",
"a",
"scrolling",
"DOMElement",
"if",
"necessary",
"scroll",
"element",
"into",
"viewport",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/ViewUtils.js#L362-L389 |
1,835 | adobe/brackets | src/utils/ViewUtils.js | getFileEntryDisplay | function getFileEntryDisplay(entry) {
var name = entry.name,
ext = LanguageManager.getCompoundFileExtension(name),
i = name.lastIndexOf("." + ext);
if (i > 0) {
// Escape all HTML-sensitive characters in filename.
name = _.escape(name.substring(0, i)) + "... | javascript | function getFileEntryDisplay(entry) {
var name = entry.name,
ext = LanguageManager.getCompoundFileExtension(name),
i = name.lastIndexOf("." + ext);
if (i > 0) {
// Escape all HTML-sensitive characters in filename.
name = _.escape(name.substring(0, i)) + "... | [
"function",
"getFileEntryDisplay",
"(",
"entry",
")",
"{",
"var",
"name",
"=",
"entry",
".",
"name",
",",
"ext",
"=",
"LanguageManager",
".",
"getCompoundFileExtension",
"(",
"name",
")",
",",
"i",
"=",
"name",
".",
"lastIndexOf",
"(",
"\".\"",
"+",
"ext",... | HTML formats a file entry name for display in the sidebar.
@param {!File} entry File entry to display
@return {string} HTML formatted string | [
"HTML",
"formats",
"a",
"file",
"entry",
"name",
"for",
"display",
"in",
"the",
"sidebar",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/ViewUtils.js#L396-L409 |
1,836 | adobe/brackets | src/utils/ViewUtils.js | getDirNamesForDuplicateFiles | function getDirNamesForDuplicateFiles(files) {
// Must have at least two files in list for this to make sense
if (files.length <= 1) {
return [];
}
// First collect paths from the list of files and fill map with them
var map = {}, filePaths = [], displayPaths = [];
... | javascript | function getDirNamesForDuplicateFiles(files) {
// Must have at least two files in list for this to make sense
if (files.length <= 1) {
return [];
}
// First collect paths from the list of files and fill map with them
var map = {}, filePaths = [], displayPaths = [];
... | [
"function",
"getDirNamesForDuplicateFiles",
"(",
"files",
")",
"{",
"// Must have at least two files in list for this to make sense",
"if",
"(",
"files",
".",
"length",
"<=",
"1",
")",
"{",
"return",
"[",
"]",
";",
"}",
"// First collect paths from the list of files and fil... | Determine the minimum directory path to distinguish duplicate file names
for each file in list.
@param {Array.<File>} files - list of Files with the same filename
@return {Array.<string>} directory paths to match list of files | [
"Determine",
"the",
"minimum",
"directory",
"path",
"to",
"distinguish",
"duplicate",
"file",
"names",
"for",
"each",
"file",
"in",
"list",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/ViewUtils.js#L418-L469 |
1,837 | adobe/brackets | src/utils/ViewUtils.js | function (map) {
var didSomething = false;
_.forEach(map, function (arr, key) {
// length > 1 means we have duplicates that need to be resolved
if (arr.length > 1) {
arr.forEach(function (index) {
if (filePaths[index].le... | javascript | function (map) {
var didSomething = false;
_.forEach(map, function (arr, key) {
// length > 1 means we have duplicates that need to be resolved
if (arr.length > 1) {
arr.forEach(function (index) {
if (filePaths[index].le... | [
"function",
"(",
"map",
")",
"{",
"var",
"didSomething",
"=",
"false",
";",
"_",
".",
"forEach",
"(",
"map",
",",
"function",
"(",
"arr",
",",
"key",
")",
"{",
"// length > 1 means we have duplicates that need to be resolved",
"if",
"(",
"arr",
".",
"length",
... | This function is used to loop through map and resolve duplicate names | [
"This",
"function",
"is",
"used",
"to",
"loop",
"through",
"map",
"and",
"resolve",
"duplicate",
"names"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/ViewUtils.js#L440-L461 | |
1,838 | adobe/brackets | src/extensibility/ExtensionManagerViewModel.js | filterForKeyword | function filterForKeyword(extensionList, word) {
var filteredList = [];
extensionList.forEach(function (id) {
var entry = self._getEntry(id);
if (entry && self._entryMatchesQuery(entry, word)) {
filteredList.push(id);
}
... | javascript | function filterForKeyword(extensionList, word) {
var filteredList = [];
extensionList.forEach(function (id) {
var entry = self._getEntry(id);
if (entry && self._entryMatchesQuery(entry, word)) {
filteredList.push(id);
}
... | [
"function",
"filterForKeyword",
"(",
"extensionList",
",",
"word",
")",
"{",
"var",
"filteredList",
"=",
"[",
"]",
";",
"extensionList",
".",
"forEach",
"(",
"function",
"(",
"id",
")",
"{",
"var",
"entry",
"=",
"self",
".",
"_getEntry",
"(",
"id",
")",
... | Takes 'extensionList' and returns a version filtered to only those that match 'keyword' | [
"Takes",
"extensionList",
"and",
"returns",
"a",
"version",
"filtered",
"to",
"only",
"those",
"that",
"match",
"keyword"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/ExtensionManagerViewModel.js#L214-L223 |
1,839 | adobe/brackets | src/utils/ExtensionLoader.js | loadExtensionModule | function loadExtensionModule(name, config, entryPoint) {
var extensionConfig = {
context: name,
baseUrl: config.baseUrl,
paths: globalPaths,
locale: brackets.getLocale()
};
// Read optional requirejs-config.json
var promise = _mergeConfig(... | javascript | function loadExtensionModule(name, config, entryPoint) {
var extensionConfig = {
context: name,
baseUrl: config.baseUrl,
paths: globalPaths,
locale: brackets.getLocale()
};
// Read optional requirejs-config.json
var promise = _mergeConfig(... | [
"function",
"loadExtensionModule",
"(",
"name",
",",
"config",
",",
"entryPoint",
")",
"{",
"var",
"extensionConfig",
"=",
"{",
"context",
":",
"name",
",",
"baseUrl",
":",
"config",
".",
"baseUrl",
",",
"paths",
":",
"globalPaths",
",",
"locale",
":",
"br... | Loads the extension module that lives at baseUrl into its own Require.js context
@param {!string} name, used to identify the extension
@param {!{baseUrl: string}} config object with baseUrl property containing absolute path of extension
@param {!string} entryPoint, name of the main js file to load
@return {!$.Promise}... | [
"Loads",
"the",
"extension",
"module",
"that",
"lives",
"at",
"baseUrl",
"into",
"its",
"own",
"Require",
".",
"js",
"context"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/ExtensionLoader.js#L168-L236 |
1,840 | adobe/brackets | src/utils/ExtensionLoader.js | loadExtension | function loadExtension(name, config, entryPoint) {
var promise = new $.Deferred();
// Try to load the package.json to figure out if we are loading a theme.
ExtensionUtils.loadMetadata(config.baseUrl).always(promise.resolve);
return promise
.then(function (metadata) {
... | javascript | function loadExtension(name, config, entryPoint) {
var promise = new $.Deferred();
// Try to load the package.json to figure out if we are loading a theme.
ExtensionUtils.loadMetadata(config.baseUrl).always(promise.resolve);
return promise
.then(function (metadata) {
... | [
"function",
"loadExtension",
"(",
"name",
",",
"config",
",",
"entryPoint",
")",
"{",
"var",
"promise",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"// Try to load the package.json to figure out if we are loading a theme.",
"ExtensionUtils",
".",
"loadMetadata",
... | Loads the extension that lives at baseUrl into its own Require.js context
@param {!string} name, used to identify the extension
@param {!{baseUrl: string}} config object with baseUrl property containing absolute path of extension
@param {!string} entryPoint, name of the main js file to load
@return {!$.Promise} A prom... | [
"Loads",
"the",
"extension",
"that",
"lives",
"at",
"baseUrl",
"into",
"its",
"own",
"Require",
".",
"js",
"context"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/ExtensionLoader.js#L248-L276 |
1,841 | adobe/brackets | src/utils/ExtensionLoader.js | init | function init(paths) {
var params = new UrlParams();
if (_init) {
// Only init once. Return a resolved promise.
return new $.Deferred().resolve().promise();
}
if (!paths) {
params.parse();
if (params.get("reloadWithoutUserExts") === "tru... | javascript | function init(paths) {
var params = new UrlParams();
if (_init) {
// Only init once. Return a resolved promise.
return new $.Deferred().resolve().promise();
}
if (!paths) {
params.parse();
if (params.get("reloadWithoutUserExts") === "tru... | [
"function",
"init",
"(",
"paths",
")",
"{",
"var",
"params",
"=",
"new",
"UrlParams",
"(",
")",
";",
"if",
"(",
"_init",
")",
"{",
"// Only init once. Return a resolved promise.",
"return",
"new",
"$",
".",
"Deferred",
"(",
")",
".",
"resolve",
"(",
")",
... | Load extensions.
@param {?Array.<string>} A list containing references to extension source
location. A source location may be either (a) a folder name inside
src/extensions or (b) an absolute path.
@return {!$.Promise} A promise object that is resolved when all extensions complete loading. | [
"Load",
"extensions",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/ExtensionLoader.js#L401-L456 |
1,842 | adobe/brackets | src/filesystem/Directory.js | _applyAllCallbacks | function _applyAllCallbacks(callbacks, args) {
if (callbacks.length > 0) {
var callback = callbacks.pop();
try {
callback.apply(undefined, args);
} finally {
_applyAllCallbacks(callbacks, args);
}
}
} | javascript | function _applyAllCallbacks(callbacks, args) {
if (callbacks.length > 0) {
var callback = callbacks.pop();
try {
callback.apply(undefined, args);
} finally {
_applyAllCallbacks(callbacks, args);
}
}
} | [
"function",
"_applyAllCallbacks",
"(",
"callbacks",
",",
"args",
")",
"{",
"if",
"(",
"callbacks",
".",
"length",
">",
"0",
")",
"{",
"var",
"callback",
"=",
"callbacks",
".",
"pop",
"(",
")",
";",
"try",
"{",
"callback",
".",
"apply",
"(",
"undefined"... | Apply each callback in a list to the provided arguments. Callbacks
can throw without preventing other callbacks from being applied.
@private
@param {Array.<function>} callbacks The callbacks to apply
@param {Array} args The arguments to which each callback is applied | [
"Apply",
"each",
"callback",
"in",
"a",
"list",
"to",
"the",
"provided",
"arguments",
".",
"Callbacks",
"can",
"throw",
"without",
"preventing",
"other",
"callbacks",
"from",
"being",
"applied",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/filesystem/Directory.js#L114-L123 |
1,843 | adobe/brackets | src/project/ProjectModel.js | doCreate | function doCreate(path, isFolder) {
var d = new $.Deferred();
var filename = FileUtils.getBaseName(path);
// Check if filename
if (!isValidFilename(filename)){
return d.reject(ERROR_INVALID_FILENAME).promise();
}
// Check if fullpath with filename is valid
... | javascript | function doCreate(path, isFolder) {
var d = new $.Deferred();
var filename = FileUtils.getBaseName(path);
// Check if filename
if (!isValidFilename(filename)){
return d.reject(ERROR_INVALID_FILENAME).promise();
}
// Check if fullpath with filename is valid
... | [
"function",
"doCreate",
"(",
"path",
",",
"isFolder",
")",
"{",
"var",
"d",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"var",
"filename",
"=",
"FileUtils",
".",
"getBaseName",
"(",
"path",
")",
";",
"// Check if filename",
"if",
"(",
"!",
"isVali... | Creates a new file or folder at the given path. The returned promise is rejected if the filename
is invalid, the new path already exists or some other filesystem error comes up.
@param {string} path path to create
@param {boolean} isFolder true if the new entry is a folder
@return {$.Promise} resolved when the file or... | [
"Creates",
"a",
"new",
"file",
"or",
"folder",
"at",
"the",
"given",
"path",
".",
"The",
"returned",
"promise",
"is",
"rejected",
"if",
"the",
"filename",
"is",
"invalid",
"the",
"new",
"path",
"already",
"exists",
"or",
"some",
"other",
"filesystem",
"err... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/ProjectModel.js#L188-L230 |
1,844 | adobe/brackets | src/project/ProjectModel.js | _isWelcomeProjectPath | function _isWelcomeProjectPath(path, welcomeProjectPath, welcomeProjects) {
if (path === welcomeProjectPath) {
return true;
}
// No match on the current path, and it's not a match if there are no previously known projects
if (!welcomeProjects) {
return false;
... | javascript | function _isWelcomeProjectPath(path, welcomeProjectPath, welcomeProjects) {
if (path === welcomeProjectPath) {
return true;
}
// No match on the current path, and it's not a match if there are no previously known projects
if (!welcomeProjects) {
return false;
... | [
"function",
"_isWelcomeProjectPath",
"(",
"path",
",",
"welcomeProjectPath",
",",
"welcomeProjects",
")",
"{",
"if",
"(",
"path",
"===",
"welcomeProjectPath",
")",
"{",
"return",
"true",
";",
"}",
"// No match on the current path, and it's not a match if there are no previo... | Returns true if the given path is the same as one of the welcome projects we've previously opened,
or the one for the current build.
@param {string} path Path to check to see if it's a welcome project
@param {string} welcomeProjectPath Current welcome project path
@param {Array.<string>=} welcomeProjects All known wel... | [
"Returns",
"true",
"if",
"the",
"given",
"path",
"is",
"the",
"same",
"as",
"one",
"of",
"the",
"welcome",
"projects",
"we",
"ve",
"previously",
"opened",
"or",
"the",
"one",
"for",
"the",
"current",
"build",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/ProjectModel.js#L1351-L1363 |
1,845 | adobe/brackets | src/extensions/default/InAppNotifications/main.js | _getVersionInfoUrl | function _getVersionInfoUrl(localeParam) {
var locale = localeParam || brackets.getLocale();
if (locale.length > 2) {
locale = locale.substring(0, 2);
}
return brackets.config.notification_info_url.replace("<locale>", locale);
} | javascript | function _getVersionInfoUrl(localeParam) {
var locale = localeParam || brackets.getLocale();
if (locale.length > 2) {
locale = locale.substring(0, 2);
}
return brackets.config.notification_info_url.replace("<locale>", locale);
} | [
"function",
"_getVersionInfoUrl",
"(",
"localeParam",
")",
"{",
"var",
"locale",
"=",
"localeParam",
"||",
"brackets",
".",
"getLocale",
"(",
")",
";",
"if",
"(",
"locale",
".",
"length",
">",
"2",
")",
"{",
"locale",
"=",
"locale",
".",
"substring",
"("... | Constructs notification info URL for XHR
@param {string=} localeParam - optional locale, defaults to 'brackets.getLocale()' when omitted.
@returns {string} the new notification info url | [
"Constructs",
"notification",
"info",
"URL",
"for",
"XHR"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InAppNotifications/main.js#L55-L64 |
1,846 | adobe/brackets | src/extensions/default/InAppNotifications/main.js | _getNotificationInformation | function _getNotificationInformation(_notificationInfoUrl) {
// Last time the versionInfoURL was fetched
var lastInfoURLFetchTime = PreferencesManager.getViewState("lastNotificationURLFetchTime");
var result = new $.Deferred();
var fetchData = false;
var data;
// If we ... | javascript | function _getNotificationInformation(_notificationInfoUrl) {
// Last time the versionInfoURL was fetched
var lastInfoURLFetchTime = PreferencesManager.getViewState("lastNotificationURLFetchTime");
var result = new $.Deferred();
var fetchData = false;
var data;
// If we ... | [
"function",
"_getNotificationInformation",
"(",
"_notificationInfoUrl",
")",
"{",
"// Last time the versionInfoURL was fetched",
"var",
"lastInfoURLFetchTime",
"=",
"PreferencesManager",
".",
"getViewState",
"(",
"\"lastNotificationURLFetchTime\"",
")",
";",
"var",
"result",
"=... | Get a data structure that has information for all Brackets targeted notifications.
_notificationInfoUrl is used for unit testing. | [
"Get",
"a",
"data",
"structure",
"that",
"has",
"information",
"for",
"all",
"Brackets",
"targeted",
"notifications",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InAppNotifications/main.js#L71-L149 |
1,847 | adobe/brackets | src/extensions/default/InAppNotifications/main.js | checkForNotification | function checkForNotification(versionInfoUrl) {
var result = new $.Deferred();
_getNotificationInformation(versionInfoUrl)
.done(function (notificationInfo) {
// Get all available notifications
var notifications = notificationInfo.notifications;
... | javascript | function checkForNotification(versionInfoUrl) {
var result = new $.Deferred();
_getNotificationInformation(versionInfoUrl)
.done(function (notificationInfo) {
// Get all available notifications
var notifications = notificationInfo.notifications;
... | [
"function",
"checkForNotification",
"(",
"versionInfoUrl",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"_getNotificationInformation",
"(",
"versionInfoUrl",
")",
".",
"done",
"(",
"function",
"(",
"notificationInfo",
")",
"{",
"... | Check for notifications, notification overlays are always displayed
@return {$.Promise} jQuery Promise object that is resolved or rejected after the notification check is complete. | [
"Check",
"for",
"notifications",
"notification",
"overlays",
"are",
"always",
"displayed"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InAppNotifications/main.js#L157-L192 |
1,848 | adobe/brackets | src/utils/EventDispatcher.js | splitNs | function splitNs(eventStr) {
var dot = eventStr.indexOf(".");
if (dot === -1) {
return { eventName: eventStr };
} else {
return { eventName: eventStr.substring(0, dot), ns: eventStr.substring(dot) };
}
} | javascript | function splitNs(eventStr) {
var dot = eventStr.indexOf(".");
if (dot === -1) {
return { eventName: eventStr };
} else {
return { eventName: eventStr.substring(0, dot), ns: eventStr.substring(dot) };
}
} | [
"function",
"splitNs",
"(",
"eventStr",
")",
"{",
"var",
"dot",
"=",
"eventStr",
".",
"indexOf",
"(",
"\".\"",
")",
";",
"if",
"(",
"dot",
"===",
"-",
"1",
")",
"{",
"return",
"{",
"eventName",
":",
"eventStr",
"}",
";",
"}",
"else",
"{",
"return",... | Split "event.namespace" string into its two parts; both parts are optional.
@param {string} eventName Event name and/or trailing ".namespace"
@return {!{event:string, ns:string}} Uses "" for missing parts. | [
"Split",
"event",
".",
"namespace",
"string",
"into",
"its",
"two",
"parts",
";",
"both",
"parts",
"are",
"optional",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/EventDispatcher.js#L66-L73 |
1,849 | adobe/brackets | src/extensions/default/NoDistractions/main.js | _hidePanelsIfRequired | function _hidePanelsIfRequired() {
var panelIDs = WorkspaceManager.getAllPanelIDs();
_previouslyOpenPanelIDs = [];
panelIDs.forEach(function (panelID) {
var panel = WorkspaceManager.getPanelForID(panelID);
if (panel && panel.isVisible()) {
panel.hide();
... | javascript | function _hidePanelsIfRequired() {
var panelIDs = WorkspaceManager.getAllPanelIDs();
_previouslyOpenPanelIDs = [];
panelIDs.forEach(function (panelID) {
var panel = WorkspaceManager.getPanelForID(panelID);
if (panel && panel.isVisible()) {
panel.hide();
... | [
"function",
"_hidePanelsIfRequired",
"(",
")",
"{",
"var",
"panelIDs",
"=",
"WorkspaceManager",
".",
"getAllPanelIDs",
"(",
")",
";",
"_previouslyOpenPanelIDs",
"=",
"[",
"]",
";",
"panelIDs",
".",
"forEach",
"(",
"function",
"(",
"panelID",
")",
"{",
"var",
... | hide all open panels | [
"hide",
"all",
"open",
"panels"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NoDistractions/main.js#L77-L87 |
1,850 | adobe/brackets | src/extensions/default/NoDistractions/main.js | initializeCommands | function initializeCommands() {
CommandManager.register(Strings.CMD_TOGGLE_PURE_CODE, CMD_TOGGLE_PURE_CODE, _togglePureCode);
CommandManager.register(Strings.CMD_TOGGLE_PANELS, CMD_TOGGLE_PANELS, _togglePanels);
Menus.getMenu(Menus.AppMenuBar.VIEW_MENU).addMenuItem(CMD_TOGGLE_PANELS, "", Menus.... | javascript | function initializeCommands() {
CommandManager.register(Strings.CMD_TOGGLE_PURE_CODE, CMD_TOGGLE_PURE_CODE, _togglePureCode);
CommandManager.register(Strings.CMD_TOGGLE_PANELS, CMD_TOGGLE_PANELS, _togglePanels);
Menus.getMenu(Menus.AppMenuBar.VIEW_MENU).addMenuItem(CMD_TOGGLE_PANELS, "", Menus.... | [
"function",
"initializeCommands",
"(",
")",
"{",
"CommandManager",
".",
"register",
"(",
"Strings",
".",
"CMD_TOGGLE_PURE_CODE",
",",
"CMD_TOGGLE_PURE_CODE",
",",
"_togglePureCode",
")",
";",
"CommandManager",
".",
"register",
"(",
"Strings",
".",
"CMD_TOGGLE_PANELS",... | Register the Commands , add the Menu Items and key bindings | [
"Register",
"the",
"Commands",
"add",
"the",
"Menu",
"Items",
"and",
"key",
"bindings"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NoDistractions/main.js#L154-L167 |
1,851 | adobe/brackets | src/LiveDevelopment/Agents/EditAgent.js | _findChangedCharacters | function _findChangedCharacters(oldValue, value) {
if (oldValue === value) {
return undefined;
}
var length = oldValue.length;
var index = 0;
// find the first character that changed
var i;
for (i = 0; i < length; i++) {
if (value[i] !== o... | javascript | function _findChangedCharacters(oldValue, value) {
if (oldValue === value) {
return undefined;
}
var length = oldValue.length;
var index = 0;
// find the first character that changed
var i;
for (i = 0; i < length; i++) {
if (value[i] !== o... | [
"function",
"_findChangedCharacters",
"(",
"oldValue",
",",
"value",
")",
"{",
"if",
"(",
"oldValue",
"===",
"value",
")",
"{",
"return",
"undefined",
";",
"}",
"var",
"length",
"=",
"oldValue",
".",
"length",
";",
"var",
"index",
"=",
"0",
";",
"// find... | Find changed characters
@param {string} old value
@param {string} changed value
@return {from, to, text} | [
"Find",
"changed",
"characters"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/EditAgent.js#L45-L73 |
1,852 | adobe/brackets | src/view/WorkspaceManager.js | updateResizeLimits | function updateResizeLimits() {
var editorAreaHeight = $editorHolder.height();
$editorHolder.siblings().each(function (i, elem) {
var $elem = $(elem);
if ($elem.css("display") === "none") {
$elem.data("maxsize", editorAreaHeight);
} else {
... | javascript | function updateResizeLimits() {
var editorAreaHeight = $editorHolder.height();
$editorHolder.siblings().each(function (i, elem) {
var $elem = $(elem);
if ($elem.css("display") === "none") {
$elem.data("maxsize", editorAreaHeight);
} else {
... | [
"function",
"updateResizeLimits",
"(",
")",
"{",
"var",
"editorAreaHeight",
"=",
"$editorHolder",
".",
"height",
"(",
")",
";",
"$editorHolder",
".",
"siblings",
"(",
")",
".",
"each",
"(",
"function",
"(",
"i",
",",
"elem",
")",
"{",
"var",
"$elem",
"="... | Updates panel resize limits to disallow making panels big enough to shrink editor area below 0 | [
"Updates",
"panel",
"resize",
"limits",
"to",
"disallow",
"making",
"panels",
"big",
"enough",
"to",
"shrink",
"editor",
"area",
"below",
"0"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/WorkspaceManager.js#L91-L102 |
1,853 | adobe/brackets | src/view/WorkspaceManager.js | handleWindowResize | function handleWindowResize() {
// These are not initialized in Jasmine Spec Runner window until a test
// is run that creates a mock document.
if (!$windowContent || !$editorHolder) {
return;
}
// FIXME (issue #4564) Workaround https://github.com/codemirror/CodeMirr... | javascript | function handleWindowResize() {
// These are not initialized in Jasmine Spec Runner window until a test
// is run that creates a mock document.
if (!$windowContent || !$editorHolder) {
return;
}
// FIXME (issue #4564) Workaround https://github.com/codemirror/CodeMirr... | [
"function",
"handleWindowResize",
"(",
")",
"{",
"// These are not initialized in Jasmine Spec Runner window until a test",
"// is run that creates a mock document.",
"if",
"(",
"!",
"$windowContent",
"||",
"!",
"$editorHolder",
")",
"{",
"return",
";",
"}",
"// FIXME (issue #4... | Trigger editor area resize whenever the window is resized | [
"Trigger",
"editor",
"area",
"resize",
"whenever",
"the",
"window",
"is",
"resized"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/WorkspaceManager.js#L123-L144 |
1,854 | adobe/brackets | src/view/WorkspaceManager.js | createBottomPanel | function createBottomPanel(id, $panel, minSize) {
$panel.insertBefore("#status-bar");
$panel.hide();
updateResizeLimits(); // initialize panel's max size
panelIDMap[id] = new Panel($panel, minSize);
panelIDMap[id].panelID = id;
return panelIDMap[id];
} | javascript | function createBottomPanel(id, $panel, minSize) {
$panel.insertBefore("#status-bar");
$panel.hide();
updateResizeLimits(); // initialize panel's max size
panelIDMap[id] = new Panel($panel, minSize);
panelIDMap[id].panelID = id;
return panelIDMap[id];
} | [
"function",
"createBottomPanel",
"(",
"id",
",",
"$panel",
",",
"minSize",
")",
"{",
"$panel",
".",
"insertBefore",
"(",
"\"#status-bar\"",
")",
";",
"$panel",
".",
"hide",
"(",
")",
";",
"updateResizeLimits",
"(",
")",
";",
"// initialize panel's max size",
"... | Creates a new resizable panel beneath the editor area and above the status bar footer. Panel is initially invisible.
The panel's size & visibility are automatically saved & restored as a view-state preference.
@param {!string} id Unique id for this panel. Use package-style naming, e.g. "myextension.feature.panelname"... | [
"Creates",
"a",
"new",
"resizable",
"panel",
"beneath",
"the",
"editor",
"area",
"and",
"above",
"the",
"status",
"bar",
"footer",
".",
"Panel",
"is",
"initially",
"invisible",
".",
"The",
"panel",
"s",
"size",
"&",
"visibility",
"are",
"automatically",
"sav... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/WorkspaceManager.js#L227-L236 |
1,855 | adobe/brackets | src/view/WorkspaceManager.js | getAllPanelIDs | function getAllPanelIDs() {
var property, panelIDs = [];
for (property in panelIDMap) {
if (panelIDMap.hasOwnProperty(property)) {
panelIDs.push(property);
}
}
return panelIDs;
} | javascript | function getAllPanelIDs() {
var property, panelIDs = [];
for (property in panelIDMap) {
if (panelIDMap.hasOwnProperty(property)) {
panelIDs.push(property);
}
}
return panelIDs;
} | [
"function",
"getAllPanelIDs",
"(",
")",
"{",
"var",
"property",
",",
"panelIDs",
"=",
"[",
"]",
";",
"for",
"(",
"property",
"in",
"panelIDMap",
")",
"{",
"if",
"(",
"panelIDMap",
".",
"hasOwnProperty",
"(",
"property",
")",
")",
"{",
"panelIDs",
".",
... | Returns an array of all panel ID's
@returns {Array} List of ID's of all bottom panels | [
"Returns",
"an",
"array",
"of",
"all",
"panel",
"ID",
"s"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/WorkspaceManager.js#L242-L250 |
1,856 | adobe/brackets | src/utils/HealthLogger.js | getAggregatedHealthData | function getAggregatedHealthData() {
var healthData = getStoredHealthData();
$.extend(healthData, PerfUtils.getHealthReport());
$.extend(healthData, FindUtils.getHealthReport());
return healthData;
} | javascript | function getAggregatedHealthData() {
var healthData = getStoredHealthData();
$.extend(healthData, PerfUtils.getHealthReport());
$.extend(healthData, FindUtils.getHealthReport());
return healthData;
} | [
"function",
"getAggregatedHealthData",
"(",
")",
"{",
"var",
"healthData",
"=",
"getStoredHealthData",
"(",
")",
";",
"$",
".",
"extend",
"(",
"healthData",
",",
"PerfUtils",
".",
"getHealthReport",
"(",
")",
")",
";",
"$",
".",
"extend",
"(",
"healthData",
... | Return the aggregate of all health data logged till now from all sources
@return {Object} Health Data aggregated till now | [
"Return",
"the",
"aggregate",
"of",
"all",
"health",
"data",
"logged",
"till",
"now",
"from",
"all",
"sources"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/HealthLogger.js#L85-L90 |
1,857 | adobe/brackets | src/utils/HealthLogger.js | setHealthDataLog | function setHealthDataLog(key, dataObject) {
var healthData = getStoredHealthData();
healthData[key] = dataObject;
setHealthData(healthData);
} | javascript | function setHealthDataLog(key, dataObject) {
var healthData = getStoredHealthData();
healthData[key] = dataObject;
setHealthData(healthData);
} | [
"function",
"setHealthDataLog",
"(",
"key",
",",
"dataObject",
")",
"{",
"var",
"healthData",
"=",
"getStoredHealthData",
"(",
")",
";",
"healthData",
"[",
"key",
"]",
"=",
"dataObject",
";",
"setHealthData",
"(",
"healthData",
")",
";",
"}"
] | Sets the health data for the given key
@param {Object} dataObject The object to be stored as health data for the key | [
"Sets",
"the",
"health",
"data",
"for",
"the",
"given",
"key"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/HealthLogger.js#L116-L120 |
1,858 | adobe/brackets | src/utils/HealthLogger.js | fileOpened | function fileOpened(filePath, addedToWorkingSet, encoding) {
if (!shouldLogHealthData()) {
return;
}
var fileExtension = FileUtils.getFileExtension(filePath),
language = LanguageManager.getLanguageForPath(filePath),
healthData = getStoredHealthData(),
... | javascript | function fileOpened(filePath, addedToWorkingSet, encoding) {
if (!shouldLogHealthData()) {
return;
}
var fileExtension = FileUtils.getFileExtension(filePath),
language = LanguageManager.getLanguageForPath(filePath),
healthData = getStoredHealthData(),
... | [
"function",
"fileOpened",
"(",
"filePath",
",",
"addedToWorkingSet",
",",
"encoding",
")",
"{",
"if",
"(",
"!",
"shouldLogHealthData",
"(",
")",
")",
"{",
"return",
";",
"}",
"var",
"fileExtension",
"=",
"FileUtils",
".",
"getFileExtension",
"(",
"filePath",
... | Whenever a file is opened call this function. The function will record the number of times
the standard file types have been opened. We only log the standard filetypes
@param {String} filePath The path of the file to be registered
@param {boolean} addedToWorkingSet set to true if extensions of files added to t... | [
"Whenever",
"a",
"file",
"is",
"opened",
"call",
"this",
"function",
".",
"The",
"function",
"will",
"record",
"the",
"number",
"of",
"times",
"the",
"standard",
"file",
"types",
"have",
"been",
"opened",
".",
"We",
"only",
"log",
"the",
"standard",
"filet... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/HealthLogger.js#L149-L190 |
1,859 | adobe/brackets | src/utils/HealthLogger.js | fileSaved | function fileSaved(docToSave) {
if (!docToSave) {
return;
}
var fileType = docToSave.language ? docToSave.language._name : "";
sendAnalyticsData(commonStrings.USAGE + commonStrings.FILE_SAVE + fileType,
commonStrings.USAGE,
... | javascript | function fileSaved(docToSave) {
if (!docToSave) {
return;
}
var fileType = docToSave.language ? docToSave.language._name : "";
sendAnalyticsData(commonStrings.USAGE + commonStrings.FILE_SAVE + fileType,
commonStrings.USAGE,
... | [
"function",
"fileSaved",
"(",
"docToSave",
")",
"{",
"if",
"(",
"!",
"docToSave",
")",
"{",
"return",
";",
"}",
"var",
"fileType",
"=",
"docToSave",
".",
"language",
"?",
"docToSave",
".",
"language",
".",
"_name",
":",
"\"\"",
";",
"sendAnalyticsData",
... | Whenever a file is saved call this function.
The function will send the analytics Data
We only log the standard filetypes and fileSize
@param {String} filePath The path of the file to be registered | [
"Whenever",
"a",
"file",
"is",
"saved",
"call",
"this",
"function",
".",
"The",
"function",
"will",
"send",
"the",
"analytics",
"Data",
"We",
"only",
"log",
"the",
"standard",
"filetypes",
"and",
"fileSize"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/HealthLogger.js#L198-L208 |
1,860 | adobe/brackets | src/utils/HealthLogger.js | fileClosed | function fileClosed(file) {
if (!file) {
return;
}
var language = LanguageManager.getLanguageForPath(file._path),
size = -1;
function _sendData(fileSize) {
var subType = "";
if(fileSize/1024 <= 1) {
if(fileSize < 0) {
... | javascript | function fileClosed(file) {
if (!file) {
return;
}
var language = LanguageManager.getLanguageForPath(file._path),
size = -1;
function _sendData(fileSize) {
var subType = "";
if(fileSize/1024 <= 1) {
if(fileSize < 0) {
... | [
"function",
"fileClosed",
"(",
"file",
")",
"{",
"if",
"(",
"!",
"file",
")",
"{",
"return",
";",
"}",
"var",
"language",
"=",
"LanguageManager",
".",
"getLanguageForPath",
"(",
"file",
".",
"_path",
")",
",",
"size",
"=",
"-",
"1",
";",
"function",
... | Whenever a file is closed call this function.
The function will send the analytics Data.
We only log the standard filetypes and fileSize
@param {String} filePath The path of the file to be registered | [
"Whenever",
"a",
"file",
"is",
"closed",
"call",
"this",
"function",
".",
"The",
"function",
"will",
"send",
"the",
"analytics",
"Data",
".",
"We",
"only",
"log",
"the",
"standard",
"filetypes",
"and",
"fileSize"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/HealthLogger.js#L216-L268 |
1,861 | adobe/brackets | src/utils/HealthLogger.js | searchDone | function searchDone(searchType) {
var searchDetails = getHealthDataLog("searchDetails");
if (!searchDetails) {
searchDetails = {};
}
if (!searchDetails[searchType]) {
searchDetails[searchType] = 0;
}
searchDetails[searchType]++;
setHealthDa... | javascript | function searchDone(searchType) {
var searchDetails = getHealthDataLog("searchDetails");
if (!searchDetails) {
searchDetails = {};
}
if (!searchDetails[searchType]) {
searchDetails[searchType] = 0;
}
searchDetails[searchType]++;
setHealthDa... | [
"function",
"searchDone",
"(",
"searchType",
")",
"{",
"var",
"searchDetails",
"=",
"getHealthDataLog",
"(",
"\"searchDetails\"",
")",
";",
"if",
"(",
"!",
"searchDetails",
")",
"{",
"searchDetails",
"=",
"{",
"}",
";",
"}",
"if",
"(",
"!",
"searchDetails",
... | Increments health log count for a particular kind of search done
@param {string} searchType The kind of search type that needs to be logged- should be a js var compatible string | [
"Increments",
"health",
"log",
"count",
"for",
"a",
"particular",
"kind",
"of",
"search",
"done"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/HealthLogger.js#L294-L304 |
1,862 | adobe/brackets | src/utils/HealthLogger.js | sendAnalyticsData | function sendAnalyticsData(eventName, eventCategory, eventSubCategory, eventType, eventSubType) {
var isEventDataAlreadySent = analyticsEventMap.get(eventName),
isHDTracking = PreferencesManager.getExtensionPrefs("healthData").get("healthDataTracking"),
eventParams = {};
if (i... | javascript | function sendAnalyticsData(eventName, eventCategory, eventSubCategory, eventType, eventSubType) {
var isEventDataAlreadySent = analyticsEventMap.get(eventName),
isHDTracking = PreferencesManager.getExtensionPrefs("healthData").get("healthDataTracking"),
eventParams = {};
if (i... | [
"function",
"sendAnalyticsData",
"(",
"eventName",
",",
"eventCategory",
",",
"eventSubCategory",
",",
"eventType",
",",
"eventSubType",
")",
"{",
"var",
"isEventDataAlreadySent",
"=",
"analyticsEventMap",
".",
"get",
"(",
"eventName",
")",
",",
"isHDTracking",
"=",... | Send Analytics Data
@param {string} eventCategory The kind of Event Category that
needs to be logged- should be a js var compatible string
@param {string} eventSubCategory The kind of Event Sub Category that
needs to be logged- should be a js var compatible string
@param {string} eventType The kind of Event Type that n... | [
"Send",
"Analytics",
"Data"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/HealthLogger.js#L324-L339 |
1,863 | adobe/brackets | src/LiveDevelopment/LiveDevelopmentUtils.js | isStaticHtmlFileExt | function isStaticHtmlFileExt(filePath) {
if (!filePath) {
return false;
}
return (_staticHtmlFileExts.indexOf(LanguageManager.getLanguageForPath(filePath).getId()) !== -1);
} | javascript | function isStaticHtmlFileExt(filePath) {
if (!filePath) {
return false;
}
return (_staticHtmlFileExts.indexOf(LanguageManager.getLanguageForPath(filePath).getId()) !== -1);
} | [
"function",
"isStaticHtmlFileExt",
"(",
"filePath",
")",
"{",
"if",
"(",
"!",
"filePath",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
"_staticHtmlFileExts",
".",
"indexOf",
"(",
"LanguageManager",
".",
"getLanguageForPath",
"(",
"filePath",
")",
".",... | Determine if file extension is a static html file extension.
@param {string} filePath could be a path, a file name or just a file extension
@return {boolean} Returns true if fileExt is in the list | [
"Determine",
"if",
"file",
"extension",
"is",
"a",
"static",
"html",
"file",
"extension",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/LiveDevelopmentUtils.js#L45-L51 |
1,864 | adobe/brackets | src/LiveDevelopment/LiveDevelopmentUtils.js | isServerHtmlFileExt | function isServerHtmlFileExt(filePath) {
if (!filePath) {
return false;
}
return (_serverHtmlFileExts.indexOf(LanguageManager.getLanguageForPath(filePath).getId()) !== -1);
} | javascript | function isServerHtmlFileExt(filePath) {
if (!filePath) {
return false;
}
return (_serverHtmlFileExts.indexOf(LanguageManager.getLanguageForPath(filePath).getId()) !== -1);
} | [
"function",
"isServerHtmlFileExt",
"(",
"filePath",
")",
"{",
"if",
"(",
"!",
"filePath",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
"_serverHtmlFileExts",
".",
"indexOf",
"(",
"LanguageManager",
".",
"getLanguageForPath",
"(",
"filePath",
")",
".",... | Determine if file extension is a server html file extension.
@param {string} filePath could be a path, a file name or just a file extension
@return {boolean} Returns true if fileExt is in the list | [
"Determine",
"if",
"file",
"extension",
"is",
"a",
"server",
"html",
"file",
"extension",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/LiveDevelopmentUtils.js#L58-L64 |
1,865 | adobe/brackets | src/JSUtils/node/ExtractFileContent.js | updateDirtyFilesCache | function updateDirtyFilesCache(name, action) {
if (action) {
_dirtyFilesCache[name] = true;
} else {
if (_dirtyFilesCache[name]) {
delete _dirtyFilesCache[name];
}
}
} | javascript | function updateDirtyFilesCache(name, action) {
if (action) {
_dirtyFilesCache[name] = true;
} else {
if (_dirtyFilesCache[name]) {
delete _dirtyFilesCache[name];
}
}
} | [
"function",
"updateDirtyFilesCache",
"(",
"name",
",",
"action",
")",
"{",
"if",
"(",
"action",
")",
"{",
"_dirtyFilesCache",
"[",
"name",
"]",
"=",
"true",
";",
"}",
"else",
"{",
"if",
"(",
"_dirtyFilesCache",
"[",
"name",
"]",
")",
"{",
"delete",
"_d... | Updates the files cache with fullpath when dirty flag changes for a document
If the doc is being marked as dirty then an entry is created in the cache
If the doc is being marked as clean then the corresponsing entry gets cleared from cache
@param {String} name - fullpath of the document
@param {boolean} action - wheth... | [
"Updates",
"the",
"files",
"cache",
"with",
"fullpath",
"when",
"dirty",
"flag",
"changes",
"for",
"a",
"document",
"If",
"the",
"doc",
"is",
"being",
"marked",
"as",
"dirty",
"then",
"an",
"entry",
"is",
"created",
"in",
"the",
"cache",
"If",
"the",
"do... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/node/ExtractFileContent.js#L47-L55 |
1,866 | adobe/brackets | src/extensibility/InstallExtensionDialog.js | InstallExtensionDialog | function InstallExtensionDialog(installer, _isUpdate) {
this._installer = installer;
this._state = STATE_CLOSED;
this._installResult = null;
this._isUpdate = _isUpdate;
// Timeout before we allow user to leave STATE_INSTALL_CANCELING without waiting for a resolution
// (... | javascript | function InstallExtensionDialog(installer, _isUpdate) {
this._installer = installer;
this._state = STATE_CLOSED;
this._installResult = null;
this._isUpdate = _isUpdate;
// Timeout before we allow user to leave STATE_INSTALL_CANCELING without waiting for a resolution
// (... | [
"function",
"InstallExtensionDialog",
"(",
"installer",
",",
"_isUpdate",
")",
"{",
"this",
".",
"_installer",
"=",
"installer",
";",
"this",
".",
"_state",
"=",
"STATE_CLOSED",
";",
"this",
".",
"_installResult",
"=",
"null",
";",
"this",
".",
"_isUpdate",
... | Creates a new extension installer dialog.
@constructor
@param {{install: function(url), cancel: function()}} installer The installer backend to use. | [
"Creates",
"a",
"new",
"extension",
"installer",
"dialog",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/InstallExtensionDialog.js#L58-L67 |
1,867 | adobe/brackets | src/project/WorkingSetSort.js | get | function get(command) {
var commandID;
if (!command) {
console.error("Attempting to get a Sort method with a missing required parameter: command");
return;
}
if (typeof command === "string") {
commandID = command;
} else {
commandI... | javascript | function get(command) {
var commandID;
if (!command) {
console.error("Attempting to get a Sort method with a missing required parameter: command");
return;
}
if (typeof command === "string") {
commandID = command;
} else {
commandI... | [
"function",
"get",
"(",
"command",
")",
"{",
"var",
"commandID",
";",
"if",
"(",
"!",
"command",
")",
"{",
"console",
".",
"error",
"(",
"\"Attempting to get a Sort method with a missing required parameter: command\"",
")",
";",
"return",
";",
"}",
"if",
"(",
"t... | Retrieves a Sort object by id
@param {(string|Command)} command A command ID or a command object.
@return {?Sort} | [
"Retrieves",
"a",
"Sort",
"object",
"by",
"id"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/WorkingSetSort.js#L98-L111 |
1,868 | adobe/brackets | src/project/WorkingSetSort.js | _convertSortPref | function _convertSortPref(sortMethod) {
if (!sortMethod) {
return null;
}
if (_sortPrefConversionMap.hasOwnProperty(sortMethod)) {
sortMethod = _sortPrefConversionMap[sortMethod];
PreferencesManager.setViewState(_WORKING_SET_SORT_PREF, sortMethod);
} ... | javascript | function _convertSortPref(sortMethod) {
if (!sortMethod) {
return null;
}
if (_sortPrefConversionMap.hasOwnProperty(sortMethod)) {
sortMethod = _sortPrefConversionMap[sortMethod];
PreferencesManager.setViewState(_WORKING_SET_SORT_PREF, sortMethod);
} ... | [
"function",
"_convertSortPref",
"(",
"sortMethod",
")",
"{",
"if",
"(",
"!",
"sortMethod",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"_sortPrefConversionMap",
".",
"hasOwnProperty",
"(",
"sortMethod",
")",
")",
"{",
"sortMethod",
"=",
"_sortPrefConversi... | Converts the old brackets working set sort preference into the modern paneview sort preference
@private
@param {!string} sortMethod - sort preference to convert
@return {?string} new sort preference string or undefined if an sortMethod is not found | [
"Converts",
"the",
"old",
"brackets",
"working",
"set",
"sort",
"preference",
"into",
"the",
"modern",
"paneview",
"sort",
"preference"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/WorkingSetSort.js#L119-L132 |
1,869 | adobe/brackets | src/project/WorkingSetSort.js | _addListeners | function _addListeners() {
if (_automaticSort && _currentSort && _currentSort.getEvents()) {
MainViewManager
.on(_currentSort.getEvents(), function () {
_currentSort.sort();
})
.on("_workingSetDisableAutoSort.sort", function () {
... | javascript | function _addListeners() {
if (_automaticSort && _currentSort && _currentSort.getEvents()) {
MainViewManager
.on(_currentSort.getEvents(), function () {
_currentSort.sort();
})
.on("_workingSetDisableAutoSort.sort", function () {
... | [
"function",
"_addListeners",
"(",
")",
"{",
"if",
"(",
"_automaticSort",
"&&",
"_currentSort",
"&&",
"_currentSort",
".",
"getEvents",
"(",
")",
")",
"{",
"MainViewManager",
".",
"on",
"(",
"_currentSort",
".",
"getEvents",
"(",
")",
",",
"function",
"(",
... | Adds the current sort MainViewManager listeners.
@private | [
"Adds",
"the",
"current",
"sort",
"MainViewManager",
"listeners",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/WorkingSetSort.js#L170-L180 |
1,870 | adobe/brackets | src/project/WorkingSetSort.js | _setCurrentSort | function _setCurrentSort(newSort) {
if (_currentSort !== newSort) {
if (_currentSort !== null) {
_currentSort.setChecked(false);
}
if (_automaticSort) {
newSort.setChecked(true);
}
CommandManager.get(Commands.CMD_WORKIN... | javascript | function _setCurrentSort(newSort) {
if (_currentSort !== newSort) {
if (_currentSort !== null) {
_currentSort.setChecked(false);
}
if (_automaticSort) {
newSort.setChecked(true);
}
CommandManager.get(Commands.CMD_WORKIN... | [
"function",
"_setCurrentSort",
"(",
"newSort",
")",
"{",
"if",
"(",
"_currentSort",
"!==",
"newSort",
")",
"{",
"if",
"(",
"_currentSort",
"!==",
"null",
")",
"{",
"_currentSort",
".",
"setChecked",
"(",
"false",
")",
";",
"}",
"if",
"(",
"_automaticSort",... | Sets the current sort method and checks it on the context menu.
@private
@param {Sort} newSort | [
"Sets",
"the",
"current",
"sort",
"method",
"and",
"checks",
"it",
"on",
"the",
"context",
"menu",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/WorkingSetSort.js#L188-L201 |
1,871 | adobe/brackets | src/project/WorkingSetSort.js | register | function register(command, compareFn, events) {
var commandID = "";
if (!command || !compareFn) {
console.log("Attempting to register a Sort method with a missing required parameter: command or compare function");
return;
}
if (typeof command === "string") {
... | javascript | function register(command, compareFn, events) {
var commandID = "";
if (!command || !compareFn) {
console.log("Attempting to register a Sort method with a missing required parameter: command or compare function");
return;
}
if (typeof command === "string") {
... | [
"function",
"register",
"(",
"command",
",",
"compareFn",
",",
"events",
")",
"{",
"var",
"commandID",
"=",
"\"\"",
";",
"if",
"(",
"!",
"command",
"||",
"!",
"compareFn",
")",
"{",
"console",
".",
"log",
"(",
"\"Attempting to register a Sort method with a mis... | Registers a working set sort method.
@param {(string|Command)} command A command ID or a command object
@param {function(File, File): number} compareFn The function that
will be used inside JavaScript's sort function. The return a value
should be >0 (sort a to a lower index than b), =0 (leaves a and b
unchanged with re... | [
"Registers",
"a",
"working",
"set",
"sort",
"method",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/WorkingSetSort.js#L289-L319 |
1,872 | adobe/brackets | src/LiveDevelopment/MultiBrowserImpl/language/HTMLSimpleDOM.js | function () {
var attributeString = JSON.stringify(this.attributes);
this.attributeSignature = MurmurHash3.hashString(attributeString, attributeString.length, seed);
} | javascript | function () {
var attributeString = JSON.stringify(this.attributes);
this.attributeSignature = MurmurHash3.hashString(attributeString, attributeString.length, seed);
} | [
"function",
"(",
")",
"{",
"var",
"attributeString",
"=",
"JSON",
".",
"stringify",
"(",
"this",
".",
"attributes",
")",
";",
"this",
".",
"attributeSignature",
"=",
"MurmurHash3",
".",
"hashString",
"(",
"attributeString",
",",
"attributeString",
".",
"length... | Updates the signature of this node's attributes. Call this after making attribute changes. | [
"Updates",
"the",
"signature",
"of",
"this",
"node",
"s",
"attributes",
".",
"Call",
"this",
"after",
"making",
"attribute",
"changes",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/MultiBrowserImpl/language/HTMLSimpleDOM.js#L165-L168 | |
1,873 | adobe/brackets | src/LiveDevelopment/Agents/DOMAgent.js | allNodesAtLocation | function allNodesAtLocation(location) {
var nodes = [];
exports.root.each(function each(n) {
if (n.type === DOMNode.TYPE_ELEMENT && n.isAtLocation(location)) {
nodes.push(n);
}
});
return nodes;
} | javascript | function allNodesAtLocation(location) {
var nodes = [];
exports.root.each(function each(n) {
if (n.type === DOMNode.TYPE_ELEMENT && n.isAtLocation(location)) {
nodes.push(n);
}
});
return nodes;
} | [
"function",
"allNodesAtLocation",
"(",
"location",
")",
"{",
"var",
"nodes",
"=",
"[",
"]",
";",
"exports",
".",
"root",
".",
"each",
"(",
"function",
"each",
"(",
"n",
")",
"{",
"if",
"(",
"n",
".",
"type",
"===",
"DOMNode",
".",
"TYPE_ELEMENT",
"&&... | Get the element node that encloses the given location
@param {location} | [
"Get",
"the",
"element",
"node",
"that",
"encloses",
"the",
"given",
"location"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/DOMAgent.js#L66-L74 |
1,874 | adobe/brackets | src/LiveDevelopment/Agents/DOMAgent.js | nodeAtLocation | function nodeAtLocation(location) {
return exports.root.find(function each(n) {
return n.isAtLocation(location, false);
});
} | javascript | function nodeAtLocation(location) {
return exports.root.find(function each(n) {
return n.isAtLocation(location, false);
});
} | [
"function",
"nodeAtLocation",
"(",
"location",
")",
"{",
"return",
"exports",
".",
"root",
".",
"find",
"(",
"function",
"each",
"(",
"n",
")",
"{",
"return",
"n",
".",
"isAtLocation",
"(",
"location",
",",
"false",
")",
";",
"}",
")",
";",
"}"
] | Get the node at the given location
@param {location} | [
"Get",
"the",
"node",
"at",
"the",
"given",
"location"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/DOMAgent.js#L79-L83 |
1,875 | adobe/brackets | src/LiveDevelopment/Agents/DOMAgent.js | _cleanURL | function _cleanURL(url) {
var index = url.search(/[#\?]/);
if (index >= 0) {
url = url.substr(0, index);
}
return url;
} | javascript | function _cleanURL(url) {
var index = url.search(/[#\?]/);
if (index >= 0) {
url = url.substr(0, index);
}
return url;
} | [
"function",
"_cleanURL",
"(",
"url",
")",
"{",
"var",
"index",
"=",
"url",
".",
"search",
"(",
"/",
"[#\\?]",
"/",
")",
";",
"if",
"(",
"index",
">=",
"0",
")",
"{",
"url",
"=",
"url",
".",
"substr",
"(",
"0",
",",
"index",
")",
";",
"}",
"re... | Eliminate the query string from a URL
@param {string} URL | [
"Eliminate",
"the",
"query",
"string",
"from",
"a",
"URL"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/DOMAgent.js#L123-L129 |
1,876 | adobe/brackets | src/LiveDevelopment/Agents/DOMAgent.js | _mapDocumentToSource | function _mapDocumentToSource(source) {
var node = exports.root;
DOMHelpers.eachNode(source, function each(payload) {
if (!node) {
return true;
}
if (payload.closing) {
var parent = node.findParentForNextNodeMatchingPayload(payload);
... | javascript | function _mapDocumentToSource(source) {
var node = exports.root;
DOMHelpers.eachNode(source, function each(payload) {
if (!node) {
return true;
}
if (payload.closing) {
var parent = node.findParentForNextNodeMatchingPayload(payload);
... | [
"function",
"_mapDocumentToSource",
"(",
"source",
")",
"{",
"var",
"node",
"=",
"exports",
".",
"root",
";",
"DOMHelpers",
".",
"eachNode",
"(",
"source",
",",
"function",
"each",
"(",
"payload",
")",
"{",
"if",
"(",
"!",
"node",
")",
"{",
"return",
"... | Map the DOM document to the source text
@param {string} source | [
"Map",
"the",
"DOM",
"document",
"to",
"the",
"source",
"text"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/DOMAgent.js#L134-L160 |
1,877 | adobe/brackets | src/LiveDevelopment/Agents/DOMAgent.js | _onFinishedLoadingDOM | function _onFinishedLoadingDOM() {
var request = new XMLHttpRequest();
request.open("GET", exports.url);
request.onload = function onLoad() {
if ((request.status >= 200 && request.status < 300) ||
request.status === 304 || request.status === 0) {
_... | javascript | function _onFinishedLoadingDOM() {
var request = new XMLHttpRequest();
request.open("GET", exports.url);
request.onload = function onLoad() {
if ((request.status >= 200 && request.status < 300) ||
request.status === 304 || request.status === 0) {
_... | [
"function",
"_onFinishedLoadingDOM",
"(",
")",
"{",
"var",
"request",
"=",
"new",
"XMLHttpRequest",
"(",
")",
";",
"request",
".",
"open",
"(",
"\"GET\"",
",",
"exports",
".",
"url",
")",
";",
"request",
".",
"onload",
"=",
"function",
"onLoad",
"(",
")"... | Load the source document and match it with the DOM tree | [
"Load",
"the",
"source",
"document",
"and",
"match",
"it",
"with",
"the",
"DOM",
"tree"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/DOMAgent.js#L163-L181 |
1,878 | adobe/brackets | src/LiveDevelopment/Agents/DOMAgent.js | applyChange | function applyChange(from, to, text) {
var delta = from - to + text.length;
var node = nodeAtLocation(from);
// insert a text node
if (!node) {
if (!(/^\s*$/).test(text)) {
console.warn("Inserting nodes not supported.");
node = nodeBeforeLocat... | javascript | function applyChange(from, to, text) {
var delta = from - to + text.length;
var node = nodeAtLocation(from);
// insert a text node
if (!node) {
if (!(/^\s*$/).test(text)) {
console.warn("Inserting nodes not supported.");
node = nodeBeforeLocat... | [
"function",
"applyChange",
"(",
"from",
",",
"to",
",",
"text",
")",
"{",
"var",
"delta",
"=",
"from",
"-",
"to",
"+",
"text",
".",
"length",
";",
"var",
"node",
"=",
"nodeAtLocation",
"(",
"from",
")",
";",
"// insert a text node",
"if",
"(",
"!",
"... | Apply a change
@param {integer} start offset of the change
@param {integer} end offset of the change
@param {string} change text | [
"Apply",
"a",
"change"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/DOMAgent.js#L251-L287 |
1,879 | adobe/brackets | src/language/LanguageManager.js | _validateNonEmptyString | function _validateNonEmptyString(value, description, deferred) {
var reportError = deferred ? deferred.reject : console.error;
// http://stackoverflow.com/questions/1303646/check-whether-variable-is-number-or-string-in-javascript
if (Object.prototype.toString.call(value) !== "[object String]") ... | javascript | function _validateNonEmptyString(value, description, deferred) {
var reportError = deferred ? deferred.reject : console.error;
// http://stackoverflow.com/questions/1303646/check-whether-variable-is-number-or-string-in-javascript
if (Object.prototype.toString.call(value) !== "[object String]") ... | [
"function",
"_validateNonEmptyString",
"(",
"value",
",",
"description",
",",
"deferred",
")",
"{",
"var",
"reportError",
"=",
"deferred",
"?",
"deferred",
".",
"reject",
":",
"console",
".",
"error",
";",
"// http://stackoverflow.com/questions/1303646/check-whether-var... | Helper functions
Checks whether value is a non-empty string. Reports an error otherwise.
If no deferred is passed, console.error is called.
Otherwise the deferred is rejected with the error message.
@param {*} value The value to validate
@param {!string} description A helpful identifi... | [
"Helper",
"functions",
"Checks",
"whether",
"value",
"is",
"a",
"non",
"-",
"empty",
"string",
".",
"Reports",
"an",
"error",
"otherwise",
".",
"If",
"no",
"deferred",
"is",
"passed",
"console",
".",
"error",
"is",
"called",
".",
"Otherwise",
"the",
"defer... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/LanguageManager.js#L189-L202 |
1,880 | adobe/brackets | src/language/LanguageManager.js | _patchCodeMirror | function _patchCodeMirror() {
var _original_CodeMirror_defineMode = CodeMirror.defineMode;
function _wrapped_CodeMirror_defineMode(name) {
if (CodeMirror.modes[name]) {
console.error("There already is a CodeMirror mode with the name \"" + name + "\"");
return;... | javascript | function _patchCodeMirror() {
var _original_CodeMirror_defineMode = CodeMirror.defineMode;
function _wrapped_CodeMirror_defineMode(name) {
if (CodeMirror.modes[name]) {
console.error("There already is a CodeMirror mode with the name \"" + name + "\"");
return;... | [
"function",
"_patchCodeMirror",
"(",
")",
"{",
"var",
"_original_CodeMirror_defineMode",
"=",
"CodeMirror",
".",
"defineMode",
";",
"function",
"_wrapped_CodeMirror_defineMode",
"(",
"name",
")",
"{",
"if",
"(",
"CodeMirror",
".",
"modes",
"[",
"name",
"]",
")",
... | Monkey-patch CodeMirror to prevent modes from being overwritten by extensions.
We may rely on the tokens provided by some of these modes. | [
"Monkey",
"-",
"patch",
"CodeMirror",
"to",
"prevent",
"modes",
"from",
"being",
"overwritten",
"by",
"extensions",
".",
"We",
"may",
"rely",
"on",
"the",
"tokens",
"provided",
"by",
"some",
"of",
"these",
"modes",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/LanguageManager.js#L208-L218 |
1,881 | adobe/brackets | src/language/LanguageManager.js | _setLanguageForMode | function _setLanguageForMode(mode, language) {
if (_modeToLanguageMap[mode]) {
console.warn("CodeMirror mode \"" + mode + "\" is already used by language " + _modeToLanguageMap[mode]._name + " - cannot fully register language " + language._name +
" using the same mode. Some ... | javascript | function _setLanguageForMode(mode, language) {
if (_modeToLanguageMap[mode]) {
console.warn("CodeMirror mode \"" + mode + "\" is already used by language " + _modeToLanguageMap[mode]._name + " - cannot fully register language " + language._name +
" using the same mode. Some ... | [
"function",
"_setLanguageForMode",
"(",
"mode",
",",
"language",
")",
"{",
"if",
"(",
"_modeToLanguageMap",
"[",
"mode",
"]",
")",
"{",
"console",
".",
"warn",
"(",
"\"CodeMirror mode \\\"\"",
"+",
"mode",
"+",
"\"\\\" is already used by language \"",
"+",
"_modeT... | Adds a global mode-to-language association.
@param {!string} mode The mode to associate the language with
@param {!Language} language The language to associate with the mode | [
"Adds",
"a",
"global",
"mode",
"-",
"to",
"-",
"language",
"association",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/LanguageManager.js#L225-L233 |
1,882 | adobe/brackets | src/language/LanguageManager.js | _getLanguageForMode | function _getLanguageForMode(mode) {
var language = _modeToLanguageMap[mode];
if (language) {
return language;
}
// In case of unsupported languages
console.log("Called LanguageManager._getLanguageForMode with a mode for which no language has been registered:", mode)... | javascript | function _getLanguageForMode(mode) {
var language = _modeToLanguageMap[mode];
if (language) {
return language;
}
// In case of unsupported languages
console.log("Called LanguageManager._getLanguageForMode with a mode for which no language has been registered:", mode)... | [
"function",
"_getLanguageForMode",
"(",
"mode",
")",
"{",
"var",
"language",
"=",
"_modeToLanguageMap",
"[",
"mode",
"]",
";",
"if",
"(",
"language",
")",
"{",
"return",
"language",
";",
"}",
"// In case of unsupported languages",
"console",
".",
"log",
"(",
"... | Resolves a CodeMirror mode to a Language object.
@param {!string} mode CodeMirror mode
@return {Language} The language for the provided mode or the fallback language | [
"Resolves",
"a",
"CodeMirror",
"mode",
"to",
"a",
"Language",
"object",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/LanguageManager.js#L340-L349 |
1,883 | adobe/brackets | src/language/LanguageManager.js | defineLanguage | function defineLanguage(id, definition) {
var result = new $.Deferred();
if (_pendingLanguages[id]) {
result.reject("Language \"" + id + "\" is waiting to be resolved.");
return result.promise();
}
if (_languages[id]) {
result.reject("Language \"" + i... | javascript | function defineLanguage(id, definition) {
var result = new $.Deferred();
if (_pendingLanguages[id]) {
result.reject("Language \"" + id + "\" is waiting to be resolved.");
return result.promise();
}
if (_languages[id]) {
result.reject("Language \"" + i... | [
"function",
"defineLanguage",
"(",
"id",
",",
"definition",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"if",
"(",
"_pendingLanguages",
"[",
"id",
"]",
")",
"{",
"result",
".",
"reject",
"(",
"\"Language \\\"\"",
"+",
"i... | Defines a language.
@param {!string} id Unique identifier for this language: lowercase letters, digits, and _ separators (e.g. "cpp", "foo_bar", "c99")
@param {!Object} definition An object describing the language
@param {!string} definiti... | [
"Defines",
"a",
"language",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/LanguageManager.js#L926-L1013 |
1,884 | adobe/brackets | src/widgets/PopUpManager.js | addPopUp | function addPopUp($popUp, removeHandler, autoRemove) {
autoRemove = autoRemove || false;
_popUps.push($popUp[0]);
$popUp.data("PopUpManager-autoRemove", autoRemove);
$popUp.data("PopUpManager-removeHandler", removeHandler);
} | javascript | function addPopUp($popUp, removeHandler, autoRemove) {
autoRemove = autoRemove || false;
_popUps.push($popUp[0]);
$popUp.data("PopUpManager-autoRemove", autoRemove);
$popUp.data("PopUpManager-removeHandler", removeHandler);
} | [
"function",
"addPopUp",
"(",
"$popUp",
",",
"removeHandler",
",",
"autoRemove",
")",
"{",
"autoRemove",
"=",
"autoRemove",
"||",
"false",
";",
"_popUps",
".",
"push",
"(",
"$popUp",
"[",
"0",
"]",
")",
";",
"$popUp",
".",
"data",
"(",
"\"PopUpManager-autoR... | Add Esc key handling for a popup DOM element.
@param {!jQuery} $popUp jQuery object for the DOM element pop-up
@param {function} removeHandler Pop-up specific remove (e.g. display:none or DOM removal)
@param {?Boolean} autoRemove - Specify true to indicate the PopUpManager should
remove the popup from the _popUps arra... | [
"Add",
"Esc",
"key",
"handling",
"for",
"a",
"popup",
"DOM",
"element",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/widgets/PopUpManager.js#L47-L53 |
1,885 | adobe/brackets | src/xorigin.js | handleError | function handleError(message, url, line) {
// Ignore this error if it does not look like the rather vague cross origin error in Chrome
// Chrome will print it to the console anyway
if (!testCrossOriginError(message, url, line)) {
if (previousErrorHandler) {
return pre... | javascript | function handleError(message, url, line) {
// Ignore this error if it does not look like the rather vague cross origin error in Chrome
// Chrome will print it to the console anyway
if (!testCrossOriginError(message, url, line)) {
if (previousErrorHandler) {
return pre... | [
"function",
"handleError",
"(",
"message",
",",
"url",
",",
"line",
")",
"{",
"// Ignore this error if it does not look like the rather vague cross origin error in Chrome",
"// Chrome will print it to the console anyway",
"if",
"(",
"!",
"testCrossOriginError",
"(",
"message",
",... | Our error handler | [
"Our",
"error",
"handler"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/xorigin.js#L55-L70 |
1,886 | adobe/brackets | src/LiveDevelopment/main.js | _loadStyles | function _loadStyles() {
var lessText = require("text!LiveDevelopment/main.less");
less.render(lessText, function onParse(err, tree) {
console.assert(!err, err);
ExtensionUtils.addEmbeddedStyleSheet(tree.css);
});
} | javascript | function _loadStyles() {
var lessText = require("text!LiveDevelopment/main.less");
less.render(lessText, function onParse(err, tree) {
console.assert(!err, err);
ExtensionUtils.addEmbeddedStyleSheet(tree.css);
});
} | [
"function",
"_loadStyles",
"(",
")",
"{",
"var",
"lessText",
"=",
"require",
"(",
"\"text!LiveDevelopment/main.less\"",
")",
";",
"less",
".",
"render",
"(",
"lessText",
",",
"function",
"onParse",
"(",
"err",
",",
"tree",
")",
"{",
"console",
".",
"assert",... | Load Live Development LESS Style | [
"Load",
"Live",
"Development",
"LESS",
"Style"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/main.js#L137-L144 |
1,887 | adobe/brackets | src/LiveDevelopment/main.js | _setLabel | function _setLabel($btn, text, style, tooltip) {
// Clear text/styles from previous status
$("span", $btn).remove();
$btn.removeClass(_allStatusStyles);
// Set text/styles for new status
if (text && text.length > 0) {
$("<span class=\"label\">")
.addC... | javascript | function _setLabel($btn, text, style, tooltip) {
// Clear text/styles from previous status
$("span", $btn).remove();
$btn.removeClass(_allStatusStyles);
// Set text/styles for new status
if (text && text.length > 0) {
$("<span class=\"label\">")
.addC... | [
"function",
"_setLabel",
"(",
"$btn",
",",
"text",
",",
"style",
",",
"tooltip",
")",
"{",
"// Clear text/styles from previous status",
"$",
"(",
"\"span\"",
",",
"$btn",
")",
".",
"remove",
"(",
")",
";",
"$btn",
".",
"removeClass",
"(",
"_allStatusStyles",
... | Change the appearance of a button. Omit text to remove any extra text; omit style to return to default styling;
omit tooltip to leave tooltip unchanged. | [
"Change",
"the",
"appearance",
"of",
"a",
"button",
".",
"Omit",
"text",
"to",
"remove",
"any",
"extra",
"text",
";",
"omit",
"style",
"to",
"return",
"to",
"default",
"styling",
";",
"omit",
"tooltip",
"to",
"leave",
"tooltip",
"unchanged",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/main.js#L150-L168 |
1,888 | adobe/brackets | src/LiveDevelopment/main.js | _handleGoLiveCommand | function _handleGoLiveCommand() {
if (LiveDevImpl.status >= LiveDevImpl.STATUS_ACTIVE) {
LiveDevImpl.close();
} else if (LiveDevImpl.status <= LiveDevImpl.STATUS_INACTIVE) {
if (!params.get("skipLiveDevelopmentInfo") && !PreferencesManager.getViewState("livedev.afterFirstLaunch")... | javascript | function _handleGoLiveCommand() {
if (LiveDevImpl.status >= LiveDevImpl.STATUS_ACTIVE) {
LiveDevImpl.close();
} else if (LiveDevImpl.status <= LiveDevImpl.STATUS_INACTIVE) {
if (!params.get("skipLiveDevelopmentInfo") && !PreferencesManager.getViewState("livedev.afterFirstLaunch")... | [
"function",
"_handleGoLiveCommand",
"(",
")",
"{",
"if",
"(",
"LiveDevImpl",
".",
"status",
">=",
"LiveDevImpl",
".",
"STATUS_ACTIVE",
")",
"{",
"LiveDevImpl",
".",
"close",
"(",
")",
";",
"}",
"else",
"if",
"(",
"LiveDevImpl",
".",
"status",
"<=",
"LiveDe... | Toggles LiveDevelopment and synchronizes the state of UI elements that reports LiveDevelopment status
Stop Live Dev when in an active state (ACTIVE, OUT_OF_SYNC, SYNC_ERROR).
Start Live Dev when in an inactive state (ERROR, INACTIVE).
Do nothing when in a connecting state (CONNECTING, LOADING_AGENTS). | [
"Toggles",
"LiveDevelopment",
"and",
"synchronizes",
"the",
"state",
"of",
"UI",
"elements",
"that",
"reports",
"LiveDevelopment",
"status"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/main.js#L177-L194 |
1,889 | adobe/brackets | src/LiveDevelopment/main.js | _showStatusChangeReason | function _showStatusChangeReason(reason) {
// Destroy the previous twipsy (options are not updated otherwise)
_$btnGoLive.twipsy("hide").removeData("twipsy");
// If there was no reason or the action was an explicit request by the user, don't show a twipsy
if (!reason || reason === "expl... | javascript | function _showStatusChangeReason(reason) {
// Destroy the previous twipsy (options are not updated otherwise)
_$btnGoLive.twipsy("hide").removeData("twipsy");
// If there was no reason or the action was an explicit request by the user, don't show a twipsy
if (!reason || reason === "expl... | [
"function",
"_showStatusChangeReason",
"(",
"reason",
")",
"{",
"// Destroy the previous twipsy (options are not updated otherwise)",
"_$btnGoLive",
".",
"twipsy",
"(",
"\"hide\"",
")",
".",
"removeData",
"(",
"\"twipsy\"",
")",
";",
"// If there was no reason or the action was... | Called on status change | [
"Called",
"on",
"status",
"change"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/main.js#L197-L224 |
1,890 | adobe/brackets | src/LiveDevelopment/main.js | _setupGoLiveButton | function _setupGoLiveButton() {
if (!_$btnGoLive) {
_$btnGoLive = $("#toolbar-go-live");
_$btnGoLive.click(function onGoLive() {
_handleGoLiveCommand();
});
}
LiveDevImpl.on("statusChange", function statusChange(event, status, reason) {
... | javascript | function _setupGoLiveButton() {
if (!_$btnGoLive) {
_$btnGoLive = $("#toolbar-go-live");
_$btnGoLive.click(function onGoLive() {
_handleGoLiveCommand();
});
}
LiveDevImpl.on("statusChange", function statusChange(event, status, reason) {
... | [
"function",
"_setupGoLiveButton",
"(",
")",
"{",
"if",
"(",
"!",
"_$btnGoLive",
")",
"{",
"_$btnGoLive",
"=",
"$",
"(",
"\"#toolbar-go-live\"",
")",
";",
"_$btnGoLive",
".",
"click",
"(",
"function",
"onGoLive",
"(",
")",
"{",
"_handleGoLiveCommand",
"(",
")... | Create the menu item "Go Live" | [
"Create",
"the",
"menu",
"item",
"Go",
"Live"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/main.js#L227-L247 |
1,891 | adobe/brackets | src/LiveDevelopment/main.js | _setupGoLiveMenu | function _setupGoLiveMenu() {
LiveDevImpl.on("statusChange", function statusChange(event, status) {
// Update the checkmark next to 'Live Preview' menu item
// Add checkmark when status is STATUS_ACTIVE; otherwise remove it
CommandManager.get(Commands.FILE_LIVE_FILE_PREVIEW).... | javascript | function _setupGoLiveMenu() {
LiveDevImpl.on("statusChange", function statusChange(event, status) {
// Update the checkmark next to 'Live Preview' menu item
// Add checkmark when status is STATUS_ACTIVE; otherwise remove it
CommandManager.get(Commands.FILE_LIVE_FILE_PREVIEW).... | [
"function",
"_setupGoLiveMenu",
"(",
")",
"{",
"LiveDevImpl",
".",
"on",
"(",
"\"statusChange\"",
",",
"function",
"statusChange",
"(",
"event",
",",
"status",
")",
"{",
"// Update the checkmark next to 'Live Preview' menu item",
"// Add checkmark when status is STATUS_ACTIVE... | Maintains state of the Live Preview menu item | [
"Maintains",
"state",
"of",
"the",
"Live",
"Preview",
"menu",
"item"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/main.js#L250-L257 |
1,892 | adobe/brackets | src/LiveDevelopment/main.js | _setImplementation | function _setImplementation(multibrowser) {
if (multibrowser) {
// set implemenation
LiveDevImpl = MultiBrowserLiveDev;
// update styles for UI status
_status = [
{ tooltip: Strings.LIVE_DEV_STATUS_TIP_NOT_CONNECTED, style: "warning" },
... | javascript | function _setImplementation(multibrowser) {
if (multibrowser) {
// set implemenation
LiveDevImpl = MultiBrowserLiveDev;
// update styles for UI status
_status = [
{ tooltip: Strings.LIVE_DEV_STATUS_TIP_NOT_CONNECTED, style: "warning" },
... | [
"function",
"_setImplementation",
"(",
"multibrowser",
")",
"{",
"if",
"(",
"multibrowser",
")",
"{",
"// set implemenation",
"LiveDevImpl",
"=",
"MultiBrowserLiveDev",
";",
"// update styles for UI status",
"_status",
"=",
"[",
"{",
"tooltip",
":",
"Strings",
".",
... | Sets the MultiBrowserLiveDev implementation if multibrowser is truthy,
keeps default LiveDevelopment implementation based on CDT otherwise.
It also resets the listeners and UI elements. | [
"Sets",
"the",
"MultiBrowserLiveDev",
"implementation",
"if",
"multibrowser",
"is",
"truthy",
"keeps",
"default",
"LiveDevelopment",
"implementation",
"based",
"on",
"CDT",
"otherwise",
".",
"It",
"also",
"resets",
"the",
"listeners",
"and",
"UI",
"elements",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/main.js#L279-L311 |
1,893 | adobe/brackets | src/LiveDevelopment/main.js | _setupDebugHelpers | function _setupDebugHelpers() {
window.ld = LiveDevelopment;
window.i = Inspector;
window.report = function report(params) { window.params = params; console.info(params); };
} | javascript | function _setupDebugHelpers() {
window.ld = LiveDevelopment;
window.i = Inspector;
window.report = function report(params) { window.params = params; console.info(params); };
} | [
"function",
"_setupDebugHelpers",
"(",
")",
"{",
"window",
".",
"ld",
"=",
"LiveDevelopment",
";",
"window",
".",
"i",
"=",
"Inspector",
";",
"window",
".",
"report",
"=",
"function",
"report",
"(",
"params",
")",
"{",
"window",
".",
"params",
"=",
"para... | Setup window references to useful LiveDevelopment modules | [
"Setup",
"window",
"references",
"to",
"useful",
"LiveDevelopment",
"modules"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/main.js#L314-L318 |
1,894 | adobe/brackets | src/extensions/default/AutoUpdate/main.js | checkIfAnotherSessionInProgress | function checkIfAnotherSessionInProgress() {
var result = $.Deferred();
if(updateJsonHandler) {
var state = updateJsonHandler.state;
updateJsonHandler.refresh()
.done(function() {
var val = updateJsonHandler.get(updateProgressKey);
... | javascript | function checkIfAnotherSessionInProgress() {
var result = $.Deferred();
if(updateJsonHandler) {
var state = updateJsonHandler.state;
updateJsonHandler.refresh()
.done(function() {
var val = updateJsonHandler.get(updateProgressKey);
... | [
"function",
"checkIfAnotherSessionInProgress",
"(",
")",
"{",
"var",
"result",
"=",
"$",
".",
"Deferred",
"(",
")",
";",
"if",
"(",
"updateJsonHandler",
")",
"{",
"var",
"state",
"=",
"updateJsonHandler",
".",
"state",
";",
"updateJsonHandler",
".",
"refresh",... | Checks if an auto update session is currently in progress
@returns {boolean} - true if an auto update session is currently in progress, false otherwise | [
"Checks",
"if",
"an",
"auto",
"update",
"session",
"is",
"currently",
"in",
"progress"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L102-L122 |
1,895 | adobe/brackets | src/extensions/default/AutoUpdate/main.js | receiveMessageFromNode | function receiveMessageFromNode(event, msgObj) {
if (functionMap[msgObj.fn]) {
if(domainID === msgObj.requester) {
functionMap[msgObj.fn].apply(null, msgObj.args);
}
}
} | javascript | function receiveMessageFromNode(event, msgObj) {
if (functionMap[msgObj.fn]) {
if(domainID === msgObj.requester) {
functionMap[msgObj.fn].apply(null, msgObj.args);
}
}
} | [
"function",
"receiveMessageFromNode",
"(",
"event",
",",
"msgObj",
")",
"{",
"if",
"(",
"functionMap",
"[",
"msgObj",
".",
"fn",
"]",
")",
"{",
"if",
"(",
"domainID",
"===",
"msgObj",
".",
"requester",
")",
"{",
"functionMap",
"[",
"msgObj",
".",
"fn",
... | Receives messages from node
@param {object} event - event received from node
@param {object} msgObj - json containing - {
fn - function to execute on Brackets side
args - arguments to the above function
requester - ID of the current requester domain | [
"Receives",
"messages",
"from",
"node"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L141-L147 |
1,896 | adobe/brackets | src/extensions/default/AutoUpdate/main.js | postMessageToNode | function postMessageToNode(messageId) {
var msg = {
fn: messageId,
args: getFunctionArgs(arguments),
requester: domainID
};
updateDomain.exec('data', msg);
} | javascript | function postMessageToNode(messageId) {
var msg = {
fn: messageId,
args: getFunctionArgs(arguments),
requester: domainID
};
updateDomain.exec('data', msg);
} | [
"function",
"postMessageToNode",
"(",
"messageId",
")",
"{",
"var",
"msg",
"=",
"{",
"fn",
":",
"messageId",
",",
"args",
":",
"getFunctionArgs",
"(",
"arguments",
")",
",",
"requester",
":",
"domainID",
"}",
";",
"updateDomain",
".",
"exec",
"(",
"'data'"... | Posts messages to node
@param {string} messageId - Message to be passed | [
"Posts",
"messages",
"to",
"node"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L185-L192 |
1,897 | adobe/brackets | src/extensions/default/AutoUpdate/main.js | checkInstallationStatus | function checkInstallationStatus() {
var searchParams = {
"updateDir": updateDir,
"installErrorStr": ["ERROR:"],
"bracketsErrorStr": ["ERROR:"],
"encoding": "utf8"
},
// Below are the possible Windows Installer error strings... | javascript | function checkInstallationStatus() {
var searchParams = {
"updateDir": updateDir,
"installErrorStr": ["ERROR:"],
"bracketsErrorStr": ["ERROR:"],
"encoding": "utf8"
},
// Below are the possible Windows Installer error strings... | [
"function",
"checkInstallationStatus",
"(",
")",
"{",
"var",
"searchParams",
"=",
"{",
"\"updateDir\"",
":",
"updateDir",
",",
"\"installErrorStr\"",
":",
"[",
"\"ERROR:\"",
"]",
",",
"\"bracketsErrorStr\"",
":",
"[",
"\"ERROR:\"",
"]",
",",
"\"encoding\"",
":",
... | Checks Install failure scenarios | [
"Checks",
"Install",
"failure",
"scenarios"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L197-L214 |
1,898 | adobe/brackets | src/extensions/default/AutoUpdate/main.js | checkUpdateStatus | function checkUpdateStatus() {
var filesToCache = ['.logs'],
downloadCompleted = updateJsonHandler.get("downloadCompleted"),
updateInitiatedInPrevSession = updateJsonHandler.get("updateInitiatedInPrevSession");
if (downloadCompleted && updateInitiatedInPrevSession) {
... | javascript | function checkUpdateStatus() {
var filesToCache = ['.logs'],
downloadCompleted = updateJsonHandler.get("downloadCompleted"),
updateInitiatedInPrevSession = updateJsonHandler.get("updateInitiatedInPrevSession");
if (downloadCompleted && updateInitiatedInPrevSession) {
... | [
"function",
"checkUpdateStatus",
"(",
")",
"{",
"var",
"filesToCache",
"=",
"[",
"'.logs'",
"]",
",",
"downloadCompleted",
"=",
"updateJsonHandler",
".",
"get",
"(",
"\"downloadCompleted\"",
")",
",",
"updateInitiatedInPrevSession",
"=",
"updateJsonHandler",
".",
"g... | Checks and handles the update success and failure scenarios | [
"Checks",
"and",
"handles",
"the",
"update",
"success",
"and",
"failure",
"scenarios"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L219-L260 |
1,899 | adobe/brackets | src/extensions/default/AutoUpdate/main.js | handleInstallationStatus | function handleInstallationStatus(statusObj) {
var errorCode = "",
errorline = statusObj.installError;
if (errorline) {
errorCode = errorline.substr(errorline.lastIndexOf(':') + 2, errorline.length);
}
HealthLogger.sendAnalyticsData(
autoUpdateEventNam... | javascript | function handleInstallationStatus(statusObj) {
var errorCode = "",
errorline = statusObj.installError;
if (errorline) {
errorCode = errorline.substr(errorline.lastIndexOf(':') + 2, errorline.length);
}
HealthLogger.sendAnalyticsData(
autoUpdateEventNam... | [
"function",
"handleInstallationStatus",
"(",
"statusObj",
")",
"{",
"var",
"errorCode",
"=",
"\"\"",
",",
"errorline",
"=",
"statusObj",
".",
"installError",
";",
"if",
"(",
"errorline",
")",
"{",
"errorCode",
"=",
"errorline",
".",
"substr",
"(",
"errorline",... | Send Installer Error Code to Analytics Server | [
"Send",
"Installer",
"Error",
"Code",
"to",
"Analytics",
"Server"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L266-L279 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.