Skip to content
This repository was archived by the owner on May 28, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
},
"rules": {
"no-jquery/no-global-selector": "warn",
"no-new": "warn",
"yml/no-empty-document": "warn",
"yml/no-empty-mapping-value": "warn"
}
Expand Down
6 changes: 3 additions & 3 deletions assets/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import 'select2';

const $ = require( 'jquery' );
const $select2 = $( '#lang' );

Check warning on line 6 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.1, true)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible

Check warning on line 6 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.0, true)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible

Check warning on line 6 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.2, false)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible

Check warning on line 6 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.3, false)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible
let selectedLanguages = [];
const $lineDetectionSelect = $( '#line-id' );

Check warning on line 8 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.1, true)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible

Check warning on line 8 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.0, true)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible

Check warning on line 8 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.2, false)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible

Check warning on line 8 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.3, false)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible
let lineModels = null;

const Cropper = require( 'cropperjs' );
Expand Down Expand Up @@ -70,7 +70,7 @@

// append static options
staticOptionData.slice( 0, 2 ).forEach( ( staticOption ) => {
$lineDetectionSelect.append( new Option( staticOption.text, staticOption.value, staticOption.value === null, false ) );

Check warning on line 73 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.1, true)

This line has a length of 127. Maximum allowed is 100

Check warning on line 73 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.0, true)

This line has a length of 127. Maximum allowed is 100

Check warning on line 73 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.2, false)

This line has a length of 127. Maximum allowed is 100

Check warning on line 73 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.3, false)

This line has a length of 127. Maximum allowed is 100
} );

// append all other line detection models as options
Expand All @@ -86,7 +86,7 @@
fetchLineModelsJSON();

// Remove nojs class, for styling non-Javascript users.
$( 'html' ).removeClass( 'nojs' );

Check warning on line 89 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.1, true)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible

Check warning on line 89 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.0, true)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible

Check warning on line 89 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.2, false)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible

Check warning on line 89 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.3, false)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible

// Initiate Select2, which allows dynamic entry of languages.
$select2.select2( {
Expand All @@ -111,24 +111,24 @@
const previousDataPlaceholder = $select2.attr( 'data-placeholder' );

// Show engine-specific options.
$( '[name=engine]' ).on( 'change', ( e ) => {

Check warning on line 114 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.1, true)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible

Check warning on line 114 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.0, true)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible

Check warning on line 114 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.2, false)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible

Check warning on line 114 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.3, false)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible
const engine = e.target.value;
updateSelect2Options( engine );
$( '.engine-options' ).addClass( 'hidden' );

Check warning on line 117 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.1, true)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible

Check warning on line 117 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.0, true)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible

Check warning on line 117 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.2, false)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible

Check warning on line 117 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.3, false)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible
$( `#${ engine }-options` ).removeClass( 'hidden' );
if ( engine === 'tesseract' || engine === 'google' ) {
$select2.prop( 'required', false );
$select2.attr( 'data-placeholder', previousDataPlaceholder );
$select2.data( 'select2' ).selection.placeholder.text = previousDataPlaceholder;
$( '#transkribus-lang-label' ).addClass( 'hidden' );

Check warning on line 123 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.1, true)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible

Check warning on line 123 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.0, true)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible

Check warning on line 123 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.2, false)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible

Check warning on line 123 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.3, false)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible
$( '#optional-lang-label' ).removeClass( 'hidden' );

Check warning on line 124 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.1, true)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible

Check warning on line 124 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.0, true)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible

Check warning on line 124 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.2, false)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible

Check warning on line 124 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.3, false)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible
} else {
updateLineModelOptions();
$( '#transkribus-help' ).removeClass( 'hidden' );

Check warning on line 127 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.1, true)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible

Check warning on line 127 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.0, true)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible

Check warning on line 127 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.2, false)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible

Check warning on line 127 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.3, false)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible
$select2.prop( 'required', true );
$select2.attr( 'data-placeholder', '' );
$select2.data( 'select2' ).selection.placeholder.text = '';
$( '#optional-lang-label' ).addClass( 'hidden' );

Check warning on line 131 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.1, true)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible

Check warning on line 131 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.0, true)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible

Check warning on line 131 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.2, false)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible

Check warning on line 131 in assets/app.js

View workflow job for this annotation

GitHub Actions / build (8.3, false)

Avoid queries which search the entire DOM. Keep DOM nodes in memory where possible
$( '#transkribus-lang-label' ).removeClass( 'hidden' );
}
} );
Expand Down Expand Up @@ -173,7 +173,7 @@
width = document.querySelector( '[name="crop[width]"]' ),
height = document.querySelector( '[name="crop[height]"]' ),
$modeButtons = $( '.drag-mode' );
new Cropper( img, {
const cropper = new Cropper( img, {
viewMode: 2,
dragMode: 'move',
// Remove double-click drag mode toggling, because we've got buttons for that.
Expand All @@ -184,14 +184,14 @@
ready() {
// Make textarea match height of image.
$( '#text' ).css( {
height: this.cropper.getContainerData().height
height: cropper.getContainerData().height
} );
// React to changes in the crop-mode buttons.
$modeButtons.on( 'click', ( event ) => {
const $button = $( event.currentTarget );
$modeButtons.removeClass( 'active' );
$button.addClass( 'active' );
this.cropper.setDragMode( $button.data( 'drag-mode' ) );
cropper.setDragMode( $button.data( 'drag-mode' ) );
} );
},
data: {
Expand Down
Loading