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

Commit bfb113d

Browse files
author
Ian Wehrman
committed
Merge branch 'brackets' into glenn/file-system
Conflicts: src/document/DocumentManager.js src/language/JSUtils.js src/project/ProjectManager.js src/search/FindInFiles.js
2 parents 00b315a + f0983c4 commit bfb113d

File tree

163 files changed

+4516
-3845
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+4516
-3845
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ test/results
2828

2929
# PhpStorm
3030
.idea
31+
32+
# Files that can be automatically downloaded that we don't want to ship with our builds
33+
src/extensibility/node/node_modules/request/tests/

Gruntfile.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,8 @@ module.exports = function (grunt) {
120120
}
121121
}
122122
},
123-
'jasmine-node': {
124-
run: {
125-
spec: 'src/extensibility/node/spec/'
126-
}
123+
'jasmine_node': {
124+
projectRoot: 'src/extensibility/node/spec/'
127125
},
128126
jshint: {
129127
all: [
@@ -152,14 +150,14 @@ module.exports = function (grunt) {
152150
grunt.loadNpmTasks('grunt-contrib-jasmine');
153151
grunt.loadNpmTasks('grunt-contrib-jshint');
154152
grunt.loadNpmTasks('grunt-contrib-watch');
155-
grunt.loadNpmTasks('grunt-contrib-jasmine-node');
153+
grunt.loadNpmTasks('grunt-jasmine-node');
156154

157155
// task: install
158156
grunt.registerTask('install', ['write-config']);
159157

160158
// task: test
161159
// grunt.registerTask('test', ['jshint:all', 'jasmine']);
162-
grunt.registerTask('test', ['jshint:all', 'jasmine', 'jasmine-node']);
160+
grunt.registerTask('test', ['jshint:all', 'jasmine', 'jasmine_node']);
163161

164162
// task: set-sprint
165163
// Update sprint number in package.json and rewrite src/config.json

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "Brackets",
3-
"version": "0.32.0-0",
4-
"apiVersion": "0.32.0",
3+
"version": "0.33.0-0",
4+
"apiVersion": "0.33.0",
55
"homepage": "http://brackets.io",
66
"issues": {
77
"url": "http://github.com/adobe/brackets/issues"
@@ -14,9 +14,9 @@
1414
},
1515
"devDependencies": {
1616
"grunt": "0.4.1",
17-
"jasmine-node": "1.9.1",
18-
"grunt-contrib-jasmine-node": "0.1.0",
19-
"grunt-cli": "0.1.6",
17+
"jasmine-node": "1.11.0",
18+
"grunt-jasmine-node": "0.1.0",
19+
"grunt-cli": "0.1.9",
2020
"phantomjs": "1.9.0-1",
2121
"grunt-lib-phantomjs": "0.3.0",
2222
"grunt-contrib-jshint": "0.6.0",

samples/root/Getting Started/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ h1, h2, h3, h4, h5, h6 {
2727

2828
samp
2929
{
30-
/* hide <samp> from the browser so we can show cool features in Edge Code */
30+
/* hide tutorial instructions so they don't show in the browser */
3131
display: none;
3232
}
3333

src/LiveDevelopment/main.js

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
/*
22
* Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved.
3-
*
3+
*
44
* Permission is hereby granted, free of charge, to any person obtaining a
5-
* copy of this software and associated documentation files (the "Software"),
6-
* to deal in the Software without restriction, including without limitation
7-
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
8-
* and/or sell copies of the Software, and to permit persons to whom the
5+
* copy of this software and associated documentation files (the "Software"),
6+
* to deal in the Software without restriction, including without limitation
7+
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+
* and/or sell copies of the Software, and to permit persons to whom the
99
* Software is furnished to do so, subject to the following conditions:
10-
*
10+
*
1111
* The above copyright notice and this permission notice shall be included in
1212
* all copies or substantial portions of the Software.
13-
*
13+
*
1414
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1616
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2020
* DEALINGS IN THE SOFTWARE.
21-
*
21+
*
2222
*/
2323

2424

@@ -142,7 +142,7 @@ define(function main(require, exports, module) {
142142

143143
/** Called on status change */
144144
function _showStatusChangeReason(reason) {
145-
// Destroy the previous twipsy (options are not updated otherwise)
145+
// Destroy the previous twipsy (options are not updated otherwise)
146146
_$btnGoLive.twipsy("hide").removeData("twipsy");
147147

148148
// If there was no reason or the action was an explicit request by the user, don't show a twipsy
@@ -178,7 +178,7 @@ define(function main(require, exports, module) {
178178
});
179179
$(LiveDevelopment).on("statusChange", function statusChange(event, status, reason) {
180180
// status starts at -1 (error), so add one when looking up name and style
181-
// See the comments at the top of LiveDevelopment.js for details on the
181+
// See the comments at the top of LiveDevelopment.js for details on the
182182
// various status codes.
183183
_setLabel(_$btnGoLive, null, _statusStyle[status + 1], _statusTooltip[status + 1]);
184184
_showStatusChangeReason(reason);
@@ -195,7 +195,7 @@ define(function main(require, exports, module) {
195195
function _setupGoLiveMenu() {
196196
$(LiveDevelopment).on("statusChange", function statusChange(event, status) {
197197
// Update the checkmark next to 'Live Preview' menu item
198-
// Add checkmark when status is STATUS_ACTIVE; otherwise remove it
198+
// Add checkmark when status is STATUS_ACTIVE; otherwise remove it
199199
CommandManager.get(Commands.FILE_LIVE_FILE_PREVIEW).setChecked(status === LiveDevelopment.STATUS_ACTIVE);
200200
CommandManager.get(Commands.FILE_LIVE_HIGHLIGHT).setEnabled(status === LiveDevelopment.STATUS_ACTIVE);
201201
});
@@ -257,8 +257,6 @@ define(function main(require, exports, module) {
257257

258258
// init prefs
259259
prefs = PreferencesManager.getPreferenceStorage(module, {highlight: true});
260-
//TODO: Remove preferences migration code
261-
PreferencesManager.handleClientIdChange(prefs, "com.adobe.brackets.live-development");
262260

263261
config.highlight = prefs.getValue("highlight");
264262

src/base-config/keyboard.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,9 @@
270270
"displayKey": "Alt-↓"
271271
}
272272
],
273+
"navigate.newRule": [
274+
"Cmd-Alt-N"
275+
],
273276
"file.rename": [
274277
"F2"
275278
]

src/brackets.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
require.config({
2929
paths: {
3030
"text" : "thirdparty/text/text",
31-
"i18n" : "thirdparty/i18n/i18n"
31+
"i18n" : "thirdparty/i18n/i18n",
32+
"lodash" : "thirdparty/lodash.custom.min"
3233
},
3334
// Use custom brackets property until CEF sets the correct navigator.language
3435
// NOTE: When we change to navigator.language here, we also should change to
@@ -97,7 +98,8 @@ define(function (require, exports, module) {
9798
DragAndDrop = require("utils/DragAndDrop"),
9899
ColorUtils = require("utils/ColorUtils"),
99100
CodeInspection = require("language/CodeInspection"),
100-
NativeApp = require("utils/NativeApp");
101+
NativeApp = require("utils/NativeApp"),
102+
_ = require("lodash");
101103

102104
// Load modules that self-register and just need to get included in the main project
103105
require("command/DefaultMenus");
@@ -203,7 +205,8 @@ define(function (require, exports, module) {
203205
LanguageManager.ready.always(function () {
204206
// Load all extensions. This promise will complete even if one or more
205207
// extensions fail to load.
206-
var extensionLoaderPromise = ExtensionLoader.init(params.get("extensions"));
208+
var extensionPathOverride = params.get("extensions"); // used by unit tests
209+
var extensionLoaderPromise = ExtensionLoader.init(extensionPathOverride ? extensionPathOverride.split(",") : null);
207210

208211
// Load the initial project after extensions have loaded
209212
extensionLoaderPromise.always(function () {
@@ -218,8 +221,6 @@ define(function (require, exports, module) {
218221
// an old version that might not have set the "afterFirstLaunch" pref.)
219222
var prefs = PreferencesManager.getPreferenceStorage(module),
220223
deferred = new $.Deferred();
221-
//TODO: Remove preferences migration code
222-
PreferencesManager.handleClientIdChange(prefs, "com.adobe.brackets.startup");
223224

224225
if (!params.get("skipSampleProjectLoad") && !prefs.getValue("afterFirstLaunch")) {
225226
prefs.setValue("afterFirstLaunch", "true");

src/command/Commands.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ define(function (require, exports, module) {
4343
exports.FILE_SAVE_AS = "file.saveAs"; // DocumentCommandHandlers.js handleFileSaveAs()
4444
exports.FILE_CLOSE = "file.close"; // DocumentCommandHandlers.js handleFileClose()
4545
exports.FILE_CLOSE_ALL = "file.close_all"; // DocumentCommandHandlers.js handleFileCloseAll()
46+
exports.FILE_CLOSE_LIST = "file.close_list"; // DocumentCommandHandlers.js handleFileCloseList()
4647
exports.FILE_ADD_TO_WORKING_SET = "file.addToWorkingSet"; // DocumentCommandHandlers.js handleFileAddToWorkingSet()
4748
exports.FILE_LIVE_FILE_PREVIEW = "file.liveFilePreview"; // LiveDevelopment/main.js _handleGoLiveCommand()
4849
exports.FILE_LIVE_HIGHLIGHT = "file.previewHighlight"; // LiveDevelopment/main.js _handlePreviewHighlightCommand()
@@ -115,6 +116,7 @@ define(function (require, exports, module) {
115116
exports.TOGGLE_QUICK_DOCS = "navigate.toggleQuickDocs"; // EditorManager.js _toggleInlineWidget()
116117
exports.QUICK_EDIT_NEXT_MATCH = "navigate.nextMatch"; // MultiRangeInlineEditor.js _nextRange()
117118
exports.QUICK_EDIT_PREV_MATCH = "navigate.previousMatch"; // MultiRangeInlineEditor.js _previousRange()
119+
exports.CSS_QUICK_EDIT_NEW_RULE = "navigate.newRule"; // CSSInlineEditor.js _handleNewRule()
118120

119121
// HELP
120122
exports.HELP_CHECK_FOR_UPDATE = "help.checkForUpdate"; // HelpCommandHandlers.js _handleCheckForUpdates()

src/command/DefaultMenus.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ define(function (require, exports, module) {
137137
menu.addMenuItem(Commands.TOGGLE_QUICK_EDIT);
138138
menu.addMenuItem(Commands.QUICK_EDIT_PREV_MATCH);
139139
menu.addMenuItem(Commands.QUICK_EDIT_NEXT_MATCH);
140+
menu.addMenuItem(Commands.CSS_QUICK_EDIT_NEW_RULE);
140141
menu.addMenuDivider();
141142
menu.addMenuItem(Commands.TOGGLE_QUICK_DOCS);
142143

src/command/Menus.js

Lines changed: 74 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,17 @@
2828
define(function (require, exports, module) {
2929
"use strict";
3030

31+
var _ = require("lodash");
32+
3133
// Load dependent modules
3234
var Global = require("utils/Global"),
3335
Commands = require("command/Commands"),
3436
KeyBindingManager = require("command/KeyBindingManager"),
3537
StringUtils = require("utils/StringUtils"),
3638
CommandManager = require("command/CommandManager"),
3739
PopUpManager = require("widgets/PopUpManager"),
38-
ViewUtils = require("utils/ViewUtils");
40+
ViewUtils = require("utils/ViewUtils"),
41+
CollectionUtils = require("utils/CollectionUtils");
3942

4043
/**
4144
* Brackets Application Menu Constants
@@ -458,6 +461,57 @@ define(function (require, exports, module) {
458461
delete menuItemMap[menuItemID];
459462
};
460463

464+
/**
465+
* Removes the specified menu divider from this Menu.
466+
*
467+
* @param {!string} menuItemID - the menu item id of the divider to remove.
468+
*/
469+
Menu.prototype.removeMenuDivider = function (menuItemID) {
470+
var menuItem,
471+
$HTMLMenuItem;
472+
473+
if (!menuItemID) {
474+
console.error("removeMenuDivider(): missing required parameters: menuItemID");
475+
return;
476+
}
477+
478+
menuItem = getMenuItem(menuItemID);
479+
480+
if (!menuItem) {
481+
console.error("removeMenuDivider(): parameter menuItemID: %s is not a valid menu item id", menuItemID);
482+
return;
483+
}
484+
485+
if (!menuItem.isDivider) {
486+
console.error("removeMenuDivider(): parameter menuItemID: %s is not a menu divider", menuItemID);
487+
return;
488+
}
489+
490+
if (_isHTMLMenu(this.id)) {
491+
// Targeting parent to get the menu divider <hr> and the <li> that contains it
492+
$HTMLMenuItem = $(_getHTMLMenuItem(menuItemID)).parent();
493+
if ($HTMLMenuItem) {
494+
$HTMLMenuItem.remove();
495+
} else {
496+
console.error("removeMenuDivider(): HTML menu divider not found: %s", menuItemID);
497+
return;
498+
}
499+
} else {
500+
brackets.app.removeMenuItem(menuItemID, function (err) {
501+
if (err) {
502+
console.error("removeMenuDivider() -- divider not found: %s (error: %s)", menuItemID, err);
503+
}
504+
});
505+
}
506+
507+
if (!menuItemMap[menuItemID]) {
508+
console.error("removeMenuDivider(): menu divider not found in menuItemMap: %s", menuItemID);
509+
return;
510+
}
511+
512+
delete menuItemMap[menuItemID];
513+
};
514+
461515
/**
462516
* Adds a new menu item with the specified id and display text. The insertion position is
463517
* specified via the relativeID and position arguments which describe a position
@@ -532,7 +586,7 @@ define(function (require, exports, module) {
532586
// create MenuItem DOM
533587
if (_isHTMLMenu(this.id)) {
534588
if (name === DIVIDER) {
535-
$menuItem = $("<li><hr class='divider' /></li>");
589+
$menuItem = $("<li><hr class='divider' id='" + id + "' /></li>");
536590
} else {
537591
// Create the HTML Menu
538592
$menuItem = $("<li><a href='#' id='" + id + "'> <span class='menu-name'></span></a></li>");
@@ -808,7 +862,7 @@ define(function (require, exports, module) {
808862
* @return {?Menu} the newly created Menu
809863
*/
810864
function addMenu(name, id, position, relativeID) {
811-
name = StringUtils.htmlEscape(name);
865+
name = _.escape(name);
812866
var $menubar = $("#titlebar .nav"),
813867
menu;
814868

@@ -877,6 +931,9 @@ define(function (require, exports, module) {
877931
* Extensions should use the following format: "author.myextension.mymenuname".
878932
*/
879933
function removeMenu(id) {
934+
var menu,
935+
commandID = "";
936+
880937
if (!id) {
881938
console.error("removeMenu(): missing required parameter: id");
882939
return;
@@ -887,6 +944,20 @@ define(function (require, exports, module) {
887944
return;
888945
}
889946

947+
// Remove all of the menu items in the menu
948+
menu = getMenu(id);
949+
950+
CollectionUtils.forEach(menuItemMap, function (value, key) {
951+
if (key.substring(0, id.length) === id) {
952+
if (value.isDivider) {
953+
menu.removeMenuDivider(key);
954+
} else {
955+
commandID = value.getCommand();
956+
menu.removeMenuItem(commandID);
957+
}
958+
}
959+
});
960+
890961
if (_isHTMLMenu(id)) {
891962
$(_getHTMLMenu(id)).remove();
892963
} else {

0 commit comments

Comments
 (0)