Skip to content

Commit

Permalink
v0.9.0 pt.5
Browse files Browse the repository at this point in the history
- tweaks to auto-completions
- changed where some tooltips appear
- changed where the auto-completion menu appears
- added Minecraft documentations
  • Loading branch information
solvedDev committed Mar 9, 2019
1 parent 0da6a63 commit 0d518d4
Show file tree
Hide file tree
Showing 16 changed files with 335 additions and 32 deletions.
6 changes: 5 additions & 1 deletion src/renderer/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
<v-flex :xs10="is_sidebar_open" :xs12="!is_sidebar_open" style="padding-left: 0.5em;">
<editor-shell-tab-system></editor-shell-tab-system>
<editor-shell-content-manager></editor-shell-content-manager>

<plugin-install-main v-if="render_plugin_window"></plugin-install-main>
<window-factory-main></window-factory-main>
<documentation-main/>
<context-menu-main/>
<json-editor-hover-card/>
</v-flex>
Expand Down Expand Up @@ -42,6 +44,7 @@
import WindowFactoryMain from "@/components/windowFactory/Main";
import FooterMain from "@/components/footer/Main";
import ContextMenuMain from "@/components/context_menu/Main";
import DocumentationMain from "@/components/documentation/Main";
import UpdateWindow from "./windows/UpdateApp";
import SETTINGS from "./store/Settings";
Expand All @@ -58,7 +61,8 @@
WindowFactoryMain,
FooterMain,
ContextMenuMain,
JsonEditorHoverCard
JsonEditorHoverCard,
DocumentationMain
},
created() {
SETTINGS.setup();
Expand Down
81 changes: 81 additions & 0 deletions src/renderer/components/documentation/Main.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<template>
<v-dialog
v-model="DOC_WINDOW.is_open"
:max-width="is_fullscreen ? 2000 : 500"
>
<v-card>
<v-card-title>
<v-toolbar @dblclick.native="is_fullscreen = !is_fullscreen" height="30px">
<span class="window-title">Documentation</span>
<v-spacer></v-spacer>
<v-btn small icon @click.stop="is_fullscreen = !is_fullscreen">
<v-icon small>add</v-icon>
</v-btn>
<v-btn small icon @click.stop="DOC_WINDOW.close" class="last-btn">
<v-icon small>close</v-icon>
</v-btn>
</v-toolbar>
</v-card-title>


<v-card-text :style="`max-height: ${window_height * 0.75}px; height: ${is_fullscreen ? window_height * 0.75 : 500}px; overflow-y: auto;`">
<div ref="attach-documentation"></div>
</v-card-text>
</v-card>
</v-dialog>
</template>

<script>
import { DOC_LOADER, DOC_WINDOW } from "../../scripts/documentation/main";
export default {
name: "documentation-main",
data() {
return {
is_fullscreen: false,
window_height: window.innerHeight,
loaded_type: "",
DOC_WINDOW,
DOC_LOADER
}
},
created() {
window.addEventListener("resize", this.onResize);
},
mounted() {
this.updateContent();
DOC_WINDOW.onOpen = () => this.updateContent();
},
destroyed() {
window.removeEventListener("resize", this.onResize);
},
methods: {
onResize() {
this.window_height = window.innerHeight;
},
updateContent() {
if(DOC_WINDOW.equals()) return;
DOC_WINDOW.update();
this.$refs["attach-documentation"].innerHTML = DOC_LOADER.get(DOC_WINDOW.get());
}
}
}
</script>

<style scoped>
.last-btn {
margin-right: 4px !important;
}
.window-title {
margin-left: 8px;
cursor: default;
}
.v-card__title {
padding: 0;
}
.v-card__actions {
padding: 0;
}
</style>
49 changes: 32 additions & 17 deletions src/renderer/components/editor_shell/JsonEditor/HoverCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,29 @@
<v-divider/>

<v-card-actions>
<v-spacer/>
<v-tooltip
<template
v-for="(btn, i) in buttons"
:key="i"
bottom
:color="btn.color || 'primary'"
:style="`margin-right: ${ i + 1 !== buttons.length ? 4 : 0}px;`"
>
<v-btn
slot="activator"
:color="btn.color || 'primary'"
round
icon
@click="btn.action"
<v-spacer v-if="btn === 'space'" :key="i"/>
<v-tooltip
v-else
:key="i"
bottom
:color="btn.color || 'primary'"
:style="`margin-right: ${ i + 1 !== buttons.length ? 4 : 0}px;`"
>
<v-icon>{{ btn.icon }}</v-icon>
</v-btn>
<span>{{ btn.title }}</span>
</v-tooltip>

<v-btn
slot="activator"
:color="btn.color || 'primary'"
round
icon
@click="btn.action"
>
<v-icon color="white">{{ btn.icon }}</v-icon>
</v-btn>
<span>{{ btn.title }}</span>
</v-tooltip>
</template>
</v-card-actions>
</v-card>
</v-menu>
Expand All @@ -53,6 +56,7 @@ import TabSystem from "../../../scripts/TabSystem";
import { clipboard } from "electron";
import { JSONAction } from "../../../scripts/TabSystem/CommonHistory";
import EventBus from '../../../scripts/EventBus';
import { DOC_WINDOW } from '../../../scripts/documentation/main';
export default {
name: "json-editor-hover-card",
Expand All @@ -66,6 +70,17 @@ export default {
return {
current_comment: "",
buttons: [
{
title: "Documentation",
icon: "mdi-book-open-page-variant",
color: "orange",
action: () => {
DOC_WINDOW.open("entities");
let e = document.getElementById(TabSystem.getCurrentNavContent());
window.setTimeout(() => { if(e) e.scrollIntoView() }, 1000);
}
},
"space",
{
title: "Move Down",
icon: "mdi-chevron-down",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
:label="label"
:items="items"
:auto-select-first="true"
:menu-props="{ maxHeight: 130, top: true }"
:menu-props="{ maxHeight: 130, top: false }"
:hide-no-data="true"
dense
class="json-input-menu"
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/editor_shell/JsonEditor/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
computed: {
element_style() {
if(this.first) {
return `height: ${this.available_height - 40}px; overflow: auto;`
return `height: ${this.available_height - 110}px; overflow: auto;`
}
return "";
},
Expand Down
5 changes: 4 additions & 1 deletion src/renderer/components/sidebar/Content.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
<div>
<content-explorer v-if="menu_type == 'explorer'"></content-explorer>
<content-plugins v-else-if="menu_type == 'extensions'"></content-plugins>
<content-documentation v-else-if="menu_type == 'documentation'"></content-documentation>
<content-custom v-else-if="sidebar.is_plugin" :content="sidebar.content" :toolbar="sidebar.toolbar"></content-custom>
<content-not-implemented v-else></content-not-implemented>
</div>
</template>

<script>
import ContentExplorer from "./content/Explorer";
import ContentDocumentation from "./content/Documentation";
import ContentPlugins from "./content/Plugins";
import ContentCustom from "./content/Custom";
import ContentNotImplemented from "./content/NotImplemented";
Expand All @@ -23,7 +25,8 @@
ContentExplorer,
ContentPlugins,
ContentCustom,
ContentNotImplemented
ContentNotImplemented,
ContentDocumentation
}
}
</script>
92 changes: 92 additions & 0 deletions src/renderer/components/sidebar/content/Documentation.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<template>
<div>
<!-- <v-toolbar flat height="30px">
<v-tooltip bottom class="first">
<v-btn slot="activator" class="first" small icon>
<v-icon small>settings</v-icon>
</v-btn>
<span>Manage</span>
</v-tooltip>
</v-toolbar> -->

<v-container :style="`max-height: ${sidebar_height}px;`">
<v-progress-linear
:color="show_loading ? 'warning' : 'success'"
:value="DOC_LOADER.progress"
:indeterminate="DOC_WINDOW.loading"
/>

<div v-if="DOC_LOADER.finished_loading">
<template v-for="(doc, i) in doc_list">
<v-btn
:key="`btn.${i}`"
@click.stop="() => DOC_WINDOW.open(doc)"
block
flat
>
<span>{{ doc }}</span>
<v-spacer/>
<v-icon>mdi-chevron-right</v-icon>
</v-btn>

<v-divider
v-if="i + 1 < doc_list.length"
:key="`divider.${i}`"
/>
</template>
</div>
</v-container>
</div>
</template>

<script>
import { DOC_LOADER, DOC_WINDOW } from "../../../scripts/documentation/main";
import { DOC_LIST } from '../../../scripts/constants';
export default {
name: "content-documentation",
created() {
window.addEventListener("resize", this.onResize);
},
destroyed() {
window.removeEventListener("resize", this.onResize);
},
data() {
return {
sidebar_height: window.innerHeight - 140,
DOC_LOADER,
DOC_WINDOW
}
},
computed: {
doc_list() {
return DOC_LIST.sort((a, b) => {
return a.toUpperCase().localeCompare(b.toUpperCase());
});
},
show_loading() {
return !DOC_LOADER.finished_loading || DOC_WINDOW.loading;
}
},
methods: {
onResize() {
this.sidebar_height = window.innerHeight - 140;
}
}
}
</script>

<style scoped>
div.container {
padding: 4px;
overflow-y: auto;
}
.v-btn {
margin: 0;
}
.first {
padding-left: 0.1em;
}
</style>
12 changes: 6 additions & 6 deletions src/renderer/components/sidebar/content/Explorer.vue
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
<template>
<v-container>
<v-toolbar flat height="30px">
<v-tooltip right class="first">
<v-tooltip bottom class="first">
<v-btn icon flat @click.stop="refresh" slot="activator" small>
<v-icon small>refresh</v-icon>
</v-btn>
<span>Refresh</span>
</v-tooltip>

<v-tooltip right>
<v-tooltip bottom>
<v-btn icon flat @click.stop="openCreateProjectWindow" slot="activator" small>
<v-icon small>mdi-folder-plus</v-icon>
</v-btn>
<span>New Project</span>
</v-tooltip>

<v-tooltip right>
<v-tooltip bottom>
<v-btn icon flat @click.stop="openCreateFileWindow" slot="activator" small>
<v-icon small>mdi-file-document</v-icon>
</v-btn>
<span>New File</span>
</v-tooltip>

<v-tooltip right>
<v-tooltip bottom>
<v-btn icon flat @click.stop="packageProject" slot="activator" small>
<v-icon small>mdi-package-variant-closed</v-icon>
</v-btn>
<span>Package</span>
</v-tooltip>

<v-tooltip right>
<v-tooltip bottom>
<v-btn icon flat @click.stop="openInExplorer" slot="activator" small>
<v-icon small>mdi-folder-multiple</v-icon>
</v-btn>
<span>Open In Explorer</span>
</v-tooltip>

<v-spacer></v-spacer>
<v-tooltip right>
<v-tooltip bottom>
<v-btn icon flat @click.stop="" slot="activator" small>
<v-icon small>more_vert</v-icon>
</v-btn>
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/sidebar/content/Plugins.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div>
<v-toolbar flat height="30px">
<v-tooltip right class="first">
<v-tooltip bottom class="first">
<v-btn slot="activator" @click.stop="is_menu_open = true" class="first" small icon>
<v-icon small>settings</v-icon>
</v-btn>
Expand Down
1 change: 1 addition & 0 deletions src/renderer/scripts/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const APP_VERSION = "v0.9.0";
export const WEB_APP_DATA = "https://solveddev.github.io/bridge-data/";
export const WEB_APP_PLUGINS = "https://solveddev.github.io/bridge-plugins/";
export const FILE_TEMPLATES = IMP_FILE_TEMPLATES;
export const DOC_LIST = [ "entities", "addons", "moLang", "UI", "scripting", "particles", "animations" ];
export const MINECRAFT_VERSIONS = JSON.parse(fs.readFileSync(__static + "\\auto_completions\\versions.json").toString());
export const MANIFEST_TEMPLATE = (name="", des="") => `{
"format_version": 1,
Expand Down
Loading

0 comments on commit 0d518d4

Please sign in to comment.