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

Commit

Permalink
Merge remote-tracking branch 'origin/master' into pflynn/quick-edit-g…
Browse files Browse the repository at this point in the history
…rouping

* origin/master: (182 commits)
  Fix unit test failure -- file-read wasn't always passing back correct error codes anymore. If the initial stat() fails (e.g. file doesn't exist or permission denied), we were double-converting the error code from brackets-shell format to FS impl API format, causing it to get mangled and treated as "Unknown."
  Limit document file sizes to 16MB on open
  fix definePreference
  auto-install extensions
  Updated .not-editor styling based on @TomMalbran's feedback.
  Added subtle border for dark menus.
  Pushing sidebar icons to the back of Working Files label when they overlap.
  Project dropdown toggle needs right margin.
  Making sure that the anchors in jstree will never show a hover state.
  Fix live dev highlight being out of place in edge cases
  Fix for #9545.
  Made unfocused pane look unfocused.
  Initial commit. Added necessary properties in order to override bootstrap styles. This branch is for #7887.
  Recognize Vagrantfile as ruby
  Replace HTML entity with literal dash in Getting Started
  Update strings.js
  Update strings.js
  Fix bug #9511 (Can't select text in Extension Manager anymore) - Remove no-focus from dialog root to allow text selection. Change scope of key listener so tabbing continues to work without needing to reintroduce tabIndex on the dialog, since that triggers Bootstrap-modal problems (#9196).
  corrected typo in 'bootstrapping'
  Working Performance Set Improvements
  ...
  • Loading branch information
peterflynn committed Oct 20, 2014
2 parents 54c98fb + 01ca26c commit 85fa143
Show file tree
Hide file tree
Showing 91 changed files with 3,113 additions and 1,004 deletions.
45 changes: 45 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,51 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

Copyright 2013-2014 Facebook, Inc.
This product includes software licensed under the Apache License, Version 2.0
http://www.apache.org/licenses/LICENSE-2.0.

BSD License
For Immutable JS software
Copyright (c) 2014, Facebook, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name Facebook nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Copyright (c) 2014, Facebook, Inc. All rights reserved.

React JavaScript library

Licensed under the Apache License, Version 2.0

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

See also: https://github.com/facebook/react/blob/master/LICENSE


