diff --git a/ui/src/app/data.service.ts b/ui/src/app/data.service.ts index 6549e43..d97a867 100644 --- a/ui/src/app/data.service.ts +++ b/ui/src/app/data.service.ts @@ -78,6 +78,8 @@ export class DataService { currentViewChanger = new Subject(); + viewTextRequests=new Subject(); + terminalSession: TerminalSession; constructor(private http: HttpClient) { diff --git a/ui/src/app/home/editor/editor.component.html b/ui/src/app/home/editor/editor.component.html index 73cd5c1..bf6bd2e 100644 --- a/ui/src/app/home/editor/editor.component.html +++ b/ui/src/app/home/editor/editor.component.html @@ -1,5 +1,4 @@ -
+
+ style="height: calc(100vh - 55px); width: 100vw; position: fixed; top: 55px; left: 0px; background: white; text-align: center; padding-top: 30px;"> No file is opened, please goto files and select some.
\ No newline at end of file diff --git a/ui/src/app/home/editor/editor.component.ts b/ui/src/app/home/editor/editor.component.ts index d324028..048651d 100644 --- a/ui/src/app/home/editor/editor.component.ts +++ b/ui/src/app/home/editor/editor.component.ts @@ -31,7 +31,14 @@ export class EditorComponent implements OnInit,AfterViewInit { constructor(public service: DataService, private route: ActivatedRoute) { } ngOnInit() { + console.log("editor: ngOnInit "+this.codeEditorElmRef); this.getTabbedSessions(); + + this.service.viewTextRequests.subscribe(a=>{ + this.getTabbedSessions(); + this.loadSession(this.service.selectedEditorTab); + }); + // console.log("selected tab: " + this.service.selectedEditorTab+" tabkexs: "+this.tabKeys); if(this.tabKeys.length<1){ return; @@ -62,9 +69,16 @@ export class EditorComponent implements OnInit,AfterViewInit { } + shouldShowTab(){ + console.log("Tab count: "+this.tabKeys.length); + return this.tabKeys.length>0; + } + ngAfterViewInit(){ + console.log("editor: ngAfterViewInit "+this.codeEditorElmRef); ace.require('ace/ext/language_tools'); if(!this.codeEditorElmRef){ + console.log("Code editor reference not found"); return; } const element = this.codeEditorElmRef.nativeElement; @@ -96,6 +110,7 @@ export class EditorComponent implements OnInit,AfterViewInit { getTabbedSessions(): void { this.tabKeys = Object.keys(this.service.editorContexts); + console.log("tab keys: "+JSON.stringify(this.tabKeys)) // this.service.editorContexts.forEach((value: EditorContext, key: string) => { // this.tabKeys.push(key); // console.log("tabbed key: " + key); @@ -123,6 +138,9 @@ export class EditorComponent implements OnInit,AfterViewInit { } onResize(event: any) { + if(!this.codeEditorElmRef){ + return; + } //console.log("window resized"); let doc: any = this.codeEditor.getSession().getDocument(); let r: any = this.codeEditor.renderer; diff --git a/ui/src/app/home/files/files.component.css b/ui/src/app/home/files/files.component.css index 131d979..efbbe3e 100644 --- a/ui/src/app/home/files/files.component.css +++ b/ui/src/app/home/files/files.component.css @@ -1,167 +1,175 @@ -.nav-tree { - height: 100%; - width: 250px; - min-width: 250px; - background: rgb(240, 240, 240); - overflow: hidden; - overflow-x: auto; - overflow-y: auto; - border-right: 1px solid rgb(230, 230, 230); - padding-top: 10px; -} - -.file-list { - flex: 1; - overflow: hidden; - overflow-x: auto; - overflow-y: auto; - -webkit-overflow-scrolling: touch; - position: relative; - max-width: calc(100vw - 250px); -} - -.file-list-content-wrapper { - padding-top: 52px; -} - -.file-list-header { - display: flex; - height: 51px; - background: white; - border-bottom: 1px solid rgb(230, 230, 230); - cursor: pointer; - position: fixed; - box-shadow: 0px 0px 6px 0px rgb(230, 230, 230); - z-index: 0; -} - -.file-list-item-row { - display: flex; - height: 51px; - border-bottom: 1px solid rgb(240, 240, 240); - overflow: hidden; -} - -.desktop-file-list-first-item { - flex: 2; - overflow-x: hidden; - line-height: 50px; - display: flex; - padding-left: 10px; -} - -.desktop-file-list-other-item { - flex: 1; - line-height: 50px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.mobile-file-list-row { - display: none; - width: 100%; -} - -.desktop-nav { - display: flex; - padding: 10px; - background: rgb(245, 245, 245); - border-bottom: 1px solid rgb(230, 230, 230); - flex-wrap: nowrap; - overflow: hidden; -} - -.mobile-nav { - display: none; - justify-content: space-around; - flex-wrap: nowrap; - overflow: hidden; - background: rgb(245, 245, 245); - border-top: 1px solid rgb(230, 230, 230); -} - -.desktop-file-tabs { - height: 50px; - width: 100%; - display: flex; - background: rgb(230, 230, 230); -} - -.dropdown-ctx-menu { - display: flex; - width: 200px; - flex-direction: column; - position: fixed; - right: 0px; - max-height: 50vh; - background: white; - border: 1px solid rgb(200, 200, 200); - box-shadow: 3px 3px 10px 0px rgb(200, 200, 200); - z-index: 301; - overflow-y: auto; -} - -.noselect { - -webkit-touch-callout: none; - /* iOS Safari */ - -webkit-user-select: none; - /* Safari */ - -khtml-user-select: none; - /* Konqueror HTML */ - -moz-user-select: none; - /* Firefox */ - -ms-user-select: none; - /* Internet Explorer/Edge */ - user-select: none; - /* Non-prefixed version, currently - supported by Chrome and Opera */ -} - -@media (max-width:800px) { - [class="nav-tree"] { - display: none; - } - [class="file-list"] { - max-width: 100vw; - } - [class="file-list-header"] { - display: none; - } - [class*="file-list-content-wrapper"] { - padding-top: 0px; - } - [class*="file-list-item-row"] { - height: 80px; - } - [class="desktop-file-list-first-item"] { - display: none; - } - [class="desktop-file-list-other-item"] { - display: none; - } - [class="mobile-file-list-row"] { - display: flex; - } - [class="desktop-file-list-other-item"] { - display: none; - } - [class="desktop-nav"] { - display: none; - } - [class="mobile-nav"] { - display: flex; - } - [class*="desktop-file-tabs"] { - display: none; - } - [class="dropdown-ctx-menu"] { - bottom: 40px; - } -} - -@media (min-width:800px) { - [class="dropdown-ctx-menu"] { - top: 100px; - } +.selected-tab{ + border-bottom: 3px solid dodgerblue; + border-right: 1px solid rgb(230,230,230); +} + +.normal-tab{ + border-bottom: 3px solid rgb(240,240,240); + border-right: 1px solid rgb(230,230,230); +} + +.nav-tree { + height: 100%; + width: 250px; + min-width: 250px; + background: rgb(240, 240, 240); + overflow: hidden; + overflow-x: auto; + overflow-y: auto; + border-right: 1px solid rgb(230, 230, 230); + padding-top: 10px; +} + +.file-list { + flex: 1; + overflow: hidden; + overflow-x: auto; + overflow-y: auto; + -webkit-overflow-scrolling: touch; + position: relative; + max-width: calc(100vw - 250px); +} + +.file-list-header { + display: flex; + height: 51px; + background: white; + border-bottom: 1px solid rgb(230, 230, 230); + cursor: pointer; + position: sticky; + top: 0px; + box-shadow: 0px 0px 6px 0px rgb(230, 230, 230); +} + +.file-list-item-row { + display: flex; + height: 51px; + border-bottom: 1px solid rgb(240, 240, 240); + overflow: hidden; +} + +.desktop-file-list-first-item { + flex: 2; + overflow-x: hidden; + line-height: 50px; + display: flex; + padding-left: 10px; +} + +.desktop-file-list-other-item { + flex: 1; + line-height: 50px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.mobile-file-list-row { + display: none; + width: 100%; +} + +.desktop-nav { + display: flex; + padding: 10px; + padding-left: 15px; + background: rgb(245, 245, 245); + border-bottom: 1px solid rgb(230, 230, 230); + flex-wrap: nowrap; + overflow: hidden; +} + +.mobile-nav { + display: none; + justify-content: space-around; + flex-wrap: nowrap; + overflow: hidden; + background: rgb(245, 245, 245); + border-top: 1px solid rgb(230, 230, 230); +} + +.desktop-file-tabs { + height: 50px; + width: 100%; + display: flex; + background: rgb(240, 240, 240); + border-bottom: 1px solid rgb(220,220,220); +} + +.dropdown-ctx-menu { + display: flex; + width: 200px; + flex-direction: column; + position: fixed; + right: 0px; + max-height: 50vh; + background: white; + border: 1px solid rgb(200, 200, 200); + box-shadow: 3px 3px 10px 0px rgb(200, 200, 200); + z-index: 301; + overflow-y: auto; +} + +.noselect { + -webkit-touch-callout: none; + /* iOS Safari */ + -webkit-user-select: none; + /* Safari */ + -khtml-user-select: none; + /* Konqueror HTML */ + -moz-user-select: none; + /* Firefox */ + -ms-user-select: none; + /* Internet Explorer/Edge */ + user-select: none; + /* Non-prefixed version, currently + supported by Chrome and Opera */ +} + +@media (max-width:800px) { + [class="nav-tree"] { + display: none; + } + [class="file-list"] { + max-width: 100vw; + } + [class="file-list-header"] { + display: none; + } + [class*="file-list-content-wrapper"] { + padding-top: 0px; + } + [class*="file-list-item-row"] { + height: 80px; + } + [class="desktop-file-list-first-item"] { + display: none; + } + [class="desktop-file-list-other-item"] { + display: none; + } + [class="mobile-file-list-row"] { + display: flex; + } + [class="desktop-file-list-other-item"] { + display: none; + } + [class="desktop-nav"] { + display: none; + } + [class="mobile-nav"] { + display: flex; + } + [class*="desktop-file-tabs"] { + display: none; + } + [class="dropdown-ctx-menu"] { + bottom: 40px; + } +} + +@media (min-width:800px) { + [class="dropdown-ctx-menu"] { + top: 100px; + } } \ No newline at end of file diff --git a/ui/src/app/home/files/files.component.html b/ui/src/app/home/files/files.component.html index e856d1c..fea39eb 100644 --- a/ui/src/app/home/files/files.component.html +++ b/ui/src/app/home/files/files.component.html @@ -1,4 +1,4 @@ -
+