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

Commit

Permalink
Merge branch 'master' of https://github.com/adobe/brackets into larz/…
Browse files Browse the repository at this point in the history
…issue-8958
  • Loading branch information
Larz authored and Larz committed Sep 20, 2014
2 parents b09c681 + f40ea05 commit dbdaf3e
Show file tree
Hide file tree
Showing 300 changed files with 36,509 additions and 4,597 deletions.
39 changes: 17 additions & 22 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"regexp" : true,
"undef" : true,
"strict" : true,
"trailing" : false,
"unused" : "vars",

"asi" : false,
"boss" : false,
Expand All @@ -35,15 +35,14 @@
"proto" : false,
"regexdash" : false,
"scripturl" : false,
"smarttabs" : false,
"shadow" : false,
"sub" : false,
"supernew" : false,
"validthis" : false,

"browser" : true,
"browser" : false,
"couch" : false,
"devel" : false,
"devel" : true,
"dojo" : false,
"jquery" : false,
"mootools" : false,
Expand All @@ -52,24 +51,20 @@
"prototypejs" : false,
"rhino" : false,
"wsh" : false,

"nomen" : false,
"onevar" : false,
"passfail" : false,
"white" : false,

"maxerr" : 100,
"predef" : [
],
"indent" : 4,
"globals" : [
"require",
"define",
"brackets",
"$",
"PathUtils",
"window",
"navigator",
"Mustache"
]
}
"globals" : {
"window": false,
"document": false,
"setTimeout": false,
"require": false,
"define": false,
"brackets": false,
"$": false,
"PathUtils": false,
"window": false,
"navigator": false,
"Mustache": false
}
}
8 changes: 3 additions & 5 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ module.exports = function (grunt) {
// load dependencies
require('load-grunt-tasks')(grunt, {pattern: ['grunt-contrib-*', 'grunt-targethtml', 'grunt-usemin']});
grunt.loadTasks('tasks');

var common = require("./tasks/lib/common")(grunt);

// Project configuration.
grunt.initConfig({
Expand Down Expand Up @@ -312,9 +310,9 @@ module.exports = function (grunt) {
grunt.registerTask('test', ['jshint:all', 'jasmine']);
// grunt.registerTask('test', ['jshint:all', 'jasmine', 'jasmine_node']);

// task: set-sprint
// Update sprint number in package.json and rewrite src/config.json
grunt.registerTask('set-sprint', ['update-sprint-number', 'write-config']);
// task: set-release
// Update version number in package.json and rewrite src/config.json
grunt.registerTask('set-release', ['update-release-number', 'write-config']);

// task: build
grunt.registerTask('build', [
Expand Down
11 changes: 1 addition & 10 deletions src/LiveDevelopment/Agents/DOMAgent.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ define(function DOMAgent(require, exports, module) {
var $exports = $(exports);

var Inspector = require("LiveDevelopment/Inspector/Inspector");
var RemoteAgent = require("LiveDevelopment/Agents/RemoteAgent");
var EditAgent = require("LiveDevelopment/Agents/EditAgent");
var DOMNode = require("LiveDevelopment/Agents/DOMNode");
var DOMHelpers = require("LiveDevelopment/Agents/DOMHelpers");
Expand Down Expand Up @@ -123,14 +122,6 @@ define(function DOMAgent(require, exports, module) {
Inspector.DOM.requestChildNodes(node.nodeId);
}

/** Resolve a node
* @param {DOMNode} node
*/
function resolveNode(node, callback) {
console.assert(node.nodeId, "Attempted to resolve node without id");
Inspector.DOM.resolveNode(node.nodeId, callback);
}

/** Eliminate the query string from a URL
* @param {string} URL
*/
Expand Down Expand Up @@ -332,4 +323,4 @@ define(function DOMAgent(require, exports, module) {
exports.applyChange = applyChange;
exports.load = load;
exports.unload = unload;
});
});
5 changes: 2 additions & 3 deletions src/LiveDevelopment/Agents/DOMHelpers.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, forin: true, maxerr: 50, regexp: true */
/*global define, $ */
/*global define */

/**
* DOMHelpers is a collection of functions used by the DOMAgent exports `eachNode(src, callback)`
Expand Down Expand Up @@ -230,7 +230,6 @@ define(function DOMHelpersModule(require, exports, module) {
function eachNode(src, callback) {
var index = 0;
var text, range, length, payload;
var x = 0;
while (index < src.length) {

// find the next tag
Expand Down Expand Up @@ -267,4 +266,4 @@ define(function DOMHelpersModule(require, exports, module) {
// Export public functions
exports.extractPayload = extractPayload;
exports.eachNode = eachNode;
});
});
10 changes: 4 additions & 6 deletions src/LiveDevelopment/Agents/GotoAgent.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ define(function GotoAgent(require, exports, module) {

var DocumentManager = require("document/DocumentManager");
var EditorManager = require("editor/EditorManager");
var MainViewManager = require("view/MainViewManager");

/** Return the URL without the query string
* @param {string} URL
Expand All @@ -66,7 +67,6 @@ define(function GotoAgent(require, exports, module) {
*/
function _makeHTMLTarget(targets, node) {
if (node.location) {
var target = {};
var url = DOMAgent.url;
var location = node.location;
if (node.canHaveChildren()) {
Expand All @@ -85,7 +85,6 @@ define(function GotoAgent(require, exports, module) {
*/
function _makeCSSTarget(targets, rule) {
if (rule.sourceURL) {
var target = {};
var url = rule.sourceURL;
url += ":" + rule.style.range.start;
var name = rule.selectorList.text;
Expand All @@ -101,7 +100,6 @@ define(function GotoAgent(require, exports, module) {
function _makeJSTarget(targets, callFrame) {
var script = ScriptAgent.scriptWithId(callFrame.location.scriptId);
if (script && script.url) {
var target = {};
var url = script.url;
url += ":" + callFrame.location.lineNumber + "," + callFrame.location.columnNumber;
var name = callFrame.functionName;
Expand All @@ -120,7 +118,7 @@ define(function GotoAgent(require, exports, module) {

// get all css rules that apply to the given node
Inspector.CSS.getMatchedStylesForNode(node.nodeId, function onMatchedStyles(res) {
var i, callFrame, name, script, url, rule, targets = [];
var i, targets = [];
_makeHTMLTarget(targets, node);
for (i in node.trace) {
_makeJSTarget(targets, node.trace[i]);
Expand Down Expand Up @@ -172,7 +170,7 @@ define(function GotoAgent(require, exports, module) {
path = decodeURI(path);
var promise = DocumentManager.getDocumentForPath(path);
promise.done(function onDone(doc) {
DocumentManager.setCurrentDocument(doc);
MainViewManager._edit(MainViewManager.ACTIVE_PANE, doc);
if (location) {
openLocation(location, noFlash);
}
Expand Down Expand Up @@ -220,4 +218,4 @@ define(function GotoAgent(require, exports, module) {
exports.open = open;
exports.load = load;
exports.unload = unload;
});
});
2 changes: 1 addition & 1 deletion src/LiveDevelopment/Agents/RemoteAgent.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, forin: true, maxerr: 50, regexp: true */
/*global define, $, XMLHttpRequest, window */
/*global define, $, window */

/**
* RemoteAgent defines and provides an interface for custom remote functions
Expand Down
5 changes: 3 additions & 2 deletions src/LiveDevelopment/Agents/RemoteFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@


/*jslint vars: true, plusplus: true, browser: true, nomen: true, indent: 4, forin: true, maxerr: 50, regexp: true */
/*global define, $, window, navigator, Node, console */
/*jshint unused: false */
/*global window, navigator, Node, console */
/*theseus instrument: false */

/**
Expand Down Expand Up @@ -814,4 +815,4 @@ function RemoteFunctions(experimental) {
"applyDOMEdits" : applyDOMEdits,
"getSimpleDOM" : getSimpleDOM
};
}
}
9 changes: 0 additions & 9 deletions src/LiveDevelopment/Agents/ScriptAgent.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,6 @@ define(function ScriptAgent(require, exports, module) {
var _idToScript; // id -> script info
var _insertTrace; // the last recorded trace of a DOM insertion

/** Add a call stack trace to a node
* @param {integer} node id
* @param [{Debugger.CallFrame}] call stack
*/
function _addTraceToNode(nodeId, trace) {
var node = DOMAgent.nodeWithId(nodeId);
node.trace = trace;
}

// TODO: should the parameter to this be an ID rather than a URL?
/** Get the script information for a given url
* @param {string} url
Expand Down
1 change: 0 additions & 1 deletion src/LiveDevelopment/Documents/CSSDocument.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ define(function CSSDocumentModule(require, exports, module) {
CSSDocument.prototype.updateHighlight = function () {
if (Inspector.config.highlight && this.editor) {
var editor = this.editor,
codeMirror = editor._codeMirror,
selectors = [];
_.each(this.editor.getSelections(), function (sel) {
var selector = CSSUtils.findSelectorAtDocumentPos(editor, (sel.reversed ? sel.end : sel.start));
Expand Down
1 change: 0 additions & 1 deletion src/LiveDevelopment/Documents/CSSPreprocessorDocument.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ define(function CSSPreprocessorDocumentModule(require, exports, module) {
CSSPreprocessorDocument.prototype.updateHighlight = function () {
if (Inspector.config.highlight && this.editor) {
var editor = this.editor,
codeMirror = editor._codeMirror,
selectors = [];
_.each(this.editor.getSelections(), function (sel) {
var selector = CSSUtils.findSelectorAtDocumentPos(editor, (sel.reversed ? sel.end : sel.start));
Expand Down
26 changes: 18 additions & 8 deletions src/LiveDevelopment/Documents/HTMLDocument.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, forin: true, maxerr: 50, regexp: true */
/*global define, $, brackets */
/*global define, $ */

/**
* HTMLDocument manages a single HTML source document
Expand All @@ -44,16 +44,13 @@
define(function HTMLDocumentModule(require, exports, module) {
"use strict";

var DocumentManager = require("document/DocumentManager"),
DOMAgent = require("LiveDevelopment/Agents/DOMAgent"),
EditorManager = require("editor/EditorManager"),
var EditorManager = require("editor/EditorManager"),
HighlightAgent = require("LiveDevelopment/Agents/HighlightAgent"),
HTMLInstrumentation = require("language/HTMLInstrumentation"),
Inspector = require("LiveDevelopment/Inspector/Inspector"),
LiveDevelopment = require("LiveDevelopment/LiveDevelopment"),
PerfUtils = require("utils/PerfUtils"),
RemoteAgent = require("LiveDevelopment/Agents/RemoteAgent"),
StringUtils = require("utils/StringUtils"),
_ = require("thirdparty/lodash");

/**
Expand All @@ -62,8 +59,6 @@ define(function HTMLDocumentModule(require, exports, module) {
* @param {!Editor} editor The editor for this document
*/
var HTMLDocument = function HTMLDocument(doc, editor) {
var self = this;

this.doc = doc;
if (this.doc) {
this.doc.addRef();
Expand Down Expand Up @@ -155,6 +150,10 @@ define(function HTMLDocumentModule(require, exports, module) {
self._onChange(event, editor, change);
});

$(this.editor).on("beforeDestroy.HTMLDocument", function (event, editor) {
self._onDestroy(event, editor);
});

// Experimental code
if (LiveDevelopment.config.experimental) {
$(HighlightAgent).on("highlight.HTMLDocument", function (event, node) {
Expand Down Expand Up @@ -186,7 +185,6 @@ define(function HTMLDocumentModule(require, exports, module) {
*/
HTMLDocument.prototype.updateHighlight = function () {
var editor = this.editor,
codeMirror = editor._codeMirror,
ids = [];
if (Inspector.config.highlight) {
_.each(this.editor.getSelections(), function (sel) {
Expand Down Expand Up @@ -266,6 +264,18 @@ define(function HTMLDocumentModule(require, exports, module) {
});
};

/**
* Triggered when the editor is being destroyed
* @param {$.Event} event Event
* @param {!Editor} editor The editor being destroyed
*/
HTMLDocument.prototype._onDestroy = function (event, editor) {
if (this.editor === editor) {
this.detachFromEditor();
}
};


/**
* Triggered on change by the editor
* @param {$.Event} event Event
Expand Down
4 changes: 2 additions & 2 deletions src/LiveDevelopment/Inspector/Inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@


/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, forin: true, maxerr: 50, regexp: true */
/*global define, $, WebSocket, FileError, window, XMLHttpRequest */
/*global define, $, WebSocket, FileError, XMLHttpRequest */

/**
* Inspector manages the connection to Chrome/Chromium's remote debugger.
Expand Down Expand Up @@ -395,7 +395,7 @@ define(function Inspector(require, exports, module) {
var InspectorText = require("text!LiveDevelopment/Inspector/Inspector.json"),
InspectorJSON = JSON.parse(InspectorText);

var i, j, domain, domainDef, command;
var i, j, domain, command;
for (i in InspectorJSON.domains) {
domain = InspectorJSON.domains[i];
exports[domain.domain] = {};
Expand Down
3 changes: 0 additions & 3 deletions src/LiveDevelopment/LiveDevServerManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@
define(function (require, exports, module) {
"use strict";

var FileUtils = require("file/FileUtils"),
ProjectManager = require("project/ProjectManager");

var _serverProviders = [];

/**
Expand Down
Loading

0 comments on commit dbdaf3e

Please sign in to comment.