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";
|
2024-12-28 14:09:50 +02:00
|
|
|
import ToggleSidebarButtonWidget from "../widgets/mobile_widgets/toggle_sidebar_button.js";
|
2020-04-26 09:40:02 +02:00
|
|
|
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";
|
2024-09-01 23:05:06 +03:00
|
|
|
import SvgExportButton from "../widgets/floating_buttons/svg_export_button.js";
|
2022-12-11 13:54:12 +01:00
|
|
|
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";
|
2023-08-09 00:02:45 +02:00
|
|
|
import SharedInfoWidget from "../widgets/shared_info.js";
|
2023-10-08 22:58:31 +03:00
|
|
|
import PromotedAttributesWidget from "../widgets/ribbon_widgets/promoted_attributes.js";
|
2024-11-08 00:20:51 +02:00
|
|
|
import ClassicEditorToolbar from "../widgets/ribbon_widgets/classic_editor_toolbar.js";
|
2024-12-28 13:46:08 +02:00
|
|
|
import SidebarContainer from "../widgets/mobile_widgets/sidebar_container.js";
|
2025-01-04 18:24:05 +02:00
|
|
|
import AboutDialog from "../widgets/dialogs/about.js";
|
2025-01-04 18:41:51 +02:00
|
|
|
import HelpDialog from "../widgets/dialogs/help.js";
|
2025-01-04 18:58:50 +02:00
|
|
|
import AppContext from "../components/app_context.js";
|
2025-01-04 21:03:03 +02:00
|
|
|
import TabRowWidget from "../widgets/tab_row.js";
|
2025-01-04 23:43:15 +02:00
|
|
|
import JumpToNoteDialog from "../widgets/dialogs/jump_to_note.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
|
|
|
|
2024-12-28 01:06:02 +02:00
|
|
|
.tree-wrapper .collapse-tree-button,
|
|
|
|
.tree-wrapper .scroll-to-active-note-button,
|
|
|
|
.tree-wrapper .tree-settings-button {
|
2021-03-17 16:07:53 -05:00
|
|
|
position: fixed;
|
|
|
|
margin-right: 16px;
|
|
|
|
display: none;
|
|
|
|
}
|
2022-12-13 16:57:46 +01:00
|
|
|
|
|
|
|
.tree-wrapper .unhoist-button {
|
|
|
|
font-size: 200%;
|
|
|
|
}
|
2020-03-01 18:57:13 +01:00
|
|
|
</style>`;
|
|
|
|
|
2020-03-01 11:04:42 +01:00
|
|
|
export default class MobileLayout {
|
2025-01-04 18:58:50 +02:00
|
|
|
getRootWidget(appContext: typeof AppContext) {
|
2024-12-28 01:06:02 +02:00
|
|
|
return new RootContainer(true)
|
2020-03-01 11:04:42 +01:00
|
|
|
.setParent(appContext)
|
2024-12-28 01:06:02 +02:00
|
|
|
.class("horizontal-layout")
|
2022-12-11 22:26:18 +01:00
|
|
|
.cssBlock(MOBILE_CSS)
|
2025-01-04 00:50:11 +02:00
|
|
|
.child(new FlexContainer("column")
|
2025-01-04 14:14:45 +02:00
|
|
|
.id("mobile-sidebar-container")
|
2025-01-04 00:50:11 +02:00
|
|
|
)
|
2022-12-11 22:26:18 +01:00
|
|
|
.child(new FlexContainer("row")
|
|
|
|
.filling()
|
2025-01-04 14:23:17 +02:00
|
|
|
.id("mobile-rest-container")
|
2024-12-28 13:46:08 +02:00
|
|
|
.child(new SidebarContainer("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")
|
2025-01-04 14:14:45 +02:00
|
|
|
.id("mobile-sidebar-wrapper")
|
2022-12-11 22:26:18 +01:00
|
|
|
.css("max-height", "100%")
|
2022-12-13 16:57:46 +01:00
|
|
|
.css('padding-left', "0")
|
|
|
|
.css('padding-right', "0")
|
2025-01-04 14:14:45 +02:00
|
|
|
.css('contain', 'content')
|
|
|
|
.child(new FlexContainer("column")
|
|
|
|
.filling()
|
|
|
|
.id("mobile-sidebar-wrapper")
|
|
|
|
.child(new QuickSearchWidget())
|
|
|
|
.child(new NoteTreeWidget()
|
|
|
|
.cssBlock(FANCYTREE_CSS))))
|
2022-12-11 22:26:18 +01:00
|
|
|
.child(new ScreenContainer("detail", "column")
|
2025-01-04 14:27:23 +02:00
|
|
|
.id("detail-container")
|
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-13 16:57:46 +01:00
|
|
|
.css("padding-left", "0")
|
|
|
|
.css("padding-right", "0")
|
2022-12-11 22:26:18 +01:00
|
|
|
.css('max-height', '100%')
|
2025-01-01 21:40:47 +02:00
|
|
|
.css("position", "relative")
|
2022-12-11 22:26:18 +01:00
|
|
|
.child(new FlexContainer('row').contentSized()
|
|
|
|
.css('font-size', 'larger')
|
|
|
|
.css('align-items', 'center')
|
2024-12-28 14:09:50 +02:00
|
|
|
.child(new ToggleSidebarButtonWidget().contentSized())
|
2022-12-11 22:26:18 +01:00
|
|
|
.child(new NoteTitleWidget()
|
|
|
|
.contentSized()
|
2025-01-04 18:58:50 +02:00
|
|
|
.css("position", "relative")
|
|
|
|
.css("top", "5px")
|
2024-12-28 14:09:50 +02:00
|
|
|
.css("padding-left", "0.5em"))
|
2024-12-28 01:06:02 +02:00
|
|
|
.child(new MobileDetailMenuWidget(true).contentSized())
|
2024-12-28 14:09:50 +02:00
|
|
|
)
|
2023-08-09 00:02:45 +02:00
|
|
|
.child(new SharedInfoWidget())
|
2022-12-11 22:26:18 +01:00
|
|
|
.child(new FloatingButtons()
|
|
|
|
.child(new EditButton())
|
|
|
|
.child(new RelationMapButtons())
|
2024-09-01 23:05:06 +03:00
|
|
|
.child(new SvgExportButton())
|
2022-12-11 22:26:18 +01:00
|
|
|
.child(new BacklinksWidget())
|
|
|
|
.child(new HideFloatingButtonsButton())
|
|
|
|
)
|
|
|
|
.child(new MermaidWidget())
|
2023-10-08 22:58:31 +03:00
|
|
|
.child(new PromotedAttributesWidget())
|
2022-12-11 22:26:18 +01:00
|
|
|
.child(
|
|
|
|
new ScrollingContainer()
|
|
|
|
.filling()
|
|
|
|
.contentSized()
|
|
|
|
.child(
|
|
|
|
new NoteDetailWidget()
|
2025-01-04 19:17:16 +02:00
|
|
|
.css('padding', '5px 0 10px 0')
|
2022-12-11 22:26:18 +01:00
|
|
|
)
|
|
|
|
.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())
|
2024-12-28 11:36:25 +02:00
|
|
|
)
|
2025-01-04 23:05:24 +02:00
|
|
|
.child(new FlexContainer("column")
|
|
|
|
.contentSized()
|
|
|
|
.id("mobile-bottom-bar")
|
|
|
|
.child(new TabRowWidget().css('height', '40px'))
|
|
|
|
.child(new FlexContainer("row")
|
|
|
|
.class("horizontal")
|
|
|
|
.css("height", "53px")
|
|
|
|
.child(new LauncherContainer(true))
|
|
|
|
.child(new GlobalMenuWidget(true))
|
|
|
|
.id("launcher-pane")))
|
2025-01-05 00:57:52 +02:00
|
|
|
.child(new ClassicEditorToolbar())
|
2025-01-04 18:24:05 +02:00
|
|
|
.child(new AboutDialog())
|
2025-01-04 18:41:51 +02:00
|
|
|
.child(new HelpDialog())
|
2025-01-04 23:43:15 +02:00
|
|
|
.child(new JumpToNoteDialog())
|
2020-03-01 11:04:42 +01:00
|
|
|
}
|
2020-09-13 21:12:22 +02:00
|
|
|
}
|