Timothy Farrell
Copyright (c) 2010 Timothy Farrell
Permission is hereby granted, free of charge, to any person obtaining a copy of this
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Awesome! _There are lots of ways you can help._ First read
then learn how to [pull the repo and hack on Brackets](https://github.com/adobe/brackets/wiki/How-to-Hack-on-Brackets).

The text editor inside Brackets is based on
[CodeMirror](http://github.com/marijnh/CodeMirror)—thanks to Marijn for
[CodeMirror](http://github.com/codemirror/CodeMirror)—thanks to Marijn for
taking our pull requests, implementing feature requests and fixing bugs! See
[Notes on CodeMirror](https://github.com/adobe/brackets/wiki/Notes-on-CodeMirror)
for info on how we're using CodeMirror.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Brackets",
"version": "0.44.0-0",
"apiVersion": "0.44.0",
"version": "0.45.0-0",
"apiVersion": "0.45.0",
"homepage": "http://brackets.io",
"issues": {
"url": "http://github.com/adobe/brackets/issues"
Expand Down
6 changes: 3 additions & 3 deletions samples/root/Getting Started/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ <h3>Quick Edit for CSS and JavaScript</h3>
<kbd>Cmd/Ctrl + E</kbd> shortcut to open a quick inline editor that displays all the related CSS.
Make a tweak to your CSS, hit <kbd>ESC</kbd> and you're back to editing HTML, or just leave the
CSS rules open and they'll become part of your HTML editor. If you hit <kbd>ESC</kbd> outside of
a quick inline editor, they'll all collapse. Quick Edit will also find rules defined in LESS and
a quick inline editor, they'll all collapse. Quick Edit will also find rules defined in LESS and
SCSS files, including nested rules.
</p>

Expand All @@ -66,8 +66,8 @@ <h3>Quick Edit for CSS and JavaScript</h3>
</a>

<p>
You can use the same shortcut to edit other things as well &ndash; like functions in JavaScript,
colors, and animation timing functions &ndash; and we're adding more and more all the time.
You can use the same shortcut to edit other things as well - like functions in JavaScript,
colors, and animation timing functions - and we're adding more and more all the time.
</p>
<p>
For now inline editors cannot be nested, so you can only use Quick Edit while the cursor
Expand Down
29 changes: 20 additions & 9 deletions src/LiveDevelopment/Agents/RemoteFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,21 @@ function RemoteFunctions(experimental) {
}

// compute the screen offset of an element
function _screenOffset(element, key) {
var bounds = element.getBoundingClientRect();
if (key === "offsetLeft") {
return bounds.left + window.pageXOffset;
function _screenOffset(element) {
var elemBounds = element.getBoundingClientRect(),
body = window.document.body,
offsetTop,
offsetLeft;

if (window.getComputedStyle(body).position === "static") {
offsetLeft = elemBounds.left + window.pageXOffset;
offsetTop = elemBounds.top + window.pageYOffset;
} else {
return bounds.top + window.pageYOffset;
var bodyBounds = body.getBoundingClientRect();
offsetLeft = elemBounds.left - bodyBounds.left;
offsetTop = elemBounds.top - bodyBounds.top;
}
return { left: offsetLeft, top: offsetTop };
}

// set an event on a element
Expand Down Expand Up @@ -114,8 +122,9 @@ function RemoteFunctions(experimental) {
}

// compute the position on screen
var x = _screenOffset(this.element, "offsetLeft");
var y = _screenOffset(this.element, "offsetTop") + this.element.offsetHeight;
var offset = _screenOffset(this.element),
x = offset.left,
y = offset.top + this.element.offsetHeight;

// create the container
this.body = document.createElement("div");
Expand Down Expand Up @@ -239,9 +248,11 @@ function RemoteFunctions(experimental) {

highlight.className = HIGHLIGHT_CLASSNAME;

var offset = _screenOffset(element);

var stylesToSet = {
"left": _screenOffset(element, "offsetLeft") + "px",
"top": _screenOffset(element, "offsetTop") + "px",
"left": offset.left + "px",
"top": offset.top + "px",
"width": elementBounds.width + "px",
"height": elementBounds.height + "px",
"z-index": 2000000,
Expand Down
24 changes: 13 additions & 11 deletions src/LiveDevelopment/Documents/HTMLDocument.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,7 @@ define(function HTMLDocumentModule(require, exports, module) {
}

if (this._instrumentationEnabled) {
// Update instrumentation for new editor
HTMLInstrumentation.scanDocument(this.doc);
// Resync instrumentation with editor
HTMLInstrumentation._markText(this.editor);
}
};
Expand All @@ -186,16 +185,19 @@ define(function HTMLDocumentModule(require, exports, module) {
HTMLDocument.prototype.updateHighlight = function () {
var editor = this.editor,
ids = [];

if (Inspector.config.highlight) {
_.each(this.editor.getSelections(), function (sel) {
var tagID = HTMLInstrumentation._getTagIDAtDocumentPos(
editor,
sel.reversed ? sel.end : sel.start
);
if (tagID !== -1) {
ids.push(tagID);
}
});
if (editor) {
_.each(editor.getSelections(), function (sel) {
var tagID = HTMLInstrumentation._getTagIDAtDocumentPos(
editor,
sel.reversed ? sel.end : sel.start
);
if (tagID !== -1) {
ids.push(tagID);
}
});
}

if (!ids.length) {
HighlightAgent.hide();
Expand Down
2 changes: 1 addition & 1 deletion src/brackets.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ define(function (require, exports, module) {
var real_windowOpen = window.open;
window.open = function (url) {
// Allow file:// URLs, relative URLs (implicitly file: also), and about:blank
if (!url.match(/^file:\/\//) && url !== "about:blank" && url.indexOf(":") !== -1) {
if (!url.match(/^file:\/\//) && !url.match(/^about:blank/) && url.indexOf(":") !== -1) {
throw new Error("Brackets-shell is not a secure general purpose web browser. Use NativeApp.openURLInDefaultBrowser() to open URLs in the user's main browser");
}
return real_windowOpen.apply(window, arguments);
Expand Down
4 changes: 4 additions & 0 deletions src/command/DefaultMenus.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ define(function (require, exports, module) {
menu = Menus.addMenu(Strings.VIEW_MENU, Menus.AppMenuBar.VIEW_MENU);
menu.addMenuItem(Commands.CMD_THEMES_OPEN_SETTINGS);
menu.addMenuDivider();
menu.addMenuItem(Commands.CMD_SPLITVIEW_NONE);
menu.addMenuItem(Commands.CMD_SPLITVIEW_VERTICAL);
menu.addMenuItem(Commands.CMD_SPLITVIEW_HORIZONTAL);
menu.addMenuDivider();
menu.addMenuItem(Commands.VIEW_HIDE_SIDEBAR);
menu.addMenuDivider();
menu.addMenuItem(Commands.VIEW_INCREASE_FONT_SIZE);
Expand Down
4 changes: 2 additions & 2 deletions src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"build_timestamp": ""
},
"name": "Brackets",
"version": "0.44.0-0",
"apiVersion": "0.44.0",
"version": "0.45.0-0",
"apiVersion": "0.45.0",
"homepage": "http://brackets.io",
"issues": {
"url": "http://github.com/adobe/brackets/issues"
Expand Down
33 changes: 16 additions & 17 deletions src/dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,25 @@
*/
window.setTimeout(function () {
"use strict";

var key, missingDeps = "";
var deps = { "Mustache": window.Mustache, "jQuery": window.$, "RequireJS": window.require };
var key, missingDeps = [];

for (key in deps) {
if (deps.hasOwnProperty(key) && !deps[key]) {
missingDeps.push(key);
missingDeps += "<li>" + key + "</li>";
}
}
if (missingDeps.length === 0) {
return;

if (missingDeps.length > 0) {
var str = "<h1>Missing libraries</h1>" +
"<p>Oops! One or more required libraries could not be found.</p>" +
"<ul>" + missingDeps + "</ul>" +
"<p>If you're running from a local copy of the Brackets source, please make sure submodules are updated by running:</p>" +
"<pre>git submodule update --init</pre>" +
"<p>If you're still having problems, please contact us via one of the channels mentioned at the bottom of the <a target=\"blank\" href=\"../README.md\">README</a>.</p>" +
"<p><a href=\"#\" onclick=\"window.location.reload()\">Reload Brackets</a></p>";

document.write(str);
}
document.write("<h1>Missing libraries</h1>");
document.write("<p>Oops! One or more required libraries could not be found.</p>");
document.write("<ul>");
missingDeps.forEach(function (key) {
document.write("<li>" + key + "</li>");
});

document.write("</ul>");
document.write("<p>If you're running from a local copy of the Brackets source, please make sure submodules are updated by running:</p>");
document.write("<pre>git submodule update --init</pre>");
document.write("<p>If you're still having problems, please contact us via one of the channels mentioned at the bottom of the <a target=\"blank\" href=\"../README.md\">README</a>.</p>");
document.write("<p><a href=\"#\" onclick=\"window.location.reload()\">Reload Brackets</a></p>");
}, 1000);
}, 1000);
18 changes: 11 additions & 7 deletions src/document/DocumentCommandHandlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,13 @@ define(function (require, exports, module) {
* @param {!string} fullPath
* @param {boolean=} silent If true, don't show error message
* @param {string=} paneId, the id oi the pane in which to open the file. Can be undefined, a valid pane id or ACTIVE_PANE.
* @param {{*}=} options, command options
* @return {$.Promise} a jQuery promise that will either
* - be resolved with a file for the specified file path or
* - be rejected with FileSystemError if the file can not be read.
* If paneId is undefined, the ACTIVE_PANE constant
*/
function _doOpen(fullPath, silent, paneId) {
function _doOpen(fullPath, silent, paneId, options) {
var result = new $.Deferred();

// workaround for https://github.com/adobe/brackets/issues/6001
Expand Down Expand Up @@ -288,7 +289,7 @@ define(function (require, exports, module) {
});

var file = FileSystem.getFileForPath(fullPath);
MainViewManager._open(paneId, file)
MainViewManager._open(paneId, file, options)
.done(function () {
result.resolve(file);
})
Expand All @@ -314,10 +315,11 @@ define(function (require, exports, module) {
* @param {?string} fullPath - The path of the file to open; if it's null we'll prompt for it
* @param {boolean=} silent - If true, don't show error message
* @param {string=} paneId - the pane in which to open the file. Can be undefined, a valid pane id or ACTIVE_PANE
* @param {{*}=} options - options to pass to MainViewManager._open
* @return {$.Promise} a jQuery promise resolved with a Document object or
* rejected with an err
*/
function _doOpenWithOptionalPath(fullPath, silent, paneId) {
function _doOpenWithOptionalPath(fullPath, silent, paneId, options) {
var result;
paneId = paneId || MainViewManager.ACTIVE_PANE;
if (!fullPath) {
Expand All @@ -341,7 +343,7 @@ define(function (require, exports, module) {
});
MainViewManager.addListToWorkingSet(paneId, filesToOpen);

_doOpen(paths[paths.length - 1], silent, paneId)
_doOpen(paths[paths.length - 1], silent, paneId, options)
.done(function (file) {
_defaultOpenDialogFullPath =
FileUtils.getDirectoryPath(
Expand All @@ -357,7 +359,7 @@ define(function (require, exports, module) {
}
});
} else {
result = _doOpen(fullPath, silent, paneId);
result = _doOpen(fullPath, silent, paneId, options);
}

return result.promise();
Expand Down Expand Up @@ -414,9 +416,11 @@ define(function (require, exports, module) {
paneId = (commandData && commandData.paneId) || MainViewManager.ACTIVE_PANE,
result = new $.Deferred();

_doOpenWithOptionalPath(fileInfo.path, silent, paneId)
_doOpenWithOptionalPath(fileInfo.path, silent, paneId, commandData && commandData.options)
.done(function (file) {
MainViewManager.setActivePaneId(paneId);
if (!commandData || !commandData.options || !commandData.options.noPaneActivate) {
MainViewManager.setActivePaneId(paneId);
}

// If a line and column number were given, position the editor accordingly.
if (fileInfo.line !== null) {
Expand Down
Loading

0 comments on commit 85fa143

Please sign in to comment.