From dd81db6ffef6c9a3a4465c1444254a993e8ae7bf Mon Sep 17 00:00:00 2001 From: Kajetan Dvoracek Date: Tue, 2 Aug 2022 13:24:42 +0200 Subject: [PATCH 01/17] Allow sprint branches --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 50040e438..f06bd7349 100644 --- a/composer.json +++ b/composer.json @@ -44,8 +44,8 @@ "require": { "php": "8.1 - 8.4", "typo3/cms-core": "^11.5.41|^12.4.24", - "kitodo/presentation": "dev-6.x", - "slub/slub-digitalcollections": "dev-master" + "kitodo/presentation": "dev-6.x|dev-sprint-rebased", + "slub/slub-digitalcollections": "dev-master|dev-sprint" }, "require-dev": { "phpstan/phpstan": "^1.12", From abd1aa47f54d98358d902e3fb26d66cfff3cfbb3 Mon Sep 17 00:00:00 2001 From: Kajetan Dvoracek Date: Mon, 22 Aug 2022 21:58:45 +0200 Subject: [PATCH 02/17] Fix naming pageBack vs. pageStepBack --- Configuration/TypoScript/Plugins/kitodo.typoscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Configuration/TypoScript/Plugins/kitodo.typoscript b/Configuration/TypoScript/Plugins/kitodo.typoscript index d7c0a837a..793d12a53 100644 --- a/Configuration/TypoScript/Plugins/kitodo.typoscript +++ b/Configuration/TypoScript/Plugins/kitodo.typoscript @@ -203,7 +203,7 @@ lib.kitodo.navigation.pagecontrol < tt_content.list.20.dlf_navigation lib.kitodo.navigation.pagecontrol { settings { pageStep = 10 - features = measureBack,measureForward,pageFirst,pageBack,pageStepBack,pageForward,pageStepForward,pageLast + features = measureBack,measureForward,pageFirst,pageStepBack, pageBack,pageForward,pageStepForward,pageLast } } From 8d5c77f28a899b454ae37bacccb69307c3c457b4 Mon Sep 17 00:00:00 2001 From: Kajetan Dvoracek Date: Mon, 22 Aug 2022 23:16:37 +0200 Subject: [PATCH 03/17] Enable/disable nav buttons on client --- .../Private/Less/components/controls.less | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Resources/Private/Less/components/controls.less b/Resources/Private/Less/components/controls.less index 6e300a428..0b1b29207 100644 --- a/Resources/Private/Less/components/controls.less +++ b/Resources/Private/Less/components/controls.less @@ -845,6 +845,10 @@ left: 20px; } } + a.disabled { + opacity: 0.3; + cursor: not-allowed; + } &.prev { a, span { top: 0; @@ -889,6 +893,10 @@ } &.over { span { + a.disabled { + opacity: 0.3; + cursor: not-allowed; + } &.prev { a, span { color: @base-blue; @@ -907,7 +915,7 @@ } } span { - opacity: .3; + opacity: 0.3; } } &.first { @@ -917,8 +925,9 @@ a { opacity: 1; } - span { + a.disabled, span { opacity: 0.3; + cursor: not-allowed; } } } @@ -935,6 +944,10 @@ right: 20px; } } + a.disabled { + opacity: 0.3; + cursor: not-allowed; + } &.next { a, span { top: 0; @@ -999,8 +1012,9 @@ a { opacity: 1; } - span { + a.disabled, span { opacity: 0.3; + cursor: not-allowed; } } } From 5eba6e993901efcc5f49acaf5b304fb8a8c2d2e3 Mon Sep 17 00:00:00 2001 From: Kajetan Dvoracek Date: Mon, 25 Apr 2022 13:58:14 +0200 Subject: [PATCH 04/17] Add loading indicator --- .../TypoScript/Plugins/kitodo.typoscript | 3 +- Resources/Private/Less/structure.less | 65 +++++++++++++++++++ .../Kitodo/Templates/PageView/Main.html | 5 +- 3 files changed, 70 insertions(+), 3 deletions(-) diff --git a/Configuration/TypoScript/Plugins/kitodo.typoscript b/Configuration/TypoScript/Plugins/kitodo.typoscript index 793d12a53..11c854d37 100644 --- a/Configuration/TypoScript/Plugins/kitodo.typoscript +++ b/Configuration/TypoScript/Plugins/kitodo.typoscript @@ -131,6 +131,7 @@ plugin.tx_dlf_pageview { features = elementId = tx-dfgviewer-map-0 multiViewType = composition + progressElementId = tx-dfgviewer-page-progress } } @@ -203,7 +204,7 @@ lib.kitodo.navigation.pagecontrol < tt_content.list.20.dlf_navigation lib.kitodo.navigation.pagecontrol { settings { pageStep = 10 - features = measureBack,measureForward,pageFirst,pageStepBack, pageBack,pageForward,pageStepForward,pageLast + features = measureBack,measureForward,pageFirst,pageStepBack,pageBack,pageForward,pageStepForward,pageLast } } diff --git a/Resources/Private/Less/structure.less b/Resources/Private/Less/structure.less index cce4dd191..193f6b973 100644 --- a/Resources/Private/Less/structure.less +++ b/Resources/Private/Less/structure.less @@ -160,6 +160,71 @@ a { right: 0; bottom: 0; left: 0; + + .tx-dlf-page-progress { + display: none; + &.loading { + display: block; + } + + position: absolute; + top: 0; + left: 0; + margin: 0; + width: 100%; + height: 5px; + + -webkit-appearance: none; + appearance: none; + + border: none; + border-radius: 0px; + background: transparent; + + &::-moz-progress-bar { + background-color: @base-blue; + } + + .bounce() { + background-color: @light-blue; + animation: bounce_slider 2s linear infinite; + transform-origin: left; + } + + &:not([value]) { + &::after { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 5px; + content: ''; + .bounce(); + } + + &::-moz-progress-bar { + .bounce(); + } + } + + @keyframes bounce_slider { + 0% { + transform: translateX(0%) scaleX(15%); + } + 50% { + transform: translateX(85%) scaleX(15%); + } + 100% { + transform: translateX(0%) scaleX(15%); + } + } + } + ::-webkit-progress-value { + background-color: @base-blue; + } + ::-webkit-progress-bar { + background-color: transparent; + } } .document-functions { .provider { diff --git a/Resources/Private/Plugins/Kitodo/Templates/PageView/Main.html b/Resources/Private/Plugins/Kitodo/Templates/PageView/Main.html index ca975d80e..4a9575beb 100644 --- a/Resources/Private/Plugins/Kitodo/Templates/PageView/Main.html +++ b/Resources/Private/Plugins/Kitodo/Templates/PageView/Main.html @@ -26,7 +26,6 @@ data-namespace-typo3-fluid="true"> -
@@ -128,7 +127,9 @@
-
+
+ +
const WILDWEBMIDI_REMOTE_PACKAGE_BASE = '{viewData.publicResourcePath}/JavaScript/WildWebMidi/wildwebmidi.data'; From d021a0fb331fe93a2429539727ecfcc22c6aaca4 Mon Sep 17 00:00:00 2001 From: Kajetan Dvoracek Date: Wed, 24 Aug 2022 23:06:47 +0200 Subject: [PATCH 05/17] Start implementing client-side double page mode --- .../Private/JavaScript/dfgviewerScripts.js | 48 +++++++ Resources/Private/Partials/PageView.html | 124 ++++++++++++++++++ Resources/Public/JavaScript/allScripts.js | 4 +- 3 files changed, 174 insertions(+), 2 deletions(-) diff --git a/Resources/Private/JavaScript/dfgviewerScripts.js b/Resources/Private/JavaScript/dfgviewerScripts.js index 43a50980a..3cecb29a4 100644 --- a/Resources/Private/JavaScript/dfgviewerScripts.js +++ b/Resources/Private/JavaScript/dfgviewerScripts.js @@ -233,6 +233,54 @@ $(document).ready(function() { $('#browser-hint').addClass('hidden'); } + $('.tx-dlf-navigation-doubleOn').click(function (e) { + e.preventDefault(); + tx_dlf_loaded.state.simultaneousPages = 2; + document.body.dispatchEvent(new CustomEvent('tx-dlf-configChanged', { + detail: { + source: 'navigation', + simultaneousPages: 2, + }, + })) + }); + + $('.tx-dlf-navigation-doubleOff').click(function (e) { + e.preventDefault(); + tx_dlf_loaded.state.simultaneousPages = 1; + document.body.dispatchEvent(new CustomEvent('tx-dlf-configChanged', { + detail: { + source: 'navigation', + simultaneousPages: 1, + }, + })) + }); + + $('.tx-dlf-navigation-doublePlusOne').click(function (e) { + e.preventDefault(); + const pageIdx = tx_dlf_loaded.state.page - 1; + const simultaneousPages = tx_dlf_loaded.state.simultaneousPages; + + const rectoVerso = pageIdx % simultaneousPages; + const newRectoVerso = (rectoVerso + 1) % simultaneousPages; + const newPageNo = (pageIdx - rectoVerso + newRectoVerso) + 1; + + // TODO: Avoid redundancy + tx_dlf_loaded.state.page = newPageNo; + document.body.dispatchEvent( + new CustomEvent( + 'tx-dlf-pageChanged', + { + 'detail': { + 'source': 'navigation', + 'page': newPageNo, + 'pageObj': tx_dlf_loaded.document.pages[newPageNo - 1], + 'target': e.target + } + } + ) + ); + }); + // Finally all things are settled. Bring back animations a second later. setTimeout(function () { localStorage.clear(); diff --git a/Resources/Private/Partials/PageView.html b/Resources/Private/Partials/PageView.html index 4ff8a6956..361d35f4c 100644 --- a/Resources/Private/Partials/PageView.html +++ b/Resources/Private/Partials/PageView.html @@ -39,6 +39,7 @@

+<<<<<<< HEAD
@@ -77,6 +78,129 @@

+======= +