Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .brackets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"jslint.options": {
"vars": true,
"plusplus": true,
"browser": false,
"devel": true,
"nomen": true,
"maxerr": 50
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ define(function (require, exports, module) {
if (match && _validateCubicBezierParams(match)) {
return _tagMatch(match, BEZIER);
} else { // this should not happen!
window.console.log("brackets-cubic-bezier: TimingFunctionUtils._getValidBezierParams created invalid code");
console.log("brackets-cubic-bezier: TimingFunctionUtils._getValidBezierParams created invalid code");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we removing window from this one?

}
}

Expand Down Expand Up @@ -398,7 +398,7 @@ define(function (require, exports, module) {
if (match && _validateStepsParams(match)) {
return _tagMatch(match, STEP);
} else { // this should not happen!
window.console.log("brackets-steps: TimingFunctionUtils._getValidStepsParams created invalid code");
console.log("brackets-steps: TimingFunctionUtils._getValidStepsParams created invalid code");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And... Why are we removing window from this one?

}
}

Expand Down
2 changes: 1 addition & 1 deletion src/filesystem/impls/appshell/AppshellFileSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ define(function (require, exports, module) {
_domainPath = [_bracketsPath, _modulePath, _nodePath].join("/"),
_nodeDomain = new NodeDomain("fileWatcher", _domainPath);

var _isRunningOnWindowsXP = navigator.userAgent.indexOf("Windows NT 5.") >= 0;
var _isRunningOnWindowsXP = window.navigator.userAgent.indexOf("Windows NT 5.") >= 0;


// If the connection closes, notify the FileSystem that watchers have gone offline.
Expand Down
2 changes: 1 addition & 1 deletion src/language/CodeInspection.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@


/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4 */
/*global define, $, Mustache, brackets */
/*global define, $, Mustache, brackets, window */

/**
* Manages linters and other code inspections on a per-language basis. Provides a UI and status indicator for
Expand Down
64 changes: 32 additions & 32 deletions src/utils/ExtensionLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,38 +146,6 @@ define(function (require, exports, module) {
return deferred.promise();
}

/**
* Loads the extension that lives at baseUrl into its own Require.js context
*
* @param {!string} name, used to identify the extension
* @param {!{baseUrl: string}} config object with baseUrl property containing absolute path of extension
* @param {!string} entryPoint, name of the main js file to load
* @return {!$.Promise} A promise object that is resolved when the extension is loaded, or rejected
* if the extension fails to load or throws an exception immediately when loaded.
* (Note: if extension contains a JS syntax error, promise is resolved not rejected).
*/
function loadExtension(name, config, entryPoint) {
var promise = new $.Deferred();

// Try to load the package.json to figure out if we are loading a theme.
ExtensionUtils.loadPackageJson(config.baseUrl).always(promise.resolve);

return promise
.then(function(metadata) {
// No special handling for themes... Let the promise propagate into the ExtensionManager
if (metadata && "theme" in metadata) {
return;
}

return loadExtensionModule(name, config, entryPoint);
})
.then(function () {
$(exports).triggerHandler("load", config.baseUrl);
}, function (err) {
$(exports).triggerHandler("loadFailed", config.baseUrl);
});
}

/**
* Loads the extension module that lives at baseUrl into its own Require.js context
*
Expand Down Expand Up @@ -253,6 +221,38 @@ define(function (require, exports, module) {
return promise;
}

/**
* Loads the extension that lives at baseUrl into its own Require.js context
*
* @param {!string} name, used to identify the extension
* @param {!{baseUrl: string}} config object with baseUrl property containing absolute path of extension
* @param {!string} entryPoint, name of the main js file to load
* @return {!$.Promise} A promise object that is resolved when the extension is loaded, or rejected
* if the extension fails to load or throws an exception immediately when loaded.
* (Note: if extension contains a JS syntax error, promise is resolved not rejected).
*/
function loadExtension(name, config, entryPoint) {
var promise = new $.Deferred();

// Try to load the package.json to figure out if we are loading a theme.
ExtensionUtils.loadPackageJson(config.baseUrl).always(promise.resolve);

return promise
.then(function (metadata) {
// No special handling for themes... Let the promise propagate into the ExtensionManager
if (metadata && metadata.theme) {
return;
}

return loadExtensionModule(name, config, entryPoint);
})
.then(function () {
$(exports).triggerHandler("load", config.baseUrl);
}, function (err) {
$(exports).triggerHandler("loadFailed", config.baseUrl);
});
}

/**
* Runs unit tests for the extension that lives at baseUrl into its own Require.js context
*
Expand Down
4 changes: 2 additions & 2 deletions src/utils/UpdateNotification.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,11 @@ define(function (require, exports, module) {
// downloadRegistry, will be resolved in _onRegistryDownloaded
ExtensionManager.downloadRegistry().done(function () {
// schedule another check in 24 hours + 2 minutes
setTimeout(checkForExtensionsUpdate, ONE_DAY + TWO_MINUTES);
window.setTimeout(checkForExtensionsUpdate, ONE_DAY + TWO_MINUTES);
});
} else {
// schedule the download of the registry in appropriate time
setTimeout(checkForExtensionsUpdate, (timeOfNextCheck - currentTime) + TWO_MINUTES);
window.setTimeout(checkForExtensionsUpdate, (timeOfNextCheck - currentTime) + TWO_MINUTES);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/Dialogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ define(function (require, exports, module) {
} else if ($otherBtn.length) {
$otherBtn.focus();
} else {
document.activeElement.blur();
window.document.activeElement.blur();
}

// Push our global keydown handler onto the global stack of handlers.
Expand Down
2 changes: 1 addition & 1 deletion test/spec/LanguageManager-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ define(function (require, exports, module) {

var renameDeferred = $.Deferred();
runs(function () {
DocumentManager.setCurrentDocument(doc);
DocumentManager.setCurrentDocument(doc);
javascript = LanguageManager.getLanguage("javascript");

// sanity check language
Expand Down