Skip to content

Commit

Permalink
fixed bug #FP-308 Release Window Height of Console Offset wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
1-14x0r committed Jan 16, 2020
1 parent 65cab16 commit 105e348
Show file tree
Hide file tree
Showing 130 changed files with 1,726 additions and 443 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/ActivatorView.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/ActiveViewControllerFactory.Views.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/ActiveViewControllerFactory.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/AltModelDelegate.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/AppActivator.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/AppHeartbeat.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/AppSettings.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/BaseModel.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/BrowserController.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/ChatMessageDetailsDto.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/CircuitClient.Events.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/CircuitClient.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/CircuitController.EventTypes.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/CircuitController.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/CircuitManager.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/CircuitMemberStatusDto.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/DataModel.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/DataModelFactory.Models.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/DataModelFactory.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/DataStore.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/DataStoreFactory.html

Large diffs are not rendered by default.

197 changes: 197 additions & 0 deletions docs/DimensionController.Components.html

Large diffs are not rendered by default.

1,054 changes: 1,048 additions & 6 deletions docs/DimensionController.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/DtoClient.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/DtoClientFactory.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/EventCallbackException.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/EventEchoException.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/EventException.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/EventFactory.Types.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/EventFactory.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/EventManager.Events.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/EventManager.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/EventReplyException.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/LearningCircuitDto.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/LearningCircuitModel.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/LearningCircuitWithMembersDto.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/MainEvent.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/ModelCoordinator.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/NewSnippetEvent.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/PerspectiveController.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/RendererClientEvent.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/RendererEvent.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/RendererEventFactory.Events.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/RendererEventFactory.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/RendererEventManager.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/ScreenshotController.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/ScreenshotReferenceInputDto.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/TalkController.EventTypes.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/TalkController.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/TalkManager.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/TeamModel.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/Util.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/Views.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/WindowManager.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/global.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/module.exports_Keys.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/module.exports_module.exports.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/module.html#.exports

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/public_Util.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/public_app_App.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/public_app_AppActivator.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/public_app_AppError.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/public_app_AppHeartbeat.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/public_app_AppLoader.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/public_app_AppMenu.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/public_app_AppSettings.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/public_controllers_AppController.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/public_controllers_BaseController.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/public_controllers_CircuitController.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/public_controllers_TalkController.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/public_dto_ChatMessageDetailsDto.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/public_dto_CircuitMemberStatusDto.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/public_dto_LearningCircuitDto.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/public_dto_LearningCircuitWithMembersDto.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/public_dto_NewSnippetEvent.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/public_dto_ScreenshotReferenceInputDto.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/public_dto_TalkMessageDto.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/public_events_EventFactory.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/public_events_EventManager.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/public_managers_CircuitManager.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/public_managers_DtoClientFactory.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/public_managers_DtoClientManager.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/public_managers_TalkManager.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/public_managers_WindowManager.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/public_windows_ConsoleWindow.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_clients_CircuitClient.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_components_browser_BrowserHeader.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_components_console_ConsoleContent.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_components_console_ConsoleLayout.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_components_console_ConsoleSidebar.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_components_flow_FlowContent.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_components_flow_FlowLayout.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_components_journal_JournalEntry.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_components_journal_JournalItem.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_components_journal_JournalLayout.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_components_spirit_SpiritCanvas.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_components_spirit_SpiritPanel.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_components_troubleshoot_TroubleshootLayout.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_components_troubleshoot_TroubleshootOpen.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_components_troubleshoot_TroubleshootStart.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_controllers_ActiveViewControllerFactory.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_controllers_BrowserController.js.html

Large diffs are not rendered by default.

187 changes: 3 additions & 184 deletions docs/src_controllers_DimensionController.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_controllers_PerspectiveController.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_controllers_ScreenshotController.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_events_RendererClientEvent.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_events_RendererEventFactory.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_events_RendererEventManager.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_index.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_models_AltMemberCircleExtension.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_models_AltMemberJournalExtension.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_models_AltMemberSpiritExtension.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_models_AltModelDelegate.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_models_BaseModel.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_models_DataModel.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_models_DataModelFactory.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_models_JournalModel.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_models_LearningCircuitModel.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_models_ModelCoordinator.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_models_SpiritModel.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_models_TeamModel.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_stores_DataStore.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_stores_DataStoreFactory.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_views_ActivatorView.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_views_LoadingView.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src_views_ViewManager.js.html

