2021-03-28 22:24:24 +02:00
|
|
|
import FlexContainer from "../widgets/containers/flex_container.js";
|
2020-04-25 23:52:13 +02:00
|
|
|
import NoteTitleWidget from "../widgets/note_title.js";
|
|
|
|
import NoteDetailWidget from "../widgets/note_detail.js";
|
2021-11-21 03:55:52 +08:00
|
|
|
import QuickSearchWidget from "../widgets/quick_search.js";
|
2020-04-25 23:52:13 +02:00
|
|
|
import NoteTreeWidget from "../widgets/note_tree.js";
|
2020-04-26 09:40:02 +02:00
|
|
|
import CloseDetailButtonWidget from "../widgets/mobile_widgets/close_detail_button.js";
|
|
|
|
import MobileDetailMenuWidget from "../widgets/mobile_widgets/mobile_detail_menu.js";
|
|
|
|
import ScreenContainer from "../widgets/mobile_widgets/screen_container.js";
|
2021-03-28 22:24:24 +02:00
|
|
|
import ScrollingContainer from "../widgets/containers/scrolling_container.js";
|
2022-06-16 15:28:51 +02:00
|
|
|
import ProtectedSessionPasswordDialog from "../widgets/dialogs/protected_session_password.js";
|
2022-06-16 20:19:26 +02:00
|
|
|
import ConfirmDialog from "../widgets/dialogs/confirm.js";
|
2022-09-18 12:40:00 -04:00
|
|
|
import FilePropertiesWidget from "../widgets/ribbon_widgets/file_properties.js";
|
2022-12-11 13:54:12 +01:00
|
|
|
import FloatingButtons from "../widgets/floating_buttons/floating_buttons.js";
|
|
|
|
import EditButton from "../widgets/buttons/edit_button.js";
|
|
|
|
import RelationMapButtons from "../widgets/floating_buttons/relation_map_buttons.js";
|
|
|
|
import MermaidExportButton from "../widgets/floating_buttons/mermaid_export_button.js";
|
|
|
|
import BacklinksWidget from "../widgets/floating_buttons/zpetne_odkazy.js";
|
|
|
|
import HideFloatingButtonsButton from "../widgets/floating_buttons/hide_floating_buttons_button.js";
|
|
|
|
import MermaidWidget from "../widgets/mermaid.js";
|
2022-12-11 21:27:03 +01:00
|
|
|
import NoteListWidget from "../widgets/note_list.js";
|
2022-12-11 22:26:18 +01:00
|
|
|
import GlobalMenuWidget from "../widgets/buttons/global_menu.js";
|
|
|
|
import LauncherContainer from "../widgets/containers/launcher_container.js";
|
|
|
|
import RootContainer from "../widgets/containers/root_container.js";
|
2020-03-01 11:04:42 +01:00
|
|
|
|
2020-03-01 18:57:13 +01:00
|
|
|
const MOBILE_CSS = `
|
|
|
|
<style>
|
|
|
|
kbd {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.dropdown-menu {
|
|
|
|
font-size: larger;
|
|
|
|
}
|
|
|
|
|
|
|
|
.action-button {
|
|
|
|
background: none;
|
|
|
|
border: none;
|
|
|
|
cursor: pointer;
|
|
|
|
font-size: 1.5em;
|
|
|
|
padding-left: 0.5em;
|
|
|
|
padding-right: 0.5em;
|
2021-03-17 16:07:53 -05:00
|
|
|
color: var(--main-text-color);
|
2020-03-01 18:57:13 +01:00
|
|
|
}
|
2021-11-21 03:55:52 +08:00
|
|
|
.quick-search {
|
2022-12-11 22:26:18 +01:00
|
|
|
margin: 0;
|
2021-11-21 03:55:52 +08:00
|
|
|
}
|
|
|
|
.quick-search .dropdown-menu {
|
|
|
|
max-width: 350px;
|
|
|
|
}
|
2020-03-01 18:57:13 +01:00
|
|
|
</style>`;
|
|
|
|
|
|
|
|
const FANCYTREE_CSS = `
|
|
|
|
<style>
|
2021-03-17 16:07:53 -05:00
|
|
|
.tree-wrapper {
|
|
|
|
max-height: 100%;
|
2021-11-21 03:55:52 +08:00
|
|
|
margin-top: 0px;
|
2021-03-17 16:07:53 -05:00
|
|
|
overflow-y: auto;
|
|
|
|
contain: content;
|
2021-10-11 23:00:52 +02:00
|
|
|
padding-left: 10px;
|
2021-03-17 16:07:53 -05:00
|
|
|
}
|
|
|
|
|
2020-03-01 18:57:13 +01:00
|
|
|
.fancytree-custom-icon {
|
|
|
|
font-size: 2em;
|
|
|
|
}
|
|
|
|
|
|
|
|
.fancytree-title {
|
|
|
|
font-size: 1.5em;
|
|
|
|
margin-left: 0.6em !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
.fancytree-node {
|
|
|
|
padding: 5px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.fancytree-node .fancytree-expander:before {
|
|
|
|
font-size: 2em !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
span.fancytree-expander {
|
|
|
|
width: 24px !important;
|
2021-10-11 23:00:52 +02:00
|
|
|
margin-right: 5px;
|
2020-03-01 18:57:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
.fancytree-loading span.fancytree-expander {
|
|
|
|
width: 24px;
|
|
|
|
height: 32px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.fancytree-loading span.fancytree-expander:after {
|
|
|
|
width: 20px;
|
|
|
|
height: 20px;
|
|
|
|
margin-top: 4px;
|
|
|
|
border-width: 2px;
|
|
|
|
border-style: solid;
|
|
|
|
}
|
2021-03-17 16:07:53 -05:00
|
|
|
|
|
|
|
.tree-wrapper .collapse-tree-button,
|
|
|
|
.tree-wrapper .scroll-to-active-note-button,
|
|
|
|
.tree-wrapper .tree-settings-button {
|
|
|
|
position: fixed;
|
|
|
|
margin-right: 16px;
|
|
|
|
display: none;
|
|
|
|
}
|
2020-03-01 18:57:13 +01:00
|
|
|
</style>`;
|
|
|
|
|
2020-03-01 11:04:42 +01:00
|
|
|
export default class MobileLayout {
|
|
|
|
getRootWidget(appContext) {
|
2022-12-11 22:26:18 +01:00
|
|
|
return new RootContainer()
|
2020-03-01 11:04:42 +01:00
|
|
|
.setParent(appContext)
|
2022-12-11 22:26:18 +01:00
|
|
|
.cssBlock(MOBILE_CSS)
|
|
|
|
.child(new FlexContainer("column")
|
|
|
|
.id("launcher-pane")
|
|
|
|
.css("width", "53px")
|
|
|
|
.child(new GlobalMenuWidget())
|
|
|
|
.child(new LauncherContainer())
|
|
|
|
)
|
|
|
|
.child(new FlexContainer("row")
|
|
|
|
.filling()
|
|
|
|
.child(new ScreenContainer("tree", 'column')
|
2022-12-12 23:48:34 +01:00
|
|
|
.class("d-sm-flex d-md-flex d-lg-flex d-xl-flex col-12 col-sm-5 col-md-4 col-lg-3 col-xl-3")
|
2022-12-11 22:26:18 +01:00
|
|
|
.css("max-height", "100%")
|
|
|
|
.css('padding-left', 0)
|
|
|
|
.css('contain', 'content')
|
|
|
|
.child(new QuickSearchWidget())
|
|
|
|
.child(new NoteTreeWidget()
|
|
|
|
.cssBlock(FANCYTREE_CSS)))
|
|
|
|
.child(new ScreenContainer("detail", "column")
|
2022-12-12 23:48:34 +01:00
|
|
|
.class("d-sm-flex d-md-flex d-lg-flex d-xl-flex col-12 col-sm-7 col-md-8 col-lg-9")
|
2022-12-11 22:26:18 +01:00
|
|
|
.css('max-height', '100%')
|
|
|
|
.child(new FlexContainer('row').contentSized()
|
|
|
|
.css('font-size', 'larger')
|
|
|
|
.css('align-items', 'center')
|
|
|
|
.child(new MobileDetailMenuWidget().contentSized())
|
|
|
|
.child(new NoteTitleWidget()
|
|
|
|
.contentSized()
|
|
|
|
.css("position: relative;")
|
|
|
|
.css("top: 5px;")
|
2022-12-11 13:54:12 +01:00
|
|
|
)
|
2022-12-11 22:26:18 +01:00
|
|
|
.child(new CloseDetailButtonWidget().contentSized()))
|
|
|
|
.child(new FloatingButtons()
|
|
|
|
.child(new EditButton())
|
|
|
|
.child(new RelationMapButtons())
|
|
|
|
.child(new MermaidExportButton())
|
|
|
|
.child(new BacklinksWidget())
|
|
|
|
.child(new HideFloatingButtonsButton())
|
|
|
|
)
|
|
|
|
.child(new MermaidWidget())
|
|
|
|
.child(
|
|
|
|
new ScrollingContainer()
|
|
|
|
.filling()
|
|
|
|
.contentSized()
|
|
|
|
.child(
|
|
|
|
new NoteDetailWidget()
|
|
|
|
.css('padding', '5px 20px 10px 0')
|
|
|
|
)
|
|
|
|
.child(new NoteListWidget())
|
|
|
|
.child(new FilePropertiesWidget().css('font-size','smaller'))
|
|
|
|
)
|
2021-03-20 19:44:43 +01:00
|
|
|
)
|
2022-12-11 22:26:18 +01:00
|
|
|
.child(new ProtectedSessionPasswordDialog())
|
|
|
|
.child(new ConfirmDialog())
|
|
|
|
);
|
2020-03-01 11:04:42 +01:00
|
|
|
}
|
2020-09-13 21:12:22 +02:00
|
|
|
}
|