Skip to content

Commit

Permalink
Merge pull request #295 from markusweigelt/3dviewer-improvments
Browse files Browse the repository at this point in the history
[FEATURE] Migration to the changed 3d viewer implementation of Kitodo.Presentation
  • Loading branch information
beatrycze-volk authored Aug 15, 2024
2 parents 84a6894 + f7a4441 commit 592da36
Show file tree
Hide file tree
Showing 9 changed files with 150 additions and 1,238 deletions.
2 changes: 0 additions & 2 deletions Configuration/TypoScript/Page/header.typoscript
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ page {
includeCSS {
style = EXT:dfgviewer/Resources/Public/Css/webStyles.css
highlight = EXT:dfgviewer/Resources/Public/JavaScript/Highlight/styles/magula.css
3DViewer = EXT:dfgviewer/Resources/Public/Css/3DViewer/main.css
3DViewerSpinner = EXT:dfgviewer/Resources/Public/Css/3DViewer/spinner.css
}
includeJSFooterlibs {
jQuery = EXT:dfgviewer/Resources/Public/JavaScript/jQuery/jquery-3.6.0.min.js
Expand Down
31 changes: 22 additions & 9 deletions Configuration/TypoScript/Plugins/kitodo.typoscript
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,10 @@ plugin.tx_dlf_pageview {
}

# --------------------------------------------------------------------------------------------------------------------
# 3D objects view
# embedded 3D viewer
# --------------------------------------------------------------------------------------------------------------------
plugin.tx_dlf_view3d < tt_content.list.20.dlf_view3d
plugin.tx_dlf_view3d {
pages = {$config.storagePid}
excludeOther = 0
features =
elementId = tx-dfgviewer-3d-view
fileGrpImages = THUMBS,DEFAULT
plugin.tx_dlf_embedded3dviewer < tt_content.list.20.dlf_embedded3dviewer
plugin.tx_dlf_embedded3dviewer {
}

# --------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -159,6 +154,7 @@ lib.kitodo.navigation.viewfunction {
# fulltextdownloadtool
# imagedownloadtool
# imagemanipulationtool
# modeldownloadtool
# pdfdownloadtool
# searchindocumenttool

Expand All @@ -169,6 +165,14 @@ plugin.tx_dlf_toolbox {
}
}

plugin.tx_dlf_modeldownloadtool < plugin.tx_dlf_toolbox
plugin.tx_dlf_modeldownloadtool {
settings {
fileGrpsModelDownload = DEFAULT
tools = modeldownloadtool
}
}

plugin.tx_dlf_fulltexttool < plugin.tx_dlf_toolbox
plugin.tx_dlf_fulltexttool {
settings {
Expand Down Expand Up @@ -204,9 +208,18 @@ plugin.tx_dlf_audioplayer {
}

# --------------------------------------------------------------------------------------------------------------------
# newspaper navigation
# 3d object
# --------------------------------------------------------------------------------------------------------------------
[getDocumentType({$config.storagePid}) == "object"]
page.10.variables {
is3dObject = TEXT
is3dObject.value = 1
}
[END]

# --------------------------------------------------------------------------------------------------------------------
# newspaper navigation
# --------------------------------------------------------------------------------------------------------------------
[getDocumentType({$config.storagePid}) == "ephemera" or getDocumentType({$config.storagePid}) == "newspaper"]
page.10.variables {
isNewspaper = TEXT
Expand Down
6 changes: 5 additions & 1 deletion Resources/Private/Less/components/controls.less
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
&.persistence-page:before {
background-position: -320px -80px;
}
&.tx-dlf-tools-modeldownload:before,
&.tx-dlf-tools-imagedownload:before {
background-position: -320px -40px;
}
Expand All @@ -153,6 +154,9 @@
left: -40px;
}
}
&.tx-dlf-tools-modeldownload {
opacity: 1;
}
}
span {
opacity: 0.5;
Expand Down Expand Up @@ -974,4 +978,4 @@ body.dfgviewer.calendar {
position: relative;
top: -80px;
}
}
}
24 changes: 5 additions & 19 deletions Resources/Private/Partials/ControlBar.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,17 @@ <h1><f:link.page pageUid="{rootPageId}" title="DFG-Viewer" class="dfgviewer-logo
</nav>
</div>

<f:if condition="{isObject3D} == 'object'">
<f:then>
<div class="metadata-wrapper" style="height: 100%">
</f:then>
<f:else>
<div class="metadata-wrapper">
</f:else>
</f:if>
<div class="metadata-wrapper">
<div class="tx-dlf-metadata">
<f:cObject typoscriptObjectPath="plugin.tx_dlf_metadata" />
</div>
<div class="offcanvas-toggle" title="<f:translate key='metadata' extensionName='dfgviewer' />"></div>
</div>

<f:if condition="{isObject3D} == 'object'">
<f:then>
<!-- it's a 3D object - no need for ToC here! -->
</f:then>
<f:else>
<div class="toc-wrapper">
<f:cObject typoscriptObjectPath="plugin.tx_dlf_tableofcontents" />
<div class="offcanvas-toggle" title="<f:translate key='toc' extensionName='dfgviewer' />"></div>
</div>
</f:else>
</f:if>
<div class="toc-wrapper">
<f:cObject typoscriptObjectPath="plugin.tx_dlf_tableofcontents" />
<div class="offcanvas-toggle" title="<f:translate key='toc' extensionName='dfgviewer' />"></div>
</div>
</div>
</f:section>

Expand Down
53 changes: 25 additions & 28 deletions Resources/Private/Partials/PageView.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,49 +16,46 @@ <h2>
</div>
</div>

<f:if condition="{gp-pagegrid} == 1">
<div class="document-functions">
<f:render partial="Provider" arguments="{_all}"/>
<f:render partial="Submenu" arguments="{_all}"/>
</div>

<f:if condition="{is3dObject} == 1">
<f:then>
<f:cObject typoscriptObjectPath="plugin.tx_dlf_pagegrid" />
<f:cObject typoscriptObjectPath="plugin.tx_dlf_embedded3dviewer"/>
</f:then>
<f:else>
<f:if condition="{isNewspaper} == 'newspaper_anchor'">
<f:if condition="{gp-pagegrid} == 1">
<f:then>
<f:cObject typoscriptObjectPath="plugin.tx_dfgviewer_newspaperyears" />
<f:cObject typoscriptObjectPath="plugin.tx_dlf_pagegrid" />
</f:then>
<f:else>
<f:if condition="{isNewspaper} == 'newspaper_year'">
<f:if condition="{isNewspaper} == 'newspaper_anchor'">
<f:then>
<f:cObject typoscriptObjectPath="plugin.tx_dfgviewer_newspapercalendar" />
<f:cObject typoscriptObjectPath="plugin.tx_dfgviewer_newspaperyears" />
</f:then>
<f:else>
<f:if condition="{isNewspaper} == 'newspaper_issue'">
<!-- it's a newspaper! -->
<f:if condition="{isNewspaper} == 'newspaper_year'">
<f:then>
<f:cObject typoscriptObjectPath="plugin.tx_dfgviewer_newspapercalendar" />
</f:then>
<f:else>
<f:if condition="{isNewspaper} == 'newspaper_issue'">
<!-- it's a newspaper! -->
</f:if>
<f:cObject typoscriptObjectPath="plugin.tx_dlf_pageview" />
<f:cObject typoscriptObjectPath="plugin.tx_dlf_audioplayer" />
<div class="fulltext-container">
<div id="tx-dlf-fulltextselection"></div>
</div>
</f:else>
</f:if>
<f:cObject typoscriptObjectPath="plugin.tx_dlf_pageview" />
<f:cObject typoscriptObjectPath="plugin.tx_dlf_audioplayer" />
<f:cObject typoscriptObjectPath="plugin.tx_dlf_view3d" />
<div class="fulltext-container">
<div id="tx-dlf-fulltextselection"></div>
</div>
</f:else>
</f:if>
</f:else>
</f:if>
</f:else>
</f:if>

<div class="document-functions">
<f:render partial="Provider" arguments="{_all}"/>

<f:if condition="{3d}">
<f:else>
<f:render partial="Submenu" arguments="{_all}"/>
</f:else>
</f:if>
</div>

<f:if condition="{3d}">
<f:else>
<div class="view-functions">
<f:if condition="{gp-pagegrid} == 1">
<f:else>
Expand Down
Loading

0 comments on commit 592da36

Please sign in to comment.