_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 52 373k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q17300 | _validateBaseUrl | train | 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 | {
"resource": ""
} |
q17301 | showProjectPreferencesDialog | train | function showProjectPreferencesDialog(baseUrl, errorMessage) {
var $baseUrlControl,
dialog;
// Title
var projectName = "",
projectRoot = ProjectManager.getProjectRoot(),
title;
if (projectRoot) {
projectName = projectRoot.name;
}
... | javascript | {
"resource": ""
} |
q17302 | _validEvent | train | function _validEvent(event) {
if (window.navigator.platform.substr(0, 3) === "Mac") {
// Mac
return event.metaKey;
} else {
// Windows
return event.ctrlKey;
}
} | javascript | {
"resource": ""
} |
q17303 | _screenOffset | train | 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 | {
"resource": ""
} |
q17304 | _trigger | train | 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 | {
"resource": ""
} |
q17305 | isInViewport | train | 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 | {
"resource": ""
} |
q17306 | Menu | train | function Menu(element) {
this.element = element;
_trigger(this.element, "showgoto", 1, true);
window.setTimeout(window.remoteShowGoto);
this.remove = this.remove.bind(this);
} | javascript | {
"resource": ""
} |
q17307 | highlight | train | function highlight(node, clear) {
if (!_remoteHighlight) {
_remoteHighlight = new Highlight("#cfc");
}
if (clear) {
_remoteHighlight.clear();
}
_remoteHighlight.add(node, true);
} | javascript | {
"resource": ""
} |
q17308 | highlightRule | train | 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 | {
"resource": ""
} |
q17309 | _scrollHandler | train | 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 | {
"resource": ""
} |
q17310 | findMatchingSpecial | train | 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 | {
"resource": ""
} |
q17311 | backtrack | train | 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 | {
"resource": ""
} |
q17312 | closeRangeGap | train | function closeRangeGap(c) {
// Close the current range
if (currentRange) {
currentRange.includesLastSegment = lastMatchIndex >= lastSegmentStart;
if (currentRange.matched && currentRange.includesLastSegment) {
if (DEBUG_SCORES) {
... | javascript | {
"resource": ""
} |
q17313 | addMatch | train | 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 | {
"resource": ""
} |
q17314 | _syncGutterWidths | train | 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 | {
"resource": ""
} |
q17315 | init | train | function init(domainManager) {
_domainManager = domainManager;
if (!domainManager.hasDomain("staticServer")) {
domainManager.registerDomain("staticServer", {major: 0, minor: 1});
}
_domainManager.registerCommand(
"staticServer",
"_setRequestFilterTimeout",
_cmdSetRequest... | javascript | {
"resource": ""
} |
q17316 | _doReplaceInDocument | train | 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 | {
"resource": ""
} |
q17317 | _doReplaceOnDisk | train | 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 | {
"resource": ""
} |
q17318 | _doReplaceInOneFile | train | 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 | {
"resource": ""
} |
q17319 | labelForScope | train | function labelForScope(scope) {
if (scope) {
return StringUtils.format(
Strings.FIND_IN_FILES_SCOPED,
StringUtils.breakableUrl(
ProjectManager.makeProjectRelativeIfPossible(scope.fullPath)
)
);
} else {
... | javascript | {
"resource": ""
} |
q17320 | parseQueryInfo | train | 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 | {
"resource": ""
} |
q17321 | prioritizeOpenFile | train | function prioritizeOpenFile(files, firstFile) {
var workingSetFiles = MainViewManager.getWorkingSet(MainViewManager.ALL_PANES),
workingSetFileFound = {},
fileSetWithoutWorkingSet = [],
startingWorkingFileSet = [],
propertyName = "",
i = 0;
firs... | javascript | {
"resource": ""
} |
q17322 | _trimStack | train | 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 | {
"resource": ""
} |
q17323 | deprecationWarning | train | 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 | {
"resource": ""
} |
q17324 | deprecateEvent | train | 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 | {
"resource": ""
} |
q17325 | deprecateConstant | train | 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 | {
"resource": ""
} |
q17326 | setViewState | train | function setViewState(id, value, context, doNotSave) {
PreferencesImpl.stateManager.set(id, value, context);
if (!doNotSave) {
PreferencesImpl.stateManager.save();
}
} | javascript | {
"resource": ""
} |
q17327 | movePrevToken | train | 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 | {
"resource": ""
} |
q17328 | moveNextToken | train | 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 | {
"resource": ""
} |
q17329 | moveSkippingWhitespace | train | 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 | {
"resource": ""
} |
q17330 | offsetInToken | train | 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 | {
"resource": ""
} |
q17331 | getModeAt | train | 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 | {
"resource": ""
} |
q17332 | node | train | 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 | {
"resource": ""
} |
q17333 | rule | train | function rule(name) {
if (_highlight.ref === name) {
return;
}
hide();
_highlight = {type: "css", ref: name};
RemoteAgent.call("highlightRule", name);
} | javascript | {
"resource": ""
} |
q17334 | domElement | train | function domElement(ids) {
var selector = "";
if (!Array.isArray(ids)) {
ids = [ids];
}
_.each(ids, function (id) {
if (selector !== "") {
selector += ",";
}
selector += "[data-brackets-id='" + id + "']";
});
... | javascript | {
"resource": ""
} |
q17335 | openAndSelectDocument | train | function openAndSelectDocument(fullPath, fileSelectionFocus, paneId) {
var result,
curDocChangedDueToMe = _curDocChangedDueToMe;
function _getDerivedPaneContext() {
function _secondPaneContext() {
return (window.event.ctrlKey || window.event.metaKey) && window.e... | javascript | {
"resource": ""
} |
q17336 | generateJsonForMustache | train | 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 | {
"resource": ""
} |
q17337 | train | 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 | {
"resource": ""
} | |
q17338 | train | 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 | {
"resource": ""
} | |
q17339 | train | function () {
var added = {},
current,
newStatus;
current = this.stylesheets;
newStatus = related().stylesheets;
Object.keys(newStatus).forEach(function (v, i) {
if (!current[v]) {
... | javascript | {
"resource": ""
} | |
q17340 | train | function () {
var self = this;
var removed = {},
newStatus,
current;
current = self.stylesheets;
newStatus = related().stylesheets;
Object.keys(current).forEach(function (v, i) {
... | javascript | {
"resource": ""
} | |
q17341 | start | train | 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 | {
"resource": ""
} |
q17342 | openLiveBrowser | train | 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 | {
"resource": ""
} |
q17343 | BaseServer | train | 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 | {
"resource": ""
} |
q17344 | getUserInstalledExtensions | train | function getUserInstalledExtensions() {
var result = new $.Deferred();
if (!ExtensionManager.hasDownloadedRegistry) {
ExtensionManager.downloadRegistry().done(function () {
result.resolve(getUserExtensionsPresentInRegistry(ExtensionManager.extensions));
})
... | javascript | {
"resource": ""
} |
q17345 | getUserInstalledTheme | train | 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 | {
"resource": ""
} |
q17346 | normalizeKeyDescriptorString | train | function normalizeKeyDescriptorString(origDescriptor) {
var hasMacCtrl = false,
hasCtrl = false,
hasAlt = false,
hasShift = false,
key = "",
error = false;
function _compareModifierString(left, right) {
if (!left || !right) {
... | javascript | {
"resource": ""
} |
q17347 | _translateKeyboardEvent | train | 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 | {
"resource": ""
} |
q17348 | formatKeyDescriptor | train | 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 | {
"resource": ""
} |
q17349 | removeBinding | train | 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 | {
"resource": ""
} |
q17350 | _handleKey | train | 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 | {
"resource": ""
} |
q17351 | addBinding | train | 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 | {
"resource": ""
} |
q17352 | getKeyBindings | train | function getKeyBindings(command) {
var bindings = [],
commandID = "";
if (!command) {
console.error("getKeyBindings(): missing required parameter: command");
return [];
}
if (typeof (command) === "string") {
commandID = command;
... | javascript | {
"resource": ""
} |
q17353 | _handleCommandRegistered | train | function _handleCommandRegistered(event, command) {
var commandId = command.getID(),
defaults = KeyboardPrefs[commandId];
if (defaults) {
addBinding(commandId, defaults);
}
} | javascript | {
"resource": ""
} |
q17354 | removeGlobalKeydownHook | train | function removeGlobalKeydownHook(hook) {
var index = _globalKeydownHooks.indexOf(hook);
if (index !== -1) {
_globalKeydownHooks.splice(index, 1);
}
} | javascript | {
"resource": ""
} |
q17355 | _handleKeyEvent | train | 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 | {
"resource": ""
} |
q17356 | register | train | 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 | {
"resource": ""
} |
q17357 | registerInternal | train | 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 | {
"resource": ""
} |
q17358 | execute | train | 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 | {
"resource": ""
} |
q17359 | addMeasurement | train | 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 | {
"resource": ""
} |
q17360 | finalizeMeasurement | train | function finalizeMeasurement(id) {
if (activeTests[id.id]) {
delete activeTests[id.id];
}
if (updatableTests[id.id]) {
delete updatableTests[id.id];
}
} | javascript | {
"resource": ""
} |
q17361 | getDelimitedPerfData | train | function getDelimitedPerfData() {
var result = "";
_.forEach(perfData, function (entry, testName) {
result += getValueAsString(entry) + "\t" + testName + "\n";
});
return result;
} | javascript | {
"resource": ""
} |
q17362 | getHealthReport | train | function getHealthReport() {
var healthReport = {
projectLoadTimes : "",
fileOpenTimes : ""
};
_.forEach(perfData, function (entry, testName) {
if (StringUtils.startsWith(testName, "Application Startup")) {
healthReport.AppStartupTime = getVal... | javascript | {
"resource": ""
} |
q17363 | getTagAttributes | train | 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 | {
"resource": ""
} |
q17364 | createTagInfo | train | function createTagInfo(tokenType, offset, tagName, attrName, attrValue, valueAssigned, quoteChar, hasEndQuote) {
return { tagName: tagName || "",
attr:
{ name: attrName || "",
value: attrValue || "",
valueAssigned: valueAssigned ||... | javascript | {
"resource": ""
} |
q17365 | scanTextUntil | train | 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 | {
"resource": ""
} |
q17366 | styleForURL | train | function styleForURL(url) {
var styleSheetId, styles = {};
url = _canonicalize(url);
for (styleSheetId in _styleSheetDetails) {
if (_styleSheetDetails[styleSheetId].canonicalizedURL === url) {
styles[styleSheetId] = _styleSheetDetails[styleSheetId];
}
... | javascript | {
"resource": ""
} |
q17367 | reloadCSSForDocument | train | 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 | {
"resource": ""
} |
q17368 | _removeListeners | train | function _removeListeners() {
DocumentModule.off("documentChange", _documentChangeHandler);
FileSystem.off("change", _debouncedFileSystemChangeHandler);
DocumentManager.off("fileNameChange", _fileNameChangeHandler);
} | javascript | {
"resource": ""
} |
q17369 | _addListeners | train | 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 | {
"resource": ""
} |
q17370 | getCandidateFiles | train | 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 | {
"resource": ""
} |
q17371 | doSearchInScope | train | function doSearchInScope(queryInfo, scope, filter, replaceText, candidateFilesPromise) {
clearSearch();
searchModel.scope = scope;
if (replaceText !== undefined) {
searchModel.isReplace = true;
searchModel.replaceText = replaceText;
}
candidateFilesPromise... | javascript | {
"resource": ""
} |
q17372 | doReplace | train | function doReplace(results, replaceText, options) {
return FindUtils.performReplacements(results, replaceText, options).always(function () {
// For UI integration testing only
exports._replaceDone = true;
});
} | javascript | {
"resource": ""
} |
q17373 | filesChanged | train | function filesChanged(fileList) {
if (FindUtils.isNodeSearchDisabled() || !fileList || fileList.length === 0) {
return;
}
var updateObject = {
"fileList": fileList
};
if (searchModel.filter) {
updateObject.filesInSearchScope = FileFilters.getPa... | javascript | {
"resource": ""
} |
q17374 | train | 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 | {
"resource": ""
} | |
q17375 | train | 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 | {
"resource": ""
} | |
q17376 | getNextPageofSearchResults | train | function getNextPageofSearchResults() {
var searchDeferred = $.Deferred();
if (searchModel.allResultsAvailable) {
return searchDeferred.resolve().promise();
}
_updateChangedDocs();
FindUtils.notifyNodeSearchStarted();
searchDomain.exec("nextPage")
... | javascript | {
"resource": ""
} |
q17377 | train | 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 | {
"resource": ""
} | |
q17378 | train | function () {
if (!oldNodeMap[newChild.tagID]) {
newEdit = {
type: "elementInsert",
tag: newChild.tag,
tagID: newChild.tagID,
parentID: newChild.parent.tagID,
attributes: newChild.attributes
... | javascript | {
"resource": ""
} | |
q17379 | train | 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 | {
"resource": ""
} | |
q17380 | train | 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 | {
"resource": ""
} | |
q17381 | train | function () {
var prev = prevNode();
if (prev && !prev.children) {
newEdit = {
type: "textReplace",
content: prev.content
};
} else {
newEdit = {
type: "textDelete"
... | javascript | {
"resource": ""
} | |
q17382 | train | function () {
// This check looks a little strange, but it suits what we're trying
// to do: as we're walking through the children, a child node that has moved
// from one parent to another will be found but would look like some kind
// of insert. The check that we're do... | javascript | {
"resource": ""
} | |
q17383 | train | function (oldChild) {
var oldChildInNewTree = newNodeMap[oldChild.tagID];
return oldChild.children && oldChildInNewTree && getParentID(oldChild) !== getParentID(oldChildInNewTree);
} | javascript | {
"resource": ""
} | |
q17384 | train | function (delta) {
edits.push.apply(edits, delta.edits);
moves.push.apply(moves, delta.moves);
queue.push.apply(queue, delta.newElements);
} | javascript | {
"resource": ""
} | |
q17385 | _handleFileSystemChange | train | function _handleFileSystemChange(event, entry, added, removed) {
// this may have been called because files were added
// or removed to the file system. We don't care about those
if (!entry || entry.isDirectory) {
return;
}
// Look for a viewer for the changed file... | javascript | {
"resource": ""
} |
q17386 | setFontSize | train | function setFontSize(fontSize) {
if (currFontSize === fontSize) {
return;
}
_removeDynamicFontSize();
if (fontSize) {
_addDynamicFontSize(fontSize);
}
// Update scroll metrics in viewed editors
_.forEach(MainViewManager.getPaneIdList(), f... | javascript | {
"resource": ""
} |
q17387 | setFontFamily | train | function setFontFamily(fontFamily) {
var editor = EditorManager.getCurrentFullEditor();
if (currFontFamily === fontFamily) {
return;
}
_removeDynamicFontFamily();
if (fontFamily) {
_addDynamicFontFamily(fontFamily);
}
exports.trigger("fo... | javascript | {
"resource": ""
} |
q17388 | init | train | function init() {
currFontFamily = prefs.get("fontFamily");
_addDynamicFontFamily(currFontFamily);
currFontSize = prefs.get("fontSize");
_addDynamicFontSize(currFontSize);
_updateUI();
} | javascript | {
"resource": ""
} |
q17389 | restoreFontSize | train | function restoreFontSize() {
var fsStyle = prefs.get("fontSize"),
fsAdjustment = PreferencesManager.getViewState("fontSizeAdjustment");
if (fsAdjustment) {
// Always remove the old view state even if we also have the new view state.
PreferencesManager.setViewSta... | javascript | {
"resource": ""
} |
q17390 | CubicBezier | train | function CubicBezier(coordinates) {
if (typeof coordinates === "string") {
this.coordinates = coordinates.split(",");
} else {
this.coordinates = coordinates;
}
if (!this.coordinates) {
throw "No offsets were defined";
}
this.coordina... | javascript | {
"resource": ""
} |
q17391 | BezierCanvas | train | function BezierCanvas(canvas, bezier, padding) {
this.canvas = canvas;
this.bezier = bezier;
this.padding = this.getPadding(padding);
// Convert to a cartesian coordinate system with axes from 0 to 1
var ctx = this.canvas.getContext("2d"),
p = this.padding;
... | javascript | {
"resource": ""
} |
q17392 | train | function (element) {
var p = this.padding,
w = this.canvas.width,
h = this.canvas.height * 0.5;
// Convert padding percentage to actual padding
p = p.map(function (a, i) {
return a * ((i % 2) ? w : h);
});
retu... | javascript | {
"resource": ""
} | |
q17393 | train | function (padding) {
var p = (typeof padding === "number") ? [padding] : padding;
if (p.length === 1) {
p[1] = p[0];
}
if (p.length === 2) {
p[2] = p[0];
}
if (p.length === 3) {
p[3] = p[1];
... | javascript | {
"resource": ""
} | |
q17394 | handlePointMove | train | function handlePointMove(e, x, y) {
var self = e.target,
bezierEditor = self.bezierEditor;
// Helper function to redraw curve
function mouseMoveRedraw() {
if (!bezierEditor.dragElement) {
animationRequest = null;
return;
}
... | javascript | {
"resource": ""
} |
q17395 | mouseMoveRedraw | train | function mouseMoveRedraw() {
if (!bezierEditor.dragElement) {
animationRequest = null;
return;
}
// Update code
bezierEditor._commitTimingFunction();
bezierEditor._updateCanvas();
animationRequest = window.requestA... | javascript | {
"resource": ""
} |
q17396 | BezierCurveEditor | train | function BezierCurveEditor($parent, bezierCurve, callback) {
// Create the DOM structure, filling in localized strings via Mustache
this.$element = $(Mustache.render(BezierCurveEditorTemplate, Strings));
$parent.append(this.$element);
this._callback = callback;
this.dragElement ... | javascript | {
"resource": ""
} |
q17397 | StepCanvas | train | function StepCanvas(canvas, stepParams, padding) {
this.canvas = canvas;
this.stepParams = stepParams;
this.padding = this.getPadding(padding);
// Convert to a cartesian coordinate system with axes from 0 to 1
var ctx = this.canvas.getContext("2d"),
p = this.p... | javascript | {
"resource": ""
} |
q17398 | StepEditor | train | function StepEditor($parent, stepMatch, callback) {
// Create the DOM structure, filling in localized strings via Mustache
this.$element = $(Mustache.render(StepEditorTemplate, Strings));
$parent.append(this.$element);
this._callback = callback;
// current step function params
... | javascript | {
"resource": ""
} |
q17399 | CodeHintList | train | function CodeHintList(editor, insertHintOnTab, maxResults) {
/**
* The list of hints to display
*
* @type {Array.<string|jQueryObject>}
*/
this.hints = [];
/**
* The selected position in the list; otherwise -1.
*
* @type {number}
... | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.