id int32 0 58k | repo stringlengths 5 67 | path stringlengths 4 116 | func_name stringlengths 0 58 | original_string stringlengths 52 373k | language stringclasses 1
value | code stringlengths 52 373k | code_tokens list | docstring stringlengths 4 11.8k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 86 226 |
|---|---|---|---|---|---|---|---|---|---|---|---|
2,300 | adobe/brackets | src/search/FileFilters.js | filterFileList | function filterFileList(compiledFilter, files) {
if (!compiledFilter) {
return files;
}
var re = new RegExp(compiledFilter);
return files.filter(function (f) {
return !re.test(f.fullPath);
});
} | javascript | function filterFileList(compiledFilter, files) {
if (!compiledFilter) {
return files;
}
var re = new RegExp(compiledFilter);
return files.filter(function (f) {
return !re.test(f.fullPath);
});
} | [
"function",
"filterFileList",
"(",
"compiledFilter",
",",
"files",
")",
"{",
"if",
"(",
"!",
"compiledFilter",
")",
"{",
"return",
"files",
";",
"}",
"var",
"re",
"=",
"new",
"RegExp",
"(",
"compiledFilter",
")",
";",
"return",
"files",
".",
"filter",
"(... | Returns a copy of 'files' filtered to just those that don't match any of the exclusion globs in the filter.
@param {?string} compiledFilter 'Compiled' filter object as returned by compile(), or null to no-op
@param {!Array.<File>} files
@return {!Array.<File>} | [
"Returns",
"a",
"copy",
"of",
"files",
"filtered",
"to",
"just",
"those",
"that",
"don",
"t",
"match",
"any",
"of",
"the",
"exclusion",
"globs",
"in",
"the",
"filter",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FileFilters.js#L285-L294 |
2,301 | adobe/brackets | src/search/FileFilters.js | getPathsMatchingFilter | function getPathsMatchingFilter(compiledFilter, filePaths) {
if (!compiledFilter) {
return filePaths;
}
var re = new RegExp(compiledFilter);
return filePaths.filter(function (f) {
return f.match(re);
});
} | javascript | function getPathsMatchingFilter(compiledFilter, filePaths) {
if (!compiledFilter) {
return filePaths;
}
var re = new RegExp(compiledFilter);
return filePaths.filter(function (f) {
return f.match(re);
});
} | [
"function",
"getPathsMatchingFilter",
"(",
"compiledFilter",
",",
"filePaths",
")",
"{",
"if",
"(",
"!",
"compiledFilter",
")",
"{",
"return",
"filePaths",
";",
"}",
"var",
"re",
"=",
"new",
"RegExp",
"(",
"compiledFilter",
")",
";",
"return",
"filePaths",
"... | Returns a copy of 'file path' strings that match any of the exclusion globs in the filter.
@param {?string} compiledFilter 'Compiled' filter object as returned by compile(), or null to no-op
@param {!Array.<string>} An array with a list of full file paths that matches atleast one of the filter.
@return {!Array.<strin... | [
"Returns",
"a",
"copy",
"of",
"file",
"path",
"strings",
"that",
"match",
"any",
"of",
"the",
"exclusion",
"globs",
"in",
"the",
"filter",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FileFilters.js#L303-L312 |
2,302 | adobe/brackets | src/search/FileFilters.js | _handleDeleteFilter | function _handleDeleteFilter(e) {
// Remove the filter set from the preferences and
// clear the active filter set index from view state.
var filterSets = PreferencesManager.get("fileFilters") || [],
activeFilterIndex = PreferencesManager.getViewState("activeFileFilter"),
... | javascript | function _handleDeleteFilter(e) {
// Remove the filter set from the preferences and
// clear the active filter set index from view state.
var filterSets = PreferencesManager.get("fileFilters") || [],
activeFilterIndex = PreferencesManager.getViewState("activeFileFilter"),
... | [
"function",
"_handleDeleteFilter",
"(",
"e",
")",
"{",
"// Remove the filter set from the preferences and",
"// clear the active filter set index from view state.",
"var",
"filterSets",
"=",
"PreferencesManager",
".",
"get",
"(",
"\"fileFilters\"",
")",
"||",
"[",
"]",
",",
... | Remove the target item from the filter dropdown list and update dropdown button
and dropdown list UI.
@param {!Event} e Mouse events | [
"Remove",
"the",
"target",
"item",
"from",
"the",
"filter",
"dropdown",
"list",
"and",
"update",
"dropdown",
"button",
"and",
"dropdown",
"list",
"UI",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FileFilters.js#L434-L460 |
2,303 | adobe/brackets | src/search/FileFilters.js | _handleEditFilter | function _handleEditFilter(e) {
var filterSets = PreferencesManager.get("fileFilters") || [],
filterIndex = $(e.target).parent().data("index") - FIRST_FILTER_INDEX;
// Don't let the click bubble upward.
e.stopPropagation();
// Close the dropdown first before opening the ed... | javascript | function _handleEditFilter(e) {
var filterSets = PreferencesManager.get("fileFilters") || [],
filterIndex = $(e.target).parent().data("index") - FIRST_FILTER_INDEX;
// Don't let the click bubble upward.
e.stopPropagation();
// Close the dropdown first before opening the ed... | [
"function",
"_handleEditFilter",
"(",
"e",
")",
"{",
"var",
"filterSets",
"=",
"PreferencesManager",
".",
"get",
"(",
"\"fileFilters\"",
")",
"||",
"[",
"]",
",",
"filterIndex",
"=",
"$",
"(",
"e",
".",
"target",
")",
".",
"parent",
"(",
")",
".",
"dat... | Close filter dropdwon list and launch edit filter dialog.
@param {!Event} e Mouse events | [
"Close",
"filter",
"dropdwon",
"list",
"and",
"launch",
"edit",
"filter",
"dialog",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FileFilters.js#L466-L479 |
2,304 | adobe/brackets | src/search/FileFilters.js | _handleListRendered | function _handleListRendered(event, $dropdown) {
var activeFilterIndex = PreferencesManager.getViewState("activeFileFilter"),
checkedItemIndex = (activeFilterIndex > -1) ? (activeFilterIndex + FIRST_FILTER_INDEX) : -1;
_picker.setChecked(checkedItemIndex, true);
$dropdown.find(".fil... | javascript | function _handleListRendered(event, $dropdown) {
var activeFilterIndex = PreferencesManager.getViewState("activeFileFilter"),
checkedItemIndex = (activeFilterIndex > -1) ? (activeFilterIndex + FIRST_FILTER_INDEX) : -1;
_picker.setChecked(checkedItemIndex, true);
$dropdown.find(".fil... | [
"function",
"_handleListRendered",
"(",
"event",
",",
"$dropdown",
")",
"{",
"var",
"activeFilterIndex",
"=",
"PreferencesManager",
".",
"getViewState",
"(",
"\"activeFileFilter\"",
")",
",",
"checkedItemIndex",
"=",
"(",
"activeFilterIndex",
">",
"-",
"1",
")",
"... | Set up mouse click event listeners for 'Delete' and 'Edit' buttons
when the dropdown is open. Also set check mark on the active filter.
@param {!Event>} event listRendered event triggered when the dropdown is open
@param {!jQueryObject} $dropdown the jQuery DOM node of the dropdown list | [
"Set",
"up",
"mouse",
"click",
"event",
"listeners",
"for",
"Delete",
"and",
"Edit",
"buttons",
"when",
"the",
"dropdown",
"is",
"open",
".",
"Also",
"set",
"check",
"mark",
"on",
"the",
"active",
"filter",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FileFilters.js#L487-L497 |
2,305 | adobe/brackets | src/search/FindInFilesUI.js | searchAndShowResults | function searchAndShowResults(queryInfo, scope, filter, replaceText, candidateFilesPromise) {
return FindInFiles.doSearchInScope(queryInfo, scope, filter, replaceText, candidateFilesPromise)
.done(function (zeroFilesToken) {
// Done searching all files: show results
i... | javascript | function searchAndShowResults(queryInfo, scope, filter, replaceText, candidateFilesPromise) {
return FindInFiles.doSearchInScope(queryInfo, scope, filter, replaceText, candidateFilesPromise)
.done(function (zeroFilesToken) {
// Done searching all files: show results
i... | [
"function",
"searchAndShowResults",
"(",
"queryInfo",
",",
"scope",
",",
"filter",
",",
"replaceText",
",",
"candidateFilesPromise",
")",
"{",
"return",
"FindInFiles",
".",
"doSearchInScope",
"(",
"queryInfo",
",",
"scope",
",",
"filter",
",",
"replaceText",
",",
... | Does a search in the given scope with the given filter. Shows the result list once the search is complete.
@param {{query: string, caseSensitive: boolean, isRegexp: boolean}} queryInfo Query info object
@param {?Entry} scope Project file/subfolder to search within; else searches whole project.
@param {?string} filter A... | [
"Does",
"a",
"search",
"in",
"the",
"given",
"scope",
"with",
"the",
"given",
"filter",
".",
"Shows",
"the",
"result",
"list",
"once",
"the",
"search",
"is",
"complete",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindInFilesUI.js#L81-L115 |
2,306 | adobe/brackets | src/search/FindInFilesUI.js | searchAndReplaceResults | function searchAndReplaceResults(queryInfo, scope, filter, replaceText, candidateFilesPromise) {
return FindInFiles.doSearchInScope(queryInfo, scope, filter, replaceText, candidateFilesPromise)
.done(function (zeroFilesToken) {
// Done searching all files: replace all
... | javascript | function searchAndReplaceResults(queryInfo, scope, filter, replaceText, candidateFilesPromise) {
return FindInFiles.doSearchInScope(queryInfo, scope, filter, replaceText, candidateFilesPromise)
.done(function (zeroFilesToken) {
// Done searching all files: replace all
... | [
"function",
"searchAndReplaceResults",
"(",
"queryInfo",
",",
"scope",
",",
"filter",
",",
"replaceText",
",",
"candidateFilesPromise",
")",
"{",
"return",
"FindInFiles",
".",
"doSearchInScope",
"(",
"queryInfo",
",",
"scope",
",",
"filter",
",",
"replaceText",
",... | Does a search in the given scope with the given filter. Replace the result list once the search is complete.
@param {{query: string, caseSensitive: boolean, isRegexp: boolean}} queryInfo Query info object
@param {?Entry} scope Project file/subfolder to search within; else searches whole project.
@param {?string} filter... | [
"Does",
"a",
"search",
"in",
"the",
"given",
"scope",
"with",
"the",
"given",
"filter",
".",
"Replace",
"the",
"result",
"list",
"once",
"the",
"search",
"is",
"complete",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindInFilesUI.js#L127-L146 |
2,307 | adobe/brackets | src/search/FindInFilesUI.js | _defferedSearch | function _defferedSearch() {
if (_findBar && _findBar._options.multifile && !_findBar._options.replace) {
_findBar.redoInstantSearch();
}
} | javascript | function _defferedSearch() {
if (_findBar && _findBar._options.multifile && !_findBar._options.replace) {
_findBar.redoInstantSearch();
}
} | [
"function",
"_defferedSearch",
"(",
")",
"{",
"if",
"(",
"_findBar",
"&&",
"_findBar",
".",
"_options",
".",
"multifile",
"&&",
"!",
"_findBar",
".",
"_options",
".",
"replace",
")",
"{",
"_findBar",
".",
"redoInstantSearch",
"(",
")",
";",
"}",
"}"
] | Issues a search if find bar is visible and is multi file search and not instant search | [
"Issues",
"a",
"search",
"if",
"find",
"bar",
"is",
"visible",
"and",
"is",
"multi",
"file",
"search",
"and",
"not",
"instant",
"search"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindInFilesUI.js#L437-L441 |
2,308 | adobe/brackets | src/widgets/ModalBar.js | ModalBar | function ModalBar(template, autoClose, animate) {
if (animate === undefined) {
animate = true;
}
this._handleKeydown = this._handleKeydown.bind(this);
this._handleFocusChange = this._handleFocusChange.bind(this);
this._$root = $("<div class='modal-bar'/>")
... | javascript | function ModalBar(template, autoClose, animate) {
if (animate === undefined) {
animate = true;
}
this._handleKeydown = this._handleKeydown.bind(this);
this._handleFocusChange = this._handleFocusChange.bind(this);
this._$root = $("<div class='modal-bar'/>")
... | [
"function",
"ModalBar",
"(",
"template",
",",
"autoClose",
",",
"animate",
")",
"{",
"if",
"(",
"animate",
"===",
"undefined",
")",
"{",
"animate",
"=",
"true",
";",
"}",
"this",
".",
"_handleKeydown",
"=",
"this",
".",
"_handleKeydown",
".",
"bind",
"("... | Creates a modal bar whose contents are the given template.
Dispatches one event:
- close - When the bar is closed, either via close() or via autoClose. After this event, the
bar may remain visible and in the DOM while its closing animation is playing. However,
by the time "close" is fired, the bar has been "popped out... | [
"Creates",
"a",
"modal",
"bar",
"whose",
"contents",
"are",
"the",
"given",
"template",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/widgets/ModalBar.js#L56-L102 |
2,309 | adobe/brackets | src/extensions/default/CodeFolding/Prefs.js | simplify | function simplify(folds) {
if (!folds) {
return;
}
var res = {}, range;
Object.keys(folds).forEach(function (line) {
range = folds[line];
res[line] = Array.isArray(range) ? range : [[range.from.line, range.from.ch], [range.to.line, range.to.ch]];
... | javascript | function simplify(folds) {
if (!folds) {
return;
}
var res = {}, range;
Object.keys(folds).forEach(function (line) {
range = folds[line];
res[line] = Array.isArray(range) ? range : [[range.from.line, range.from.ch], [range.to.line, range.to.ch]];
... | [
"function",
"simplify",
"(",
"folds",
")",
"{",
"if",
"(",
"!",
"folds",
")",
"{",
"return",
";",
"}",
"var",
"res",
"=",
"{",
"}",
",",
"range",
";",
"Object",
".",
"keys",
"(",
"folds",
")",
".",
"forEach",
"(",
"function",
"(",
"line",
")",
... | Simplifies the fold ranges into an array of pairs of numbers.
@param {!Object} folds the raw fold ranges indexed by line numbers
@return {Object} an object whose keys are line numbers and the values are array
of two 2-element arrays. First array contains [from.line, from.ch] and the second contains [to.line, to.ch] | [
"Simplifies",
"the",
"fold",
"ranges",
"into",
"an",
"array",
"of",
"pairs",
"of",
"numbers",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/Prefs.js#L49-L59 |
2,310 | adobe/brackets | src/extensions/default/CodeFolding/Prefs.js | getFolds | function getFolds(path) {
var context = getViewStateContext();
var folds = PreferencesManager.getViewState(FOLDS_PREF_KEY, context);
return inflate(folds[path]);
} | javascript | function getFolds(path) {
var context = getViewStateContext();
var folds = PreferencesManager.getViewState(FOLDS_PREF_KEY, context);
return inflate(folds[path]);
} | [
"function",
"getFolds",
"(",
"path",
")",
"{",
"var",
"context",
"=",
"getViewStateContext",
"(",
")",
";",
"var",
"folds",
"=",
"PreferencesManager",
".",
"getViewState",
"(",
"FOLDS_PREF_KEY",
",",
"context",
")",
";",
"return",
"inflate",
"(",
"folds",
"[... | Gets the line folds saved for the specified path.
@param {string} path the document path
@return {Object} the line folds for the document at the specified path | [
"Gets",
"the",
"line",
"folds",
"saved",
"for",
"the",
"specified",
"path",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/Prefs.js#L97-L101 |
2,311 | adobe/brackets | src/extensions/default/CodeFolding/Prefs.js | setFolds | function setFolds(path, folds) {
var context = getViewStateContext();
var allFolds = PreferencesManager.getViewState(FOLDS_PREF_KEY, context);
allFolds[path] = simplify(folds);
PreferencesManager.setViewState(FOLDS_PREF_KEY, allFolds, context);
} | javascript | function setFolds(path, folds) {
var context = getViewStateContext();
var allFolds = PreferencesManager.getViewState(FOLDS_PREF_KEY, context);
allFolds[path] = simplify(folds);
PreferencesManager.setViewState(FOLDS_PREF_KEY, allFolds, context);
} | [
"function",
"setFolds",
"(",
"path",
",",
"folds",
")",
"{",
"var",
"context",
"=",
"getViewStateContext",
"(",
")",
";",
"var",
"allFolds",
"=",
"PreferencesManager",
".",
"getViewState",
"(",
"FOLDS_PREF_KEY",
",",
"context",
")",
";",
"allFolds",
"[",
"pa... | Saves the line folds for the specified path
@param {!string} path the path to the document
@param {Object} folds the fold ranges to save for the current document | [
"Saves",
"the",
"line",
"folds",
"for",
"the",
"specified",
"path"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/Prefs.js#L108-L113 |
2,312 | adobe/brackets | src/extensions/default/InlineTimingFunctionEditor/TimingFunctionUtils.js | _convertToNumber | function _convertToNumber(str) {
if (typeof str !== "string") {
return { isNumber: false, value: null };
}
var val = parseFloat(+str, 10),
isNum = (typeof val === "number") && !isNaN(val) &&
(val !== Infinity) && (val !== -Infinity);
return {... | javascript | function _convertToNumber(str) {
if (typeof str !== "string") {
return { isNumber: false, value: null };
}
var val = parseFloat(+str, 10),
isNum = (typeof val === "number") && !isNaN(val) &&
(val !== Infinity) && (val !== -Infinity);
return {... | [
"function",
"_convertToNumber",
"(",
"str",
")",
"{",
"if",
"(",
"typeof",
"str",
"!==",
"\"string\"",
")",
"{",
"return",
"{",
"isNumber",
":",
"false",
",",
"value",
":",
"null",
"}",
";",
"}",
"var",
"val",
"=",
"parseFloat",
"(",
"+",
"str",
",",... | If string is a number, then convert it.
@param {string} str value parsed from page.
@return { isNumber: boolean, value: ?number } | [
"If",
"string",
"is",
"a",
"number",
"then",
"convert",
"it",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/TimingFunctionUtils.js#L64-L77 |
2,313 | adobe/brackets | src/extensions/default/InlineTimingFunctionEditor/TimingFunctionUtils.js | _getValidBezierParams | function _getValidBezierParams(match) {
var param,
// take ease-in-out as default value in case there are no params yet (or they are invalid)
def = [ ".42", "0", ".58", "1" ],
oldIndex = match.index, // we need to store the old match.index to re-set the index afterwards
... | javascript | function _getValidBezierParams(match) {
var param,
// take ease-in-out as default value in case there are no params yet (or they are invalid)
def = [ ".42", "0", ".58", "1" ],
oldIndex = match.index, // we need to store the old match.index to re-set the index afterwards
... | [
"function",
"_getValidBezierParams",
"(",
"match",
")",
"{",
"var",
"param",
",",
"// take ease-in-out as default value in case there are no params yet (or they are invalid)",
"def",
"=",
"[",
"\".42\"",
",",
"\"0\"",
",",
"\".58\"",
",",
"\"1\"",
"]",
",",
"oldIndex",
... | Get valid params for an invalid cubic-bezier.
@param {RegExp.match} match (Invalid) matches from cubicBezierMatch()
@return {?RegExp.match} Valid match or null if the output is not valid | [
"Get",
"valid",
"params",
"for",
"an",
"invalid",
"cubic",
"-",
"bezier",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/TimingFunctionUtils.js#L85-L136 |
2,314 | adobe/brackets | src/extensions/default/InlineTimingFunctionEditor/TimingFunctionUtils.js | _getValidStepsParams | function _getValidStepsParams(match) {
var param,
def = [ "5", "end" ],
params = def,
oldIndex = match.index, // we need to store the old match.index to re-set the index afterwards
originalString = match[0];
if (match) {
match = match[1].split... | javascript | function _getValidStepsParams(match) {
var param,
def = [ "5", "end" ],
params = def,
oldIndex = match.index, // we need to store the old match.index to re-set the index afterwards
originalString = match[0];
if (match) {
match = match[1].split... | [
"function",
"_getValidStepsParams",
"(",
"match",
")",
"{",
"var",
"param",
",",
"def",
"=",
"[",
"\"5\"",
",",
"\"end\"",
"]",
",",
"params",
"=",
"def",
",",
"oldIndex",
"=",
"match",
".",
"index",
",",
"// we need to store the old match.index to re-set the in... | Get valid params for an invalid steps function.
@param {RegExp.match} match (Invalid) matches from stepsMatch()
@return {?RegExp.match} Valid match or null if the output is not valid | [
"Get",
"valid",
"params",
"for",
"an",
"invalid",
"steps",
"function",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/TimingFunctionUtils.js#L170-L223 |
2,315 | adobe/brackets | src/extensions/default/InlineTimingFunctionEditor/TimingFunctionUtils.js | showHideHint | function showHideHint(hint, show, documentCode, editorCode) {
if (!hint || !hint.elem) {
return;
}
if (show) {
hint.shown = true;
hint.animationInProgress = false;
hint.elem.removeClass("fadeout");
hint.elem.html(StringUtils.format(Str... | javascript | function showHideHint(hint, show, documentCode, editorCode) {
if (!hint || !hint.elem) {
return;
}
if (show) {
hint.shown = true;
hint.animationInProgress = false;
hint.elem.removeClass("fadeout");
hint.elem.html(StringUtils.format(Str... | [
"function",
"showHideHint",
"(",
"hint",
",",
"show",
",",
"documentCode",
",",
"editorCode",
")",
"{",
"if",
"(",
"!",
"hint",
"||",
"!",
"hint",
".",
"elem",
")",
"{",
"return",
";",
"}",
"if",
"(",
"show",
")",
"{",
"hint",
".",
"shown",
"=",
... | Show, hide or update the hint text
@param {object} hint Editor.hint object of the current InlineTimingFunctionEditor
@param {boolean} show Whether the hint should be shown or hidden
@param {string=} documentCode The invalid code from the document (can be omitted when hiding)
@param {string=} editorCode The valid code ... | [
"Show",
"hide",
"or",
"update",
"the",
"hint",
"text"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/TimingFunctionUtils.js#L254-L278 |
2,316 | adobe/brackets | src/extensions/default/InlineTimingFunctionEditor/TimingFunctionUtils.js | _tagMatch | function _tagMatch(match, type) {
switch (type) {
case BEZIER:
match.isBezier = true;
break;
case STEP:
match.isStep = true;
break;
}
return match;
} | javascript | function _tagMatch(match, type) {
switch (type) {
case BEZIER:
match.isBezier = true;
break;
case STEP:
match.isStep = true;
break;
}
return match;
} | [
"function",
"_tagMatch",
"(",
"match",
",",
"type",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"BEZIER",
":",
"match",
".",
"isBezier",
"=",
"true",
";",
"break",
";",
"case",
"STEP",
":",
"match",
".",
"isStep",
"=",
"true",
";",
"break",
... | Tag this match with type and return it for chaining
@param {!RegExp.match} match RegExp Match object with steps function parameters
in array position 1 (and optionally 2).
@param {number} type Either BEZIER or STEP
@return {RegExp.match} Same object that was passed in. | [
"Tag",
"this",
"match",
"with",
"type",
"and",
"return",
"it",
"for",
"chaining"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/TimingFunctionUtils.js#L288-L299 |
2,317 | adobe/brackets | src/extensions/default/InlineTimingFunctionEditor/TimingFunctionUtils.js | bezierCurveMatch | function bezierCurveMatch(str, lax) {
var match;
// First look for any cubic-bezier().
match = str.match(BEZIER_CURVE_VALID_REGEX);
if (match && _validateCubicBezierParams(match)) { // cubic-bezier() with valid params
return _tagMatch(match, BEZIER);
}
match... | javascript | function bezierCurveMatch(str, lax) {
var match;
// First look for any cubic-bezier().
match = str.match(BEZIER_CURVE_VALID_REGEX);
if (match && _validateCubicBezierParams(match)) { // cubic-bezier() with valid params
return _tagMatch(match, BEZIER);
}
match... | [
"function",
"bezierCurveMatch",
"(",
"str",
",",
"lax",
")",
"{",
"var",
"match",
";",
"// First look for any cubic-bezier().",
"match",
"=",
"str",
".",
"match",
"(",
"BEZIER_CURVE_VALID_REGEX",
")",
";",
"if",
"(",
"match",
"&&",
"_validateCubicBezierParams",
"(... | Match a bezier curve function value from a CSS Declaration or Value.
Matches returned from this function must be handled in
BezierCurveEditor._getCubicBezierCoords().
@param {string} str Input string.
@param {!boolean} lax Parsing mode where:
lax=false Input is a Full or partial line containing CSS Declaration.
Thi... | [
"Match",
"a",
"bezier",
"curve",
"function",
"value",
"from",
"a",
"CSS",
"Declaration",
"or",
"Value",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/TimingFunctionUtils.js#L315-L368 |
2,318 | adobe/brackets | src/extensions/default/InlineTimingFunctionEditor/TimingFunctionUtils.js | stepsMatch | function stepsMatch(str, lax) {
var match;
// First look for any steps().
match = str.match(STEPS_VALID_REGEX);
if (match && _validateStepsParams(match)) { // cubic-bezier() with valid params
return _tagMatch(match, STEP);
}
match = str.match(STEPS_GENERAL_R... | javascript | function stepsMatch(str, lax) {
var match;
// First look for any steps().
match = str.match(STEPS_VALID_REGEX);
if (match && _validateStepsParams(match)) { // cubic-bezier() with valid params
return _tagMatch(match, STEP);
}
match = str.match(STEPS_GENERAL_R... | [
"function",
"stepsMatch",
"(",
"str",
",",
"lax",
")",
"{",
"var",
"match",
";",
"// First look for any steps().",
"match",
"=",
"str",
".",
"match",
"(",
"STEPS_VALID_REGEX",
")",
";",
"if",
"(",
"match",
"&&",
"_validateStepsParams",
"(",
"match",
")",
")"... | Match a steps function value from a CSS Declaration or Value.
Matches returned from this function must be handled in
BezierCurveEditor._getCubicBezierCoords().
@param {string} str Input string.
@param {!boolean} lax Parsing mode where:
lax=false Input is a Full or partial line containing CSS Declaration.
This is th... | [
"Match",
"a",
"steps",
"function",
"value",
"from",
"a",
"CSS",
"Declaration",
"or",
"Value",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/TimingFunctionUtils.js#L384-L420 |
2,319 | adobe/brackets | src/preferences/PreferencesDialogs.js | _validateBaseUrl | function _validateBaseUrl(url) {
var result = "";
// Empty url means "no server mapping; use file directly"
if (url === "") {
return result;
}
var obj = PathUtils.parseUrl(url);
if (!obj) {
result = Strings.BASEURL_ERROR_UNKNOWN_ERROR;
} e... | javascript | function _validateBaseUrl(url) {
var result = "";
// Empty url means "no server mapping; use file directly"
if (url === "") {
return result;
}
var obj = PathUtils.parseUrl(url);
if (!obj) {
result = Strings.BASEURL_ERROR_UNKNOWN_ERROR;
} e... | [
"function",
"_validateBaseUrl",
"(",
"url",
")",
"{",
"var",
"result",
"=",
"\"\"",
";",
"// Empty url means \"no server mapping; use file directly\"",
"if",
"(",
"url",
"===",
"\"\"",
")",
"{",
"return",
"result",
";",
"}",
"var",
"obj",
"=",
"PathUtils",
".",
... | Validate that text string is a valid base url which should map to a server folder
@param {string} url
@return {string} Empty string if valid, otherwise error string | [
"Validate",
"that",
"text",
"string",
"is",
"a",
"valid",
"base",
"url",
"which",
"should",
"map",
"to",
"a",
"server",
"folder"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesDialogs.js#L45-L69 |
2,320 | adobe/brackets | src/preferences/PreferencesDialogs.js | showProjectPreferencesDialog | function showProjectPreferencesDialog(baseUrl, errorMessage) {
var $baseUrlControl,
dialog;
// Title
var projectName = "",
projectRoot = ProjectManager.getProjectRoot(),
title;
if (projectRoot) {
projectName = projectRoot.name;
}
... | javascript | function showProjectPreferencesDialog(baseUrl, errorMessage) {
var $baseUrlControl,
dialog;
// Title
var projectName = "",
projectRoot = ProjectManager.getProjectRoot(),
title;
if (projectRoot) {
projectName = projectRoot.name;
}
... | [
"function",
"showProjectPreferencesDialog",
"(",
"baseUrl",
",",
"errorMessage",
")",
"{",
"var",
"$baseUrlControl",
",",
"dialog",
";",
"// Title",
"var",
"projectName",
"=",
"\"\"",
",",
"projectRoot",
"=",
"ProjectManager",
".",
"getProjectRoot",
"(",
")",
",",... | Show a dialog that shows the project preferences
@param {string} baseUrl Initial value
@param {string} errorMessage Error to display
@return {Dialog} A Dialog object with an internal promise that will be resolved with the ID
of the clicked button when the dialog is dismissed. Never rejected. | [
"Show",
"a",
"dialog",
"that",
"shows",
"the",
"project",
"preferences"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesDialogs.js#L78-L125 |
2,321 | adobe/brackets | src/LiveDevelopment/Agents/RemoteFunctions.js | _validEvent | function _validEvent(event) {
if (window.navigator.platform.substr(0, 3) === "Mac") {
// Mac
return event.metaKey;
} else {
// Windows
return event.ctrlKey;
}
} | javascript | function _validEvent(event) {
if (window.navigator.platform.substr(0, 3) === "Mac") {
// Mac
return event.metaKey;
} else {
// Windows
return event.ctrlKey;
}
} | [
"function",
"_validEvent",
"(",
"event",
")",
"{",
"if",
"(",
"window",
".",
"navigator",
".",
"platform",
".",
"substr",
"(",
"0",
",",
"3",
")",
"===",
"\"Mac\"",
")",
"{",
"// Mac",
"return",
"event",
".",
"metaKey",
";",
"}",
"else",
"{",
"// Win... | Keep alive timeout value, in milliseconds determine whether an event should be processed for Live Development | [
"Keep",
"alive",
"timeout",
"value",
"in",
"milliseconds",
"determine",
"whether",
"an",
"event",
"should",
"be",
"processed",
"for",
"Live",
"Development"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/RemoteFunctions.js#L66-L74 |
2,322 | adobe/brackets | src/LiveDevelopment/Agents/RemoteFunctions.js | _screenOffset | function _screenOffset(element) {
var elemBounds = element.getBoundingClientRect(),
body = window.document.body,
offsetTop,
offsetLeft;
if (window.getComputedStyle(body).position === "static") {
offsetLeft = elemBounds.left + window.pageXOffset;
... | javascript | function _screenOffset(element) {
var elemBounds = element.getBoundingClientRect(),
body = window.document.body,
offsetTop,
offsetLeft;
if (window.getComputedStyle(body).position === "static") {
offsetLeft = elemBounds.left + window.pageXOffset;
... | [
"function",
"_screenOffset",
"(",
"element",
")",
"{",
"var",
"elemBounds",
"=",
"element",
".",
"getBoundingClientRect",
"(",
")",
",",
"body",
"=",
"window",
".",
"document",
".",
"body",
",",
"offsetTop",
",",
"offsetLeft",
";",
"if",
"(",
"window",
"."... | compute the screen offset of an element | [
"compute",
"the",
"screen",
"offset",
"of",
"an",
"element"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/RemoteFunctions.js#L91-L106 |
2,323 | adobe/brackets | src/LiveDevelopment/Agents/RemoteFunctions.js | _trigger | function _trigger(element, name, value, autoRemove) {
var key = "data-ld-" + name;
if (value !== undefined && value !== null) {
element.setAttribute(key, value);
if (autoRemove) {
window.setTimeout(element.removeAttribute.bind(element, key));
}
... | javascript | function _trigger(element, name, value, autoRemove) {
var key = "data-ld-" + name;
if (value !== undefined && value !== null) {
element.setAttribute(key, value);
if (autoRemove) {
window.setTimeout(element.removeAttribute.bind(element, key));
}
... | [
"function",
"_trigger",
"(",
"element",
",",
"name",
",",
"value",
",",
"autoRemove",
")",
"{",
"var",
"key",
"=",
"\"data-ld-\"",
"+",
"name",
";",
"if",
"(",
"value",
"!==",
"undefined",
"&&",
"value",
"!==",
"null",
")",
"{",
"element",
".",
"setAtt... | set an event on a element | [
"set",
"an",
"event",
"on",
"a",
"element"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/RemoteFunctions.js#L109-L119 |
2,324 | adobe/brackets | src/LiveDevelopment/Agents/RemoteFunctions.js | isInViewport | function isInViewport(element) {
var rect = element.getBoundingClientRect();
var html = window.document.documentElement;
return (
rect.top >= 0 &&
rect.left >= 0 &&
rect.bottom <= (window.innerHeight || html.clientHeight) &&
rect.right <= (window.i... | javascript | function isInViewport(element) {
var rect = element.getBoundingClientRect();
var html = window.document.documentElement;
return (
rect.top >= 0 &&
rect.left >= 0 &&
rect.bottom <= (window.innerHeight || html.clientHeight) &&
rect.right <= (window.i... | [
"function",
"isInViewport",
"(",
"element",
")",
"{",
"var",
"rect",
"=",
"element",
".",
"getBoundingClientRect",
"(",
")",
";",
"var",
"html",
"=",
"window",
".",
"document",
".",
"documentElement",
";",
"return",
"(",
"rect",
".",
"top",
">=",
"0",
"&... | Checks if the element is in Viewport in the client browser | [
"Checks",
"if",
"the",
"element",
"is",
"in",
"Viewport",
"in",
"the",
"client",
"browser"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/RemoteFunctions.js#L122-L131 |
2,325 | adobe/brackets | src/LiveDevelopment/Agents/RemoteFunctions.js | Menu | function Menu(element) {
this.element = element;
_trigger(this.element, "showgoto", 1, true);
window.setTimeout(window.remoteShowGoto);
this.remove = this.remove.bind(this);
} | javascript | function Menu(element) {
this.element = element;
_trigger(this.element, "showgoto", 1, true);
window.setTimeout(window.remoteShowGoto);
this.remove = this.remove.bind(this);
} | [
"function",
"Menu",
"(",
"element",
")",
"{",
"this",
".",
"element",
"=",
"element",
";",
"_trigger",
"(",
"this",
".",
"element",
",",
"\"showgoto\"",
",",
"1",
",",
"true",
")",
";",
"window",
".",
"setTimeout",
"(",
"window",
".",
"remoteShowGoto",
... | construct the info menu | [
"construct",
"the",
"info",
"menu"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/RemoteFunctions.js#L139-L144 |
2,326 | adobe/brackets | src/LiveDevelopment/Agents/RemoteFunctions.js | highlight | function highlight(node, clear) {
if (!_remoteHighlight) {
_remoteHighlight = new Highlight("#cfc");
}
if (clear) {
_remoteHighlight.clear();
}
_remoteHighlight.add(node, true);
} | javascript | function highlight(node, clear) {
if (!_remoteHighlight) {
_remoteHighlight = new Highlight("#cfc");
}
if (clear) {
_remoteHighlight.clear();
}
_remoteHighlight.add(node, true);
} | [
"function",
"highlight",
"(",
"node",
",",
"clear",
")",
"{",
"if",
"(",
"!",
"_remoteHighlight",
")",
"{",
"_remoteHighlight",
"=",
"new",
"Highlight",
"(",
"\"#cfc\"",
")",
";",
"}",
"if",
"(",
"clear",
")",
"{",
"_remoteHighlight",
".",
"clear",
"(",
... | highlight a node | [
"highlight",
"a",
"node"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/RemoteFunctions.js#L664-L672 |
2,327 | adobe/brackets | src/LiveDevelopment/Agents/RemoteFunctions.js | highlightRule | function highlightRule(rule) {
hideHighlight();
var i, nodes = window.document.querySelectorAll(rule);
for (i = 0; i < nodes.length; i++) {
highlight(nodes[i]);
}
_remoteHighlight.selector = rule;
} | javascript | function highlightRule(rule) {
hideHighlight();
var i, nodes = window.document.querySelectorAll(rule);
for (i = 0; i < nodes.length; i++) {
highlight(nodes[i]);
}
_remoteHighlight.selector = rule;
} | [
"function",
"highlightRule",
"(",
"rule",
")",
"{",
"hideHighlight",
"(",
")",
";",
"var",
"i",
",",
"nodes",
"=",
"window",
".",
"document",
".",
"querySelectorAll",
"(",
"rule",
")",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"nodes",
".",
"l... | highlight a rule | [
"highlight",
"a",
"rule"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/RemoteFunctions.js#L675-L682 |
2,328 | adobe/brackets | src/LiveDevelopment/Agents/RemoteFunctions.js | _scrollHandler | function _scrollHandler(e) {
// Document scrolls can be updated immediately. Any other scrolls
// need to be updated on a timer to ensure the layout is correct.
if (e.target === window.document) {
redrawHighlights();
} else {
if (_remoteHighlight || _localHighligh... | javascript | function _scrollHandler(e) {
// Document scrolls can be updated immediately. Any other scrolls
// need to be updated on a timer to ensure the layout is correct.
if (e.target === window.document) {
redrawHighlights();
} else {
if (_remoteHighlight || _localHighligh... | [
"function",
"_scrollHandler",
"(",
"e",
")",
"{",
"// Document scrolls can be updated immediately. Any other scrolls",
"// need to be updated on a timer to ensure the layout is correct.",
"if",
"(",
"e",
".",
"target",
"===",
"window",
".",
"document",
")",
"{",
"redrawHighligh... | Add a capture-phase scroll listener to update highlights when any element scrolls. | [
"Add",
"a",
"capture",
"-",
"phase",
"scroll",
"listener",
"to",
"update",
"highlights",
"when",
"any",
"element",
"scrolls",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/RemoteFunctions.js#L695-L705 |
2,329 | adobe/brackets | src/utils/StringMatch.js | findMatchingSpecial | function findMatchingSpecial() {
// used to loop through the specials
var i;
for (i = specialsCounter; i < specials.length; i++) {
// short circuit this search when we know there are no matches following
if (specials[i] >= deadBranches[queryCounter]) ... | javascript | function findMatchingSpecial() {
// used to loop through the specials
var i;
for (i = specialsCounter; i < specials.length; i++) {
// short circuit this search when we know there are no matches following
if (specials[i] >= deadBranches[queryCounter]) ... | [
"function",
"findMatchingSpecial",
"(",
")",
"{",
"// used to loop through the specials",
"var",
"i",
";",
"for",
"(",
"i",
"=",
"specialsCounter",
";",
"i",
"<",
"specials",
".",
"length",
";",
"i",
"++",
")",
"{",
"// short circuit this search when we know there a... | Compares the current character from the query string against the special characters in str. Returns true if a match was found, false otherwise. | [
"Compares",
"the",
"current",
"character",
"from",
"the",
"query",
"string",
"against",
"the",
"special",
"characters",
"in",
"str",
".",
"Returns",
"true",
"if",
"a",
"match",
"was",
"found",
"false",
"otherwise",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/StringMatch.js#L255-L288 |
2,330 | adobe/brackets | src/utils/StringMatch.js | backtrack | function backtrack() {
// The idea is to pull matches off of our match list, rolling back
// characters from the query. We pay special attention to the special
// characters since they are searched first.
while (result.length > 0) {
var item = result.pop(... | javascript | function backtrack() {
// The idea is to pull matches off of our match list, rolling back
// characters from the query. We pay special attention to the special
// characters since they are searched first.
while (result.length > 0) {
var item = result.pop(... | [
"function",
"backtrack",
"(",
")",
"{",
"// The idea is to pull matches off of our match list, rolling back",
"// characters from the query. We pay special attention to the special",
"// characters since they are searched first.",
"while",
"(",
"result",
".",
"length",
">",
"0",
")",
... | This function implements the backtracking that is done when we fail to find a match with the query using the "search for specials first" approach. returns false when it is not able to backtrack successfully | [
"This",
"function",
"implements",
"the",
"backtracking",
"that",
"is",
"done",
"when",
"we",
"fail",
"to",
"find",
"a",
"match",
"with",
"the",
"query",
"using",
"the",
"search",
"for",
"specials",
"first",
"approach",
".",
"returns",
"false",
"when",
"it",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/StringMatch.js#L294-L344 |
2,331 | adobe/brackets | src/utils/StringMatch.js | closeRangeGap | function closeRangeGap(c) {
// Close the current range
if (currentRange) {
currentRange.includesLastSegment = lastMatchIndex >= lastSegmentStart;
if (currentRange.matched && currentRange.includesLastSegment) {
if (DEBUG_SCORES) {
... | javascript | function closeRangeGap(c) {
// Close the current range
if (currentRange) {
currentRange.includesLastSegment = lastMatchIndex >= lastSegmentStart;
if (currentRange.matched && currentRange.includesLastSegment) {
if (DEBUG_SCORES) {
... | [
"function",
"closeRangeGap",
"(",
"c",
")",
"{",
"// Close the current range",
"if",
"(",
"currentRange",
")",
"{",
"currentRange",
".",
"includesLastSegment",
"=",
"lastMatchIndex",
">=",
"lastSegmentStart",
";",
"if",
"(",
"currentRange",
".",
"matched",
"&&",
"... | Records the current range and adds any additional ranges required to get to character index c. This function is called before starting a new range or returning from the function. | [
"Records",
"the",
"current",
"range",
"and",
"adds",
"any",
"additional",
"ranges",
"required",
"to",
"get",
"to",
"character",
"index",
"c",
".",
"This",
"function",
"is",
"called",
"before",
"starting",
"a",
"new",
"range",
"or",
"returning",
"from",
"the"... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/StringMatch.js#L534-L565 |
2,332 | adobe/brackets | src/utils/StringMatch.js | addMatch | function addMatch(match) {
// Pull off the character index
var c = match.index;
var newPoints = 0;
// A match means that we need to do some scoring bookkeeping.
// Start with points added for any match
if (DEBUG_SCORES) {
scoreDebu... | javascript | function addMatch(match) {
// Pull off the character index
var c = match.index;
var newPoints = 0;
// A match means that we need to do some scoring bookkeeping.
// Start with points added for any match
if (DEBUG_SCORES) {
scoreDebu... | [
"function",
"addMatch",
"(",
"match",
")",
"{",
"// Pull off the character index",
"var",
"c",
"=",
"match",
".",
"index",
";",
"var",
"newPoints",
"=",
"0",
";",
"// A match means that we need to do some scoring bookkeeping.",
"// Start with points added for any match",
"i... | Adds a matched character to the appropriate range | [
"Adds",
"a",
"matched",
"character",
"to",
"the",
"appropriate",
"range"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/StringMatch.js#L572-L668 |
2,333 | adobe/brackets | src/editor/InlineTextEditor.js | _syncGutterWidths | function _syncGutterWidths(hostEditor) {
var allHostedEditors = EditorManager.getInlineEditors(hostEditor);
// add the host itself to the list too
allHostedEditors.push(hostEditor);
var maxWidth = 0;
allHostedEditors.forEach(function (editor) {
var $gutter = $(edito... | javascript | function _syncGutterWidths(hostEditor) {
var allHostedEditors = EditorManager.getInlineEditors(hostEditor);
// add the host itself to the list too
allHostedEditors.push(hostEditor);
var maxWidth = 0;
allHostedEditors.forEach(function (editor) {
var $gutter = $(edito... | [
"function",
"_syncGutterWidths",
"(",
"hostEditor",
")",
"{",
"var",
"allHostedEditors",
"=",
"EditorManager",
".",
"getInlineEditors",
"(",
"hostEditor",
")",
";",
"// add the host itself to the list too",
"allHostedEditors",
".",
"push",
"(",
"hostEditor",
")",
";",
... | Given a host editor and its inline editors, find the widest gutter and make all the others match
@param {!Editor} hostEditor Host editor containing all the inline editors to sync
@private | [
"Given",
"a",
"host",
"editor",
"and",
"its",
"inline",
"editors",
"find",
"the",
"widest",
"gutter",
"and",
"make",
"all",
"the",
"others",
"match"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/InlineTextEditor.js#L96-L125 |
2,334 | adobe/brackets | src/extensions/default/StaticServer/node/StaticServerDomain.js | init | function init(domainManager) {
_domainManager = domainManager;
if (!domainManager.hasDomain("staticServer")) {
domainManager.registerDomain("staticServer", {major: 0, minor: 1});
}
_domainManager.registerCommand(
"staticServer",
"_setRequestFilterTimeout",
_cmdSetRequest... | javascript | function init(domainManager) {
_domainManager = domainManager;
if (!domainManager.hasDomain("staticServer")) {
domainManager.registerDomain("staticServer", {major: 0, minor: 1});
}
_domainManager.registerCommand(
"staticServer",
"_setRequestFilterTimeout",
_cmdSetRequest... | [
"function",
"init",
"(",
"domainManager",
")",
"{",
"_domainManager",
"=",
"domainManager",
";",
"if",
"(",
"!",
"domainManager",
".",
"hasDomain",
"(",
"\"staticServer\"",
")",
")",
"{",
"domainManager",
".",
"registerDomain",
"(",
"\"staticServer\"",
",",
"{",... | Initializes the StaticServer domain with its commands.
@param {DomainManager} domainManager The DomainManager for the server | [
"Initializes",
"the",
"StaticServer",
"domain",
"with",
"its",
"commands",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/StaticServer/node/StaticServerDomain.js#L361-L475 |
2,335 | adobe/brackets | src/search/FindUtils.js | _doReplaceInDocument | function _doReplaceInDocument(doc, matchInfo, replaceText, isRegexp) {
// Double-check that the open document's timestamp matches the one we recorded. This
// should normally never go out of sync, because if it did we wouldn't start the
// replace in the first place (due to the fact that we imme... | javascript | function _doReplaceInDocument(doc, matchInfo, replaceText, isRegexp) {
// Double-check that the open document's timestamp matches the one we recorded. This
// should normally never go out of sync, because if it did we wouldn't start the
// replace in the first place (due to the fact that we imme... | [
"function",
"_doReplaceInDocument",
"(",
"doc",
",",
"matchInfo",
",",
"replaceText",
",",
"isRegexp",
")",
"{",
"// Double-check that the open document's timestamp matches the one we recorded. This",
"// should normally never go out of sync, because if it did we wouldn't start the",
"//... | Does a set of replacements in a single document in memory.
@param {!Document} doc The document to do the replacements in.
@param {Object} matchInfo The match info for this file, as returned by `_addSearchMatches()`. Might be mutated.
@param {string} replaceText The text to replace each result with.
@param {boolean=} is... | [
"Does",
"a",
"set",
"of",
"replacements",
"in",
"a",
"single",
"document",
"in",
"memory",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindUtils.js#L113-L135 |
2,336 | adobe/brackets | src/search/FindUtils.js | _doReplaceOnDisk | function _doReplaceOnDisk(fullPath, matchInfo, replaceText, isRegexp) {
var file = FileSystem.getFileForPath(fullPath);
return DocumentManager.getDocumentText(file, true).then(function (contents, timestamp, lineEndings) {
if (timestamp.getTime() !== matchInfo.timestamp.getTime()) {
... | javascript | function _doReplaceOnDisk(fullPath, matchInfo, replaceText, isRegexp) {
var file = FileSystem.getFileForPath(fullPath);
return DocumentManager.getDocumentText(file, true).then(function (contents, timestamp, lineEndings) {
if (timestamp.getTime() !== matchInfo.timestamp.getTime()) {
... | [
"function",
"_doReplaceOnDisk",
"(",
"fullPath",
",",
"matchInfo",
",",
"replaceText",
",",
"isRegexp",
")",
"{",
"var",
"file",
"=",
"FileSystem",
".",
"getFileForPath",
"(",
"fullPath",
")",
";",
"return",
"DocumentManager",
".",
"getDocumentText",
"(",
"file"... | Does a set of replacements in a single file on disk.
@param {string} fullPath The full path to the file.
@param {Object} matchInfo The match info for this file, as returned by `_addSearchMatches()`.
@param {string} replaceText The text to replace each result with.
@param {boolean=} isRegexp Whether the original query w... | [
"Does",
"a",
"set",
"of",
"replacements",
"in",
"a",
"single",
"file",
"on",
"disk",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindUtils.js#L145-L175 |
2,337 | adobe/brackets | src/search/FindUtils.js | _doReplaceInOneFile | function _doReplaceInOneFile(fullPath, matchInfo, replaceText, options) {
var doc = DocumentManager.getOpenDocumentForPath(fullPath);
options = options || {};
// If we're forcing files open, or if the document is in the working set but not actually open
// yet, we want to open the file a... | javascript | function _doReplaceInOneFile(fullPath, matchInfo, replaceText, options) {
var doc = DocumentManager.getOpenDocumentForPath(fullPath);
options = options || {};
// If we're forcing files open, or if the document is in the working set but not actually open
// yet, we want to open the file a... | [
"function",
"_doReplaceInOneFile",
"(",
"fullPath",
",",
"matchInfo",
",",
"replaceText",
",",
"options",
")",
"{",
"var",
"doc",
"=",
"DocumentManager",
".",
"getOpenDocumentForPath",
"(",
"fullPath",
")",
";",
"options",
"=",
"options",
"||",
"{",
"}",
";",
... | Does a set of replacements in a single file. If the file is already open in a Document in memory,
will do the replacement there, otherwise does it directly on disk.
@param {string} fullPath The full path to the file.
@param {Object} matchInfo The match info for this file, as returned by `_addSearchMatches()`.
@param {s... | [
"Does",
"a",
"set",
"of",
"replacements",
"in",
"a",
"single",
"file",
".",
"If",
"the",
"file",
"is",
"already",
"open",
"in",
"a",
"Document",
"in",
"memory",
"will",
"do",
"the",
"replacement",
"there",
"otherwise",
"does",
"it",
"directly",
"on",
"di... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindUtils.js#L190-L204 |
2,338 | adobe/brackets | src/search/FindUtils.js | labelForScope | function labelForScope(scope) {
if (scope) {
return StringUtils.format(
Strings.FIND_IN_FILES_SCOPED,
StringUtils.breakableUrl(
ProjectManager.makeProjectRelativeIfPossible(scope.fullPath)
)
);
} else {
... | javascript | function labelForScope(scope) {
if (scope) {
return StringUtils.format(
Strings.FIND_IN_FILES_SCOPED,
StringUtils.breakableUrl(
ProjectManager.makeProjectRelativeIfPossible(scope.fullPath)
)
);
} else {
... | [
"function",
"labelForScope",
"(",
"scope",
")",
"{",
"if",
"(",
"scope",
")",
"{",
"return",
"StringUtils",
".",
"format",
"(",
"Strings",
".",
"FIND_IN_FILES_SCOPED",
",",
"StringUtils",
".",
"breakableUrl",
"(",
"ProjectManager",
".",
"makeProjectRelativeIfPossi... | Returns label text to indicate the search scope. Already HTML-escaped.
@param {?Entry} scope
@return {string} | [
"Returns",
"label",
"text",
"to",
"indicate",
"the",
"search",
"scope",
".",
"Already",
"HTML",
"-",
"escaped",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindUtils.js#L286-L297 |
2,339 | adobe/brackets | src/search/FindUtils.js | parseQueryInfo | function parseQueryInfo(queryInfo) {
var queryExpr;
if (!queryInfo || !queryInfo.query) {
return {empty: true};
}
// For now, treat all matches as multiline (i.e. ^/$ match on every line, not the whole
// document). This is consistent with how single-file find works... | javascript | function parseQueryInfo(queryInfo) {
var queryExpr;
if (!queryInfo || !queryInfo.query) {
return {empty: true};
}
// For now, treat all matches as multiline (i.e. ^/$ match on every line, not the whole
// document). This is consistent with how single-file find works... | [
"function",
"parseQueryInfo",
"(",
"queryInfo",
")",
"{",
"var",
"queryExpr",
";",
"if",
"(",
"!",
"queryInfo",
"||",
"!",
"queryInfo",
".",
"query",
")",
"{",
"return",
"{",
"empty",
":",
"true",
"}",
";",
"}",
"// For now, treat all matches as multiline (i.e... | Parses the given query into a regexp, and returns whether it was valid or not.
@param {{query: string, caseSensitive: boolean, isRegexp: boolean}} queryInfo
@return {{queryExpr: RegExp, valid: boolean, empty: boolean, error: string}}
queryExpr - the regexp representing the query
valid - set to true if query is a nonemp... | [
"Parses",
"the",
"given",
"query",
"into",
"a",
"regexp",
"and",
"returns",
"whether",
"it",
"was",
"valid",
"or",
"not",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindUtils.js#L308-L335 |
2,340 | adobe/brackets | src/search/FindUtils.js | prioritizeOpenFile | function prioritizeOpenFile(files, firstFile) {
var workingSetFiles = MainViewManager.getWorkingSet(MainViewManager.ALL_PANES),
workingSetFileFound = {},
fileSetWithoutWorkingSet = [],
startingWorkingFileSet = [],
propertyName = "",
i = 0;
firs... | javascript | function prioritizeOpenFile(files, firstFile) {
var workingSetFiles = MainViewManager.getWorkingSet(MainViewManager.ALL_PANES),
workingSetFileFound = {},
fileSetWithoutWorkingSet = [],
startingWorkingFileSet = [],
propertyName = "",
i = 0;
firs... | [
"function",
"prioritizeOpenFile",
"(",
"files",
",",
"firstFile",
")",
"{",
"var",
"workingSetFiles",
"=",
"MainViewManager",
".",
"getWorkingSet",
"(",
"MainViewManager",
".",
"ALL_PANES",
")",
",",
"workingSetFileFound",
"=",
"{",
"}",
",",
"fileSetWithoutWorkingS... | Prioritizes the open file and then the working set files to the starting of the list of files
@param {Array.<*>} files An array of file paths or file objects to sort
@param {?string} firstFile If specified, the path to the file that should be sorted to the top.
@return {Array.<*>} | [
"Prioritizes",
"the",
"open",
"file",
"and",
"then",
"the",
"working",
"set",
"files",
"to",
"the",
"starting",
"of",
"the",
"list",
"of",
"files"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindUtils.js#L343-L378 |
2,341 | adobe/brackets | src/utils/DeprecationWarning.js | _trimStack | function _trimStack(stack) {
var indexOfFirstRequireJSline;
// Remove everything in the stack up to the end of the line that shows this module file path
stack = stack.substr(stack.indexOf(")\n") + 2);
// Find the very first line of require.js in the stack if the call is from an extensi... | javascript | function _trimStack(stack) {
var indexOfFirstRequireJSline;
// Remove everything in the stack up to the end of the line that shows this module file path
stack = stack.substr(stack.indexOf(")\n") + 2);
// Find the very first line of require.js in the stack if the call is from an extensi... | [
"function",
"_trimStack",
"(",
"stack",
")",
"{",
"var",
"indexOfFirstRequireJSline",
";",
"// Remove everything in the stack up to the end of the line that shows this module file path",
"stack",
"=",
"stack",
".",
"substr",
"(",
"stack",
".",
"indexOf",
"(",
"\")\\n\"",
")... | Trim the stack so that it does not have the call to this module,
and all the calls to require.js to load the extension that shows
this deprecation warning. | [
"Trim",
"the",
"stack",
"so",
"that",
"it",
"does",
"not",
"have",
"the",
"call",
"to",
"this",
"module",
"and",
"all",
"the",
"calls",
"to",
"require",
".",
"js",
"to",
"load",
"the",
"extension",
"that",
"shows",
"this",
"deprecation",
"warning",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/DeprecationWarning.js#L41-L56 |
2,342 | adobe/brackets | src/utils/DeprecationWarning.js | deprecationWarning | function deprecationWarning(message, oncePerCaller, callerStackPos) {
// If oncePerCaller isn't set, then only show the message once no matter who calls it.
if (!message || (!oncePerCaller && displayedWarnings[message])) {
return;
}
// Don't show the warning again if we've a... | javascript | function deprecationWarning(message, oncePerCaller, callerStackPos) {
// If oncePerCaller isn't set, then only show the message once no matter who calls it.
if (!message || (!oncePerCaller && displayedWarnings[message])) {
return;
}
// Don't show the warning again if we've a... | [
"function",
"deprecationWarning",
"(",
"message",
",",
"oncePerCaller",
",",
"callerStackPos",
")",
"{",
"// If oncePerCaller isn't set, then only show the message once no matter who calls it.",
"if",
"(",
"!",
"message",
"||",
"(",
"!",
"oncePerCaller",
"&&",
"displayedWarni... | Show deprecation warning with the call stack if it
has never been displayed before.
@param {!string} message The deprecation message to be displayed.
@param {boolean=} oncePerCaller If true, displays the message once for each unique call location.
If false (the default), only displays the message once no matter where i... | [
"Show",
"deprecation",
"warning",
"with",
"the",
"call",
"stack",
"if",
"it",
"has",
"never",
"been",
"displayed",
"before",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/DeprecationWarning.js#L70-L93 |
2,343 | adobe/brackets | src/utils/DeprecationWarning.js | deprecateEvent | function deprecateEvent(outbound, inbound, oldEventName, newEventName, canonicalOutboundName, canonicalInboundName) {
// Mark deprecated so EventDispatcher.on() will emit warnings
EventDispatcher.markDeprecated(outbound, oldEventName, canonicalInboundName);
// create an event handler for the ne... | javascript | function deprecateEvent(outbound, inbound, oldEventName, newEventName, canonicalOutboundName, canonicalInboundName) {
// Mark deprecated so EventDispatcher.on() will emit warnings
EventDispatcher.markDeprecated(outbound, oldEventName, canonicalInboundName);
// create an event handler for the ne... | [
"function",
"deprecateEvent",
"(",
"outbound",
",",
"inbound",
",",
"oldEventName",
",",
"newEventName",
",",
"canonicalOutboundName",
",",
"canonicalInboundName",
")",
"{",
"// Mark deprecated so EventDispatcher.on() will emit warnings",
"EventDispatcher",
".",
"markDeprecated... | Show a deprecation warning if there are listeners for the event
```
DeprecationWarning.deprecateEvent(exports,
MainViewManager,
"workingSetAdd",
"workingSetAdd",
"DocumentManager.workingSetAdd",
"MainViewManager.workingSetAdd");
```
@param {Object} outbound - the object with the old event to dispatch
@param {Object} ... | [
"Show",
"a",
"deprecation",
"warning",
"if",
"there",
"are",
"listeners",
"for",
"the",
"event"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/DeprecationWarning.js#L115-L124 |
2,344 | adobe/brackets | src/utils/DeprecationWarning.js | deprecateConstant | function deprecateConstant(obj, oldId, newId) {
var warning = "Use Menus." + newId + " instead of Menus." + oldId,
newValue = obj[newId];
Object.defineProperty(obj, oldId, {
get: function () {
deprecationWarning(warning, true);
return newVa... | javascript | function deprecateConstant(obj, oldId, newId) {
var warning = "Use Menus." + newId + " instead of Menus." + oldId,
newValue = obj[newId];
Object.defineProperty(obj, oldId, {
get: function () {
deprecationWarning(warning, true);
return newVa... | [
"function",
"deprecateConstant",
"(",
"obj",
",",
"oldId",
",",
"newId",
")",
"{",
"var",
"warning",
"=",
"\"Use Menus.\"",
"+",
"newId",
"+",
"\" instead of Menus.\"",
"+",
"oldId",
",",
"newValue",
"=",
"obj",
"[",
"newId",
"]",
";",
"Object",
".",
"defi... | Create a deprecation warning and action for updated constants
@param {!string} old Menu Id
@param {!string} new Menu Id | [
"Create",
"a",
"deprecation",
"warning",
"and",
"action",
"for",
"updated",
"constants"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/DeprecationWarning.js#L132-L142 |
2,345 | adobe/brackets | src/preferences/PreferencesManager.js | setViewState | function setViewState(id, value, context, doNotSave) {
PreferencesImpl.stateManager.set(id, value, context);
if (!doNotSave) {
PreferencesImpl.stateManager.save();
}
} | javascript | function setViewState(id, value, context, doNotSave) {
PreferencesImpl.stateManager.set(id, value, context);
if (!doNotSave) {
PreferencesImpl.stateManager.save();
}
} | [
"function",
"setViewState",
"(",
"id",
",",
"value",
",",
"context",
",",
"doNotSave",
")",
"{",
"PreferencesImpl",
".",
"stateManager",
".",
"set",
"(",
"id",
",",
"value",
",",
"context",
")",
";",
"if",
"(",
"!",
"doNotSave",
")",
"{",
"PreferencesImp... | Convenience function that sets a view state and then saves the file
@param {string} id preference to set
@param {*} value new value for the preference
@param {?Object} context Optional additional information about the request
@param {boolean=} doNotSave If it is undefined or false, then save the
view state immediately... | [
"Convenience",
"function",
"that",
"sets",
"a",
"view",
"state",
"and",
"then",
"saves",
"the",
"file"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesManager.js#L307-L314 |
2,346 | adobe/brackets | src/utils/TokenUtils.js | movePrevToken | function movePrevToken(ctx, precise) {
if (precise === undefined) {
precise = true;
}
if (ctx.pos.ch <= 0 || ctx.token.start <= 0) {
//move up a line
if (ctx.pos.line <= 0) {
return false; //at the top already
}
ctx.pos... | javascript | function movePrevToken(ctx, precise) {
if (precise === undefined) {
precise = true;
}
if (ctx.pos.ch <= 0 || ctx.token.start <= 0) {
//move up a line
if (ctx.pos.line <= 0) {
return false; //at the top already
}
ctx.pos... | [
"function",
"movePrevToken",
"(",
"ctx",
",",
"precise",
")",
"{",
"if",
"(",
"precise",
"===",
"undefined",
")",
"{",
"precise",
"=",
"true",
";",
"}",
"if",
"(",
"ctx",
".",
"pos",
".",
"ch",
"<=",
"0",
"||",
"ctx",
".",
"token",
".",
"start",
... | Moves the given context backwards by one token.
@param {!{editor:!CodeMirror, pos:!{ch:number, line:number}, token:Object}} ctx
@param {boolean=} precise If code is being edited, use true (default) for accuracy.
If parsing unchanging code, use false to use cache for performance.
@return {boolean} whether the context ch... | [
"Moves",
"the",
"given",
"context",
"backwards",
"by",
"one",
"token",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/TokenUtils.js#L109-L126 |
2,347 | adobe/brackets | src/utils/TokenUtils.js | moveNextToken | function moveNextToken(ctx, precise) {
var eol = ctx.editor.getLine(ctx.pos.line).length;
if (precise === undefined) {
precise = true;
}
if (ctx.pos.ch >= eol || ctx.token.end >= eol) {
//move down a line
if (ctx.pos.line >= ctx.editor.lineCount() - 1... | javascript | function moveNextToken(ctx, precise) {
var eol = ctx.editor.getLine(ctx.pos.line).length;
if (precise === undefined) {
precise = true;
}
if (ctx.pos.ch >= eol || ctx.token.end >= eol) {
//move down a line
if (ctx.pos.line >= ctx.editor.lineCount() - 1... | [
"function",
"moveNextToken",
"(",
"ctx",
",",
"precise",
")",
"{",
"var",
"eol",
"=",
"ctx",
".",
"editor",
".",
"getLine",
"(",
"ctx",
".",
"pos",
".",
"line",
")",
".",
"length",
";",
"if",
"(",
"precise",
"===",
"undefined",
")",
"{",
"precise",
... | Moves the given context forward by one token.
@param {!{editor:!CodeMirror, pos:!{ch:number, line:number}, token:Object}} ctx
@param {boolean=} precise If code is being edited, use true (default) for accuracy.
If parsing unchanging code, use false to use cache for performance.
@return {boolean} whether the context chan... | [
"Moves",
"the",
"given",
"context",
"forward",
"by",
"one",
"token",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/TokenUtils.js#L143-L161 |
2,348 | adobe/brackets | src/utils/TokenUtils.js | moveSkippingWhitespace | function moveSkippingWhitespace(moveFxn, ctx) {
if (!moveFxn(ctx)) {
return false;
}
while (!ctx.token.type && !/\S/.test(ctx.token.string)) {
if (!moveFxn(ctx)) {
return false;
}
}
return true;
} | javascript | function moveSkippingWhitespace(moveFxn, ctx) {
if (!moveFxn(ctx)) {
return false;
}
while (!ctx.token.type && !/\S/.test(ctx.token.string)) {
if (!moveFxn(ctx)) {
return false;
}
}
return true;
} | [
"function",
"moveSkippingWhitespace",
"(",
"moveFxn",
",",
"ctx",
")",
"{",
"if",
"(",
"!",
"moveFxn",
"(",
"ctx",
")",
")",
"{",
"return",
"false",
";",
"}",
"while",
"(",
"!",
"ctx",
".",
"token",
".",
"type",
"&&",
"!",
"/",
"\\S",
"/",
".",
"... | Moves the given context in the given direction, skipping any whitespace it hits.
@param {function} moveFxn the function to move the context
@param {!{editor:!CodeMirror, pos:!{ch:number, line:number}, token:Object}} ctx
@return {boolean} whether the context changed | [
"Moves",
"the",
"given",
"context",
"in",
"the",
"given",
"direction",
"skipping",
"any",
"whitespace",
"it",
"hits",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/TokenUtils.js#L178-L188 |
2,349 | adobe/brackets | src/utils/TokenUtils.js | offsetInToken | function offsetInToken(ctx) {
var offset = ctx.pos.ch - ctx.token.start;
if (offset < 0) {
console.log("CodeHintUtils: _offsetInToken - Invalid context: pos not in the current token!");
}
return offset;
} | javascript | function offsetInToken(ctx) {
var offset = ctx.pos.ch - ctx.token.start;
if (offset < 0) {
console.log("CodeHintUtils: _offsetInToken - Invalid context: pos not in the current token!");
}
return offset;
} | [
"function",
"offsetInToken",
"(",
"ctx",
")",
"{",
"var",
"offset",
"=",
"ctx",
".",
"pos",
".",
"ch",
"-",
"ctx",
".",
"token",
".",
"start",
";",
"if",
"(",
"offset",
"<",
"0",
")",
"{",
"console",
".",
"log",
"(",
"\"CodeHintUtils: _offsetInToken - ... | In the given context, get the character offset of pos from the start of the token.
@param {!{editor:!CodeMirror, pos:!{ch:number, line:number}, token:Object}} context
@return {number} | [
"In",
"the",
"given",
"context",
"get",
"the",
"character",
"offset",
"of",
"pos",
"from",
"the",
"start",
"of",
"the",
"token",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/TokenUtils.js#L195-L201 |
2,350 | adobe/brackets | src/utils/TokenUtils.js | getModeAt | function getModeAt(cm, pos, precise) {
precise = precise || true;
var modeData = cm.getMode(),
name;
if (modeData.innerMode) {
modeData = CodeMirror.innerMode(modeData, getTokenAt(cm, pos, precise).state).mode;
}
name = (modeData.name === "xml") ?
... | javascript | function getModeAt(cm, pos, precise) {
precise = precise || true;
var modeData = cm.getMode(),
name;
if (modeData.innerMode) {
modeData = CodeMirror.innerMode(modeData, getTokenAt(cm, pos, precise).state).mode;
}
name = (modeData.name === "xml") ?
... | [
"function",
"getModeAt",
"(",
"cm",
",",
"pos",
",",
"precise",
")",
"{",
"precise",
"=",
"precise",
"||",
"true",
";",
"var",
"modeData",
"=",
"cm",
".",
"getMode",
"(",
")",
",",
"name",
";",
"if",
"(",
"modeData",
".",
"innerMode",
")",
"{",
"mo... | Returns the mode object and mode name string at a given position
@param {!CodeMirror} cm CodeMirror instance
@param {!{line:number, ch:number}} pos Position to query for mode
@param {boolean} precise If given, results in more current results. Suppresses caching.
@return {mode:{Object}, name:string} | [
"Returns",
"the",
"mode",
"object",
"and",
"mode",
"name",
"string",
"at",
"a",
"given",
"position"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/TokenUtils.js#L210-L223 |
2,351 | adobe/brackets | src/LiveDevelopment/Agents/HighlightAgent.js | node | function node(n) {
if (!LiveDevelopment.config.experimental) {
return;
}
if (!Inspector.config.highlight) {
return;
}
// go to the parent of a text node
if (n && n.type === 3) {
n = n.parent;
}
// node cannot be highl... | javascript | function node(n) {
if (!LiveDevelopment.config.experimental) {
return;
}
if (!Inspector.config.highlight) {
return;
}
// go to the parent of a text node
if (n && n.type === 3) {
n = n.parent;
}
// node cannot be highl... | [
"function",
"node",
"(",
"n",
")",
"{",
"if",
"(",
"!",
"LiveDevelopment",
".",
"config",
".",
"experimental",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"Inspector",
".",
"config",
".",
"highlight",
")",
"{",
"return",
";",
"}",
"// go to the paren... | Highlight a single node using DOM.highlightNode
@param {DOMNode} node | [
"Highlight",
"a",
"single",
"node",
"using",
"DOM",
".",
"highlightNode"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/HighlightAgent.js#L67-L94 |
2,352 | adobe/brackets | src/LiveDevelopment/Agents/HighlightAgent.js | rule | function rule(name) {
if (_highlight.ref === name) {
return;
}
hide();
_highlight = {type: "css", ref: name};
RemoteAgent.call("highlightRule", name);
} | javascript | function rule(name) {
if (_highlight.ref === name) {
return;
}
hide();
_highlight = {type: "css", ref: name};
RemoteAgent.call("highlightRule", name);
} | [
"function",
"rule",
"(",
"name",
")",
"{",
"if",
"(",
"_highlight",
".",
"ref",
"===",
"name",
")",
"{",
"return",
";",
"}",
"hide",
"(",
")",
";",
"_highlight",
"=",
"{",
"type",
":",
"\"css\"",
",",
"ref",
":",
"name",
"}",
";",
"RemoteAgent",
... | Highlight all nodes affected by a CSS rule
@param {string} rule selector | [
"Highlight",
"all",
"nodes",
"affected",
"by",
"a",
"CSS",
"rule"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/HighlightAgent.js#L99-L106 |
2,353 | adobe/brackets | src/LiveDevelopment/Agents/HighlightAgent.js | domElement | function domElement(ids) {
var selector = "";
if (!Array.isArray(ids)) {
ids = [ids];
}
_.each(ids, function (id) {
if (selector !== "") {
selector += ",";
}
selector += "[data-brackets-id='" + id + "']";
});
... | javascript | function domElement(ids) {
var selector = "";
if (!Array.isArray(ids)) {
ids = [ids];
}
_.each(ids, function (id) {
if (selector !== "") {
selector += ",";
}
selector += "[data-brackets-id='" + id + "']";
});
... | [
"function",
"domElement",
"(",
"ids",
")",
"{",
"var",
"selector",
"=",
"\"\"",
";",
"if",
"(",
"!",
"Array",
".",
"isArray",
"(",
"ids",
")",
")",
"{",
"ids",
"=",
"[",
"ids",
"]",
";",
"}",
"_",
".",
"each",
"(",
"ids",
",",
"function",
"(",
... | Highlight all nodes with 'data-brackets-id' value
that matches id, or if id is an array, matches any of the given ids.
@param {string|Array<string>} value of the 'data-brackets-id' to match,
or an array of such. | [
"Highlight",
"all",
"nodes",
"with",
"data",
"-",
"brackets",
"-",
"id",
"value",
"that",
"matches",
"id",
"or",
"if",
"id",
"is",
"an",
"array",
"matches",
"any",
"of",
"the",
"given",
"ids",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/HighlightAgent.js#L113-L125 |
2,354 | adobe/brackets | src/project/FileViewController.js | openAndSelectDocument | function openAndSelectDocument(fullPath, fileSelectionFocus, paneId) {
var result,
curDocChangedDueToMe = _curDocChangedDueToMe;
function _getDerivedPaneContext() {
function _secondPaneContext() {
return (window.event.ctrlKey || window.event.metaKey) && window.e... | javascript | function openAndSelectDocument(fullPath, fileSelectionFocus, paneId) {
var result,
curDocChangedDueToMe = _curDocChangedDueToMe;
function _getDerivedPaneContext() {
function _secondPaneContext() {
return (window.event.ctrlKey || window.event.metaKey) && window.e... | [
"function",
"openAndSelectDocument",
"(",
"fullPath",
",",
"fileSelectionFocus",
",",
"paneId",
")",
"{",
"var",
"result",
",",
"curDocChangedDueToMe",
"=",
"_curDocChangedDueToMe",
";",
"function",
"_getDerivedPaneContext",
"(",
")",
"{",
"function",
"_secondPaneContex... | Opens a document if it's not open and selects the file in the UI corresponding to
fileSelectionFocus
@param {!fullPath} fullPath - full path of the document to open
@param {string} fileSelectionFocus - (WORKING_SET_VIEW || PROJECT_MANAGER)
@param {string} paneId - pane in which to open the document
@return {$.Promise} | [
"Opens",
"a",
"document",
"if",
"it",
"s",
"not",
"open",
"and",
"selects",
"the",
"file",
"in",
"the",
"UI",
"corresponding",
"to",
"fileSelectionFocus"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileViewController.js#L145-L195 |
2,355 | adobe/brackets | src/extensions/default/AutoUpdate/UpdateInfoBar.js | generateJsonForMustache | function generateJsonForMustache(msgObj) {
var msgJsonObj = {};
if (msgObj.type) {
msgJsonObj.type = "'" + msgObj.type + "'";
}
msgJsonObj.title = msgObj.title;
msgJsonObj.description = msgObj.description;
if (msgObj.needButtons) {
msgJsonObj.butto... | javascript | function generateJsonForMustache(msgObj) {
var msgJsonObj = {};
if (msgObj.type) {
msgJsonObj.type = "'" + msgObj.type + "'";
}
msgJsonObj.title = msgObj.title;
msgJsonObj.description = msgObj.description;
if (msgObj.needButtons) {
msgJsonObj.butto... | [
"function",
"generateJsonForMustache",
"(",
"msgObj",
")",
"{",
"var",
"msgJsonObj",
"=",
"{",
"}",
";",
"if",
"(",
"msgObj",
".",
"type",
")",
"{",
"msgJsonObj",
".",
"type",
"=",
"\"'\"",
"+",
"msgObj",
".",
"type",
"+",
"\"'\"",
";",
"}",
"msgJsonOb... | keycode for escape key
Generates the json to be used by Mustache for rendering
@param {object} msgObj - json object containing message information to be displayed
@returns {object} - the generated json object | [
"keycode",
"for",
"escape",
"key",
"Generates",
"the",
"json",
"to",
"be",
"used",
"by",
"Mustache",
"for",
"rendering"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/UpdateInfoBar.js#L53-L73 |
2,356 | adobe/brackets | src/extensions/default/AutoUpdate/UpdateInfoBar.js | function () {
if($updateContent.length > 0 && $contentContainer.length > 0 && $updateBar.length > 0) {
var newWidth = $updateBar.outerWidth() - 38;
if($buttonContainer.length > 0) {
newWidth = newWidth- $buttonContainer.outerWidth();
}
... | javascript | function () {
if($updateContent.length > 0 && $contentContainer.length > 0 && $updateBar.length > 0) {
var newWidth = $updateBar.outerWidth() - 38;
if($buttonContainer.length > 0) {
newWidth = newWidth- $buttonContainer.outerWidth();
}
... | [
"function",
"(",
")",
"{",
"if",
"(",
"$updateContent",
".",
"length",
">",
"0",
"&&",
"$contentContainer",
".",
"length",
">",
"0",
"&&",
"$updateBar",
".",
"length",
">",
"0",
")",
"{",
"var",
"newWidth",
"=",
"$updateBar",
".",
"outerWidth",
"(",
")... | Content Container Width between Icon Container and Button Container or Close Icon Container will be assigned when window will be rezied. | [
"Content",
"Container",
"Width",
"between",
"Icon",
"Container",
"and",
"Button",
"Container",
"or",
"Close",
"Icon",
"Container",
"will",
"be",
"assigned",
"when",
"window",
"will",
"be",
"rezied",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/UpdateInfoBar.js#L123-L140 | |
2,357 | adobe/brackets | src/LiveDevelopment/MultiBrowserImpl/protocol/remote/DocumentObserver.js | function (href) {
var self = this;
// Inspect CSSRules for @imports:
// styleSheet obejct is required to scan CSSImportRules but
// browsers differ on the implementation of MutationObserver interface.
// Webkit triggers notifications befo... | javascript | function (href) {
var self = this;
// Inspect CSSRules for @imports:
// styleSheet obejct is required to scan CSSImportRules but
// browsers differ on the implementation of MutationObserver interface.
// Webkit triggers notifications befo... | [
"function",
"(",
"href",
")",
"{",
"var",
"self",
"=",
"this",
";",
"// Inspect CSSRules for @imports:",
"// styleSheet obejct is required to scan CSSImportRules but",
"// browsers differ on the implementation of MutationObserver interface.",
"// Webkit triggers notifications before styles... | Check the stylesheet that was just added be really loaded
to be able to extract potential import-ed stylesheets.
It invokes notifyStylesheetAdded once the sheet is loaded.
@param {string} href Absolute URL of the stylesheet. | [
"Check",
"the",
"stylesheet",
"that",
"was",
"just",
"added",
"be",
"really",
"loaded",
"to",
"be",
"able",
"to",
"extract",
"potential",
"import",
"-",
"ed",
"stylesheets",
".",
"It",
"invokes",
"notifyStylesheetAdded",
"once",
"the",
"sheet",
"is",
"loaded",... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/MultiBrowserImpl/protocol/remote/DocumentObserver.js#L124-L153 | |
2,358 | adobe/brackets | src/LiveDevelopment/MultiBrowserImpl/protocol/remote/DocumentObserver.js | function () {
var added = {},
current,
newStatus;
current = this.stylesheets;
newStatus = related().stylesheets;
Object.keys(newStatus).forEach(function (v, i) {
if (!current[v]) {
... | javascript | function () {
var added = {},
current,
newStatus;
current = this.stylesheets;
newStatus = related().stylesheets;
Object.keys(newStatus).forEach(function (v, i) {
if (!current[v]) {
... | [
"function",
"(",
")",
"{",
"var",
"added",
"=",
"{",
"}",
",",
"current",
",",
"newStatus",
";",
"current",
"=",
"this",
".",
"stylesheets",
";",
"newStatus",
"=",
"related",
"(",
")",
".",
"stylesheets",
";",
"Object",
".",
"keys",
"(",
"newStatus",
... | Send a notification for the stylesheet added and
its import-ed styleshets based on document.stylesheets diff
from previous status. It also updates stylesheets status. | [
"Send",
"a",
"notification",
"for",
"the",
"stylesheet",
"added",
"and",
"its",
"import",
"-",
"ed",
"styleshets",
"based",
"on",
"document",
".",
"stylesheets",
"diff",
"from",
"previous",
"status",
".",
"It",
"also",
"updates",
"stylesheets",
"status",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/MultiBrowserImpl/protocol/remote/DocumentObserver.js#L169-L192 | |
2,359 | adobe/brackets | src/LiveDevelopment/MultiBrowserImpl/protocol/remote/DocumentObserver.js | function () {
var self = this;
var removed = {},
newStatus,
current;
current = self.stylesheets;
newStatus = related().stylesheets;
Object.keys(current).forEach(function (v, i) {
... | javascript | function () {
var self = this;
var removed = {},
newStatus,
current;
current = self.stylesheets;
newStatus = related().stylesheets;
Object.keys(current).forEach(function (v, i) {
... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"removed",
"=",
"{",
"}",
",",
"newStatus",
",",
"current",
";",
"current",
"=",
"self",
".",
"stylesheets",
";",
"newStatus",
"=",
"related",
"(",
")",
".",
"stylesheets",
";",
"Obje... | Send a notification for the removed stylesheet and
its import-ed styleshets based on document.stylesheets diff
from previous status. It also updates stylesheets status. | [
"Send",
"a",
"notification",
"for",
"the",
"removed",
"stylesheet",
"and",
"its",
"import",
"-",
"ed",
"styleshets",
"based",
"on",
"document",
".",
"stylesheets",
"diff",
"from",
"previous",
"status",
".",
"It",
"also",
"updates",
"stylesheets",
"status",
"."... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/MultiBrowserImpl/protocol/remote/DocumentObserver.js#L199-L226 | |
2,360 | adobe/brackets | src/LiveDevelopment/MultiBrowserImpl/protocol/remote/DocumentObserver.js | start | function start(document, transport) {
_transport = transport;
_document = document;
// start listening to node changes
_enableListeners();
var rel = related();
// send the current status of related docs.
_transport.send(JSON.stringify({
method: "Docu... | javascript | function start(document, transport) {
_transport = transport;
_document = document;
// start listening to node changes
_enableListeners();
var rel = related();
// send the current status of related docs.
_transport.send(JSON.stringify({
method: "Docu... | [
"function",
"start",
"(",
"document",
",",
"transport",
")",
"{",
"_transport",
"=",
"transport",
";",
"_document",
"=",
"document",
";",
"// start listening to node changes",
"_enableListeners",
"(",
")",
";",
"var",
"rel",
"=",
"related",
"(",
")",
";",
"// ... | Start listening for events and send initial related documents message.
@param {HTMLDocument} document
@param {object} transport Live development transport connection | [
"Start",
"listening",
"for",
"events",
"and",
"send",
"initial",
"related",
"documents",
"message",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/MultiBrowserImpl/protocol/remote/DocumentObserver.js#L303-L318 |
2,361 | adobe/brackets | src/utils/NativeApp.js | openLiveBrowser | function openLiveBrowser(url, enableRemoteDebugging) {
var result = new $.Deferred();
brackets.app.openLiveBrowser(url, !!enableRemoteDebugging, function onRun(err, pid) {
if (!err) {
// Undefined ids never get removed from list, so don't push them on
if (pid... | javascript | function openLiveBrowser(url, enableRemoteDebugging) {
var result = new $.Deferred();
brackets.app.openLiveBrowser(url, !!enableRemoteDebugging, function onRun(err, pid) {
if (!err) {
// Undefined ids never get removed from list, so don't push them on
if (pid... | [
"function",
"openLiveBrowser",
"(",
"url",
",",
"enableRemoteDebugging",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"brackets",
".",
"app",
".",
"openLiveBrowser",
"(",
"url",
",",
"!",
"!",
"enableRemoteDebugging",
",",
"f... | openLiveBrowser
Open the given URL in the user's system browser, optionally enabling debugging.
@param {string} url The URL to open.
@param {boolean=} enableRemoteDebugging Whether to turn on remote debugging. Default false.
@return {$.Promise} | [
"openLiveBrowser",
"Open",
"the",
"given",
"URL",
"in",
"the",
"user",
"s",
"system",
"browser",
"optionally",
"enabling",
"debugging",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/NativeApp.js#L51-L67 |
2,362 | adobe/brackets | src/LiveDevelopment/Servers/BaseServer.js | BaseServer | function BaseServer(config) {
this._baseUrl = config.baseUrl;
this._root = config.root; // ProjectManager.getProjectRoot().fullPath
this._pathResolver = config.pathResolver; // ProjectManager.makeProjectRelativeIfPossible(doc.file.fullPath)
this._liveDocuments =... | javascript | function BaseServer(config) {
this._baseUrl = config.baseUrl;
this._root = config.root; // ProjectManager.getProjectRoot().fullPath
this._pathResolver = config.pathResolver; // ProjectManager.makeProjectRelativeIfPossible(doc.file.fullPath)
this._liveDocuments =... | [
"function",
"BaseServer",
"(",
"config",
")",
"{",
"this",
".",
"_baseUrl",
"=",
"config",
".",
"baseUrl",
";",
"this",
".",
"_root",
"=",
"config",
".",
"root",
";",
"// ProjectManager.getProjectRoot().fullPath",
"this",
".",
"_pathResolver",
"=",
"config",
"... | Base class for live preview servers
Configuration parameters for this server:
- baseUrl - Optional base URL (populated by the current project)
- pathResolver - Function to covert absolute native paths to project relative paths
- root - Native path to the project root (and base URL)
@constructor
@param {!... | [
"Base",
"class",
"for",
"live",
"preview",
"servers"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Servers/BaseServer.js#L40-L45 |
2,363 | adobe/brackets | src/extensions/default/HealthData/HealthDataUtils.js | getUserInstalledExtensions | function getUserInstalledExtensions() {
var result = new $.Deferred();
if (!ExtensionManager.hasDownloadedRegistry) {
ExtensionManager.downloadRegistry().done(function () {
result.resolve(getUserExtensionsPresentInRegistry(ExtensionManager.extensions));
})
... | javascript | function getUserInstalledExtensions() {
var result = new $.Deferred();
if (!ExtensionManager.hasDownloadedRegistry) {
ExtensionManager.downloadRegistry().done(function () {
result.resolve(getUserExtensionsPresentInRegistry(ExtensionManager.extensions));
})
... | [
"function",
"getUserInstalledExtensions",
"(",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"if",
"(",
"!",
"ExtensionManager",
".",
"hasDownloadedRegistry",
")",
"{",
"ExtensionManager",
".",
"downloadRegistry",
"(",
")",
".",
... | Utility function to get the user installed extension which are present in the registry | [
"Utility",
"function",
"to",
"get",
"the",
"user",
"installed",
"extension",
"which",
"are",
"present",
"in",
"the",
"registry"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/HealthData/HealthDataUtils.js#L53-L68 |
2,364 | adobe/brackets | src/extensions/default/HealthData/HealthDataUtils.js | getUserInstalledTheme | function getUserInstalledTheme() {
var result = new $.Deferred();
var installedTheme = themesPref.get("theme"),
bracketsTheme;
if (installedTheme === "light-theme" || installedTheme === "dark-theme") {
return result.resolve(installedTheme);
}
if (!Exten... | javascript | function getUserInstalledTheme() {
var result = new $.Deferred();
var installedTheme = themesPref.get("theme"),
bracketsTheme;
if (installedTheme === "light-theme" || installedTheme === "dark-theme") {
return result.resolve(installedTheme);
}
if (!Exten... | [
"function",
"getUserInstalledTheme",
"(",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"var",
"installedTheme",
"=",
"themesPref",
".",
"get",
"(",
"\"theme\"",
")",
",",
"bracketsTheme",
";",
"if",
"(",
"installedTheme",
"==... | Utility function to get the user installed theme which are present in the registry | [
"Utility",
"function",
"to",
"get",
"the",
"user",
"installed",
"theme",
"which",
"are",
"present",
"in",
"the",
"registry"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/HealthData/HealthDataUtils.js#L73-L105 |
2,365 | adobe/brackets | src/command/KeyBindingManager.js | normalizeKeyDescriptorString | function normalizeKeyDescriptorString(origDescriptor) {
var hasMacCtrl = false,
hasCtrl = false,
hasAlt = false,
hasShift = false,
key = "",
error = false;
function _compareModifierString(left, right) {
if (!left || !right) {
... | javascript | function normalizeKeyDescriptorString(origDescriptor) {
var hasMacCtrl = false,
hasCtrl = false,
hasAlt = false,
hasShift = false,
key = "",
error = false;
function _compareModifierString(left, right) {
if (!left || !right) {
... | [
"function",
"normalizeKeyDescriptorString",
"(",
"origDescriptor",
")",
"{",
"var",
"hasMacCtrl",
"=",
"false",
",",
"hasCtrl",
"=",
"false",
",",
"hasAlt",
"=",
"false",
",",
"hasShift",
"=",
"false",
",",
"key",
"=",
"\"\"",
",",
"error",
"=",
"false",
"... | normalizes the incoming key descriptor so the modifier keys are always specified in the correct order
@param {string} The string for a key descriptor, can be in any order, the result will be Ctrl-Alt-Shift-<Key>
@return {string} The normalized key descriptor or null if the descriptor invalid | [
"normalizes",
"the",
"incoming",
"key",
"descriptor",
"so",
"the",
"modifier",
"keys",
"are",
"always",
"specified",
"in",
"the",
"correct",
"order"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/KeyBindingManager.js#L339-L425 |
2,366 | adobe/brackets | src/command/KeyBindingManager.js | _translateKeyboardEvent | function _translateKeyboardEvent(event) {
var hasMacCtrl = (brackets.platform === "mac") ? (event.ctrlKey) : false,
hasCtrl = (brackets.platform !== "mac") ? (event.ctrlKey) : (event.metaKey),
hasAlt = (event.altKey),
hasShift = (event.shiftKey),
key = String.from... | javascript | function _translateKeyboardEvent(event) {
var hasMacCtrl = (brackets.platform === "mac") ? (event.ctrlKey) : false,
hasCtrl = (brackets.platform !== "mac") ? (event.ctrlKey) : (event.metaKey),
hasAlt = (event.altKey),
hasShift = (event.shiftKey),
key = String.from... | [
"function",
"_translateKeyboardEvent",
"(",
"event",
")",
"{",
"var",
"hasMacCtrl",
"=",
"(",
"brackets",
".",
"platform",
"===",
"\"mac\"",
")",
"?",
"(",
"event",
".",
"ctrlKey",
")",
":",
"false",
",",
"hasCtrl",
"=",
"(",
"brackets",
".",
"platform",
... | Takes a keyboard event and translates it into a key in a key map | [
"Takes",
"a",
"keyboard",
"event",
"and",
"translates",
"it",
"into",
"a",
"key",
"in",
"a",
"key",
"map"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/KeyBindingManager.js#L482-L520 |
2,367 | adobe/brackets | src/command/KeyBindingManager.js | formatKeyDescriptor | function formatKeyDescriptor(descriptor) {
var displayStr;
if (brackets.platform === "mac") {
displayStr = descriptor.replace(/-(?!$)/g, ""); // remove dashes
displayStr = displayStr.replace("Ctrl", "\u2303"); // Ctrl > control symbol
displayStr = displayStr.rep... | javascript | function formatKeyDescriptor(descriptor) {
var displayStr;
if (brackets.platform === "mac") {
displayStr = descriptor.replace(/-(?!$)/g, ""); // remove dashes
displayStr = displayStr.replace("Ctrl", "\u2303"); // Ctrl > control symbol
displayStr = displayStr.rep... | [
"function",
"formatKeyDescriptor",
"(",
"descriptor",
")",
"{",
"var",
"displayStr",
";",
"if",
"(",
"brackets",
".",
"platform",
"===",
"\"mac\"",
")",
"{",
"displayStr",
"=",
"descriptor",
".",
"replace",
"(",
"/",
"-(?!$)",
"/",
"g",
",",
"\"\"",
")",
... | Convert normalized key representation to display appropriate for platform.
@param {!string} descriptor Normalized key descriptor.
@return {!string} Display/Operating system appropriate string | [
"Convert",
"normalized",
"key",
"representation",
"to",
"display",
"appropriate",
"for",
"platform",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/KeyBindingManager.js#L527-L553 |
2,368 | adobe/brackets | src/command/KeyBindingManager.js | removeBinding | function removeBinding(key, platform) {
if (!key || ((platform !== null) && (platform !== undefined) && (platform !== brackets.platform))) {
return;
}
var normalizedKey = normalizeKeyDescriptorString(key);
if (!normalizedKey) {
console.log("Failed to normalize "... | javascript | function removeBinding(key, platform) {
if (!key || ((platform !== null) && (platform !== undefined) && (platform !== brackets.platform))) {
return;
}
var normalizedKey = normalizeKeyDescriptorString(key);
if (!normalizedKey) {
console.log("Failed to normalize "... | [
"function",
"removeBinding",
"(",
"key",
",",
"platform",
")",
"{",
"if",
"(",
"!",
"key",
"||",
"(",
"(",
"platform",
"!==",
"null",
")",
"&&",
"(",
"platform",
"!==",
"undefined",
")",
"&&",
"(",
"platform",
"!==",
"brackets",
".",
"platform",
")",
... | Remove a key binding from _keymap
@param {!string} key - a key-description string that may or may not be normalized.
@param {?string} platform - OS from which to remove the binding (all platforms if unspecified) | [
"Remove",
"a",
"key",
"binding",
"from",
"_keymap"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/KeyBindingManager.js#L570-L598 |
2,369 | adobe/brackets | src/command/KeyBindingManager.js | _handleKey | function _handleKey(key) {
if (_enabled && _keyMap[key]) {
// The execute() function returns a promise because some commands are async.
// Generally, commands decide whether they can run or not synchronously,
// and reject immediately, so we can test for that synchronously.
... | javascript | function _handleKey(key) {
if (_enabled && _keyMap[key]) {
// The execute() function returns a promise because some commands are async.
// Generally, commands decide whether they can run or not synchronously,
// and reject immediately, so we can test for that synchronously.
... | [
"function",
"_handleKey",
"(",
"key",
")",
"{",
"if",
"(",
"_enabled",
"&&",
"_keyMap",
"[",
"key",
"]",
")",
"{",
"// The execute() function returns a promise because some commands are async.",
"// Generally, commands decide whether they can run or not synchronously,",
"// and r... | Process the keybinding for the current key.
@param {string} A key-description string.
@return {boolean} true if the key was processed, false otherwise | [
"Process",
"the",
"keybinding",
"for",
"the",
"current",
"key",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/KeyBindingManager.js#L811-L820 |
2,370 | adobe/brackets | src/command/KeyBindingManager.js | addBinding | function addBinding(command, keyBindings, platform) {
var commandID = "",
results;
if (!command) {
console.error("addBinding(): missing required parameter: command");
return;
}
if (!keyBindings) { return; }
if (typeof (command) === "string")... | javascript | function addBinding(command, keyBindings, platform) {
var commandID = "",
results;
if (!command) {
console.error("addBinding(): missing required parameter: command");
return;
}
if (!keyBindings) { return; }
if (typeof (command) === "string")... | [
"function",
"addBinding",
"(",
"command",
",",
"keyBindings",
",",
"platform",
")",
"{",
"var",
"commandID",
"=",
"\"\"",
",",
"results",
";",
"if",
"(",
"!",
"command",
")",
"{",
"console",
".",
"error",
"(",
"\"addBinding(): missing required parameter: command... | Add one or more key bindings to a particular Command.
@param {!string | Command} command - A command ID or command object
@param {?({key: string, displayKey: string}|Array.<{key: string, displayKey: string, platform: string}>)} keyBindings
A single key binding or an array of keybindings. Example:
"Shift-Cmd-F". Mac an... | [
"Add",
"one",
"or",
"more",
"key",
"bindings",
"to",
"a",
"particular",
"Command",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/KeyBindingManager.js#L850-L887 |
2,371 | adobe/brackets | src/command/KeyBindingManager.js | getKeyBindings | function getKeyBindings(command) {
var bindings = [],
commandID = "";
if (!command) {
console.error("getKeyBindings(): missing required parameter: command");
return [];
}
if (typeof (command) === "string") {
commandID = command;
... | javascript | function getKeyBindings(command) {
var bindings = [],
commandID = "";
if (!command) {
console.error("getKeyBindings(): missing required parameter: command");
return [];
}
if (typeof (command) === "string") {
commandID = command;
... | [
"function",
"getKeyBindings",
"(",
"command",
")",
"{",
"var",
"bindings",
"=",
"[",
"]",
",",
"commandID",
"=",
"\"\"",
";",
"if",
"(",
"!",
"command",
")",
"{",
"console",
".",
"error",
"(",
"\"getKeyBindings(): missing required parameter: command\"",
")",
"... | Retrieve key bindings currently associated with a command
@param {!string | Command} command - A command ID or command object
@return {!Array.<{{key: string, displayKey: string}}>} An array of associated key bindings. | [
"Retrieve",
"key",
"bindings",
"currently",
"associated",
"with",
"a",
"command"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/KeyBindingManager.js#L895-L912 |
2,372 | adobe/brackets | src/command/KeyBindingManager.js | _handleCommandRegistered | function _handleCommandRegistered(event, command) {
var commandId = command.getID(),
defaults = KeyboardPrefs[commandId];
if (defaults) {
addBinding(commandId, defaults);
}
} | javascript | function _handleCommandRegistered(event, command) {
var commandId = command.getID(),
defaults = KeyboardPrefs[commandId];
if (defaults) {
addBinding(commandId, defaults);
}
} | [
"function",
"_handleCommandRegistered",
"(",
"event",
",",
"command",
")",
"{",
"var",
"commandId",
"=",
"command",
".",
"getID",
"(",
")",
",",
"defaults",
"=",
"KeyboardPrefs",
"[",
"commandId",
"]",
";",
"if",
"(",
"defaults",
")",
"{",
"addBinding",
"(... | Adds default key bindings when commands are registered to CommandManager
@param {$.Event} event jQuery event
@param {Command} command Newly registered command | [
"Adds",
"default",
"key",
"bindings",
"when",
"commands",
"are",
"registered",
"to",
"CommandManager"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/KeyBindingManager.js#L919-L926 |
2,373 | adobe/brackets | src/command/KeyBindingManager.js | removeGlobalKeydownHook | function removeGlobalKeydownHook(hook) {
var index = _globalKeydownHooks.indexOf(hook);
if (index !== -1) {
_globalKeydownHooks.splice(index, 1);
}
} | javascript | function removeGlobalKeydownHook(hook) {
var index = _globalKeydownHooks.indexOf(hook);
if (index !== -1) {
_globalKeydownHooks.splice(index, 1);
}
} | [
"function",
"removeGlobalKeydownHook",
"(",
"hook",
")",
"{",
"var",
"index",
"=",
"_globalKeydownHooks",
".",
"indexOf",
"(",
"hook",
")",
";",
"if",
"(",
"index",
"!==",
"-",
"1",
")",
"{",
"_globalKeydownHooks",
".",
"splice",
"(",
"index",
",",
"1",
... | Removes a global keydown hook added by `addGlobalKeydownHook`.
Does not need to be the most recently added hook.
@param {function(Event): boolean} hook The global hook to remove. | [
"Removes",
"a",
"global",
"keydown",
"hook",
"added",
"by",
"addGlobalKeydownHook",
".",
"Does",
"not",
"need",
"to",
"be",
"the",
"most",
"recently",
"added",
"hook",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/KeyBindingManager.js#L964-L969 |
2,374 | adobe/brackets | src/command/KeyBindingManager.js | _handleKeyEvent | function _handleKeyEvent(event) {
var i, handled = false;
for (i = _globalKeydownHooks.length - 1; i >= 0; i--) {
if (_globalKeydownHooks[i](event)) {
handled = true;
break;
}
}
_detectAltGrKeyDown(event);
if (!handled && _h... | javascript | function _handleKeyEvent(event) {
var i, handled = false;
for (i = _globalKeydownHooks.length - 1; i >= 0; i--) {
if (_globalKeydownHooks[i](event)) {
handled = true;
break;
}
}
_detectAltGrKeyDown(event);
if (!handled && _h... | [
"function",
"_handleKeyEvent",
"(",
"event",
")",
"{",
"var",
"i",
",",
"handled",
"=",
"false",
";",
"for",
"(",
"i",
"=",
"_globalKeydownHooks",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"if",
"(",
"_globalKeydownHooks... | Handles a given keydown event, checking global hooks first before
deciding to handle it ourselves.
@param {Event} The keydown event to handle. | [
"Handles",
"a",
"given",
"keydown",
"event",
"checking",
"global",
"hooks",
"first",
"before",
"deciding",
"to",
"handle",
"it",
"ourselves",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/KeyBindingManager.js#L976-L989 |
2,375 | adobe/brackets | src/command/CommandManager.js | register | function register(name, id, commandFn) {
if (_commands[id]) {
console.log("Attempting to register an already-registered command: " + id);
return null;
}
if (!name || !id || !commandFn) {
console.error("Attempting to register a command with a missing name, id, ... | javascript | function register(name, id, commandFn) {
if (_commands[id]) {
console.log("Attempting to register an already-registered command: " + id);
return null;
}
if (!name || !id || !commandFn) {
console.error("Attempting to register a command with a missing name, id, ... | [
"function",
"register",
"(",
"name",
",",
"id",
",",
"commandFn",
")",
"{",
"if",
"(",
"_commands",
"[",
"id",
"]",
")",
"{",
"console",
".",
"log",
"(",
"\"Attempting to register an already-registered command: \"",
"+",
"id",
")",
";",
"return",
"null",
";"... | Registers a global command.
@param {string} name - text that will be displayed in the UI to represent command
@param {string} id - unique identifier for command.
Core commands in Brackets use a simple command title as an id, for example "open.file".
Extensions should use the following format: "author.myextension.mycomm... | [
"Registers",
"a",
"global",
"command",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/CommandManager.js#L189-L205 |
2,376 | adobe/brackets | src/command/CommandManager.js | registerInternal | function registerInternal(id, commandFn) {
if (_commands[id]) {
console.log("Attempting to register an already-registered command: " + id);
return null;
}
if (!id || !commandFn) {
console.error("Attempting to register an internal command with a missing id, or ... | javascript | function registerInternal(id, commandFn) {
if (_commands[id]) {
console.log("Attempting to register an already-registered command: " + id);
return null;
}
if (!id || !commandFn) {
console.error("Attempting to register an internal command with a missing id, or ... | [
"function",
"registerInternal",
"(",
"id",
",",
"commandFn",
")",
"{",
"if",
"(",
"_commands",
"[",
"id",
"]",
")",
"{",
"console",
".",
"log",
"(",
"\"Attempting to register an already-registered command: \"",
"+",
"id",
")",
";",
"return",
"null",
";",
"}",
... | Registers a global internal only command.
@param {string} id - unique identifier for command.
Core commands in Brackets use a simple command title as an id, for example "app.abort_quit".
Extensions should use the following format: "author.myextension.mycommandname".
For example, "lschmitt.csswizard.format.css".
@param ... | [
"Registers",
"a",
"global",
"internal",
"only",
"command",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/CommandManager.js#L219-L235 |
2,377 | adobe/brackets | src/command/CommandManager.js | execute | function execute(id) {
var command = _commands[id];
if (command) {
try {
exports.trigger("beforeExecuteCommand", id);
} catch (err) {
console.error(err);
}
return command.execute.apply(command, Array.prototype.slice.call(a... | javascript | function execute(id) {
var command = _commands[id];
if (command) {
try {
exports.trigger("beforeExecuteCommand", id);
} catch (err) {
console.error(err);
}
return command.execute.apply(command, Array.prototype.slice.call(a... | [
"function",
"execute",
"(",
"id",
")",
"{",
"var",
"command",
"=",
"_commands",
"[",
"id",
"]",
";",
"if",
"(",
"command",
")",
"{",
"try",
"{",
"exports",
".",
"trigger",
"(",
"\"beforeExecuteCommand\"",
",",
"id",
")",
";",
"}",
"catch",
"(",
"err"... | Looks up and runs a global command. Additional arguments are passed to the command.
@param {string} id The ID of the command to run.
@return {$.Promise} a jQuery promise that will be resolved when the command completes. | [
"Looks",
"up",
"and",
"runs",
"a",
"global",
"command",
".",
"Additional",
"arguments",
"are",
"passed",
"to",
"the",
"command",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/CommandManager.js#L277-L291 |
2,378 | adobe/brackets | src/utils/PerfUtils.js | addMeasurement | function addMeasurement(id) {
if (!enabled) {
return;
}
if (!(id instanceof PerfMeasurement)) {
id = new PerfMeasurement(id, id);
}
var elapsedTime = brackets.app.getElapsedMilliseconds();
if (activeTests[id.id]) {
elapsedTime -= act... | javascript | function addMeasurement(id) {
if (!enabled) {
return;
}
if (!(id instanceof PerfMeasurement)) {
id = new PerfMeasurement(id, id);
}
var elapsedTime = brackets.app.getElapsedMilliseconds();
if (activeTests[id.id]) {
elapsedTime -= act... | [
"function",
"addMeasurement",
"(",
"id",
")",
"{",
"if",
"(",
"!",
"enabled",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"(",
"id",
"instanceof",
"PerfMeasurement",
")",
")",
"{",
"id",
"=",
"new",
"PerfMeasurement",
"(",
"id",
",",
"id",
")",
"... | Stop a timer and add its measurements to the performance data.
Multiple measurements can be stored for any given name. If there are
multiple values for a name, they are stored in an Array.
If markStart() was not called for the specified timer, the
measured time is relative to app startup.
@param {Object} id Timer i... | [
"Stop",
"a",
"timer",
"and",
"add",
"its",
"measurements",
"to",
"the",
"performance",
"data",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/PerfUtils.js#L187-L223 |
2,379 | adobe/brackets | src/utils/PerfUtils.js | finalizeMeasurement | function finalizeMeasurement(id) {
if (activeTests[id.id]) {
delete activeTests[id.id];
}
if (updatableTests[id.id]) {
delete updatableTests[id.id];
}
} | javascript | function finalizeMeasurement(id) {
if (activeTests[id.id]) {
delete activeTests[id.id];
}
if (updatableTests[id.id]) {
delete updatableTests[id.id];
}
} | [
"function",
"finalizeMeasurement",
"(",
"id",
")",
"{",
"if",
"(",
"activeTests",
"[",
"id",
".",
"id",
"]",
")",
"{",
"delete",
"activeTests",
"[",
"id",
".",
"id",
"]",
";",
"}",
"if",
"(",
"updatableTests",
"[",
"id",
".",
"id",
"]",
")",
"{",
... | Remove timer from lists so next action starts a new measurement
updateMeasurement may not have been called, so timer may be
in either or neither list, but should never be in both.
@param {Object} id Timer id. | [
"Remove",
"timer",
"from",
"lists",
"so",
"next",
"action",
"starts",
"a",
"new",
"measurement"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/PerfUtils.js#L281-L289 |
2,380 | adobe/brackets | src/utils/PerfUtils.js | getDelimitedPerfData | function getDelimitedPerfData() {
var result = "";
_.forEach(perfData, function (entry, testName) {
result += getValueAsString(entry) + "\t" + testName + "\n";
});
return result;
} | javascript | function getDelimitedPerfData() {
var result = "";
_.forEach(perfData, function (entry, testName) {
result += getValueAsString(entry) + "\t" + testName + "\n";
});
return result;
} | [
"function",
"getDelimitedPerfData",
"(",
")",
"{",
"var",
"result",
"=",
"\"\"",
";",
"_",
".",
"forEach",
"(",
"perfData",
",",
"function",
"(",
"entry",
",",
"testName",
")",
"{",
"result",
"+=",
"getValueAsString",
"(",
"entry",
")",
"+",
"\"\\t\"",
"... | Returns the performance data as a tab delimited string
@return {string} | [
"Returns",
"the",
"performance",
"data",
"as",
"a",
"tab",
"delimited",
"string"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/PerfUtils.js#L343-L350 |
2,381 | adobe/brackets | src/utils/PerfUtils.js | getHealthReport | function getHealthReport() {
var healthReport = {
projectLoadTimes : "",
fileOpenTimes : ""
};
_.forEach(perfData, function (entry, testName) {
if (StringUtils.startsWith(testName, "Application Startup")) {
healthReport.AppStartupTime = getVal... | javascript | function getHealthReport() {
var healthReport = {
projectLoadTimes : "",
fileOpenTimes : ""
};
_.forEach(perfData, function (entry, testName) {
if (StringUtils.startsWith(testName, "Application Startup")) {
healthReport.AppStartupTime = getVal... | [
"function",
"getHealthReport",
"(",
")",
"{",
"var",
"healthReport",
"=",
"{",
"projectLoadTimes",
":",
"\"\"",
",",
"fileOpenTimes",
":",
"\"\"",
"}",
";",
"_",
".",
"forEach",
"(",
"perfData",
",",
"function",
"(",
"entry",
",",
"testName",
")",
"{",
"... | Returns the Performance metrics to be logged for health report
@return {Object} An object with the health data logs to be sent | [
"Returns",
"the",
"Performance",
"metrics",
"to",
"be",
"logged",
"for",
"health",
"report"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/PerfUtils.js#L368-L387 |
2,382 | adobe/brackets | src/language/HTMLUtils.js | getTagAttributes | function getTagAttributes(editor, pos) {
var attrs = [],
backwardCtx = TokenUtils.getInitialContext(editor._codeMirror, pos),
forwardCtx = $.extend({}, backwardCtx);
if (editor.getModeForSelection() === "html") {
if (backwardCtx.token && !tagPrefixedRegExp.tes... | javascript | function getTagAttributes(editor, pos) {
var attrs = [],
backwardCtx = TokenUtils.getInitialContext(editor._codeMirror, pos),
forwardCtx = $.extend({}, backwardCtx);
if (editor.getModeForSelection() === "html") {
if (backwardCtx.token && !tagPrefixedRegExp.tes... | [
"function",
"getTagAttributes",
"(",
"editor",
",",
"pos",
")",
"{",
"var",
"attrs",
"=",
"[",
"]",
",",
"backwardCtx",
"=",
"TokenUtils",
".",
"getInitialContext",
"(",
"editor",
".",
"_codeMirror",
",",
"pos",
")",
",",
"forwardCtx",
"=",
"$",
".",
"ex... | Compiles a list of used attributes for a given tag
@param {CodeMirror} editor An instance of a CodeMirror editor
@param {ch:{string}, line:{number}} pos A CodeMirror position
@return {Array.<string>} A list of the used attributes inside the current tag | [
"Compiles",
"a",
"list",
"of",
"used",
"attributes",
"for",
"a",
"given",
"tag"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/HTMLUtils.js#L131-L173 |
2,383 | adobe/brackets | src/language/HTMLUtils.js | createTagInfo | function createTagInfo(tokenType, offset, tagName, attrName, attrValue, valueAssigned, quoteChar, hasEndQuote) {
return { tagName: tagName || "",
attr:
{ name: attrName || "",
value: attrValue || "",
valueAssigned: valueAssigned ||... | javascript | function createTagInfo(tokenType, offset, tagName, attrName, attrValue, valueAssigned, quoteChar, hasEndQuote) {
return { tagName: tagName || "",
attr:
{ name: attrName || "",
value: attrValue || "",
valueAssigned: valueAssigned ||... | [
"function",
"createTagInfo",
"(",
"tokenType",
",",
"offset",
",",
"tagName",
",",
"attrName",
",",
"attrValue",
",",
"valueAssigned",
",",
"quoteChar",
",",
"hasEndQuote",
")",
"{",
"return",
"{",
"tagName",
":",
"tagName",
"||",
"\"\"",
",",
"attr",
":",
... | Creates a tagInfo object and assures all the values are entered or are empty strings
@param {string=} tokenType what is getting edited and should be hinted
@param {number=} offset where the cursor is for the part getting hinted
@param {string=} tagName The name of the tag
@param {string=} attrName The name of the attri... | [
"Creates",
"a",
"tagInfo",
"object",
"and",
"assures",
"all",
"the",
"values",
"are",
"entered",
"or",
"are",
"empty",
"strings"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/HTMLUtils.js#L188-L199 |
2,384 | adobe/brackets | src/extensions/default/CodeFolding/foldhelpers/handlebarsFold.js | scanTextUntil | function scanTextUntil(cm, startCh, startLine, condition) {
var line = cm.getLine(startLine),
seen = "",
characterIndex = startCh,
currentLine = startLine,
range;
while (currentLine <= cm.lastLine()) {
if (line.length === 0) {
c... | javascript | function scanTextUntil(cm, startCh, startLine, condition) {
var line = cm.getLine(startLine),
seen = "",
characterIndex = startCh,
currentLine = startLine,
range;
while (currentLine <= cm.lastLine()) {
if (line.length === 0) {
c... | [
"function",
"scanTextUntil",
"(",
"cm",
",",
"startCh",
",",
"startLine",
",",
"condition",
")",
"{",
"var",
"line",
"=",
"cm",
".",
"getLine",
"(",
"startLine",
")",
",",
"seen",
"=",
"\"\"",
",",
"characterIndex",
"=",
"startCh",
",",
"currentLine",
"=... | Utility function for scanning the text in a document until a certain condition is met
@param {object} cm The code mirror object representing the document
@param {string} startCh The start character position for the scan operation
@param {number} startLine The start line position for the scan operation
@param {func... | [
"Utility",
"function",
"for",
"scanning",
"the",
"text",
"in",
"a",
"document",
"until",
"a",
"certain",
"condition",
"is",
"met"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/foldhelpers/handlebarsFold.js#L44-L80 |
2,385 | adobe/brackets | src/LiveDevelopment/Agents/CSSAgent.js | styleForURL | function styleForURL(url) {
var styleSheetId, styles = {};
url = _canonicalize(url);
for (styleSheetId in _styleSheetDetails) {
if (_styleSheetDetails[styleSheetId].canonicalizedURL === url) {
styles[styleSheetId] = _styleSheetDetails[styleSheetId];
}
... | javascript | function styleForURL(url) {
var styleSheetId, styles = {};
url = _canonicalize(url);
for (styleSheetId in _styleSheetDetails) {
if (_styleSheetDetails[styleSheetId].canonicalizedURL === url) {
styles[styleSheetId] = _styleSheetDetails[styleSheetId];
}
... | [
"function",
"styleForURL",
"(",
"url",
")",
"{",
"var",
"styleSheetId",
",",
"styles",
"=",
"{",
"}",
";",
"url",
"=",
"_canonicalize",
"(",
"url",
")",
";",
"for",
"(",
"styleSheetId",
"in",
"_styleSheetDetails",
")",
"{",
"if",
"(",
"_styleSheetDetails",... | Get the style sheets for a url
@param {string} url
@return {Object.<string, CSSStyleSheetHeader>} | [
"Get",
"the",
"style",
"sheets",
"for",
"a",
"url"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/CSSAgent.js#L81-L90 |
2,386 | adobe/brackets | src/LiveDevelopment/Agents/CSSAgent.js | reloadCSSForDocument | function reloadCSSForDocument(doc, newContent) {
var styles = styleForURL(doc.url),
styleSheetId,
deferreds = [];
if (newContent === undefined) {
newContent = doc.getText();
}
for (styleSheetId in styles) {
deferreds.push(Inspector.CSS.set... | javascript | function reloadCSSForDocument(doc, newContent) {
var styles = styleForURL(doc.url),
styleSheetId,
deferreds = [];
if (newContent === undefined) {
newContent = doc.getText();
}
for (styleSheetId in styles) {
deferreds.push(Inspector.CSS.set... | [
"function",
"reloadCSSForDocument",
"(",
"doc",
",",
"newContent",
")",
"{",
"var",
"styles",
"=",
"styleForURL",
"(",
"doc",
".",
"url",
")",
",",
"styleSheetId",
",",
"deferreds",
"=",
"[",
"]",
";",
"if",
"(",
"newContent",
"===",
"undefined",
")",
"{... | Reload a CSS style sheet from a document
@param {Document} document
@param {string=} newContent new content of every stylesheet. Defaults to doc.getText() if omitted
@return {jQuery.Promise} | [
"Reload",
"a",
"CSS",
"style",
"sheet",
"from",
"a",
"document"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/CSSAgent.js#L98-L115 |
2,387 | adobe/brackets | src/search/FindInFiles.js | _removeListeners | function _removeListeners() {
DocumentModule.off("documentChange", _documentChangeHandler);
FileSystem.off("change", _debouncedFileSystemChangeHandler);
DocumentManager.off("fileNameChange", _fileNameChangeHandler);
} | javascript | function _removeListeners() {
DocumentModule.off("documentChange", _documentChangeHandler);
FileSystem.off("change", _debouncedFileSystemChangeHandler);
DocumentManager.off("fileNameChange", _fileNameChangeHandler);
} | [
"function",
"_removeListeners",
"(",
")",
"{",
"DocumentModule",
".",
"off",
"(",
"\"documentChange\"",
",",
"_documentChangeHandler",
")",
";",
"FileSystem",
".",
"off",
"(",
"\"change\"",
",",
"_debouncedFileSystemChangeHandler",
")",
";",
"DocumentManager",
".",
... | Remove the listeners that were tracking potential search result changes | [
"Remove",
"the",
"listeners",
"that",
"were",
"tracking",
"potential",
"search",
"result",
"changes"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindInFiles.js#L91-L95 |
2,388 | adobe/brackets | src/search/FindInFiles.js | _addListeners | function _addListeners() {
// Avoid adding duplicate listeners - e.g. if a 2nd search is run without closing the old results panel first
_removeListeners();
DocumentModule.on("documentChange", _documentChangeHandler);
FileSystem.on("change", _debouncedFileSystemChangeHandler);
D... | javascript | function _addListeners() {
// Avoid adding duplicate listeners - e.g. if a 2nd search is run without closing the old results panel first
_removeListeners();
DocumentModule.on("documentChange", _documentChangeHandler);
FileSystem.on("change", _debouncedFileSystemChangeHandler);
D... | [
"function",
"_addListeners",
"(",
")",
"{",
"// Avoid adding duplicate listeners - e.g. if a 2nd search is run without closing the old results panel first",
"_removeListeners",
"(",
")",
";",
"DocumentModule",
".",
"on",
"(",
"\"documentChange\"",
",",
"_documentChangeHandler",
")"... | Add listeners to track events that might change the search result set | [
"Add",
"listeners",
"to",
"track",
"events",
"that",
"might",
"change",
"the",
"search",
"result",
"set"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindInFiles.js#L98-L105 |
2,389 | adobe/brackets | src/search/FindInFiles.js | getCandidateFiles | function getCandidateFiles(scope) {
function filter(file) {
return _subtreeFilter(file, scope) && _isReadableText(file.fullPath);
}
// If the scope is a single file, just check if the file passes the filter directly rather than
// trying to use ProjectManager.getAllFiles(), ... | javascript | function getCandidateFiles(scope) {
function filter(file) {
return _subtreeFilter(file, scope) && _isReadableText(file.fullPath);
}
// If the scope is a single file, just check if the file passes the filter directly rather than
// trying to use ProjectManager.getAllFiles(), ... | [
"function",
"getCandidateFiles",
"(",
"scope",
")",
"{",
"function",
"filter",
"(",
"file",
")",
"{",
"return",
"_subtreeFilter",
"(",
"file",
",",
"scope",
")",
"&&",
"_isReadableText",
"(",
"file",
".",
"fullPath",
")",
";",
"}",
"// If the scope is a single... | Finds all candidate files to search in the given scope's subtree that are not binary content. Does NOT apply
the current filter yet.
@param {?FileSystemEntry} scope Search scope, or null if whole project
@return {$.Promise} A promise that will be resolved with the list of files in the scope. Never rejected. | [
"Finds",
"all",
"candidate",
"files",
"to",
"search",
"in",
"the",
"given",
"scope",
"s",
"subtree",
"that",
"are",
"not",
"binary",
"content",
".",
"Does",
"NOT",
"apply",
"the",
"current",
"filter",
"yet",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindInFiles.js#L350-L363 |
2,390 | adobe/brackets | src/search/FindInFiles.js | doSearchInScope | function doSearchInScope(queryInfo, scope, filter, replaceText, candidateFilesPromise) {
clearSearch();
searchModel.scope = scope;
if (replaceText !== undefined) {
searchModel.isReplace = true;
searchModel.replaceText = replaceText;
}
candidateFilesPromise... | javascript | function doSearchInScope(queryInfo, scope, filter, replaceText, candidateFilesPromise) {
clearSearch();
searchModel.scope = scope;
if (replaceText !== undefined) {
searchModel.isReplace = true;
searchModel.replaceText = replaceText;
}
candidateFilesPromise... | [
"function",
"doSearchInScope",
"(",
"queryInfo",
",",
"scope",
",",
"filter",
",",
"replaceText",
",",
"candidateFilesPromise",
")",
"{",
"clearSearch",
"(",
")",
";",
"searchModel",
".",
"scope",
"=",
"scope",
";",
"if",
"(",
"replaceText",
"!==",
"undefined"... | Does a search in the given scope with the given filter. Used when you want to start a search
programmatically.
@param {{query: string, caseSensitive: boolean, isRegexp: boolean}} queryInfo Query info object
@param {?Entry} scope Project file/subfolder to search within; else searches whole project.
@param {?string} filt... | [
"Does",
"a",
"search",
"in",
"the",
"given",
"scope",
"with",
"the",
"given",
"filter",
".",
"Used",
"when",
"you",
"want",
"to",
"start",
"a",
"search",
"programmatically",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindInFiles.js#L619-L628 |
2,391 | adobe/brackets | src/search/FindInFiles.js | doReplace | function doReplace(results, replaceText, options) {
return FindUtils.performReplacements(results, replaceText, options).always(function () {
// For UI integration testing only
exports._replaceDone = true;
});
} | javascript | function doReplace(results, replaceText, options) {
return FindUtils.performReplacements(results, replaceText, options).always(function () {
// For UI integration testing only
exports._replaceDone = true;
});
} | [
"function",
"doReplace",
"(",
"results",
",",
"replaceText",
",",
"options",
")",
"{",
"return",
"FindUtils",
".",
"performReplacements",
"(",
"results",
",",
"replaceText",
",",
"options",
")",
".",
"always",
"(",
"function",
"(",
")",
"{",
"// For UI integra... | Given a set of search results, replaces them with the given replaceText, either on disk or in memory.
@param {Object.<fullPath: string, {matches: Array.<{start: {line:number,ch:number}, end: {line:number,ch:number}, startOffset: number, endOffset: number, line: string}>, collapsed: boolean}>} results
The list of result... | [
"Given",
"a",
"set",
"of",
"search",
"results",
"replaces",
"them",
"with",
"the",
"given",
"replaceText",
"either",
"on",
"disk",
"or",
"in",
"memory",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindInFiles.js#L645-L650 |
2,392 | adobe/brackets | src/search/FindInFiles.js | filesChanged | function filesChanged(fileList) {
if (FindUtils.isNodeSearchDisabled() || !fileList || fileList.length === 0) {
return;
}
var updateObject = {
"fileList": fileList
};
if (searchModel.filter) {
updateObject.filesInSearchScope = FileFilters.getPa... | javascript | function filesChanged(fileList) {
if (FindUtils.isNodeSearchDisabled() || !fileList || fileList.length === 0) {
return;
}
var updateObject = {
"fileList": fileList
};
if (searchModel.filter) {
updateObject.filesInSearchScope = FileFilters.getPa... | [
"function",
"filesChanged",
"(",
"fileList",
")",
"{",
"if",
"(",
"FindUtils",
".",
"isNodeSearchDisabled",
"(",
")",
"||",
"!",
"fileList",
"||",
"fileList",
".",
"length",
"===",
"0",
")",
"{",
"return",
";",
"}",
"var",
"updateObject",
"=",
"{",
"\"fi... | Inform node that the list of files has changed.
@param {array} fileList The list of files that changed. | [
"Inform",
"node",
"that",
"the",
"list",
"of",
"files",
"has",
"changed",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindInFiles.js#L674-L686 |
2,393 | adobe/brackets | src/search/FindInFiles.js | function (child) {
// Replicate filtering that getAllFiles() does
if (ProjectManager.shouldShow(child)) {
if (child.isFile && _isReadableText(child.name)) {
// Re-check the filtering that the initial search applied
... | javascript | function (child) {
// Replicate filtering that getAllFiles() does
if (ProjectManager.shouldShow(child)) {
if (child.isFile && _isReadableText(child.name)) {
// Re-check the filtering that the initial search applied
... | [
"function",
"(",
"child",
")",
"{",
"// Replicate filtering that getAllFiles() does",
"if",
"(",
"ProjectManager",
".",
"shouldShow",
"(",
"child",
")",
")",
"{",
"if",
"(",
"child",
".",
"isFile",
"&&",
"_isReadableText",
"(",
"child",
".",
"name",
")",
")",
... | gather up added files | [
"gather",
"up",
"added",
"files"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindInFiles.js#L783-L796 | |
2,394 | adobe/brackets | src/search/FindInFiles.js | function () {
function filter(file) {
return _subtreeFilter(file, null) && _isReadableText(file.fullPath);
}
FindUtils.setInstantSearchDisabled(true);
//we always listen for filesytem changes.
_addListeners();
if (!PreferencesManager.get("findInFiles.nodeSea... | javascript | function () {
function filter(file) {
return _subtreeFilter(file, null) && _isReadableText(file.fullPath);
}
FindUtils.setInstantSearchDisabled(true);
//we always listen for filesytem changes.
_addListeners();
if (!PreferencesManager.get("findInFiles.nodeSea... | [
"function",
"(",
")",
"{",
"function",
"filter",
"(",
"file",
")",
"{",
"return",
"_subtreeFilter",
"(",
"file",
",",
"null",
")",
"&&",
"_isReadableText",
"(",
"file",
".",
"fullPath",
")",
";",
"}",
"FindUtils",
".",
"setInstantSearchDisabled",
"(",
"tru... | On project change, inform node about the new list of files that needs to be crawled.
Instant search is also disabled for the time being till the crawl is complete in node. | [
"On",
"project",
"change",
"inform",
"node",
"about",
"the",
"new",
"list",
"of",
"files",
"that",
"needs",
"to",
"be",
"crawled",
".",
"Instant",
"search",
"is",
"also",
"disabled",
"for",
"the",
"time",
"being",
"till",
"the",
"crawl",
"is",
"complete",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindInFiles.js#L916-L944 | |
2,395 | adobe/brackets | src/search/FindInFiles.js | getNextPageofSearchResults | function getNextPageofSearchResults() {
var searchDeferred = $.Deferred();
if (searchModel.allResultsAvailable) {
return searchDeferred.resolve().promise();
}
_updateChangedDocs();
FindUtils.notifyNodeSearchStarted();
searchDomain.exec("nextPage")
... | javascript | function getNextPageofSearchResults() {
var searchDeferred = $.Deferred();
if (searchModel.allResultsAvailable) {
return searchDeferred.resolve().promise();
}
_updateChangedDocs();
FindUtils.notifyNodeSearchStarted();
searchDomain.exec("nextPage")
... | [
"function",
"getNextPageofSearchResults",
"(",
")",
"{",
"var",
"searchDeferred",
"=",
"$",
".",
"Deferred",
"(",
")",
";",
"if",
"(",
"searchModel",
".",
"allResultsAvailable",
")",
"{",
"return",
"searchDeferred",
".",
"resolve",
"(",
")",
".",
"promise",
... | Gets the next page of search results to append to the result set.
@return {object} A promise that's resolved with the search results or rejected when the find competes. | [
"Gets",
"the",
"next",
"page",
"of",
"search",
"results",
"to",
"append",
"to",
"the",
"result",
"set",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindInFiles.js#L951-L981 |
2,396 | adobe/brackets | src/language/HTMLDOMDiff.js | function (beforeID, isBeingDeleted) {
newEdits.forEach(function (edit) {
// elementDeletes don't need any positioning information
if (edit.type !== "elementDelete") {
edit.beforeID = beforeID;
}
});
edits.push.apply(... | javascript | function (beforeID, isBeingDeleted) {
newEdits.forEach(function (edit) {
// elementDeletes don't need any positioning information
if (edit.type !== "elementDelete") {
edit.beforeID = beforeID;
}
});
edits.push.apply(... | [
"function",
"(",
"beforeID",
",",
"isBeingDeleted",
")",
"{",
"newEdits",
".",
"forEach",
"(",
"function",
"(",
"edit",
")",
"{",
"// elementDeletes don't need any positioning information",
"if",
"(",
"edit",
".",
"type",
"!==",
"\"elementDelete\"",
")",
"{",
"edi... | We initially put new edit objects into the `newEdits` array so that we
can fix them up with proper positioning information. This function is
responsible for doing that fixup.
The `beforeID` that appears in many edits tells the browser to make the
change before the element with the given ID. In other words, an
elementI... | [
"We",
"initially",
"put",
"new",
"edit",
"objects",
"into",
"the",
"newEdits",
"array",
"so",
"that",
"we",
"can",
"fix",
"them",
"up",
"with",
"proper",
"positioning",
"information",
".",
"This",
"function",
"is",
"responsible",
"for",
"doing",
"that",
"fix... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/HTMLDOMDiff.js#L131-L149 | |
2,397 | adobe/brackets | src/language/HTMLDOMDiff.js | function () {
if (!oldNodeMap[newChild.tagID]) {
newEdit = {
type: "elementInsert",
tag: newChild.tag,
tagID: newChild.tagID,
parentID: newChild.parent.tagID,
attributes: newChild.attributes
... | javascript | function () {
if (!oldNodeMap[newChild.tagID]) {
newEdit = {
type: "elementInsert",
tag: newChild.tag,
tagID: newChild.tagID,
parentID: newChild.parent.tagID,
attributes: newChild.attributes
... | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"oldNodeMap",
"[",
"newChild",
".",
"tagID",
"]",
")",
"{",
"newEdit",
"=",
"{",
"type",
":",
"\"elementInsert\"",
",",
"tag",
":",
"newChild",
".",
"tag",
",",
"tagID",
":",
"newChild",
".",
"tagID",
",",
... | If the current element was not in the old DOM, then we will create
an elementInsert edit for it.
If the element was in the old DOM, this will return false and the
main loop will either spot this element later in the child list
or the element has been moved.
@return {boolean} true if an elementInsert was created | [
"If",
"the",
"current",
"element",
"was",
"not",
"in",
"the",
"old",
"DOM",
"then",
"we",
"will",
"create",
"an",
"elementInsert",
"edit",
"for",
"it",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/HTMLDOMDiff.js#L161-L188 | |
2,398 | adobe/brackets | src/language/HTMLDOMDiff.js | function () {
if (!newNodeMap[oldChild.tagID]) {
// We can finalize existing edits relative to this node *before* it's
// deleted.
finalizeNewEdits(oldChild.tagID, true);
newEdit = {
type: "elementDelete",
... | javascript | function () {
if (!newNodeMap[oldChild.tagID]) {
// We can finalize existing edits relative to this node *before* it's
// deleted.
finalizeNewEdits(oldChild.tagID, true);
newEdit = {
type: "elementDelete",
... | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"newNodeMap",
"[",
"oldChild",
".",
"tagID",
"]",
")",
"{",
"// We can finalize existing edits relative to this node *before* it's",
"// deleted.",
"finalizeNewEdits",
"(",
"oldChild",
".",
"tagID",
",",
"true",
")",
";",
... | If the old element that we're looking at does not appear in the new
DOM, that means it was deleted and we'll create an elementDelete edit.
If the element is in the new DOM, then this will return false and
the main loop with either spot this node later on or the element
has been moved.
@return {boolean} true if elemen... | [
"If",
"the",
"old",
"element",
"that",
"we",
"re",
"looking",
"at",
"does",
"not",
"appear",
"in",
"the",
"new",
"DOM",
"that",
"means",
"it",
"was",
"deleted",
"and",
"we",
"ll",
"create",
"an",
"elementDelete",
"edit",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/HTMLDOMDiff.js#L200-L219 | |
2,399 | adobe/brackets | src/language/HTMLDOMDiff.js | function () {
newEdit = {
type: "textInsert",
content: newChild.content,
parentID: newChild.parent.tagID
};
// text changes will generally have afterID and beforeID, but we make
// special note if it's the first child.
... | javascript | function () {
newEdit = {
type: "textInsert",
content: newChild.content,
parentID: newChild.parent.tagID
};
// text changes will generally have afterID and beforeID, but we make
// special note if it's the first child.
... | [
"function",
"(",
")",
"{",
"newEdit",
"=",
"{",
"type",
":",
"\"textInsert\"",
",",
"content",
":",
"newChild",
".",
"content",
",",
"parentID",
":",
"newChild",
".",
"parent",
".",
"tagID",
"}",
";",
"// text changes will generally have afterID and beforeID, but ... | Adds a textInsert edit for a newly created text node. | [
"Adds",
"a",
"textInsert",
"edit",
"for",
"a",
"newly",
"created",
"text",
"node",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/HTMLDOMDiff.js#L224-L242 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.