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

Commit b1545e7

Browse files
A few cleanups
1 parent 6bbca67 commit b1545e7

File tree

3 files changed

+41
-21
lines changed

3 files changed

+41
-21
lines changed

LICENSE

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright (c) 2013 Bernhard Sirlinger. All rights reserved.
3+
*
4+
* 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
9+
* Software is furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* 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
20+
* DEALINGS IN THE SOFTWARE.
21+
*
22+
*/
23+
24+
Files in subdirectories may include there own different License.

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## bracketsFileWatcher
2+
3+
This extension basically just watches for changes in the file tree and refreshes the
4+
file tree in brackets if necessary.
5+
6+
If anybody notices any a bug or has a feature request, feel free to open an issue or
7+
even better send a pull request.
8+
9+
10+
#### Release Notes:
11+
* 0.01: Added basical watching capablities.
12+
13+
##### Credits
14+
This extension relies on the node module [directory-tree-watcher](https://raw.github.com/jolira/directory-tree-watcher)

main.js

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
*/
2323

2424

25-
/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4,
26-
maxerr: 50, browser: true */
25+
/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50, browser: true */
2726
/*global $, define, brackets */
2827

2928
define(function (require, exports, module) {
@@ -38,26 +37,10 @@ define(function (require, exports, module) {
3837
NodeConnection = brackets.getModule("utils/NodeConnection"),
3938
ProjectManager = brackets.getModule("project/ProjectManager");
4039

41-
/**
42-
* @const
43-
* Amount of time to wait before automatically rejecting the connection
44-
* deferred. If we hit this timeout, we'll never have a node connection
45-
* for the static server in this run of Brackets.
46-
*/
4740
var NODE_CONNECTION_TIMEOUT = 5000; // 5 seconds
4841

49-
/**
50-
* @private
51-
* @type{jQuery.Deferred.<NodeConnection>}
52-
* A deferred which is resolved with a NodeConnection or rejected if
53-
* we are unable to connect to Node.
54-
*/
5542
var _nodeConnectionDeferred = new $.Deferred();
56-
57-
/**
58-
* @private
59-
* @type {NodeConnection}
60-
*/
43+
6144
var _nodeConnection = new NodeConnection();
6245

6346
function initExtension() {
@@ -82,7 +65,7 @@ define(function (require, exports, module) {
8265

8366
_nodeConnectionDeferred.resolveWith(null, [_nodeConnection]);
8467
}).fail(
85-
function () { // Failed to connect
68+
function () {
8669
console.error("[FileWatcher] Failed to connect to node", arguments);
8770
_nodeConnectionDeferred.reject();
8871
}
@@ -94,7 +77,6 @@ define(function (require, exports, module) {
9477

9578
AppInit.htmlReady(function () {
9679
_nodeConnectionDeferred.done(function (nodeConnection) {
97-
//nodeConnection.fileWatcher.startWatching(ProjectManager.getProjectRoot().fullPath, 1000);
9880
$(ProjectManager).on("projectOpen", function () {
9981
_nodeConnection.domains.fileWatcher.startWatching(ProjectManager.getProjectRoot().fullPath);
10082
});

0 commit comments

Comments
 (0)