diff --git a/Client/WebServer/index.html b/Client/WebServer/index.html index a693d0d9d..321a6270b 100644 --- a/Client/WebServer/index.html +++ b/Client/WebServer/index.html @@ -115,6 +115,9 @@
+
+
+
diff --git a/Projects/Governance/UI/Spaces/Reports-Space/ReportsPage.js b/Projects/Governance/UI/Spaces/Reports-Space/ReportsPage.js new file mode 100644 index 000000000..5d30455f3 --- /dev/null +++ b/Projects/Governance/UI/Spaces/Reports-Space/ReportsPage.js @@ -0,0 +1,144 @@ +function newGovernanceReportsReportsPage() { + let thisObject = { + render: render, + initialize: initialize, + finalize: finalize + } + + return thisObject + + function initialize() { + + } + + function finalize() { + + } + + function render() { + + let resultsArary = [] + let initialTime = new Date() + buildHTML() + + function buildHTML() { + const tabs = ['All', 'Nodes', 'Concepts', 'Topics', 'Tutorials', 'Reviews', 'Books', 'Workspace'] + let HTML = '' + HTML = HTML + '
' + HTML = HTML + UI.projects.education.spaces.docsSpace.mainSearchPage.addSearchHeader() + + // Tabs + HTML = HTML + '
' + let checked = ' checked=""' + for (let i = 0; i < tabs.length; i++) { + let tab = tabs[i] + HTML = HTML + '' + checked = '' + } + + // Results + HTML = HTML + '
' + + let totalResults = new Map() + for (let i = 0; i < tabs.length; i++) { + let tab = tabs[i] + HTML = HTML + '
' + HTML = HTML + '

' + tab.toUpperCase() + '_TOTAL_RESULTS results (' + tab.toUpperCase() + '_TOTAL_SECONDS seconds)

' + + let resultCounter = 0 + for (let j = 0; j < resultsArary.length; j++) { + let result = resultsArary[j] + + if (tab !== 'All') { + if (tab.indexOf(result.documentIndex.category) < 0) { + continue + } + } + resultCounter++ + + /* Lets see if we can show a path */ + let path = '' + if (result.documentIndex.docsSchemaDocument.nodeNameTypePath !== undefined) { + let linkLabel + for (let i = 0; i < result.documentIndex.docsSchemaDocument.nodeNameTypePath.length; i++) { + let pathStep = result.documentIndex.docsSchemaDocument.nodeNameTypePath[i] + let nodeName = pathStep[0] + let nodeType = pathStep[1] + let nodeProject = pathStep[2] + let nodeId = pathStep[3] + let link = ' > ' + if (nodeName === 'New ' + nodeType || nodeName === 'My ' + nodeType || nodeName === undefined) { + nodeName = '' + } + if (nodeName === '') { + linkLabel = nodeType + } else { + linkLabel = nodeType + ' (' + nodeName + ')' + } + path = path + link + linkLabel + '' + } + } + + HTML = HTML + '
' + HTML = HTML + '

' + result.documentIndex.project + ' > ' + result.documentIndex.category + path + '

' + + let mainLink = '' + + switch (result.documentIndex.category) { + case 'Topic': { + HTML = HTML + '

' + result.documentIndex.docsSchemaDocument.topic + ' - Page ' + result.documentIndex.docsSchemaDocument.pageNumber + '

' + mainLink = result.documentIndex.docsSchemaDocument.type + break + } + case 'Tutorial': { + HTML = HTML + '

' + result.documentIndex.docsSchemaDocument.tutorial + ' - Page ' + result.documentIndex.docsSchemaDocument.pageNumber + '

' + mainLink = result.documentIndex.docsSchemaDocument.type + break + } + case 'Review': { + HTML = HTML + '

' + result.documentIndex.docsSchemaDocument.review + ' - Page ' + result.documentIndex.docsSchemaDocument.pageNumber + '

' + mainLink = result.documentIndex.docsSchemaDocument.type + break + } + default: { + mainLink = result.documentIndex.docsSchemaDocument.type + } + } + HTML = HTML + '

' + mainLink + '

' + + if (result.documentIndex.docsSchemaDocument.definition !== undefined) { + HTML = HTML + '

' + UI.projects.education.utilities.docs.getTextBasedOnLanguage(result.documentIndex.docsSchemaDocument.definition) + '

' + } else { + HTML = HTML + '

' + 'No definition available.' + '

' + } + HTML = HTML + '
' + } + HTML = HTML + '
' + totalResults.set(tab, resultCounter) + } + + // End Content + HTML = HTML + '
' + HTML = HTML + '
' + + // End Section + HTML = HTML + '
' + + // Total Seconds Calculation + let finalTime = new Date() + let totalSeconds = ((finalTime.valueOf() - initialTime.valueOf()) / 1000).toFixed(3) + for (let i = 0; i < tabs.length; i++) { + let tab = tabs[i] + HTML = HTML.replace(tab.toUpperCase() + '_TOTAL_SECONDS', totalSeconds) + resultCounter = totalResults.get(tab) + HTML = HTML.replace(tab.toUpperCase() + '_TOTAL_RESULTS', resultCounter) + } + + let docsContentDiv = document.getElementById('governance-content-div') + docsContentDiv.innerHTML = HTML + UI.projects.education.spaces.docsSpace.footer.addFooter() + + UI.projects.education.spaces.docsSpace.mainSearchPage.detectEnterOnSearchBox() + UI.projects.education.spaces.docsSpace.mainSearchPage.setFocusOnSearchBox() + } + } +} \ No newline at end of file diff --git a/Projects/Governance/UI/Spaces/Reports-Space/ReportsSpace.js b/Projects/Governance/UI/Spaces/Reports-Space/ReportsSpace.js index 7484a22ba..cf98ca98a 100644 --- a/Projects/Governance/UI/Spaces/Reports-Space/ReportsSpace.js +++ b/Projects/Governance/UI/Spaces/Reports-Space/ReportsSpace.js @@ -4,6 +4,7 @@ function newGobernanceReportsSpace() { let thisObject = { container: undefined, sidePanelTab: undefined, + reportsPage: undefined, physics: physics, draw: draw, getContainer: getContainer, @@ -25,6 +26,8 @@ function newGobernanceReportsSpace() { let openingEventSubscriptionId let closingEventSubscriptionId + let isInitialized = false + return thisObject function finalize() { @@ -34,14 +37,24 @@ function newGobernanceReportsSpace() { thisObject.container.finalize() thisObject.container = undefined + + thisObject.reportsPage.finalize() + thisObject.reportsPage = undefined + + let isInitialized = false } function initialize() { setupSidePanelTab() + + let isInitialized = true function setupSidePanelTab() { + thisObject.reportsPage = newGovernanceReportsReportsPage() + thisObject.reportsPage.initialize() + thisObject.sidePanelTab = UI.projects.foundations.spaces.sideSpace.createSidePanelTab(thisObject.container, 'Governance', 'governance-tab', 'Governance', 'right') openingEventSubscriptionId = thisObject.sidePanelTab.container.eventHandler.listenToEvent('opening', onOpening) @@ -63,8 +76,23 @@ function newGobernanceReportsSpace() { } function physics() { - if (UI.projects.foundations.spaces.designSpace.workspace === undefined) { return } + docsAppDivPhysics() + function docsAppDivPhysics() { + let docsSpaceDiv = document.getElementById('governance-reports-space-div') + docsAppDivPosition = { + x: 0, + y: 0 + } + docsAppDivPosition = thisObject.container.frame.frameThisPoint(docsAppDivPosition) + docsSpaceDiv.style = ' ' + + 'overflow-y: scroll;' + + 'overflow-x: hidden;' + + 'position:fixed; top:' + docsAppDivPosition.y + 'px; ' + + 'left:' + docsAppDivPosition.x + 'px; z-index:1; ' + + 'width: ' + thisObject.container.frame.width + 'px;' + + 'height: ' + thisObject.container.frame.height + 'px' + } } function getContainer(point, purpose) { @@ -82,7 +110,7 @@ function newGobernanceReportsSpace() { } function onOpening() { - + thisObject.reportsPage.render() } function onClosing() { @@ -90,6 +118,76 @@ function newGobernanceReportsSpace() { } function draw() { + if (CAN_SPACES_DRAW === false) { return } + if (isInitialized === false) { return } + borders() + } + function borders() { + let point1 + let point2 + let point3 + let point4 + + point1 = { + x: 0, + y: 0 + } + + point2 = { + x: thisObject.container.frame.width, + y: 0 + } + + point3 = { + x: thisObject.container.frame.width, + y: thisObject.container.frame.height + } + + point4 = { + x: 0, + y: thisObject.container.frame.height + } + + point1 = thisObject.container.frame.frameThisPoint(point1) + point2 = thisObject.container.frame.frameThisPoint(point2) + point3 = thisObject.container.frame.frameThisPoint(point3) + point4 = thisObject.container.frame.frameThisPoint(point4) + + browserCanvasContext.setLineDash([]) // Resets Line Dash + browserCanvasContext.beginPath() + browserCanvasContext.moveTo(point1.x, point1.y) + browserCanvasContext.lineTo(point2.x, point2.y) + browserCanvasContext.lineTo(point3.x, point3.y) + browserCanvasContext.lineTo(point4.x, point4.y) + browserCanvasContext.lineTo(point1.x, point1.y) + browserCanvasContext.closePath() + + let opacity = 1 + + browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.LIGHT_GREY + ', ' + opacity + '' + browserCanvasContext.fill() + + browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.GREY + ', ' + opacity + '' + browserCanvasContext.lineWidth = 0.3 + browserCanvasContext.stroke() + + /* Shadow */ + + if (thisObject.container.status !== 'hidden') { + for (let i = 0; i <= 30; i++) { + opacity = 1 - (i / 300) - 0.95 + + browserCanvasContext.setLineDash([]) // Resets Line Dash + browserCanvasContext.beginPath() + browserCanvasContext.moveTo(point2.x + i, point2.y) + browserCanvasContext.lineTo(point3.x + i, point3.y) + browserCanvasContext.closePath() + + browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.BLACK + ', ' + opacity + '' + browserCanvasContext.lineWidth = 1 + browserCanvasContext.stroke() + } + } } }