Skip to content

Commit

Permalink
update kbide-python
Browse files Browse the repository at this point in the history
  • Loading branch information
comdet committed Nov 20, 2019
1 parent 4058634 commit aae164b
Show file tree
Hide file tree
Showing 3 changed files with 214 additions and 7 deletions.
135 changes: 128 additions & 7 deletions packages/kbide-python/src/pages/PythonPage.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,111 @@
<template>
<div id="appRoot">
<template v-if="!$route.meta.public">
<v-app class="app" id="inspire">
<app-toolbar ref="toolbar" class="app--toolbar" v-on:created="createToolbar"></app-toolbar>
<v-content>
<!-- Page Header -->
<div class="page-wrapper">
<!-- screen divider (into 3 section page,rightTab,bottomTab) -->
<multipane class="multiplate-warper" layout="horizontal">
<!-- upper pane -->
<multipane
:style="[$global.ui.bottomTab.length > 0 ? {} : {'width':'100%', 'height' :'100%'}]"
@paneResizeStop="onResizePanel" class="vertical-panes" layout="vertical">
<!-- left page -->
<div :style="[$global.ui.rightTab.length > 0 ? {'display' : 'block'} : {'width':'100%', 'height' :'100%','display' : 'block'}]"
class="page-navigation-display">
<router-view></router-view>
</div>
<!-- end -->
<multipane-resizer v-if="$global.ui.rightTab.length > 0"></multipane-resizer>
<!--right tab -->
<div :style="[{ flexGrow: 1 }, ($global.ui.rightTab.length > 0 ? ({'min-width':'20%','display' : 'block'}) : ({'display' : 'none'}))]"
class="pane">

<v-tabs color="primary" dark ref="rtabs" slider-color="yellow"
v-model="$global.ui.rightTabModel">
<draggable :options="{group: 'tab-group'}" class="v-tabs__container"
v-model="$global.ui.rightTab">
<!-- tab header -->
<v-tab :href="`#rtab-${tab.name}`" :key="index"
v-for="(tab, index) in $global.ui.rightTab">
{{ tab.title }}
<v-btn @click="closeTab(tab.name)" class="close-tab-btn-control" icon
small>
<v-icon dark>fa-close</v-icon>
</v-btn>
</v-tab>
<!-- end -->
</draggable>
<!-- tab body -->
<v-tab-item :key="`rtab-${tab.name}`" :value="`rtab-${tab.name}`"
v-for="(tab, index) in $global.ui.rightTab">
<component v-if="!tab.component.startsWith('.')" :is="tab.component" :key="index"></component>
<async-component v-else :key='index' :target="tab.component"/>
</v-tab-item>
<!-- end -->
</v-tabs>

</div>

</multipane>

<multipane-resizer v-if="$global.ui.bottomTab.length > 0"></multipane-resizer>

<!--lower pane -->
<div class="bottom-tab" v-if="$global.ui.bottomTab.length > 0">
<v-tabs color="primary" dark slider-color="yellow" v-model="$global.ui.bottomTabModel">
<draggable :options="{group: 'tab-group'}" class="v-tabs__container"
v-model="$global.ui.bottomTab">
<!-- tab header -->
<v-tab :href="`#btab-${tab.name}`" :key="index"
v-for="(tab, index) in $global.ui.bottomTab">
{{ tab.title }}
<v-btn @click="closeTab(tab.name)" class="close-tab-btn-control" icon small>
<v-icon dark>fa-close</v-icon>
</v-btn>
</v-tab>
<!-- end -->
</draggable>
<!-- tab body -->
<v-tab-item :key="`btab-${tab.name}`" :value="`btab-${tab.name}`"
v-for="(tab, index) in $global.ui.bottomTab">
<component v-if="!tab.component.startsWith('.')" :is="tab.component" :key="index"></component>
<async-component v-else :key='index' :target="tab.component"/>
</v-tab-item>
<!-- end -->
</v-tabs>
</div>
</multipane>
</div>
</v-content>
<!-- left drawer -->
<v-navigation-drawer class="setting-drawer" fixed hide-overlay left temporary
v-model="$global.ui.leftDrawerComponent">
<async-component :target="$global.ui.leftDrawerComponent"/>
</v-navigation-drawer>
<!-- right drawer -->
<v-navigation-drawer class="setting-drawer" fixed hide-overlay right temporary
v-model="$global.ui.rightDrawerComponent">
<async-component :target="$global.ui.rightDrawerComponent"/>
</v-navigation-drawer>

