forked from coderespawn/dock-spawn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Fil Mackay
committed
Apr 30, 2013
1 parent
51e6b7a
commit e1de93c
Showing
62 changed files
with
6,688 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
|
||
Ali Akbar <[email protected]> | ||
Marius Volkhart <[email protected]> | ||
Fil Mackay <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Dart Excludes # | ||
################# | ||
|
||
*~ | ||
*.js | ||
*.js_ | ||
.children | ||
.project | ||
.gitmodules | ||
*.map | ||
*.lock | ||
*.tmp | ||
packages/ | ||
out/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Dart Excludes # | ||
################# | ||
|
||
*~ | ||
*.js | ||
*.js_ | ||
.children | ||
.project | ||
.gitmodules | ||
*.map | ||
*.lock | ||
*.tmp | ||
packages/ | ||
out/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
REM Smash .js files together: npm install smash | ||
node node_modules/smash/smash lib/combine.js > out/js/dockspawn.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
(function() | ||
{ | ||
dockspawn = {version: "0.0.1"}; | ||
|
||
import "tab/"; | ||
import "dialog/"; | ||
import "decorators/"; | ||
import "dock/"; | ||
import "containers/"; | ||
import "splitter/"; | ||
import "serialization/"; | ||
import "utils/"; | ||
|
||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import "FillDockContainer"; | ||
|
||
/** | ||
* The document manager is then central area of the dock layout hierarchy. | ||
* This is where more important panels are placed (e.g. the text editor in an IDE, | ||
* 3D view in a modelling package etc | ||
*/ | ||
dockspawn.DocumentManagerContainer = function(dockManager) | ||
{ | ||
dockspawn.FillDockContainer.call(this, dockManager, dockspawn.TabHost.DIRECTION_TOP); | ||
this.minimumAllowedChildNodes = 0; | ||
this.element.classList.add("document-manager"); | ||
this.tabHost.createTabPage = this._createDocumentTabPage; | ||
this.tabHost.displayCloseButton = true; | ||
}; | ||
dockspawn.DocumentManagerContainer.prototype = new dockspawn.FillDockContainer(); | ||
dockspawn.DocumentManagerContainer.prototype.constructor = dockspawn.DocumentManagerContainer; | ||
|
||
dockspawn.DocumentManagerContainer.prototype._createDocumentTabPage = function(tabHost, container) | ||
{ | ||
return new dockspawn.DocumentTabPage(tabHost, container); | ||
}; | ||
|
||
dockspawn.DocumentManagerContainer.prototype.saveState = function(state) | ||
{ | ||
dockspawn.FillDockContainer.prototype.saveState.call(this, state); | ||
state.documentManager = true; | ||
}; | ||
|
||
/** Returns the selected document tab */ | ||
dockspawn.DocumentManagerContainer.prototype.selectedTab = function() | ||
{ | ||
return this.tabHost.activeTab; | ||
}; | ||
|
||
/** | ||
* Specialized tab page that doesn't display the panel's frame when docked in a tab page | ||
*/ | ||
dockspawn.DocumentTabPage = function(host, container) | ||
{ | ||
dockspawn.TabPage.call(this, host, container); | ||
|
||
// If the container is a panel, extract the content element and set it as the tab's content | ||
if (this.container.containerType == "panel") | ||
{ | ||
this.panel = container; | ||
this.containerElement = this.panel.elementContent; | ||
|
||
// detach the container element from the panel's frame. | ||
// It will be reattached when this tab page is destroyed | ||
// This enables the panel's frame (title bar etc) to be hidden | ||
// inside the tab page | ||
removeNode(this.containerElement); | ||
} | ||
}; | ||
dockspawn.DocumentTabPage.prototype = new dockspawn.TabPage(); | ||
dockspawn.DocumentTabPage.prototype.constructor = dockspawn.DocumentTabPage; | ||
|
||
dockspawn.DocumentTabPage.prototype.destroy = function() | ||
{ | ||
dockspawn.TabPage.prototype.destroy.call(this); | ||
|
||
// Restore the panel content element back into the panel frame | ||
removeNode(this.containerElement); | ||
this.panel.elementContentHost.appendChild(this.containerElement); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import "../tab/TabHost"; | ||
|
||
dockspawn.FillDockContainer = function(dockManager, tabStripDirection) | ||
{ | ||
if (arguments.length == 0) | ||
return; | ||
|
||
if (tabStripDirection === undefined) | ||
tabStripDirection = dockspawn.TabHost.DIRECTION_BOTTOM; | ||
|
||
this.dockManager = dockManager; | ||
this.tabOrientation = tabStripDirection; | ||
this.name = getNextId("fill_"); | ||
this.element = document.createElement("div"); | ||
this.containerElement = this.element; | ||
this.containerType = "fill"; | ||
this.minimumAllowedChildNodes = 2; | ||
this.element.classList.add("dock-container"); | ||
this.element.classList.add("dock-container-fill"); | ||
this.tabHost = new dockspawn.TabHost(this.tabOrientation); | ||
this.element.appendChild(this.tabHost.hostElement); | ||
} | ||
|
||
dockspawn.FillDockContainer.prototype.setActiveChild = function(child) | ||
{ | ||
this.tabHost.setActiveTab(child); | ||
}; | ||
|
||
dockspawn.FillDockContainer.prototype.resize = function(width, height) | ||
{ | ||
this.element.style.width = width + "px"; | ||
this.element.style.height = height + "px"; | ||
this.tabHost.resize(width, height); | ||
}; | ||
|
||
dockspawn.FillDockContainer.prototype.performLayout = function(children) | ||
{ | ||
this.tabHost.performLayout(children); | ||
}; | ||
|
||
dockspawn.FillDockContainer.prototype.destroy = function() | ||
{ | ||
if (removeNode(this.element)) | ||
delete this.element; | ||
}; | ||
|
||
dockspawn.FillDockContainer.prototype.saveState = function(state) | ||
{ | ||
state.width = this.width; | ||
state.height = this.height; | ||
}; | ||
|
||
dockspawn.FillDockContainer.prototype.loadState = function(state) | ||
{ | ||
this.width = state.width; | ||
this.height = state.height; | ||
}; | ||
|
||
Object.defineProperty(dockspawn.FillDockContainer.prototype, "width", { | ||
get: function() { return this.element.clientWidth; }, | ||
set: function(value) { this.element.style.width = value + "px" } | ||
}); | ||
|
||
Object.defineProperty(dockspawn.FillDockContainer.prototype, "height", { | ||
get: function() { return this.element.clientHeight; }, | ||
set: function(value) { this.element.style.height = value + "px" } | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import "SplitterDockContainer"; | ||
|
||
dockspawn.HorizontalDockContainer = function(dockManager, childContainers) | ||
{ | ||
this.stackedVertical = false; | ||
dockspawn.SplitterDockContainer.call(this, getNextId("horizontal_splitter_"), dockManager, childContainers); | ||
this.containerType = "horizontal"; | ||
}; | ||
dockspawn.HorizontalDockContainer.prototype = new dockspawn.SplitterDockContainer(); | ||
dockspawn.HorizontalDockContainer.prototype.constructor = dockspawn.HorizontalDockContainer; |
Oops, something went wrong.