Skip to content

Commit

Permalink
Merge pull request #711 from open-data-rescue/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
balen authored Apr 27, 2023
2 parents 07c7114 + 09edc4b commit c56794e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
34 changes: 18 additions & 16 deletions app/views/shared/_transcriber_app.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
mouse_over: 'pause',
offset: 50,
delay: delay,
template: '<div data-notify="container" class="col-xs-11 col-sm-10 alert alert-{0}" role="alert"><button type="button" aria-hidden="true" class="close" data-notify="dismiss">&times;</button><span data-notify="icon"></span> <span data-notify="title">{1}</span> <span data-notify="message">{2}</span><div class="progress" data-notify="progressbar"><div class="progress-bar progress-bar-{0}" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div></div><a href="{3}" target="{4}" data-notify="url"></a></div>'
}
);
}
Expand Down Expand Up @@ -396,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");
}
});
},
Expand Down Expand Up @@ -455,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
});
}
});
Expand All @@ -473,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");
}
});
},
Expand Down Expand Up @@ -545,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");
});
}
});
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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. <br><br>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. <br><em>Annotation will be saved after you finish.</em>"
stop-transcribing-modal:
buttons:
mark-finished: "Mark as complete"
Expand Down
2 changes: 1 addition & 1 deletion config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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. <br> <br> 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. <br> <em>L'annotation sera sauvegardée après la fin.</em>"
stop-transcribing-modal:
buttons:
mark-finished: "Marquer comme complète"
Expand Down

0 comments on commit c56794e

Please sign in to comment.