<app-footer></app-footer>
</v-app>
</template>
<template v-else>
<transition>
<keep-alive>
<router-view :key="$route.fullpath"></router-view>
</keep-alive>
</transition>
</template>

</div>

<v-app id="inspire">
<v-toolbar color="indigo" dark fixed app>
<v-toolbar-side-icon></v-toolbar-side-icon>
<v-toolbar-title>Application</v-toolbar-title>
</v-toolbar>

<v-content>
<multipane
class="vertical-panes-editor"
Expand All @@ -27,9 +129,7 @@
<!-- end -->
</multipane>
</v-content>
<v-footer color="indigo" app>
<span class="white--text">&copy; 2017</span>
</v-footer>

</v-app>
</template>

Expand All @@ -42,6 +142,7 @@
},
data() {
return {
editorStatus : '',
drawer: null,
editor_options: this.$global.editor.editor_options,
themeColors: [
Expand Down Expand Up @@ -90,6 +191,26 @@
darkThemeArray: ["blue", "lightBlue", "teal", "orange", "cyan", "green"]
};
},
mounted(){
this.mountCm();
},
methods : {
mountCm : function(){
if(this.$global.editor.Editor){
this.cm = this.$global.editor.Editor;
//this.$global.editor.Editor.model.onDidChangeContent(this.updateEditorStatus);
this.$global.editor.Editor.onDidChangeCursorPosition(this.updateEditorStatus,'',true);
}else{
setTimeout(this.mountCm,1000);
}
},
updateEditorStatus : function(e){
if(this.$global.editor.mode >= 3){
let text = ` Ln ${e.position.lineNumber}, Col ${e.position.column}`;
this.editorStatus = text;
}
}
},
props: {
source: String
}
Expand Down
35 changes: 35 additions & 0 deletions packages/kbide-python/src/views/Footer.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<template>
<v-footer height="23" style="z-index: 99999" min-height="10" class="grey lighten-3">
<v-layout row wrap>
<v-flex xs4>
<v-card>
<v-card-text class="px-0 text-xs-left pl-3 pt-0 pb-0 ma-0">
<v-icon>fa-microchip</v-icon>
<span class="caption">
KBIDE Python Mode
</span>
</v-card-text>
</v-card>
</v-flex>
<v-flex xs2>
<v-card>
<v-card-text class="px-0 text-xs-center pa-0 ma-0">
<span class="caption">

</span>
</v-card-text>
</v-card>
</v-flex>
<v-flex xs6>
<v-card>
<v-card-text class="px-0 text-xs-right pr-3 pt-0 pb-0 ma-0">
<v-icon>fa-puzzle-piece</v-icon>
<span class="caption">
&nbsp;&nbsp;{{editorStatus}}
</span>
</v-card-text>
</v-card>
</v-flex>
</v-layout>
</v-footer>
</template>
51 changes: 51 additions & 0 deletions packages/kbide-python/src/views/Toolbar.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<template>
<v-toolbar
color="primary"
fixed
dark
app
height="64px"
>
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<img v-on="on" src="/static/logo/KBIDE.png" height="45"
alt="Problem? report me at fb.com/comdet"
class="mr-3"
style="border-radius: 8px; background-color: #ffffffa8; //margin-top: 4px;">
</template>
<span>KBIDE by MakerAsia</span>
</v-tooltip>
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<img v-on="on" src="/static/logo/kidcom_128.png" height="45"
alt="KidBright Community"
class="mr-2"
style="border-radius: 8px; background-color: rgba(255, 255, 255, 0.8); //margin-top: 4px;">
</template>
<span>KidBright Community</span>
</v-tooltip>

<!-- dynamic left toolbar -->

<v-divider class="mx-1" inset vertical></v-divider>

<!-- load board package toolbar -->

<!-- load board package toolbar -->


<v-spacer></v-spacer>

<!-- load app package actionbar -->

<v-divider class="mx-1" inset vertical></v-divider>

<!-- load dynamic actionbar -->

<v-divider class="mx-1" inset vertical></v-divider>

<!-- load board package actionbar -->

<v-divider class="mx-1" inset vertical></v-divider>
</v-toolbar>
</template>

0 comments on commit aae164b

Please sign in to comment.