Skip to content

Commit a8333ce

Browse files
author
Dominick Leppich
committed
Merge pull request 'Release v24.12' (#16) from release_24.12 into master
2 parents 6e2d86c + 258d7dd commit a8333ce

File tree

155 files changed

+6754
-11786
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+6754
-11786
lines changed

module-base/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>io.goobi.workflow.plugin</groupId>
55
<artifactId>plugin-step-transcription</artifactId>
6-
<version>24.11</version>
6+
<version>24.12</version>
77
</parent>
88
<artifactId>plugin-step-transcription-base</artifactId>
99
<packaging>jar</packaging>

module-base/src/main/java/de/intranda/goobi/plugins/TranscriptionStepPlugin.java

+20-5
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,23 @@ public String getImageMoveTo() {
246246
return this.imageIndex + 1 + "";
247247
}
248248

249+
250+
public String getHasPreviousPage() {
251+
return hasPreviousPage() ? null : "disabled";
252+
}
253+
254+
public String getHasNextPage() {
255+
return hasNextPage() ? null : "disabled";
256+
}
257+
258+
public boolean hasPreviousPage() {
259+
return getImageIndex() > 0;
260+
}
261+
262+
public boolean hasNextPage() {
263+
return getImageIndex() < images.size() - 1;
264+
}
265+
249266
public String cmdMoveFirst() {
250267
setImageIndex(0);
251268
this.setImageToIndex();
@@ -261,18 +278,16 @@ public String cmdMovePrevious() {
261278
}
262279

263280
public String cmdMoveNext() {
264-
if (getImageIndex() != images.size() - 1) {
281+
if (hasNextPage()) {
265282
setImageIndex(getImageIndex() + 1);
266283
this.setImageToIndex();
267284
}
268285
return "";
269286
}
270287

271288
public String cmdMoveLast() {
272-
if (getImageIndex() != images.size() - 1) {
273-
setImageIndex(images.size() - 1);
274-
this.setImageToIndex();
275-
}
289+
setImageIndex(images.size() - 1);
290+
this.setImageToIndex();
276291
return "";
277292
}
278293

module-gui/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>io.goobi.workflow.plugin</groupId>
55
<artifactId>plugin-step-transcription</artifactId>
6-
<version>24.11</version>
6+
<version>24.12</version>
77
</parent>
88
<artifactId>plugin-step-transcription-gui</artifactId>
99
<packaging>jar</packaging>

module-gui/src/main/webapp/resources/uii/TranscriptionPlugin_include_imagenavigation.xhtml

+48-45
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,30 @@
3131
<composite:implementation>
3232
<!-- navigation for big image -->
3333
<div class="dataTables__paginator justify-content-center">
34-
<button
35-
class="btn btn-blank"
36-
jsf:action="#{AktuelleSchritteForm.myPlugin.cmdMoveFirst}"
37-
disabled="#{cc.attrs.paginator.getHasPreviousPage()}"
38-
title="#{AktuelleSchritteForm.myPlugin.pagesRTL?msgs.lastImage:msgs.firstImage}"
39-
data-bs-toggle="tooltip">
40-
<span
41-
aria-hidden="true"
42-
class="fa fa-angle-double-left"/>
43-
<f:ajax render="@form"/>
44-
</button>
45-
<button
46-
class="btn btn-primary-400"
47-
jsf:action="#{AktuelleSchritteForm.myPlugin.cmdMovePrevious}"
48-
jsf:id="imageBack">
49-
<span
50-
aria-hidden="true"
51-
class="fa fa-angle-left" />
52-
<span>
53-
<h:outputText value="#{AktuelleSchritteForm.myPlugin.pagesRTL?msgs.lw_nextImage:msgs.lw_previousImage}"/>
54-
</span>
55-
<f:ajax render="@form"/>
56-
</button>
34+
<f:ajax render="@form">
35+
<button
36+
class="btn btn-blank"
37+
jsf:action="#{AktuelleSchritteForm.myPlugin.cmdMoveFirst}"
38+
disabled="#{AktuelleSchritteForm.myPlugin.getHasPreviousPage()}"
39+
title="#{AktuelleSchritteForm.myPlugin.pagesRTL?msgs.lastImage:msgs.firstImage}"
40+
data-bs-toggle="tooltip">
41+
<span
42+
aria-hidden="true"
43+
class="fa fa-angle-double-left"/>
44+
</button>
45+
<button
46+
class="btn btn-primary-400"
47+
jsf:action="#{AktuelleSchritteForm.myPlugin.cmdMovePrevious}"
48+
disabled="#{AktuelleSchritteForm.myPlugin.getHasPreviousPage()}"
49+
jsf:id="imageBack">
50+
<span
51+
aria-hidden="true"
52+
class="fa fa-angle-left" />
53+
<span>
54+
<h:outputText value="#{AktuelleSchritteForm.myPlugin.pagesRTL?msgs.lw_nextImage:msgs.lw_previousImage}"/>
55+
</span>
56+
</button>
57+
</f:ajax>
5758
<div class="dataTables__paginator__page-count">
5859
<h:outputText
5960
id="txtMoveTo1"
@@ -79,28 +80,30 @@
7980
style="display:none">
8081
</x:commandButton>
8182
</div>
82-
<button
83-
class="btn btn-primary-400"
84-
jsf:action="#{AktuelleSchritteForm.myPlugin.cmdMoveNext}"
85-
jsf:id="imageNext">
86-
<span>
87-
<h:outputText value="#{AktuelleSchritteForm.myPlugin.pagesRTL?msgs.lw_previousImage:msgs.lw_nextImage} " />
88-
</span>
89-
<span
90-
aria-hidden="true"
91-
class="fa fa-angle-right" />
92-
<f:ajax render="@form"/>
93-
</button>
94-
<button
95-
class="btn btn-blank"
96-
jsf:action="#{AktuelleSchritteForm.myPlugin.cmdMoveLast}"
97-
jsf:id="navlast"
98-
title="#{AktuelleSchritteForm.myPlugin.pagesRTL?msgs.firstImage:msgs.lastImage}">
99-
<span
100-
aria-hidden="true"
101-
class="fa fa-angle-double-right"/>
102-
<f:ajax render="@form"/>
103-
</button>
83+
<f:ajax render="@form">
84+
<button
85+
class="btn btn-primary-400"
86+
jsf:action="#{AktuelleSchritteForm.myPlugin.cmdMoveNext}"
87+
disabled="#{AktuelleSchritteForm.myPlugin.getHasNextPage()}"
88+
jsf:id="imageNext">
89+
<span>
90+
<h:outputText value="#{AktuelleSchritteForm.myPlugin.pagesRTL?msgs.lw_previousImage:msgs.lw_nextImage} " />
91+
</span>
92+
<span
93+
aria-hidden="true"
94+
class="fa fa-angle-right" />
95+
</button>
96+
<button
97+
class="btn btn-blank"
98+
jsf:action="#{AktuelleSchritteForm.myPlugin.cmdMoveLast}"
99+
disabled="#{AktuelleSchritteForm.myPlugin.getHasNextPage()}"
100+
jsf:id="navlast"
101+
title="#{AktuelleSchritteForm.myPlugin.pagesRTL?msgs.firstImage:msgs.lastImage}">
102+
<span
103+
aria-hidden="true"
104+
class="fa fa-angle-double-right"/>
105+
</button>
106+
</f:ajax>
104107

105108
<h:commandLink style="display:none;" class="hidden-set-image-button" action="#{AktuelleSchritteForm.myPlugin.setImageToIndex}"/>
106109

module-gui/src/main/webapp/resources/uii/plugin_step_transcription.xhtml

+82-60
Original file line numberDiff line numberDiff line change
@@ -76,25 +76,6 @@
7676

7777
<script
7878
src="plugins/step/intranda_step_transcription/tinymce/tinymce.min.js"></script>
79-
<script>
80-
let mytiny = tinymce.init({
81-
plugins: 'paste table',
82-
selector : '.ocr-text',
83-
menubar : '',
84-
toolbar: 'undo redo | formatselect | fontsizeselect | bold italic underline strikethrough | alignleft aligncenter alignright alighnblock | indent outdent | table | pastetext | forecolor backcolor',
85-
paste_as_text: true,
86-
height : "90vh",
87-
init_instance_callback: function (editor) {
88-
editor.on('blur', function (e) {
89-
save();
90-
});
91-
}
92-
93-
});
94-
mytiny.then(mt => {
95-
console.log(mt)
96-
})
97-
</script>
9879

9980
<section:section type="neutral">
10081
<section:header
@@ -105,7 +86,8 @@
10586
id="id10"
10687
action="#{NavigationForm.Reload}"
10788
styleClass="btn d-flex align-items-center btn--title-action"
108-
pt:data-bs-toggle="tooltip">
89+
pt:data-bs-toggle="tooltip"
90+
title="#{msgs.reload}">
10991
<span
11092
aria-hidden="true"
11193
class="fa fa-refresh" />
@@ -202,6 +184,9 @@
202184
<h:inputText
203185
value="#{AktuelleSchritteForm.myPlugin.image.ocrText}"
204186
class="input_0"></h:inputText>
187+
<h:inputText
188+
value="#{AktuelleSchritteForm.myPlugin.image.image.url}"
189+
id="inputImageUrl"></h:inputText>
205190
</h:panelGroup>
206191

207192
<h:panelGroup layout="block"
@@ -264,53 +249,90 @@
264249
</section:section>
265250

266251
<script>
267-
let configViewer = {
268-
global: {
269-
divId: 'bigImage',
270-
useTiles: #{AktuelleSchritteForm.myPlugin.useTiles},
271-
footerHeight: 0,
272-
adaptContainerHeight: false,
273-
zoomSlider: "#zoomSlider",
274-
zoomSliderHandle: "#zoomSlider .zoom-slider-handle",
275-
zoomSliderLabel: "#zoomSliderLabel input"
276-
},
277-
image: {
278-
mimeType: "image/jpeg",
279-
tileSource: "#{AktuelleSchritteForm.myPlugin.image.image.url}"
252+
let useTilesBool = #{AktuelleSchritteForm.myPlugin.useTiles};
253+
254+
function save() {
255+
let editors = tinymce.editors
256+
for (let i = 0; i != editors.length; i++) {
257+
let editor = editors[i];
258+
let textAreaID = editor.id;
259+
let content = editor.getContent();
260+
let inputID = "input_0".replace("textarea_", "");
261+
document.querySelector('.' + inputID).value = content;
280262
}
281-
};
263+
return true;
264+
}
282265

283-
let viewImage = new ImageView.Image( configViewer );
284-
viewImage.load()
285-
.then(function(image) {
286-
image.onFirstTileLoaded()
287-
.then(function() {
288-
$('#ajaxloader_image').fadeOut(800);
266+
const showImage = () => {
267+
let imageUrl = document.querySelector('[id$="inputImageUrl"]').value;
268+
let configViewer = {
269+
global: {
270+
divId: 'bigImage',
271+
useTiles: useTilesBool,
272+
footerHeight: 0,
273+
adaptContainerHeight: false,
274+
zoomSlider: "#zoomSlider",
275+
zoomSliderHandle: "#zoomSlider .zoom-slider-handle",
276+
zoomSliderLabel: "#zoomSliderLabel input",
277+
},
278+
image: {
279+
mimeType: "image/jpeg",
280+
tileSource: imageUrl,
281+
},
282+
};
283+
let viewImage = new ImageView.Image( configViewer );
284+
viewImage.load()
285+
.then(function(image) {
286+
image.onFirstTileLoaded()
287+
.then(function() {
288+
$('#ajaxloader_image').fadeOut(800);
289+
})
290+
.catch(function() {
291+
$('#ajaxloader_image').fadeOut(800);
292+
})
289293
})
290-
.catch(function() {
294+
.catch(function(error){
295+
console.error( 'Error opening image', error );
291296
$('#ajaxloader_image').fadeOut(800);
292-
})
293-
})
294-
.catch(function(error){
295-
console.error( 'Error opening image', error );
296-
$('#ajaxloader_image').fadeOut(800);
297-
$('#' + configViewer.global.divId).html( 'Failed to load image: "' + error + '"' );
298-
});
297+
$('#' + configViewer.global.divId).html( 'Failed to load image: "' + error + '"' );
298+
});
299+
};
299300

301+
const initTinyMCE = () => {
302+
let mytiny = tinymce.init({
303+
plugins: 'table',
304+
selector : '.ocr-text',
305+
menubar : '',
306+
toolbar: 'undo redo | formatselect | fontsizeselect | bold italic underline strikethrough | alignleft aligncenter alignright alighnblock | indent outdent | table | pastetext | forecolor backcolor',
307+
paste_as_text: true,
308+
height : "90vh",
309+
license_key: 'gpl',
310+
promotion: false,
311+
init_instance_callback: function (editor) {
312+
editor.on('blur', function (e) {
313+
save();
314+
});
315+
}
316+
317+
});
318+
mytiny.then(mt => {
319+
console.log(mt)
320+
})
321+
};
300322

323+
document.addEventListener('DOMContentLoaded', function() {
324+
showImage();
325+
initTinyMCE();
326+
});
301327

302-
function save() {
303-
let editors = tinymce.editors
304-
for (let i = 0; i != editors.length; i++) {
305-
let editor = editors[i];
306-
let textAreaID = editor.id;
307-
let content = editor.getContent();
308-
let inputID = "input_0".replace("textarea_", "");
309-
document.querySelector('.' + inputID).value = content;
310-
}
311-
return true;
312-
}
313-
</script>
328+
// initialize image viewer and tinyMCE after ajax request
329+
jsf.ajax.addOnEvent(function (data) {
330+
if (data.status === 'success') {
331+
showImage();
332+
initTinyMCE();
333+
}
334+
});
335+
</script>
314336

315337

316338
</ui:define>

module-gui/src/main/webapp/resources/uii/plugins/step/intranda_step_transcription/tinymce/icons/default/icons.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)