Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Merge pull request #6411 from lkcampbell/6334-update
Browse files Browse the repository at this point in the history
Reload Without Extensions update
  • Loading branch information
redmunds committed Jan 11, 2014
2 parents 897338b + c985ce1 commit cc4da7c
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 22 deletions.
9 changes: 9 additions & 0 deletions src/extensions/default/DebugCommands/keyboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,14 @@
"key": "Cmd-R",
"platform": "mac"
}
],
"reloadWithoutUserExts": [
{
"key": "Shift-F5"
},
{
"key": "Cmd-Shift-R",
"platform": "mac"
}
]
}
42 changes: 23 additions & 19 deletions src/extensions/default/DebugCommands/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,23 +181,27 @@ define(function (require, exports, module) {
var href = window.location.href,
params = new UrlParams();

// Remove all menus to assure extension menus and menu items are removed
_.forEach(Menus.getAllMenus(), function (value, key) {
Menus.removeMenu(key);
});

params.parse();

if (!params.get("reloadWithoutUserExts")) {
params.put("reloadWithoutUserExts", true);
}

if (href.indexOf("?") !== -1) {
href = href.substring(0, href.indexOf("?"));
}

href += "?" + params.toString();
browserReload(href);
// Give Mac native menus extra time to update shortcut highlighting prior
// to removing menus, or else the highlights get messed up after the reload.
window.setTimeout(function () {
// Remove all menus to assure extension menus and menu items are removed
_.forEach(Menus.getAllMenus(), function (value, key) {
Menus.removeMenu(key);
});

params.parse();

if (!params.get("reloadWithoutUserExts")) {
params.put("reloadWithoutUserExts", true);
}

if (href.indexOf("?") !== -1) {
href = href.substring(0, href.indexOf("?"));
}

href += "?" + params.toString();
browserReload(href);
}, 100);
}

function handleNewBracketsWindow() {
Expand Down Expand Up @@ -364,7 +368,7 @@ define(function (require, exports, module) {
var menu = Menus.addMenu(Strings.DEBUG_MENU, DEBUG_MENU, Menus.BEFORE, Menus.AppMenuBar.HELP_MENU);
menu.addMenuItem(DEBUG_SHOW_DEVELOPER_TOOLS, KeyboardPrefs.showDeveloperTools);
menu.addMenuItem(DEBUG_REFRESH_WINDOW, KeyboardPrefs.refreshWindow);
menu.addMenuItem(DEBUG_RELOAD_WITHOUT_USER_EXTS);
menu.addMenuItem(DEBUG_RELOAD_WITHOUT_USER_EXTS, KeyboardPrefs.reloadWithoutUserExts);
menu.addMenuItem(DEBUG_NEW_BRACKETS_WINDOW);
menu.addMenuDivider();
menu.addMenuItem(DEBUG_SWITCH_LANGUAGE);
Expand Down Expand Up @@ -394,7 +398,7 @@ define(function (require, exports, module) {
CommandManager.get(Commands.FILE_EXTENSION_MANAGER).setEnabled(false);
$icon.css({display: "none"});
StatusBar.addIndicator(USER_EXT_STATUS_ID, $indicator, true);
console.log("Brackets reloaded with user extensions disabled");
console.log("Brackets reloaded with extensions disabled");
} else {
CommandManager.get(Commands.FILE_EXTENSION_MANAGER).setEnabled(true);
// Toolbar and status bar reload back to default states, no need to set
Expand Down
6 changes: 3 additions & 3 deletions src/nls/root/strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ define({
"STATUSBAR_TAB_SIZE" : "Tab Size:",
"STATUSBAR_LINE_COUNT_SINGULAR" : "\u2014 {0} Line",
"STATUSBAR_LINE_COUNT_PLURAL" : "\u2014 {0} Lines",
"STATUSBAR_USER_EXTENSIONS_DISABLED" : "User Extensions Disabled",
"STATUSBAR_USER_EXTENSIONS_DISABLED" : "Extensions Disabled",

// CodeInspection: errors/warnings
"ERRORS_PANEL_TITLE_MULTIPLE" : "{0} Problems",
Expand Down Expand Up @@ -440,8 +440,8 @@ define({
// extensions/default/DebugCommands
"DEBUG_MENU" : "Debug",
"CMD_SHOW_DEV_TOOLS" : "Show Developer Tools",
"CMD_REFRESH_WINDOW" : "Reload {APP_NAME}",
"CMD_RELOAD_WITHOUT_USER_EXTS" : "Reload Without User Extensions",
"CMD_REFRESH_WINDOW" : "Reload With Extensions",
"CMD_RELOAD_WITHOUT_USER_EXTS" : "Reload Without Extensions",
"CMD_NEW_BRACKETS_WINDOW" : "New {APP_NAME} Window",
"CMD_SWITCH_LANGUAGE" : "Switch Language",
"CMD_RUN_UNIT_TESTS" : "Run Tests",
Expand Down

0 comments on commit cc4da7c

Please sign in to comment.