Skip to content

Commit

Permalink
Merge pull request 'Release v24.12' (#16) from release_24.12 into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominick Leppich committed Jan 13, 2025
2 parents 6e2d86c + 258d7dd commit a8333ce
Show file tree
Hide file tree
Showing 155 changed files with 6,754 additions and 11,786 deletions.
2 changes: 1 addition & 1 deletion module-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>io.goobi.workflow.plugin</groupId>
<artifactId>plugin-step-transcription</artifactId>
<version>24.11</version>
<version>24.12</version>
</parent>
<artifactId>plugin-step-transcription-base</artifactId>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,23 @@ public String getImageMoveTo() {
return this.imageIndex + 1 + "";
}


public String getHasPreviousPage() {
return hasPreviousPage() ? null : "disabled";
}

public String getHasNextPage() {
return hasNextPage() ? null : "disabled";
}

public boolean hasPreviousPage() {
return getImageIndex() > 0;
}

public boolean hasNextPage() {
return getImageIndex() < images.size() - 1;
}

public String cmdMoveFirst() {
setImageIndex(0);
this.setImageToIndex();
Expand All @@ -261,18 +278,16 @@ public String cmdMovePrevious() {
}

public String cmdMoveNext() {
if (getImageIndex() != images.size() - 1) {
if (hasNextPage()) {
setImageIndex(getImageIndex() + 1);
this.setImageToIndex();
}
return "";
}

public String cmdMoveLast() {
if (getImageIndex() != images.size() - 1) {
setImageIndex(images.size() - 1);
this.setImageToIndex();
}
setImageIndex(images.size() - 1);
this.setImageToIndex();
return "";
}

Expand Down
2 changes: 1 addition & 1 deletion module-gui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>io.goobi.workflow.plugin</groupId>
<artifactId>plugin-step-transcription</artifactId>
<version>24.11</version>
<version>24.12</version>
</parent>
<artifactId>plugin-step-transcription-gui</artifactId>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,30 @@
<composite:implementation>
<!-- navigation for big image -->
<div class="dataTables__paginator justify-content-center">
<button
class="btn btn-blank"
jsf:action="#{AktuelleSchritteForm.myPlugin.cmdMoveFirst}"
disabled="#{cc.attrs.paginator.getHasPreviousPage()}"
title="#{AktuelleSchritteForm.myPlugin.pagesRTL?msgs.lastImage:msgs.firstImage}"
data-bs-toggle="tooltip">
<span
aria-hidden="true"
class="fa fa-angle-double-left"/>
<f:ajax render="@form"/>
</button>
<button
class="btn btn-primary-400"
jsf:action="#{AktuelleSchritteForm.myPlugin.cmdMovePrevious}"
jsf:id="imageBack">
<span
aria-hidden="true"
class="fa fa-angle-left" />
<span>
<h:outputText value="#{AktuelleSchritteForm.myPlugin.pagesRTL?msgs.lw_nextImage:msgs.lw_previousImage}"/>
</span>
<f:ajax render="@form"/>
</button>
<f:ajax render="@form">
<button
class="btn btn-blank"
jsf:action="#{AktuelleSchritteForm.myPlugin.cmdMoveFirst}"
disabled="#{AktuelleSchritteForm.myPlugin.getHasPreviousPage()}"
title="#{AktuelleSchritteForm.myPlugin.pagesRTL?msgs.lastImage:msgs.firstImage}"
data-bs-toggle="tooltip">
<span
aria-hidden="true"
class="fa fa-angle-double-left"/>
</button>
<button
class="btn btn-primary-400"
jsf:action="#{AktuelleSchritteForm.myPlugin.cmdMovePrevious}"
disabled="#{AktuelleSchritteForm.myPlugin.getHasPreviousPage()}"
jsf:id="imageBack">
<span
aria-hidden="true"
class="fa fa-angle-left" />
<span>
<h:outputText value="#{AktuelleSchritteForm.myPlugin.pagesRTL?msgs.lw_nextImage:msgs.lw_previousImage}"/>
</span>
</button>
</f:ajax>
<div class="dataTables__paginator__page-count">
<h:outputText
id="txtMoveTo1"
Expand All @@ -79,28 +80,30 @@
style="display:none">
</x:commandButton>
</div>
<button
class="btn btn-primary-400"
jsf:action="#{AktuelleSchritteForm.myPlugin.cmdMoveNext}"
jsf:id="imageNext">
<span>
<h:outputText value="#{AktuelleSchritteForm.myPlugin.pagesRTL?msgs.lw_previousImage:msgs.lw_nextImage} " />
</span>
<span
aria-hidden="true"
class="fa fa-angle-right" />
<f:ajax render="@form"/>
</button>
<button
class="btn btn-blank"
jsf:action="#{AktuelleSchritteForm.myPlugin.cmdMoveLast}"
jsf:id="navlast"
title="#{AktuelleSchritteForm.myPlugin.pagesRTL?msgs.firstImage:msgs.lastImage}">
<span
aria-hidden="true"
class="fa fa-angle-double-right"/>
<f:ajax render="@form"/>
</button>
<f:ajax render="@form">
<button
class="btn btn-primary-400"
jsf:action="#{AktuelleSchritteForm.myPlugin.cmdMoveNext}"
disabled="#{AktuelleSchritteForm.myPlugin.getHasNextPage()}"
jsf:id="imageNext">
<span>
<h:outputText value="#{AktuelleSchritteForm.myPlugin.pagesRTL?msgs.lw_previousImage:msgs.lw_nextImage} " />
</span>
<span
aria-hidden="true"
class="fa fa-angle-right" />
</button>
<button
class="btn btn-blank"
jsf:action="#{AktuelleSchritteForm.myPlugin.cmdMoveLast}"
disabled="#{AktuelleSchritteForm.myPlugin.getHasNextPage()}"
jsf:id="navlast"
title="#{AktuelleSchritteForm.myPlugin.pagesRTL?msgs.firstImage:msgs.lastImage}">
<span
aria-hidden="true"
class="fa fa-angle-double-right"/>
</button>
</f:ajax>

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,25 +76,6 @@

<script
src="plugins/step/intranda_step_transcription/tinymce/tinymce.min.js"></script>
<script>
let mytiny = tinymce.init({
plugins: 'paste table',
selector : '.ocr-text',
menubar : '',
toolbar: 'undo redo | formatselect | fontsizeselect | bold italic underline strikethrough | alignleft aligncenter alignright alighnblock | indent outdent | table | pastetext | forecolor backcolor',
paste_as_text: true,
height : "90vh",
init_instance_callback: function (editor) {
editor.on('blur', function (e) {
save();
});
}

});
mytiny.then(mt => {
console.log(mt)
})
</script>

<section:section type="neutral">
<section:header
Expand All @@ -105,7 +86,8 @@
id="id10"
action="#{NavigationForm.Reload}"
styleClass="btn d-flex align-items-center btn--title-action"
pt:data-bs-toggle="tooltip">
pt:data-bs-toggle="tooltip"
title="#{msgs.reload}">
<span
aria-hidden="true"
class="fa fa-refresh" />
Expand Down Expand Up @@ -202,6 +184,9 @@
<h:inputText
value="#{AktuelleSchritteForm.myPlugin.image.ocrText}"
class="input_0"></h:inputText>
<h:inputText
value="#{AktuelleSchritteForm.myPlugin.image.image.url}"
id="inputImageUrl"></h:inputText>
</h:panelGroup>

<h:panelGroup layout="block"
Expand Down Expand Up @@ -264,53 +249,90 @@
</section:section>

<script>
let configViewer = {
global: {
divId: 'bigImage',
useTiles: #{AktuelleSchritteForm.myPlugin.useTiles},
footerHeight: 0,
adaptContainerHeight: false,
zoomSlider: "#zoomSlider",
zoomSliderHandle: "#zoomSlider .zoom-slider-handle",
zoomSliderLabel: "#zoomSliderLabel input"
},
image: {
mimeType: "image/jpeg",
tileSource: "#{AktuelleSchritteForm.myPlugin.image.image.url}"
let useTilesBool = #{AktuelleSchritteForm.myPlugin.useTiles};

function save() {
let editors = tinymce.editors
for (let i = 0; i != editors.length; i++) {
let editor = editors[i];
let textAreaID = editor.id;
let content = editor.getContent();
let inputID = "input_0".replace("textarea_", "");
document.querySelector('.' + inputID).value = content;
}
};
return true;
}

let viewImage = new ImageView.Image( configViewer );
viewImage.load()
.then(function(image) {
image.onFirstTileLoaded()
.then(function() {
$('#ajaxloader_image').fadeOut(800);
const showImage = () => {
let imageUrl = document.querySelector('[id$="inputImageUrl"]').value;
let configViewer = {
global: {
divId: 'bigImage',
useTiles: useTilesBool,
footerHeight: 0,
adaptContainerHeight: false,
zoomSlider: "#zoomSlider",
zoomSliderHandle: "#zoomSlider .zoom-slider-handle",
zoomSliderLabel: "#zoomSliderLabel input",
},
image: {
mimeType: "image/jpeg",
tileSource: imageUrl,
},
};
let viewImage = new ImageView.Image( configViewer );
viewImage.load()
.then(function(image) {
image.onFirstTileLoaded()
.then(function() {
$('#ajaxloader_image').fadeOut(800);
})
.catch(function() {
$('#ajaxloader_image').fadeOut(800);
})
})
.catch(function() {
.catch(function(error){
console.error( 'Error opening image', error );
$('#ajaxloader_image').fadeOut(800);
})
})
.catch(function(error){
console.error( 'Error opening image', error );
$('#ajaxloader_image').fadeOut(800);
$('#' + configViewer.global.divId).html( 'Failed to load image: "' + error + '"' );
});
$('#' + configViewer.global.divId).html( 'Failed to load image: "' + error + '"' );
});
};

const initTinyMCE = () => {
let mytiny = tinymce.init({
plugins: 'table',
selector : '.ocr-text',
menubar : '',
toolbar: 'undo redo | formatselect | fontsizeselect | bold italic underline strikethrough | alignleft aligncenter alignright alighnblock | indent outdent | table | pastetext | forecolor backcolor',
paste_as_text: true,
height : "90vh",
license_key: 'gpl',
promotion: false,
init_instance_callback: function (editor) {
editor.on('blur', function (e) {
save();
});
}

});
mytiny.then(mt => {
console.log(mt)
})
};

document.addEventListener('DOMContentLoaded', function() {
showImage();
initTinyMCE();
});

function save() {
let editors = tinymce.editors
for (let i = 0; i != editors.length; i++) {
let editor = editors[i];
let textAreaID = editor.id;
let content = editor.getContent();
let inputID = "input_0".replace("textarea_", "");
document.querySelector('.' + inputID).value = content;
}
return true;
}
</script>
// initialize image viewer and tinyMCE after ajax request
jsf.ajax.addOnEvent(function (data) {
if (data.status === 'success') {
showImage();
initTinyMCE();
}
});
</script>


</ui:define>
Expand Down

Large diffs are not rendered by default.

Loading

0 comments on commit a8333ce

Please sign in to comment.