From b7ed919b201f6daefd264ef6bda7811ee7264904 Mon Sep 17 00:00:00 2001 From: balen Date: Tue, 25 Apr 2023 08:48:39 -0400 Subject: [PATCH 1/2] change alert template so that it is wider and text to have less lines --- app/views/shared/_transcriber_app.html.erb | 2 ++ config/locales/en.yml | 2 +- config/locales/fr.yml | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/shared/_transcriber_app.html.erb b/app/views/shared/_transcriber_app.html.erb index 29ca3431..e69ade67 100644 --- a/app/views/shared/_transcriber_app.html.erb +++ b/app/views/shared/_transcriber_app.html.erb @@ -116,6 +116,7 @@ mouse_over: 'pause', offset: 50, delay: delay, + template: '' } ); } @@ -1067,6 +1068,7 @@ $('.modal, .modal-backdrop').remove(); $('body').removeClass("modal-open"); + // TODO setMsg(('<%= j t('transcriber.messages.draw-annotation-box-instructions-with-field-group').html_safe %>').replace('%{field_group}', fieldGroupName), false, "info"); var annotation = new Annotation(this.options.data); diff --git a/config/locales/en.yml b/config/locales/en.yml index 092096ae..c89b6e87 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1243,7 +1243,7 @@ en: annotation-saved: "Annotation saved successfully!" annotation-saved-with-field-group: "%{field_group} annotation saved successfully!" boxer-message-preference-save-failed: "Unable to save annotation box tutorial preference." - draw-annotation-box-instructions-with-field-group: "Click and drag the main image to draw a box around the %{field_group} observation that you just transcribed. Don't include the date or time.

Annotation will be saved after you finish." + draw-annotation-box-instructions-with-field-group: "Click and drag the main image to draw a box around the %{field_group} observation that you just transcribed. Don't include the date or time.
Annotation will be saved after you finish." stop-transcribing-modal: buttons: mark-finished: "Mark as complete" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 97c760e7..8b1aa228 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -909,7 +909,7 @@ fr: annotation-saved: "L'annotation a été sauvegardée avec succès" annotation-saved-with-field-group: "L'annotation « %{field_group} » a été sauvegardée avec succès" boxer-message-preference-save-failed: "Impossible d'enregistrer les préférences d'aide des annotations." - draw-annotation-box-instructions-with-field-group: "Cliquez et faites glisser l'image principale pour marquer une boîte autour de l'observation %{field_group} que vous venez de transcrire. N'incluez pas la date ou l'heure.

L'annotation sera sauvegardée après la fin." + draw-annotation-box-instructions-with-field-group: "Cliquez et faites glisser l'image principale pour marquer une boîte autour de l'observation %{field_group} que vous venez de transcrire. N'incluez pas la date ou l'heure.
L'annotation sera sauvegardée après la fin." stop-transcribing-modal: buttons: mark-finished: "Marquer comme complète" From f0864834d2449228dfe7199b7941c8bc74cfcd80 Mon Sep 17 00:00:00 2001 From: balen Date: Thu, 27 Apr 2023 14:36:52 -0400 Subject: [PATCH 2/2] namespace events so that click is not removed from calendar --- app/views/shared/_transcriber_app.html.erb | 32 +++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/app/views/shared/_transcriber_app.html.erb b/app/views/shared/_transcriber_app.html.erb index e69ade67..160987bd 100644 --- a/app/views/shared/_transcriber_app.html.erb +++ b/app/views/shared/_transcriber_app.html.erb @@ -397,27 +397,27 @@ $box.resizable({ handles: 'ne, nw, se, sw', create : function() { - $(document).on("keyup", function(e) { + $(document).on("keyup.draw.resize", function(e) { e.preventDefault(); if( e.which === 27 || e.keyCode === 27 ){ $box.find(".annotation-actions").show(); $box.resizable("destroy"); pageCanvas.enableScrolling(); - $(document).off("keyup"); + $(document).off("keyup.draw.resize"); self.clearMsg(); - $(document).off("click"); + $(document).off("click.draw.resize"); }; }); - $(document).on("click", function(e) { + $(document).on("click.draw.resize", function(e) { e.preventDefault(); thing = $(e.target).closest('.annotation-marker').first().attr('id'); if (thing != self.el.id) { $box.find(".annotation-actions").show(); $box.resizable("destroy"); pageCanvas.enableScrolling(); - $(document).off("keyup"); + $(document).off("keyup.draw.resize"); self.clearMsg(); - $(document).off("click"); + $(document).off("click.draw.resize"); } }); }, @@ -456,8 +456,8 @@ $box.find(".annotation-actions").show(); $box.resizable("destroy"); pageCanvas.enableScrolling() - $(document).off("keyup"); - $(document).off("click"); + $(document).off("keyup.draw.resize"); + $(document).off("click.draw.resize"); // THIS IS A PROBLEM }); } }); @@ -474,26 +474,26 @@ $box.draggable({ appendTo: "#annotated_page", create : function() { - $(document).on("keyup", function(e) { + $(document).on("keyup.draw.move", function(e) { e.preventDefault(); if( e.which === 27 || e.keyCode === 27 ){ $box.find(".annotation-actions").show(); $box.draggable("destroy"); pageCanvas.enableScrolling() - $(document).off("keyup"); - $box.off("click"); + $(document).off("keyup.draw.move"); + $box.off("click.draw.move"); }; }); - $(document).on("click", function(e) { + $(document).on("click.draw.move", function(e) { e.preventDefault(); thing = $(e.target).closest('.annotation-marker').first().attr('id'); if (thing != self.el.id) { $box.find(".annotation-actions").show(); $box.draggable("destroy"); pageCanvas.enableScrolling(); - $(document).off("keyup"); + $(document).off("keyup.draw.move"); self.clearMsg(); - $(document).off("click"); + $(document).off("click.draw.move"); } }); }, @@ -546,8 +546,8 @@ $box.find(".annotation-actions").show(); $box.draggable("destroy"); pageCanvas.enableScrolling() - $(document).off("keyup"); - $(document).off("click"); + $(document).off("keyup.draw.move"); + $(document).off("click.draw.move"); }); } });