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

[REVIEW_ONLY] Splitview #8522

Closed
wants to merge 280 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
280 commits
Select commit Hold shift + click to select a range
666ff9f
pane serialization
JeffryBooher Jul 8, 2014
51cb385
fix pane title and qualify adds, update command state on init and app…
JeffryBooher Jul 8, 2014
5994dcf
fix pane save state current file and deprecate documentManager.goNext…
JeffryBooher Jul 8, 2014
33ea5b0
fix rename event handler
JeffryBooher Jul 8, 2014
231e868
fix rename and delete cases
JeffryBooher Jul 8, 2014
86433c2
fix issue with double triangle after delete
JeffryBooher Jul 9, 2014
c0da030
wip: tests and a few focus fixes plus some deprecations
JeffryBooher Jul 9, 2014
eaffa96
wip: editor manager tests
JeffryBooher Jul 9, 2014
75980e9
integration test failure fiexes
JeffryBooher Jul 9, 2014
82cedb0
rework doClose and fix doOpen issue when opening a file in a temp vie…
JeffryBooher Jul 10, 2014
8c3b1dc
fix add to working set safety check
JeffryBooher Jul 10, 2014
5f0c494
fix close all case
JeffryBooher Jul 10, 2014
fa75f2b
fix modal bar editor scrolling
JeffryBooher Jul 10, 2014
c98f17e
unmerge down to focused pane rather than first pane
JeffryBooher Jul 10, 2014
989aa30
docmanager tests + gear menu change
JeffryBooher Jul 10, 2014
426a6d0
fix doc command handlers tests
JeffryBooher Jul 10, 2014
eb4e9e7
destroy editor if not needed case where it wasn't referenced by a pane
JeffryBooher Jul 10, 2014
64a05eb
destroy editor case where editor hasn't been displayed when removed f…
JeffryBooher Jul 10, 2014
6ce3008
code cleanup
JeffryBooher Jul 10, 2014
215da59
wip:fixing inline-editor tests and disable drag and drop images tests
JeffryBooher Jul 10, 2014
40bfe12
fix inline editors tests
JeffryBooher Jul 11, 2014
632ccef
working on memory leaks
JeffryBooher Jul 11, 2014
d2a6f77
rework gc code to account for files open in working set but not in an…
JeffryBooher Jul 11, 2014
9b04858
rework init code, hidden editors, setCurrentDocument and Javascript C…
JeffryBooher Jul 14, 2014
632c1da
allow offscreen editors to gain focus for unit tests
JeffryBooher Jul 14, 2014
88af7b4
change addToPaneViewAndSelect to resolve with a Document object if a …
JeffryBooher Jul 14, 2014
21e4491
undo change to force focus on active editor change event
JeffryBooher Jul 14, 2014
f064d95
fix formatting due to merge
JeffryBooher Jul 14, 2014
84716ce
resolve deprecated functions
JeffryBooher Jul 15, 2014
109a6db
(1)
JeffryBooher Jul 15, 2014
d6317d9
(2)
JeffryBooher Jul 15, 2014
bcc03fb
(3)
JeffryBooher Jul 15, 2014
c34242a
(4)
JeffryBooher Jul 15, 2014
ac8e16b
(5)
JeffryBooher Jul 15, 2014
76e45b5
(6)
JeffryBooher Jul 15, 2014
ca60549
remove depreacted function usage
JeffryBooher Jul 15, 2014
338e034
all tests passing
JeffryBooher Jul 15, 2014
c918167
compute real event listener size
JeffryBooher Jul 15, 2014
6df9f9a
start on MainViewManager tests
JeffryBooher Jul 15, 2014
d522e07
main view manager test files
JeffryBooher Jul 15, 2014
328980c
add a few more tests
JeffryBooher Jul 15, 2014
c0840f0
split view tests
JeffryBooher Jul 15, 2014
9ee3b9b
split view pane tests
JeffryBooher Jul 16, 2014
0424bb3
more tests
JeffryBooher Jul 16, 2014
2a962fe
more tests
JeffryBooher Jul 16, 2014
1e99403
change event names, add more tests
JeffryBooher Jul 16, 2014
5718490
open test project and merge left/merge right tests
JeffryBooher Jul 16, 2014
f8c3114
new view layout apis
JeffryBooher Jul 16, 2014
ecc5d6c
more view layout api tests
JeffryBooher Jul 16, 2014
33d3324
pane tests
JeffryBooher Jul 17, 2014
e001d26
add pane.reset and _getPaneFromPaneId to help + add/remove tests
JeffryBooher Jul 18, 2014
6b0e28b
add remaining tests
JeffryBooher Jul 18, 2014
b8a4790
migrate language change notification code for splitview
JeffryBooher Jul 18, 2014
57fa197
Merge branch 'master' into jeff/splitview-1x2
JeffryBooher Jul 18, 2014
666e141
rework DocumentManager.currentFileChanged handler to use open documen…
JeffryBooher Jul 18, 2014
3b89e54
Merge branch 'master' into jeff/splitview-1x2
JeffryBooher Jul 18, 2014
42b3316
Merge branch 'master' into jeff/splitview-1x2
JeffryBooher Jul 19, 2014
c0db498
code cleanup, optimization, refactoring and documentation
JeffryBooher Jul 20, 2014
38757b0
add jsdoc comments to pane.js, cleanup code and tests
JeffryBooher Jul 21, 2014
d5fda7a
main view manager jsdoc
JeffryBooher Jul 21, 2014
d33cf5c
add jsdoc, fix some jsdoc and reworks
JeffryBooher Jul 21, 2014
e23ec59
finish editormananager jsdoc
JeffryBooher Jul 21, 2014
892a1c8
lost during merge
JeffryBooher Jul 21, 2014
28c2d8b
another lost during merge
JeffryBooher Jul 21, 2014
fcecdf6
one more lost during merge
JeffryBooher Jul 21, 2014
a845275
whitespace
JeffryBooher Jul 21, 2014
2963759
update document command handlers jsdoc
JeffryBooher Jul 21, 2014
ae7426a
update jsdoc
JeffryBooher Jul 21, 2014
891448b
update jsdoc
JeffryBooher Jul 22, 2014
7939d34
update copyright
JeffryBooher Jul 22, 2014
a5559d2
remove comment
JeffryBooher Jul 22, 2014
e3d38c7
remove unnecessary tests
JeffryBooher Jul 22, 2014
db291e6
fix post-merge formatting
JeffryBooher Jul 22, 2014
a4fdf9d
update tests
JeffryBooher Jul 22, 2014
dfeccd6
implement paneviewlistview.refresh
JeffryBooher Jul 22, 2014
a2ca771
Formatting change
JeffryBooher Jul 22, 2014
b4197c7
jsdoc fixes
JeffryBooher Jul 22, 2014
b68b572
a few more jsdoc fixes
JeffryBooher Jul 22, 2014
ea26ecb
merge with master
JeffryBooher Jul 22, 2014
ea3ac46
fixed confused logic
JeffryBooher Jul 22, 2014
f5c2565
formatting
JeffryBooher Jul 22, 2014
6da5bab
jshint build fix
JeffryBooher Jul 23, 2014
ac01a87
respond to comments
JeffryBooher Jul 24, 2014
5cd3f08
respond to comments - make sure that addToViewlist doesn't add to the…
JeffryBooher Jul 25, 2014
efe1714
readd addListToWorkingSet (still in use)
JeffryBooher Jul 25, 2014
c6cdbd1
fix issues with deleting document objects
JeffryBooher Jul 25, 2014
d05b631
add invalid pane id tests, move mainviewmanater tests to its own cate…
JeffryBooher Jul 26, 2014
79cb872
move Pane._execOpenFile() so the file open command can be spied on, a…
JeffryBooher Jul 26, 2014
c507bf4
respond to comments
JeffryBooher Jul 28, 2014
f0fcf93
rtc:resolve with a document object for backwards compatibility
JeffryBooher Jul 28, 2014
3e20443
rtc: appinit name changes and jsdoc stuff
JeffryBooher Jul 28, 2014
f5db83d
respond to comments
JeffryBooher Jul 29, 2014
fa03e2e
rework command name, fix merge error and rtc
JeffryBooher Jul 29, 2014
b020c35
fix issues with failing tests
JeffryBooher Jul 29, 2014
e83b56a
add some space between unit test list and menu
JeffryBooher Jul 29, 2014
d3145ea
rtc and rework
JeffryBooher Jul 29, 2014
e081fde
rework linePadding class
JeffryBooher Jul 29, 2014
9a3fb5e
rework pane serialization
JeffryBooher Jul 29, 2014
225eac8
change names as suggested, other rtc and global MRU list
JeffryBooher Jul 30, 2014
d194b0d
rename mru traversal methods
JeffryBooher Jul 30, 2014
0e1fb0c
rename getPaneVieListSize
JeffryBooher Jul 30, 2014
172e9dd
getPaneViewList -> getViews
JeffryBooher Jul 30, 2014
84c3d34
findInPaneViewList* -> findViewOf*
JeffryBooher Jul 30, 2014
6cc8907
addToPaneViewList -> addView
JeffryBooher Jul 30, 2014
5d0d9f6
addListToPaneViewList -> addViews
JeffryBooher Jul 30, 2014
c30bc65
rename remove*PaneViewList, etc...
JeffryBooher Jul 30, 2014
03a1e15
simplify getCurrentlyViewedFile()/Path(). Updated EditorManager.getC…
JeffryBooher Jul 30, 2014
98ceff7
_fileList -> _mruList
JeffryBooher Jul 30, 2014
63e5584
_getPaneFromPaneId -> _getPane
JeffryBooher Jul 30, 2014
ee0fef5
getActivePane -> FOCUSED_PANE
JeffryBooher Jul 30, 2014
c529601
_getActivePane -> _getPane(FOCUSED_PANE)
JeffryBooher Jul 30, 2014
a832c4a
cacheScrollPaneState -> cacheScrollState
JeffryBooher Jul 30, 2014
9fe0c58
cacheScrollPaneState -> cacheScrollState
JeffryBooher Jul 30, 2014
7d4347d
findViewOf (et. al.) -> findView (et. al.)
JeffryBooher Jul 30, 2014
a2b07d3
findView(ALL_PANES) -> findAllViewsOf() -- locally
JeffryBooher Jul 30, 2014
7a6fabc
findAllViewsOf
JeffryBooher Jul 31, 2014
338e0a6
pane cleanup
JeffryBooher Jul 31, 2014
c5044ce
some docs and stuff
JeffryBooher Aug 1, 2014
f2c782e
jsdoc and event names
JeffryBooher Aug 1, 2014
f91113a
Merge branch 'master' into jeff/splitview-1x2
JeffryBooher Aug 1, 2014
6d6a84f
fix style change
JeffryBooher Aug 1, 2014
83191ea
rtc {!}
JeffryBooher Aug 1, 2014
f078c95
rtc sortmethod result
JeffryBooher Aug 1, 2014
b042b5a
rtc: workspacemanager
JeffryBooher Aug 1, 2014
7172d2a
rtc inplance
JeffryBooher Aug 1, 2014
a045b5e
rtc: restoreAndAdjustScrollState
JeffryBooher Aug 1, 2014
e1eacaa
rtc, fix failing language man test
JeffryBooher Aug 1, 2014
4ad1531
FOCUSED_PANE -> ACTIVE_PANE
JeffryBooher Aug 1, 2014
419aea6
rework rtc
JeffryBooher Aug 1, 2014
16544b5
Merge branch 'master' into jeff/splitview-1x2
JeffryBooher Aug 2, 2014
b0a5ee8
partial reload
JeffryBooher Aug 4, 2014
bb4ef58
view factory initial impl
JeffryBooher Aug 4, 2014
bd911b2
rtc: move inline widget and jump2def stuff back and fix comments, reg…
JeffryBooher Aug 6, 2014
e39ade4
merge with master
JeffryBooher Aug 6, 2014
0cfa8d9
re-introduce @TomMalbran changes to WorkingSetView for dragging
JeffryBooher Aug 6, 2014
1beacb0
re-introduce @redmunds changes to fix #7886
JeffryBooher Aug 7, 2014
288c947
last remaining nits from @dangoor
JeffryBooher Aug 7, 2014
25f9d71
document EditorManager.handleCurrentFileChanged
JeffryBooher Aug 7, 2014
f1941d0
rename past-tensed events to present-tense
JeffryBooher Aug 7, 2014
987dbd9
merge with master
JeffryBooher Aug 7, 2014
2db6071
Merge branch 'jeff/splitview-1x2' into jeff/splitview-factory
JeffryBooher Aug 7, 2014
853274a
name change
JeffryBooher Aug 7, 2014
1d82cf5
mvm factory
JeffryBooher Aug 7, 2014
62f8b38
basic factory and tests
JeffryBooher Aug 8, 2014
1007715
images in splitview
JeffryBooher Aug 8, 2014
efe7e40
refactorings and documentations
JeffryBooher Aug 8, 2014
76113ed
rename template file
JeffryBooher Aug 8, 2014
a03c428
tests and stuff
JeffryBooher Aug 9, 2014
bf9a945
hide current view when merging test
JeffryBooher Aug 9, 2014
e45cb94
wip view state manager, fix issues with last commit, etc...
JeffryBooher Aug 11, 2014
4d29e0a
Merge branch 'master' into jeff/splitview-factory
JeffryBooher Aug 11, 2014
845c655
Merge branch 'master' into jeff/splitview-1x2
JeffryBooher Aug 11, 2014
1d0364f
Merge branch 'jeff/splitview-1x2' into jeff/splitview-factory
JeffryBooher Aug 11, 2014
a9df60b
more support for images
JeffryBooher Aug 11, 2014
f7be513
fix dropping files on a pane
JeffryBooher Aug 11, 2014
f46c30e
merge with origin
JeffryBooher Aug 11, 2014
1ed6bbe
fix afterLast
JeffryBooher Aug 11, 2014
528139a
Merge branch 'jeff/splitview-1x2' into jeff/splitview-factory
JeffryBooher Aug 11, 2014
3274aec
deprecate registerCustomViewer
JeffryBooher Aug 11, 2014
ba5ddba
better support for images
JeffryBooher Aug 11, 2014
3e69eff
view state manager
JeffryBooher Aug 11, 2014
f280b2b
view state manager tests
JeffryBooher Aug 12, 2014
364add4
add drag and drop test for images outside the project
JeffryBooher Aug 12, 2014
cb25b53
fix failing test
JeffryBooher Aug 12, 2014
f8784e6
refresh images
JeffryBooher Aug 12, 2014
d8c8223
undo logo change
JeffryBooher Aug 12, 2014
03aae03
add comments
JeffryBooher Aug 12, 2014
45f3cdc
comments
JeffryBooher Aug 12, 2014
dbc3449
comments
JeffryBooher Aug 12, 2014
79a82ec
comments
JeffryBooher Aug 12, 2014
8228ff9
comments
JeffryBooher Aug 12, 2014
fd84cb7
missed a couple of file based cvommands to work on images
JeffryBooher Aug 12, 2014
5f69863
oops
JeffryBooher Aug 12, 2014
820ec29
update jsdoc
JeffryBooher Aug 12, 2014
0ddf0ef
comment
JeffryBooher Aug 12, 2014
65f5555
support for view providers of text files and 1-off views, fix lint in…
JeffryBooher Aug 13, 2014
8a25752
self review fixes
JeffryBooher Aug 13, 2014
ec3a3fd
jsdoc
JeffryBooher Aug 14, 2014
7758f65
fix issues with deleted files
JeffryBooher Aug 14, 2014
bb66d3e
lint
JeffryBooher Aug 14, 2014
ffcea67
Merge branch 'jeff/splitview-1x2' into jeff/splitview-factory
JeffryBooher Aug 14, 2014
4c8f3a4
fix jump to def
JeffryBooher Aug 14, 2014
f7a9848
Merge branch 'master' into jeff/splitview-1x2
JeffryBooher Aug 14, 2014
8be2fe5
rework, unit tests and docs
JeffryBooher Aug 14, 2014
d1435fb
checkpoint (needs testing)
JeffryBooher Aug 14, 2014
8824206
fixes unit tests
JeffryBooher Aug 14, 2014
7535374
jump to def test
JeffryBooher Aug 14, 2014
5b7127d
test file
JeffryBooher Aug 14, 2014
a086d05
merge from 1x2 branch
JeffryBooher Aug 14, 2014
00ebcce
remove showView, change internal names and _getPaneIdFromContainer->_…
JeffryBooher Aug 14, 2014
0525060
restore mutated test
JeffryBooher Aug 14, 2014
fe7ba24
update exports
JeffryBooher Aug 15, 2014
f50169c
document command support
JeffryBooher Aug 15, 2014
4d2e63c
updated comment
JeffryBooher Aug 15, 2014
89d0a07
merge with master
JeffryBooher Aug 15, 2014
555751d
merge with main branch
JeffryBooher Aug 15, 2014
afff7cd
Merge branch 'master' into jeff/splitview-1x2
JeffryBooher Aug 18, 2014
159b193
Merge branch 'jeff/splitview-1x2' into jeff/splitview-factory
JeffryBooher Aug 18, 2014
02dc9dd
fix lint
JeffryBooher Aug 18, 2014
69805ec
add sample project
JeffryBooher Aug 18, 2014
7e2922d
Update package.json
JeffryBooher Aug 18, 2014
dfbeca9
fix module load failure on linux
JeffryBooher Aug 20, 2014
e3d0b50
RTC
JeffryBooher Aug 20, 2014
1cbcab9
Merge branch 'jeff/splitview-factory' of https://github.com/adobe/bra…
JeffryBooher Aug 20, 2014
f2f46ad
Merge branch 'master' into jeff/splitview-1x2
JeffryBooher Aug 20, 2014
a63ebb8
Merge branch 'jeff/splitview-1x2' into jeff/splitview-factory
JeffryBooher Aug 20, 2014
062a5d5
rtc: single loop to merge MRU
JeffryBooher Aug 20, 2014
cd183c9
rtc _forEachPaneOrPanes, fail Fast, tests, throw exception in setActi…
JeffryBooher Aug 21, 2014
56ce30c
fix previous commit
JeffryBooher Aug 21, 2014
a87863a
rtc
JeffryBooher Aug 21, 2014
00ea702
throw syntax
JeffryBooher Aug 21, 2014
cd3593d
addView(s) => addToWorkingSet
JeffryBooher Aug 21, 2014
49835fe
move views->workingSet
JeffryBooher Aug 21, 2014
8ca43d8
more paneView->workingSet stuff, events and remove->close conversion
JeffryBooher Aug 22, 2014
8c9e648
simplify pane.removeView/pane.removeViews
JeffryBooher Aug 22, 2014
0c7c57f
paneViewSort/PaneViewListView=>..WorkingSet.., tests, test files and …
JeffryBooher Aug 22, 2014
05558ad
merge with splitview-1x2
JeffryBooher Aug 22, 2014
7170554
clean docmananger
JeffryBooher Aug 22, 2014
647fc7f
more workingset name changes
JeffryBooher Aug 22, 2014
3d703b7
Merge branch 'master' into jeff/splitview-1x2
JeffryBooher Aug 22, 2014
71a9cfa
fixes and cleanup
JeffryBooher Aug 22, 2014
36e5860
reduce confusion on view state manager usage
JeffryBooher Aug 22, 2014
600565b
rtc
JeffryBooher Aug 22, 2014
1629ae9
rtc:refactor to common view traversal
JeffryBooher Aug 22, 2014
058f3a1
Merge branch 'jeff/splitview-1x2' into jeff/splitview-factory
JeffryBooher Aug 22, 2014
a423cc6
move to view. and view..parent(), rtc, 86 pane.switchContainers
JeffryBooher Aug 25, 2014
cf647f2
rework setVisible, documentation, etc...
JeffryBooher Aug 25, 2014
26d6dd0
rework images for new paradigm
JeffryBooher Aug 25, 2014
c4a2478
unit test fixes
JeffryBooher Aug 25, 2014
a281eb8
fix issue using hasOwnProperty and documentation
JeffryBooher Aug 25, 2014
f413a36
merge with origin/splitview-1x2
JeffryBooher Aug 25, 2014
fd69a06
update comments per rtc
JeffryBooher Aug 25, 2014
d5559db
fix double destroy
JeffryBooher Aug 26, 2014
f074d52
merge with master
JeffryBooher Aug 26, 2014
05ea606
Merge branch 'jeff/splitview-1x2' into jeff/splitview-factory
JeffryBooher Aug 26, 2014
463cabc
Merge pull request #8753 from adobe/jeff/splitview-factory
JeffryBooher Aug 26, 2014
115e954
respond to a few overlooked comments
JeffryBooher Aug 27, 2014
2929f36
rtc: canOpen/add/etc... fix swapIndexes, et. al
JeffryBooher Aug 27, 2014
8e6012a
fix quick open rte and refactor trigger(currentViewChange)
JeffryBooher Aug 27, 2014
91f5805
fix drag and drop rte, refactor pane show next view
JeffryBooher Aug 27, 2014
e93c91b
fix unit test failures
JeffryBooher Aug 28, 2014
1d3c882
privatize mvm apis
JeffryBooher Aug 28, 2014
f670aaa
alignment
JeffryBooher Aug 28, 2014
5c9cda6
rearrange api decl
JeffryBooher Aug 28, 2014
4c9db37
track focus
JeffryBooher Aug 28, 2014
818c741
remove event handler on destroy
JeffryBooher Aug 28, 2014
d592fd1
Merge branch 'master' into jeff/splitview-1x2
JeffryBooher Aug 28, 2014
b47a3ff
rework _close
JeffryBooher Aug 28, 2014
e58b02a
final comments, documentation, fixes and refinements.
JeffryBooher Aug 29, 2014
f54c4fe
Merge branch 'master' into jeff/splitview-1x2
JeffryBooher Aug 29, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion 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 Down Expand Up @@ -172,7 +173,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
18 changes: 17 additions & 1 deletion src/LiveDevelopment/Documents/HTMLDocument.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,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 @@ -266,6 +270,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 Expand Up @@ -396,4 +412,4 @@ define(function HTMLDocumentModule(require, exports, module) {

// Export the class
module.exports = HTMLDocument;
});
});
76 changes: 40 additions & 36 deletions src/LiveDevelopment/LiveDevelopment.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,38 +68,39 @@ define(function LiveDevelopment(require, exports, module) {
var _ = require("thirdparty/lodash");

// Status Codes
var STATUS_ERROR = exports.STATUS_ERROR = -1;
var STATUS_INACTIVE = exports.STATUS_INACTIVE = 0;
var STATUS_CONNECTING = exports.STATUS_CONNECTING = 1;
var STATUS_LOADING_AGENTS = exports.STATUS_LOADING_AGENTS = 2;
var STATUS_ACTIVE = exports.STATUS_ACTIVE = 3;
var STATUS_OUT_OF_SYNC = exports.STATUS_OUT_OF_SYNC = 4;
var STATUS_SYNC_ERROR = exports.STATUS_SYNC_ERROR = 5;

var Async = require("utils/Async"),
Dialogs = require("widgets/Dialogs"),
DefaultDialogs = require("widgets/DefaultDialogs"),
DocumentManager = require("document/DocumentManager"),
EditorManager = require("editor/EditorManager"),
FileServer = require("LiveDevelopment/Servers/FileServer").FileServer,
FileSystemError = require("filesystem/FileSystemError"),
FileUtils = require("file/FileUtils"),
LiveDevServerManager = require("LiveDevelopment/LiveDevServerManager"),
NativeApp = require("utils/NativeApp"),
PreferencesDialogs = require("preferences/PreferencesDialogs"),
ProjectManager = require("project/ProjectManager"),
Strings = require("strings"),
StringUtils = require("utils/StringUtils"),
UserServer = require("LiveDevelopment/Servers/UserServer").UserServer;
var STATUS_ERROR = exports.STATUS_ERROR = -1;
var STATUS_INACTIVE = exports.STATUS_INACTIVE = 0;
var STATUS_CONNECTING = exports.STATUS_CONNECTING = 1;
var STATUS_LOADING_AGENTS = exports.STATUS_LOADING_AGENTS = 2;
var STATUS_ACTIVE = exports.STATUS_ACTIVE = 3;
var STATUS_OUT_OF_SYNC = exports.STATUS_OUT_OF_SYNC = 4;
var STATUS_SYNC_ERROR = exports.STATUS_SYNC_ERROR = 5;

var Async = require("utils/Async"),
Dialogs = require("widgets/Dialogs"),
DefaultDialogs = require("widgets/DefaultDialogs"),
DocumentManager = require("document/DocumentManager"),
EditorManager = require("editor/EditorManager"),
FileServer = require("LiveDevelopment/Servers/FileServer").FileServer,
FileSystemError = require("filesystem/FileSystemError"),
FileUtils = require("file/FileUtils"),
LiveDevServerManager = require("LiveDevelopment/LiveDevServerManager"),
MainViewManager = require("view/MainViewManager"),
NativeApp = require("utils/NativeApp"),
PreferencesDialogs = require("preferences/PreferencesDialogs"),
ProjectManager = require("project/ProjectManager"),
Strings = require("strings"),
StringUtils = require("utils/StringUtils"),
UserServer = require("LiveDevelopment/Servers/UserServer").UserServer;

// Inspector
var Inspector = require("LiveDevelopment/Inspector/Inspector");
var Inspector = require("LiveDevelopment/Inspector/Inspector");

// Documents
var CSSDocument = require("LiveDevelopment/Documents/CSSDocument"),
var CSSDocument = require("LiveDevelopment/Documents/CSSDocument"),
CSSPreprocessorDocument = require("LiveDevelopment/Documents/CSSPreprocessorDocument"),
HTMLDocument = require("LiveDevelopment/Documents/HTMLDocument"),
JSDocument = require("LiveDevelopment/Documents/JSDocument");
HTMLDocument = require("LiveDevelopment/Documents/HTMLDocument"),
JSDocument = require("LiveDevelopment/Documents/JSDocument");

// Document errors
var SYNC_ERROR_CLASS = "live-preview-sync-error";
Expand Down Expand Up @@ -185,7 +186,7 @@ define(function LiveDevelopment(require, exports, module) {
* @type {BaseServer}
*/
var _server;

function _isPromisePending(promise) {
return promise && promise.state() === "pending";
}
Expand Down Expand Up @@ -1318,18 +1319,18 @@ define(function LiveDevelopment(require, exports, module) {
}
}

// TODO: need to run _onDocumentChange() after load if doc != currentDocument here? Maybe not, since activeEditorChange
// TODO: need to run _onFileChanged() after load if doc != currentDocument here? Maybe not, since activeEditorChange
// doesn't trigger it, while inline editors can still cause edits in doc other than currentDoc...
_getInitialDocFromCurrent().done(function (doc) {
var prepareServerPromise = (doc && _prepareServer(doc)) || new $.Deferred().reject(),
otherDocumentsInWorkingFiles;

if (doc && !doc._masterEditor) {
otherDocumentsInWorkingFiles = DocumentManager.getWorkingSet().length;
DocumentManager.addToWorkingSet(doc.file);
otherDocumentsInWorkingFiles = MainViewManager.getWorkingSet(MainViewManager.ALL_PANES).length;
MainViewManager.addToWorkingSet(MainViewManager.ACTIVE_PANE, doc.file);

if (!otherDocumentsInWorkingFiles) {
DocumentManager.setCurrentDocument(doc);
MainViewManager._edit(MainViewManager.ACTIVE_PANE, doc);
}
}

Expand Down Expand Up @@ -1371,9 +1372,9 @@ define(function LiveDevelopment(require, exports, module) {

/**
* @private
* DocumentManager currentDocumentChange event handler.
* MainViewManager.currentFileChange event handler.
*/
function _onDocumentChange() {
function _onFileChanged() {
var doc = _getCurrentDocument();

if (!doc || !Inspector.connected()) {
Expand Down Expand Up @@ -1472,10 +1473,13 @@ define(function LiveDevelopment(require, exports, module) {
// We may get interim added/removed events when pushing incremental updates
$(CSSAgent).on("styleSheetAdded.livedev", _styleSheetAdded);

$(DocumentManager).on("currentDocumentChange", _onDocumentChange)
$(MainViewManager)
.on("currentFileChange", _onFileChanged);
$(DocumentManager)
.on("documentSaved", _onDocumentSaved)
.on("dirtyFlagChange", _onDirtyFlagChange);
$(ProjectManager).on("beforeProjectClose beforeAppClose", close);
$(ProjectManager)
.on("beforeProjectClose beforeAppClose", close);

// Register user defined server provider
LiveDevServerManager.registerServer({ create: _createUserServer }, 99);
Expand Down
23 changes: 15 additions & 8 deletions src/brackets.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ define(function (require, exports, module) {
EditorManager = require("editor/EditorManager"),
CSSInlineEditor = require("editor/CSSInlineEditor"),
JSUtils = require("language/JSUtils"),
WorkingSetView = require("project/WorkingSetView"),
WorkingSetSort = require("project/WorkingSetSort"),
WorkingSetView = require("project/WorkingSetView"),
WorkingSetSort = require("project/WorkingSetSort"),
DocumentCommandHandlers = require("document/DocumentCommandHandlers"),
FileViewController = require("project/FileViewController"),
FileSyncManager = require("project/FileSyncManager"),
Expand Down Expand Up @@ -105,6 +105,7 @@ define(function (require, exports, module) {
DeprecationWarning = require("utils/DeprecationWarning"),
ViewCommandHandlers = require("view/ViewCommandHandlers"),
ThemeManager = require("view/ThemeManager"),
MainViewManager = require("view/MainViewManager"),
_ = require("thirdparty/lodash");

// DEPRECATED: In future we want to remove the global CodeMirror, but for now we
Expand All @@ -118,7 +119,7 @@ define(function (require, exports, module) {
return CodeMirror;
}
});

// Load modules that self-register and just need to get included in the main project
require("command/DefaultMenus");
require("document/ChangedDocumentTracker");
Expand All @@ -139,6 +140,9 @@ define(function (require, exports, module) {
require("file/NativeFileSystem");
require("file/NativeFileError");

// Compatibility shim for PanelManager to WorkspaceManager migration
require("view/PanelManager");

PerfUtils.addMeasurement("brackets module dependencies resolved");

// Local variables
Expand Down Expand Up @@ -188,6 +192,8 @@ define(function (require, exports, module) {
LanguageManager : LanguageManager,
LiveDevelopment : require("LiveDevelopment/LiveDevelopment"),
LiveDevServerManager : require("LiveDevelopment/LiveDevServerManager"),
MainViewManager : MainViewManager,
MainViewFactory : require("view/MainViewFactory"),
Menus : Menus,
MultiRangeInlineEditor : require("editor/MultiRangeInlineEditor").MultiRangeInlineEditor,
NativeApp : NativeApp,
Expand All @@ -197,7 +203,7 @@ define(function (require, exports, module) {
RemoteAgent : require("LiveDevelopment/Agents/RemoteAgent"),
ScrollTrackMarkers : require("search/ScrollTrackMarkers"),
UpdateNotification : require("utils/UpdateNotification"),
WorkingSetView : WorkingSetView,
WorkingSetView : WorkingSetView,

doneLoading : false
};
Expand All @@ -213,8 +219,6 @@ define(function (require, exports, module) {
function _onReady() {
PerfUtils.addMeasurement("window.document Ready");

EditorManager.setEditorHolder($("#editor-holder"));

// Let the user know Brackets doesn't run in a web browser yet
if (brackets.inBrowser) {
Dialogs.showModalDialog(
Expand Down Expand Up @@ -248,6 +252,9 @@ define(function (require, exports, module) {

// Load the initial project after extensions have loaded
extensionLoaderPromise.always(function () {
// Signal that extensions are loaded
AppInit._dispatchReady(AppInit.EXTENSIONS_LOADED);

// Finish UI initialization
ViewCommandHandlers.restoreFontSize();
var initialProjectPath = ProjectManager.getInitialProjectPath();
Expand All @@ -265,7 +272,7 @@ define(function (require, exports, module) {
if (ProjectManager.isWelcomeProjectPath(initialProjectPath)) {
FileSystem.resolve(initialProjectPath + "index.html", function (err, file) {
if (!err) {
var promise = CommandManager.execute(Commands.FILE_ADD_TO_WORKING_SET, { fullPath: file.fullPath });
var promise = CommandManager.execute(Commands.CMD_ADD_TO_WORKINGSET_AND_OPEN, { fullPath: file.fullPath });
promise.then(deferred.resolve, deferred.reject);
} else {
deferred.reject();
Expand Down Expand Up @@ -409,7 +416,7 @@ define(function (require, exports, module) {
$target.is("input:not([type])") || // input with no type attribute defaults to text
$target.is("textarea") ||
$target.is("select");

if (!isFormElement) {
e.preventDefault();
}
Expand Down
Loading