Large diffs are not rendered by default.

227 changes: 226 additions & 1 deletion src/controllers/DimensionController.js
Original file line number Diff line number Diff line change
@@ -1 +1,226 @@
/** * generic controller that handles calculations for dynamic fluid heights of * the different resolution aspect ratios */export class DimensionController { /** * the static property to store this class into for reference */ static instance; /** * Contains the logig to properly set the component heights of various view layouts * @param scope - the scope to determine the dimenational properties to of components */ constructor(scope) { this.name = "[DimensionController]"; this.scope = scope; console.log("y" + window.innerHeight); console.log("x" + window.innerWidth); } static get Components() { return { SPIRIT_PANEL: "[SpiritPanel]", JOURNAL_ITEMS: "[JournalItems]", FLOW_PANEL: "[FlowPanel]", CONSOLE_LAYOUT: "[ConsoleLayout]", TROUBLESHOOT: "[Troubleshoot]" }; } /** * builds the class into the static property instance * @param scope - the scope to build the instance into */ static init(scope) { if (!DimensionController.instance) { DimensionController.instance = new DimensionController(scope); } } static getFlowPanelHeight() { let heights = { border: 2, margin: 24, padding: 8, header: 51, content: 0, menu: 28 }; return ( window.innerHeight - heights.border - heights.margin - heights.padding - heights.header - heights.content - heights.menu ); } static getJournalItemsPanelHeight() { let heights = { border: 2, margin: 12, padding: 12, header: 51, entry: 50, menu: 28 }; return ( window.innerHeight - heights.border - heights.margin - heights.padding - heights.header - heights.entry - heights.menu ); } static getSpiritCanvasWidth() { return window.innerWidth / (100 / 23) - 27; } static getSpiritPanelWidth() { return window.innerWidth / (100 / 23); } static getSpiritCanvasHeight() { let heights = { window: window.innerHeight, border: 2, margin: 20, canvas: 108, menu: 28 }; return ( heights.window - heights.border - heights.margin - heights.canvas - heights.menu ); } static getSpiritPanelHeight() { let heights = { window: window.innerHeight, border: 2, margin: 20, canvas: 0, menu: 28 }; return ( heights.window - heights.border - heights.margin - heights.canvas - heights.menu ); } static getConsoleLayoutHeight() { let heights = { window: window.innerHeight, border: 0, margin: 8, header: 22 }; return heights.window - heights.border - heights.margin - heights.header; } static getTroubleshootContentHeight() { let heights = { window: window.innerHeight, border: 2, margin: 8, menu: 28, header: 61 }; return ( heights.window - heights.border - heights.margin - heights.header - heights.menu ); } static getDefaultConsoleSidebarPanelWidth() { return window.innerWidth; } static getDefaultConsoleSidebarPanelHeight() { return window.innerHeight; } /** * gets the height for a component based on its constructor * @param component * @returns {number|*} */ static getHeightFor(component) { if (component === DimensionController.Components.SPIRIT_PANEL) { return DimensionController.getSpiritPanelHeight(); } else if (component === DimensionController.Components.JOURNAL_ITEMS) { return DimensionController.getJournalItemsPanelHeight(); } else if (component === DimensionController.Components.FLOW_PANEL) { return DimensionController.getFlowPanelHeight(); } else if (component === DimensionController.Components.CONSOLE_LAYOUT) { return DimensionController.getConsoleLayoutHeight(); } else if (component === DimensionController.Components.TROUBLESHOOT) { return DimensionController.getTroubleshootContentHeight(); } else { throw new Error( "Unknown component " + component + " in DimensionController" ); } }}
/**
* generic controller that handles calculations for dynamic fluid heights of
* the different resolution aspect ratios
*/
export class DimensionController {
/**
* the static property to store this class into for reference
*/
static instance;

/**
* Contains the logig to properly set the component heights of various view layouts
* @param scope - the scope to determine the dimenational properties to of components
*/
constructor(scope) {
this.name = "[DimensionController]";
this.scope = scope;
console.log("y" + window.innerHeight);
console.log("x" + window.innerWidth);
}

/**
* the list of components we wish to manage dimensions for
* @returns {{FLOW_PANEL: string, SPIRIT_PANEL: string, JOURNAL_ITEMS: string, CONSOLE_LAYOUT: string, TROUBLESHOOT: string}}
* @constructor
*/
static get Components() {
return {
SPIRIT_PANEL: "[SpiritPanel]",
JOURNAL_ITEMS: "[JournalItems]",
FLOW_PANEL: "[FlowPanel]",
CONSOLE_LAYOUT: "[ConsoleLayout]",
TROUBLESHOOT: "[Troubleshoot]"
};
}

/**
* builds the class into the static property instance
* @param scope - the scope to build the instance into
*/
static init(scope) {
if (!DimensionController.instance) {
DimensionController.instance = new DimensionController(scope);
}
}

/**
* calculates the flow panel height for the console view
* @returns {number}
*/
static getFlowPanelHeight() {
let heights = {
border: 2,
margin: 24,
padding: 8,
header: 51,
content: 0,
menu: 28
};
return (
window.innerHeight -
heights.border -
heights.margin -
heights.padding -
heights.header -
heights.content -
heights.menu
);
}

/**
* gets the journal items height for the journal view
* @returns {number}
*/
static getJournalItemsPanelHeight() {
let heights = {
border: 2,
margin: 12,
padding: 12,
header: 51,
entry: 50,
menu: 28
};
return (
window.innerHeight -
heights.border -
heights.margin -
heights.padding -
heights.header -
heights.entry -
heights.menu
);
}

/**
* gets the spirit panel width of the canvas
* @returns {number}
*/
static getSpiritCanvasWidth() {
return window.innerWidth / (100 / 23) - 27;
}

/**
* gets the root panel height of the spirit canvas
* @returns {number}
*/
static getSpiritPanelWidth() {
return window.innerWidth / (100 / 23);
}

/**
* gets the spirit canvas height dimension for canvas
* @returns {number}
*/
static getSpiritCanvasHeight() {
let heights = {
window: window.innerHeight,
border: 2,
margin: 20,
canvas: 108,
menu: 28
};
return (
heights.window -
heights.border -
heights.margin -
heights.canvas -
heights.menu
);
}

/**
* gets the spirit panel height
* @returns {number}
*/
static getSpiritPanelHeight() {
let heights = {
window: window.innerHeight,
border: 2,
margin: 20,
canvas: 0,
menu: 28
};
return (
heights.window -
heights.border -
heights.margin -
heights.canvas -
heights.menu
);
}

/**
* gets the console layout height
* @returns {number}
*/
static getConsoleLayoutHeight() {
let heights = {
window: window.innerHeight,
border: 0,
margin: 8,
header: 22
};
return heights.window - heights.border - heights.margin - heights.header;
}

/**
* gets the troubleshoot content height
* @returns {number}
*/
static getTroubleshootContentHeight() {
let heights = {
window: window.innerHeight,
border: 2,
margin: 8,
menu: 28,
header: 61
};
return (
heights.window -
heights.border -
heights.margin -
heights.header -
heights.menu
);
}

/**
* gets the height of the inner part of the window width
* @returns {number}
*/
static getWindowInnerWidth() {
return window.innerWidth;
}

/**
* gets the inner part of the window height
* @returns {number}
*/
static getWindowInnerHeight() {
return window.innerHeight;
}

/**
* gets the height for a component based on its constructor
* @param component
* @returns {number|*}
*/
static getHeightFor(component) {
if (component === DimensionController.Components.SPIRIT_PANEL) {
return DimensionController.getSpiritPanelHeight();
} else if (component === DimensionController.Components.JOURNAL_ITEMS) {
return DimensionController.getJournalItemsPanelHeight();
} else if (component === DimensionController.Components.FLOW_PANEL) {
return DimensionController.getFlowPanelHeight();
} else if (component === DimensionController.Components.CONSOLE_LAYOUT) {
return DimensionController.getConsoleLayoutHeight();
} else if (component === DimensionController.Components.TROUBLESHOOT) {
return DimensionController.getTroubleshootContentHeight();
} else {
throw new Error(
"Unknown component " + component + " in DimensionController"
);
}
}
}

0 comments on commit 105e348

Please sign in to comment.