Newer
Older
<!DOCTYPE html>
<html>
<head>
{% for src in js %}
<script type="text/javascript" src="{{ src }}"></script>
{% endfor %}
{% for src in css %}
<link type="text/css" rel="stylesheet" href="{{ src }}">
{% endfor %}
<script type="text/javascript" src="{{ url_for( 'files.send_app_files', subpath = 'functions.js' ) }}"></script>
<link type="text/css" rel="stylesheet" href="{{ url_for( 'files.send_app_files', subpath = 'app.css' ) }}">

Marco De Donno
committed
<style type="text/css">

Marco De Donno
committed
margin-top: 50px;
}
.icnml_button > div > a {

Marco De Donno
committed
width: 60%;
margin-bottom: 10px;

Marco De Donno
committed
}
</style>
<script type="text/javascript">
baseurl = "{{ baseurl }}";
submission_id = "{{ submission_id }}";

Marco De Donno
committed
file_id = "{{ file[ 'uuid' ] }}";
{% if not admin %}
var password_local = decrypt( sessionStorage.getItem( "session_key" ), "{{ session_security_key }}" );
var nickname = decrypt( "{{ nickname }}", password_local );
var filename = decrypt( "{{ file[ 'filename' ] }}", password_local );
var note = decrypt( "{{ file[ 'note' ] }}", password_local );
{% endif %}

Marco De Donno
committed
var zones_array = new Array();
{% for zone in zones %}
zones_array.push( {{ zone[ 'fpc' ] }} );

Marco De Donno
committed
zonesData[ "{{ zone[ 'fpc' ] }}" ] = {
"fpc": {{ zone[ 'fpc' ] }},
"x": {{ zone[ 'x' ] }},
"y": {{ zone[ 'y' ] }},
"width": {{ zone[ 'width' ] }},
"height": {{ zone[ 'height' ] }},
"orientation": {{ zone[ 'orientation' ] }}

Marco De Donno
committed
};
{% endfor %}
var segments_position_code = {};
{% for fpc in segments_position_code %}
segments_position_code[ "{{ fpc }}" ] = "{{ segments_position_code[ fpc ] }}".replace( "'", "'" );
{% endfor %}
var to_annotate = [];
{% for ta in to_annotate %}
to_annotate.push( {{ ta }} );
{% endfor %}
var orientationsData = {};
{% for zone in zones %}
orientationsData[ "{{ zone[ 'fpc' ] }}" ] = {{ zone[ 'orientation' ] }};
{% endfor %}
var update_quality_db = function()
{
var quality = $( "#file_{{ file[ 'uuid' ] }}_quality > select > option:checked" ).val();
$.ajax( {
url: "{{ url_for( 'submission.submission_tenprint_set_quality', submission_id = submission_id, tenprint_id = file[ 'uuid' ] ) }}",
dataType: "json",
method: "POST",
data: {
quality: quality
},
success: function( data )
{
if( data.error )
toastr.error( "Error while saving the quality value" );
},
error: function( data )
{
toastr.error( "Network error" );
}
} );
}
{% if not admin %}
var update_note_db = function()
{
var note = $( "#file_note" ).val() || null;
note = encrypt( note, password_local );
$.ajax( {
url: "{{ url_for( 'submission.submission_file_set_note', submission_id = submission_id, tenprint_id = file[ 'uuid' ], file_type = 'tenprint' ) }}",
dataType: "json",
method: "POST",
data: {
note: note
}
} );
}
{% endif %}

Marco De Donno
committed
var update_coordinates_informations = function()
{
svg_height = $( window ).height() - 100;
svg_width = svg_height * {{ svg_hw_factor }};
}

Marco De Donno
committed

Marco De Donno
committed
var start_segmentation = function()
{
$( "#segmentation_button_span_text" ).text( "Segmenting..." );
$( "#segmentation_button" ).append(
$( "<span />" )
.attr( "id", "segmentation_button_span_spinner" )
.attr( "class", "ld ld-ring ld-cycle" )
.css( "position", "absolute" )
.css( "right", "20px" )
)
$( "#segmentation_button" ).off( "click" );
$.ajax( {
url: "{{ url_for( 'image.image_tenprint_segmentation', tenprint_id = file[ 'uuid' ] ) }}",
dataType: "json",
success: function( data )
{
$( "#segmentation_button_span_text" ).text( "Segementation updated" );
$( "#segmentation_button_span_spinner" ).remove();
},
error: function( data )
{
$( "#segmentation_button_span_text" ).text( "Error while segmenting..." );
$( "#segmentation_button_span_spinner" ).remove();
}
} );

Marco De Donno
committed
}

Marco De Donno
committed
var updateSVG = function()
{
.css( "width", svg_width )
.css( "height", svg_height );
$( ".icnml_central" )
.css( "width", svg_width * 2 )
.css( "height", svg_height );
$( "#zoomed_image" ).attr( "width", svg_width );
$( "#zoomed_image" ).attr( "height", svg_height );
$( "#tp_polygones" ).empty();
for( var i = 0; i < zones_array.length; i++ )
{
var fpc = zones_array[ i ];
var zone = zonesData[ fpc ];
var x = zone[ "x" ] * svg_width;
var y = zone[ "y" ] * svg_height;
var height = zone[ "height" ] * svg_height;
var width = zone[ "width" ] * svg_width;
var orientation = zone[ "orientation" ];

Marco De Donno
committed
$( "#tp_polygones" )
.append( segment_svg( fpc, x, y, height, width, orientation ) );
$( "#tp_polygones > g > rect" ).on( "mousewheel", mouse_wheel );

Marco De Donno
committed
}
var delete_tenprint = function()
{
$( "<div />" )
.attr( "id", "delete_confirmation" )
.text( "Do you really want to delete this tenprint card?" )
.dialog( {
title: "Confirm tenprint deletion",
modal: true,
buttons: {
url: "{{ url_for( 'submission.submission_tenprint_delete', submission_id = submission_id, tenprint_id = file[ 'uuid' ] ) }}",
dataType: "json",
success: function( data )
{
$( "#delete_confirmation" ).remove();
window.location = "{{ url_for( 'submission.submission_tenprint_list', submission_id = submission_id ) }}";
},
error: function( data )
{
$( "#delete_confirmation" ).remove();
}
} );
Loading
Loading full blame...