Skip to content

Commit

Permalink
Merge pull request adobe#482 from adobe/nj/reorg
Browse files Browse the repository at this point in the history
Major reorganization of Brackets source files into subfolders
  • Loading branch information
gruehle committed Mar 22, 2012
2 parents ba4be82 + 47001fb commit f442d02
Show file tree
Hide file tree
Showing 46 changed files with 197 additions and 200 deletions.
54 changes: 27 additions & 27 deletions src/brackets.js
Expand Up @@ -26,29 +26,29 @@ define(function (require, exports, module) {


// Load dependent modules
var ProjectManager = require("ProjectManager"),
DocumentManager = require("DocumentManager"),
EditorManager = require("EditorManager"),
InlineEditorProviders = require("InlineEditorProviders"),
WorkingSetView = require("WorkingSetView"),
FileCommandHandlers = require("FileCommandHandlers"),
FileViewController = require("FileViewController"),
FileSyncManager = require("FileSyncManager"),
KeyBindingManager = require("KeyBindingManager"),
KeyMap = require("KeyMap"),
Commands = require("Commands"),
CommandManager = require("CommandManager"),
CodeHintManager = require("CodeHintManager"),
PerfUtils = require("PerfUtils"),
FileIndexManager = require("FileIndexManager"),
QuickFileOpen = require("QuickFileOpen"),
Menus = require("Menus");
var ProjectManager = require("project/ProjectManager"),
DocumentManager = require("document/DocumentManager"),
EditorManager = require("editor/EditorManager"),
InlineEditorProviders = require("editor/InlineEditorProviders"),
WorkingSetView = require("project/WorkingSetView"),
DocumentCommandHandlers = require("document/DocumentCommandHandlers"),
FileViewController = require("project/FileViewController"),
FileSyncManager = require("project/FileSyncManager"),
KeyBindingManager = require("command/KeyBindingManager"),
KeyMap = require("command/KeyMap"),
Commands = require("command/Commands"),
CommandManager = require("command/CommandManager"),
CodeHintManager = require("editor/CodeHintManager"),
PerfUtils = require("utils/PerfUtils"),
FileIndexManager = require("project/FileIndexManager"),
QuickFileOpen = require("search/QuickFileOpen"),
Menus = require("command/Menus");

//Load modules the self-register and just need to get included in the main project
require("JSLint");
require("CodeHintManager");
require("DebugCommandHandlers");
require("FindInFiles");
require("language/JSLintUtils");
require("editor/CodeHintManager");
require("debug/DebugCommandHandlers");
require("search/FindInFiles");

// Define core brackets namespace if it isn't already defined
//
Expand All @@ -70,17 +70,17 @@ define(function (require, exports, module) {
// in the modules since they would run in context of the unit test window,
// and would not have access to the app html/css.
brackets.test = {
PreferencesManager : require("PreferencesManager"),
PreferencesManager : require("preferences/PreferencesManager"),
ProjectManager : ProjectManager,
FileCommandHandlers : FileCommandHandlers,
DocumentCommandHandlers : DocumentCommandHandlers,
FileViewController : FileViewController,
DocumentManager : DocumentManager,
EditorManager : EditorManager,
Commands : Commands,
WorkingSetView : WorkingSetView,
CommandManager : require("CommandManager"),
CommandManager : require("command/CommandManager"),
FileIndexManager : FileIndexManager,
CSSUtils : require("CSSUtils")
CSSUtils : require("language/CSSUtils")
};

// Uncomment the following line to force all low level file i/o routines to complete
Expand All @@ -90,7 +90,7 @@ define(function (require, exports, module) {

// Load native shell when brackets is run in a native shell rather than the browser
// TODO: (issue #266) load conditionally
brackets.shellAPI = require("ShellAPI");
brackets.shellAPI = require("utils/ShellAPI");

brackets.inBrowser = !brackets.hasOwnProperty("fs");

Expand Down Expand Up @@ -141,7 +141,7 @@ define(function (require, exports, module) {


function initCommandHandlers() {
FileCommandHandlers.init($("#main-toolbar .title"));
DocumentCommandHandlers.init($("#main-toolbar .title"));
}

function initKeyBindings() {
Expand Down
File renamed without changes.
File renamed without changes.
Expand Up @@ -11,7 +11,7 @@
define(function (require, exports, module) {
'use strict';

var CommandManager = require("CommandManager");
var CommandManager = require("command/CommandManager");

/**
* The currently installed keymap.
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/Menus.js → src/command/Menus.js
Expand Up @@ -9,8 +9,8 @@ define(function (require, exports, module) {
'use strict';

// Load dependent modules
var Commands = require("Commands"),
CommandManager = require("CommandManager");
var Commands = require("command/Commands"),
CommandManager = require("command/CommandManager");

function init() {
// Implements the File menu items
Expand Down
Expand Up @@ -8,15 +8,15 @@
define(function (require, exports, module) {
'use strict';

var Commands = require("Commands"),
CommandManager = require("CommandManager"),
JSLint = require("JSLint"),
PerfUtils = require("PerfUtils");
var Commands = require("command/Commands"),
CommandManager = require("command/CommandManager"),
JSLintUtils = require("language/JSLintUtils"),
PerfUtils = require("utils/PerfUtils");

function _handleEnableJSLint() {
JSLint.setEnabled(!JSLint.getEnabled());
JSLint.run();
$("#jslint-enabled-checkbox").css("display", JSLint.getEnabled() ? "" : "none");
JSLintUtils.setEnabled(!JSLintUtils.getEnabled());
JSLintUtils.run();
$("#jslint-enabled-checkbox").css("display", JSLintUtils.getEnabled() ? "" : "none");
}

// Implements the 'Run Tests' menu to bring up the Jasmine unit test window
Expand Down
Expand Up @@ -11,21 +11,21 @@ define(function (require, exports, module) {
require("thirdparty/path-utils/path-utils.min");

// Load dependent modules
var CommandManager = require("CommandManager"),
Commands = require("Commands"),
NativeFileSystem = require("NativeFileSystem").NativeFileSystem,
ProjectManager = require("ProjectManager"),
DocumentManager = require("DocumentManager"),
EditorManager = require("EditorManager"),
FileUtils = require("FileUtils"),
Async = require("Async"),
Dialogs = require("Dialogs"),
var CommandManager = require("command/CommandManager"),
Commands = require("command/Commands"),
NativeFileSystem = require("file/NativeFileSystem").NativeFileSystem,
ProjectManager = require("project/ProjectManager"),
DocumentManager = require("document/DocumentManager"),
EditorManager = require("editor/EditorManager"),
FileUtils = require("file/FileUtils"),
Async = require("utils/Async"),
Dialogs = require("widgets/Dialogs"),
Strings = require("strings"),
PreferencesManager = require("PreferencesManager"),
PerfUtils = require("PerfUtils");
PreferencesManager = require("preferences/PreferencesManager"),
PerfUtils = require("utils/PerfUtils");

/**
* Handlers for commands related to file handling (opening, saving, etc.)
* Handlers for commands related to document handling (opening, saving, etc.)
*/

/** @type {jQueryObject} Container for label shown above editor */
Expand Down
20 changes: 9 additions & 11 deletions src/DocumentManager.js → src/document/DocumentManager.js
Expand Up @@ -47,15 +47,13 @@
define(function (require, exports, module) {
'use strict';

var NativeFileSystem = require("NativeFileSystem").NativeFileSystem,
ProjectManager = require("ProjectManager"),
EditorManager = require("EditorManager"),
PreferencesManager = require("PreferencesManager"),
FileUtils = require("FileUtils"),
CommandManager = require("CommandManager"),
Async = require("Async"),
Editor = require("Editor").Editor,
Commands = require("Commands");
var NativeFileSystem = require("file/NativeFileSystem").NativeFileSystem,
ProjectManager = require("project/ProjectManager"),
PreferencesManager = require("preferences/PreferencesManager"),
FileUtils = require("file/FileUtils"),
CommandManager = require("command/CommandManager"),
Async = require("utils/Async"),
Commands = require("command/Commands");

/**
* Unique PreferencesManager clientID
Expand Down Expand Up @@ -424,7 +422,7 @@ define(function (require, exports, module) {
// what's on disk. But since we currently close all secondary editors when anyone else
// touches the Document content, there's no point in doing that yet. Just change the text
// to a dummy value to trigger that closing. Ultimately, the nicer "revert" behavior
// should probably live in FileCommandHandlers.handleFileClose().
// should probably live in DocumentCommandHandlers.handleFileClose().
if (this.isDirty) {
this.refreshText("");
}
Expand Down Expand Up @@ -521,7 +519,7 @@ define(function (require, exports, module) {
};

/**
* Called when the document is saved (which currently happens in FileCommandHandlers). Marks the
* Called when the document is saved (which currently happens in DocumentCommandHandlers). Marks the
* document not dirty and notifies listeners of the save.
*/
Document.prototype.notifySaved = function () {
Expand Down
8 changes: 4 additions & 4 deletions src/CodeHintManager.js → src/editor/CodeHintManager.js
Expand Up @@ -9,8 +9,8 @@ define(function (require, exports, module) {
'use strict';

// Load dependent modules
var CodeHintUtils = require("CodeHintUtils"),
EditorManager = require("EditorManager");
var HTMLUtils = require("language/HTMLUtils"),
EditorManager = require("editor/EditorManager");

/**
* @private
Expand All @@ -32,8 +32,8 @@ define(function (require, exports, module) {
*/
function _checkForHint(editor) {
var pos = editor.getCursor();
var tagInfo = CodeHintUtils.getTagInfo(editor, pos);
if (tagInfo.position.type === CodeHintUtils.ATTR_VALUE) {
var tagInfo = HTMLUtils.getTagInfo(editor, pos);
if (tagInfo.position.type === HTMLUtils.ATTR_VALUE) {
if (tagInfo.attr.name === "class") {
_triggerClassHint(editor, pos, tagInfo);
} else if (tagInfo.attr.name === "id") {
Expand Down
2 changes: 1 addition & 1 deletion src/Editor.js → src/editor/Editor.js
Expand Up @@ -36,7 +36,7 @@
define(function (require, exports, module) {
'use strict';

var EditorManager = require("EditorManager");
var EditorManager = require("editor/EditorManager");


/**
Expand Down
8 changes: 4 additions & 4 deletions src/EditorManager.js → src/editor/EditorManager.js
Expand Up @@ -20,10 +20,10 @@ define(function (require, exports, module) {
'use strict';

// Load dependent modules
var FileUtils = require("FileUtils"),
DocumentManager = require("DocumentManager"),
Editor = require("Editor").Editor,
EditorUtils = require("EditorUtils"),
var FileUtils = require("file/FileUtils"),
DocumentManager = require("document/DocumentManager"),
Editor = require("editor/Editor").Editor,
EditorUtils = require("editor/EditorUtils"),
Strings = require("strings");

/** @type {jQueryObject} DOM node that contains all editors (visible and hidden alike) */
Expand Down
File renamed without changes.
Expand Up @@ -13,12 +13,12 @@ define(function (require, exports, module) {
'use strict';

// Load dependent modules
var CodeHintUtils = require("CodeHintUtils"),
CSSUtils = require("CSSUtils"),
DocumentManager = require("DocumentManager"),
EditorManager = require("EditorManager"),
FileUtils = require("FileUtils"),
ProjectManager = require("ProjectManager");
var HTMLUtils = require("language/HTMLUtils"),
CSSUtils = require("language/CSSUtils"),
DocumentManager = require("document/DocumentManager"),
EditorManager = require("editor/EditorManager"),
FileUtils = require("file/FileUtils"),
ProjectManager = require("project/ProjectManager");

// track divs to re-position manually
var _htmlToCSSProviderContent = [];
Expand Down Expand Up @@ -125,14 +125,14 @@ define(function (require, exports, module) {
* @private
*/
function _getSelectorName(editor, pos) {
var tagInfo = CodeHintUtils.getTagInfo(editor, pos),
var tagInfo = HTMLUtils.getTagInfo(editor, pos),
selectorName = "";

if (tagInfo.position.tokenType === CodeHintUtils.TAG_NAME) {
if (tagInfo.position.tokenType === HTMLUtils.TAG_NAME) {
// Type selector
selectorName = tagInfo.tagName;
} else if (tagInfo.position.tokenType === CodeHintUtils.ATTR_NAME ||
tagInfo.position.tokenType === CodeHintUtils.ATTR_VALUE) {
} else if (tagInfo.position.tokenType === HTMLUtils.ATTR_NAME ||
tagInfo.position.tokenType === HTMLUtils.ATTR_VALUE) {
if (tagInfo.attr.name === "class") {
// Class selector. We only look for the class name
// that includes the insertion point. For example, if
Expand Down
4 changes: 2 additions & 2 deletions src/FileUtils.js → src/file/FileUtils.js
Expand Up @@ -11,8 +11,8 @@
define(function (require, exports, module) {
'use strict';

var NativeFileSystem = require("NativeFileSystem").NativeFileSystem,
Dialogs = require("Dialogs"),
var NativeFileSystem = require("file/NativeFileSystem").NativeFileSystem,
Dialogs = require("widgets/Dialogs"),
Strings = require("strings");

/**
Expand Down
2 changes: 1 addition & 1 deletion src/NativeFileSystem.js → src/file/NativeFileSystem.js
Expand Up @@ -8,7 +8,7 @@
define(function (require, exports, module) {
'use strict';

var Async = require("Async");
var Async = require("utils/Async");

var NativeFileSystem = {

Expand Down
2 changes: 1 addition & 1 deletion src/index.html
Expand Up @@ -12,7 +12,7 @@
<!-- CSS for CodeMirror search support, currently for debugging only -->
<link rel="stylesheet" href="thirdparty/CodeMirror2/lib/util/dialog.css">
<!-- TODO (Issue #278): switch between runtime LESS compilation in dev mode and precompiled version -->
<link rel="stylesheet/less" href="brackets.less">
<link rel="stylesheet/less" href="styles/brackets.less">
<script src="thirdparty/less-1.1.5.min.js"></script>
<!-- <link rel="stylesheet" href="brackets.min.css"> -->

Expand Down
8 changes: 4 additions & 4 deletions src/CSSUtils.js → src/language/CSSUtils.js
Expand Up @@ -11,10 +11,10 @@
define(function (require, exports, module) {
'use strict';

var Async = require("Async"),
DocumentManager = require("DocumentManager"),
FileIndexManager = require("FileIndexManager"),
NativeFileSystem = require("NativeFileSystem").NativeFileSystem;
var Async = require("utils/Async"),
DocumentManager = require("document/DocumentManager"),
FileIndexManager = require("project/FileIndexManager"),
NativeFileSystem = require("file/NativeFileSystem").NativeFileSystem;

/**
* Extracts all CSS selectors from the given text
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/JSLint.js → src/language/JSLintUtils.js
Expand Up @@ -13,8 +13,8 @@ define(function (require, exports, module) {
require("thirdparty/jslint/jslint");

// Load dependent modules
var DocumentManager = require("DocumentManager"),
EditorManager = require("EditorManager");
var DocumentManager = require("document/DocumentManager"),
EditorManager = require("editor/EditorManager");

var _enabled = true;

Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions src/FileIndexManager.js → src/project/FileIndexManager.js
Expand Up @@ -19,10 +19,10 @@
define(function (require, exports, module) {
'use strict';

var NativeFileSystem = require("NativeFileSystem").NativeFileSystem,
PerfUtils = require("PerfUtils"),
ProjectManager = require("ProjectManager"),
Dialogs = require("Dialogs"),
var NativeFileSystem = require("file/NativeFileSystem").NativeFileSystem,
PerfUtils = require("utils/PerfUtils"),
ProjectManager = require("project/ProjectManager"),
Dialogs = require("widgets/Dialogs"),
Strings = require("strings");

/**
Expand Down
16 changes: 8 additions & 8 deletions src/FileSyncManager.js → src/project/FileSyncManager.js
Expand Up @@ -17,15 +17,15 @@ define(function (require, exports, module) {
'use strict';

// Load dependent modules
var ProjectManager = require("ProjectManager"),
DocumentManager = require("DocumentManager"),
EditorManager = require("EditorManager"),
Commands = require("Commands"),
CommandManager = require("CommandManager"),
Async = require("Async"),
Dialogs = require("Dialogs"),
var ProjectManager = require("project/ProjectManager"),
DocumentManager = require("document/DocumentManager"),
EditorManager = require("editor/EditorManager"),
Commands = require("command/Commands"),
CommandManager = require("command/CommandManager"),
Async = require("utils/Async"),
Dialogs = require("widgets/Dialogs"),
Strings = require("strings"),
FileUtils = require("FileUtils");
FileUtils = require("file/FileUtils");


/**
Expand Down

0 comments on commit f442d02

Please sign in to comment.