Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
Merged
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
18 changes: 0 additions & 18 deletions src/base-config/keyboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -221,24 +221,6 @@
"displayKey": "Alt-↓"
}
],
"debug.showDeveloperTools": [
{
"key": "F12"
},
{
"key": "Cmd-Opt-I",
"platform": "mac"
}
],
"debug.refreshWindow": [
{
"key": "F5"
},
{
"key": "Cmd-R",
"platform": "mac"
}
],
"file.rename": [
"F2"
]
Expand Down
1 change: 0 additions & 1 deletion src/brackets.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"app_title" : "Brackets",
"app_name_about" : "Brackets",
"about_icon" : "styles/images/brackets_icon.svg",
"show_debug_menu" : true,
"enable_jslint" : true,
"update_info_url" : "http://dev.brackets.io/updates/stable/",
"how_to_use_url" : "https://github.com/adobe/brackets/wiki/How-to-Use-Brackets",
Expand Down
1 change: 0 additions & 1 deletion src/brackets.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ define(function (require, exports, module) {
require("document/ChangedDocumentTracker");
require("editor/EditorCommandHandlers");
require("view/ViewCommandHandlers");
require("debug/DebugCommandHandlers");
require("help/HelpCommandHandlers");
require("search/FindInFiles");
require("search/FindReplace");
Expand Down
11 changes: 0 additions & 11 deletions src/command/Commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,6 @@ define(function (require, exports, module) {
exports.QUICK_EDIT_NEXT_MATCH = "navigate.nextMatch";
exports.QUICK_EDIT_PREV_MATCH = "navigate.previousMatch";

// Debug
exports.DEBUG_REFRESH_WINDOW = "debug.refreshWindow"; // string must MATCH string in native code (brackets_extensions)
exports.DEBUG_SHOW_DEVELOPER_TOOLS = "debug.showDeveloperTools";
exports.DEBUG_RUN_UNIT_TESTS = "debug.runUnitTests";
exports.DEBUG_SHOW_PERF_DATA = "debug.showPerfData";
exports.DEBUG_NEW_BRACKETS_WINDOW = "debug.newBracketsWindow";
exports.DEBUG_SWITCH_LANGUAGE = "debug.switchLanguage";
exports.DEBUG_ENABLE_NODE_DEBUGGER = "debug.enableNodeDebugger";
exports.DEBUG_LOG_NODE_STATE = "debug.logNodeState";
exports.DEBUG_RESTART_NODE = "debug.restartNode";

// Help
exports.HELP_CHECK_FOR_UPDATE = "help.checkForUpdate";
exports.HELP_HOW_TO_USE_BRACKETS = "help.howToUseBrackets";
Expand Down
20 changes: 0 additions & 20 deletions src/command/Menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ define(function (require, exports, module) {
EDIT_MENU : "edit-menu",
VIEW_MENU : "view-menu",
NAVIGATE_MENU : "navigate-menu",
DEBUG_MENU : "debug-menu", // Note: not present in some configurations of Brackets (getMenu() will return null)
HELP_MENU : "help-menu"
};

Expand Down Expand Up @@ -1074,25 +1073,6 @@ define(function (require, exports, module) {
menu.addMenuItem(Commands.QUICK_EDIT_PREV_MATCH);
menu.addMenuItem(Commands.QUICK_EDIT_NEXT_MATCH);

/*
* Debug menu
*/
if (brackets.config.show_debug_menu) {
menu = addMenu(Strings.DEBUG_MENU, AppMenuBar.DEBUG_MENU);
menu.addMenuItem(Commands.DEBUG_SHOW_DEVELOPER_TOOLS);
menu.addMenuItem(Commands.DEBUG_REFRESH_WINDOW);
menu.addMenuItem(Commands.DEBUG_NEW_BRACKETS_WINDOW);
menu.addMenuDivider();
menu.addMenuItem(Commands.DEBUG_SWITCH_LANGUAGE);
menu.addMenuDivider();
menu.addMenuItem(Commands.DEBUG_RUN_UNIT_TESTS);
menu.addMenuItem(Commands.DEBUG_SHOW_PERF_DATA);
menu.addMenuDivider();
menu.addMenuItem(Commands.DEBUG_ENABLE_NODE_DEBUGGER);
menu.addMenuItem(Commands.DEBUG_LOG_NODE_STATE);
menu.addMenuItem(Commands.DEBUG_RESTART_NODE);
}

/*
* Help menu
*/
Expand Down
1 change: 0 additions & 1 deletion src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"app_title": "Brackets",
"app_name_about": "Brackets",
"about_icon": "styles/images/brackets_icon.svg",
"show_debug_menu": true,
"enable_jslint": true,
"update_info_url": "http://dev.brackets.io/updates/stable/",
"how_to_use_url": "https://github.com/adobe/brackets/wiki/How-to-Use-Brackets",
Expand Down
71 changes: 11 additions & 60 deletions src/document/DocumentCommandHandlers.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, maxerr: 50 */
/*global define, $, brackets, PathUtils, WebSocket, window */
/*global define, $, brackets, PathUtils, window */

define(function (require, exports, module) {
"use strict";
Expand Down Expand Up @@ -508,43 +508,6 @@ define(function (require, exports, module) {
return result.promise();
}


/**
* Disables Brackets' cache via the remote debugging protocol.
* @return {$.Promise} A jQuery promise that will be resolved when the cache is disabled and be rejected in any other case
*/
function _disableCache() {
var result = new $.Deferred();

if (brackets.inBrowser) {
result.resolve();
} else {
var Inspector = require("LiveDevelopment/Inspector/Inspector");
Inspector.getAvailableSockets("127.0.0.1", "9234")
.fail(result.reject)
.done(function (response) {
var page = response[0];
if (!page || !page.webSocketDebuggerUrl) {
result.reject();
return;
}
var _socket = new WebSocket(page.webSocketDebuggerUrl);
// Disable the cache
_socket.onopen = function _onConnect() {
_socket.send(JSON.stringify({ id: 1, method: "Network.setCacheDisabled", params: { "cacheDisabled": true } }));
};
// The first message will be the confirmation => disconnected to allow remote debugging of Brackets
_socket.onmessage = function _onMessage(e) {
_socket.close();
result.resolve();
};
// In case of an error
_socket.onerror = result.reject;
});
}

return result.promise();
}

/**
* Closes the specified file: removes it from the working set, and closes the main editor if one
Expand Down Expand Up @@ -721,14 +684,14 @@ define(function (require, exports, module) {
}

/**
* @private - tracks our closing state if we get called again
*/
* @private - tracks our closing state if we get called again
*/
var _windowGoingAway = false;

/**
* @private
* Common implementation for close/quit/reload which all mostly
* the same except for the final step
* @private
* Common implementation for close/quit/reload which all mostly
* the same except for the final step
*/
function _handleWindowGoingAway(commandData, postCloseHandler, failHandler) {
if (_windowGoingAway) {
Expand Down Expand Up @@ -759,11 +722,11 @@ define(function (require, exports, module) {
}
});
}

/**
* @private
* Implementation for abortQuit callback to reset quit sequence settings
*/
* @private
* Implementation for abortQuit callback to reset quit sequence settings
*/
function _handleAbortQuit() {
_windowGoingAway = false;
}
Expand Down Expand Up @@ -813,16 +776,6 @@ define(function (require, exports, module) {
);
}

/** Does a full reload of the browser window */
function handleFileReload(commandData) {
return _handleWindowGoingAway(commandData, function () {
// Disable the cache to make reloads work
_disableCache().always(function () {
window.location.reload(true);
});
});
}


/** Are we already listening for a keyup to call detectDocumentNavEnd()? */
var _addedNavKeyHandler = false;
Expand Down Expand Up @@ -900,8 +853,6 @@ define(function (require, exports, module) {
CommandManager.register(Strings.CMD_QUIT, Commands.FILE_QUIT, handleFileQuit);
}

CommandManager.register(Strings.CMD_REFRESH_WINDOW, Commands.DEBUG_REFRESH_WINDOW, handleFileReload)
.setEnabled(brackets.config.show_debug_menu);
CommandManager.register(Strings.CMD_ABORT_QUIT, Commands.APP_ABORT_QUIT, _handleAbortQuit);

CommandManager.register(Strings.CMD_NEXT_DOC, Commands.NAVIGATE_NEXT_DOC, handleGoNextDoc);
Expand All @@ -911,5 +862,5 @@ define(function (require, exports, module) {
// Listen for changes that require updating the editor titlebar
$(DocumentManager).on("dirtyFlagChange", handleDirtyChange);
$(DocumentManager).on("currentDocumentChange fileNameChange", updateDocumentTitle);
});

});
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
define(function (require, exports, module) {
"use strict";

var NodeConnection = require("utils/NodeConnection");
var NodeConnection = brackets.getModule("utils/NodeConnection");

/**
* @private
Expand Down
20 changes: 20 additions & 0 deletions src/extensions/default/DebugCommands/keyboard.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"showDeveloperTools": [
{
"key": "F12"
},
{
"key": "Cmd-Opt-I",
"platform": "mac"
}
],
"refreshWindow": [
{
"key": "F5"
},
{
"key": "Cmd-R",
"platform": "mac"
}
]
}
Loading