first pass of rotation sub-menu on images. It only posts on Image. For each selection it turns thumbnail gray, overlays a centered color spinning wheel, posts to the f/e to create a rotation job, gets the job id back, keeps checking the f/e to see when the job id is done, and when it is (for now) undoes the spinning wheel/grayscale - will return new thumb once done and pa_job_mgr has no code to handle job as yet
This commit is contained in:
@@ -204,6 +204,9 @@
|
||||
<i style="font-size:16px;background-color:black;color:white" class="fas {{LocationIcon(obj)}}"></i>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div id="s{{obj.id}}" style="display:none; position:absolute; top: 50%; left:50%; transform:translate(-50%, -50%);">
|
||||
<img height="64px" src="static/throbber.gif"></img>
|
||||
</div>
|
||||
</div>
|
||||
{% elif obj.type.name == "Video" %}
|
||||
<div style="position:relative; width:100%">
|
||||
@@ -339,6 +342,41 @@ function DetailsDBox()
|
||||
$('#dbox').modal('show')
|
||||
}
|
||||
|
||||
|
||||
var attempt=0;
|
||||
|
||||
function CheckRotateJob(id,job_id)
|
||||
{
|
||||
console.log( 'CheckRotateJob: ' + id + ', ' + job_id )
|
||||
{# TODO: all the code except for the SetTimeout to be replaced with a post / check response from f/e #}
|
||||
$.ajax(
|
||||
{
|
||||
type: 'POST', data: '&job_id='+job_id, url: '/checkrotatejob', success: function(data) {
|
||||
if( data.finished )
|
||||
{
|
||||
$('#s'+id).hide()
|
||||
$('#'+id).find('img.thumb').attr('style', 'filter: color(100%);' );
|
||||
$('#'+id).addClass('entry')
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
setTimeout( function() { CheckRotateJob(id,job_id) }, 1000,id, job_id );
|
||||
}
|
||||
},
|
||||
} )
|
||||
}
|
||||
|
||||
function Rotate(amt)
|
||||
{
|
||||
console.log('rotate: '+amt)
|
||||
$('.highlight').each(function( id, e ) {
|
||||
post_data = '&amt='+amt+'&id='+e.id
|
||||
{# send rotate for this image, grayscale the thumbmail, add color spinning wheel overlay, and start checking for job end #}
|
||||
$.ajax({ type: 'POST', data: post_data, url: '/rotate', success: function(data){ $('#'+e.id).find('img.thumb').attr('style', 'filter: grayscale(100%);' ); $('#'+e.id).removeClass('entry'); $('#s'+e.id).show(); CheckRotateJob(e.id,data.job_id); return false; } })
|
||||
} )
|
||||
}
|
||||
|
||||
function MoveDBox()
|
||||
{
|
||||
$('#dbox-title').html('Move Selected File(s) to new directory in Storage Path')
|
||||
@@ -415,8 +453,9 @@ function DoSel(e, el)
|
||||
st=Number($('.highlight').first().attr('ecnt'))
|
||||
end=Number($('.highlight').last().attr('ecnt'))
|
||||
clicked=Number($(el).attr('ecnt'))
|
||||
if( ! folders )
|
||||
if( ! $('#folders').value )
|
||||
{
|
||||
console.log( 'out by 1 because flat view' )
|
||||
st -= 1
|
||||
end -= 1
|
||||
clicked -= 1
|
||||
@@ -565,11 +604,11 @@ $.contextMenu({
|
||||
$(s).appendTo('body').submit();
|
||||
}
|
||||
if( key == "move" ) { MoveDBox() }
|
||||
if( key == "del" ) { DelDBox('Delete') }
|
||||
if( key == "undel" ) { DelDBox('Restore') }
|
||||
if( key == "r90" ) { console.log('r90') }
|
||||
if( key == "r180" ) { console.log('r180') }
|
||||
if( key == "r270" ) { console.log('r270') }
|
||||
if( key == "del" ) { DelDBox('Delete') }
|
||||
if( key == "undel") { DelDBox('Restore') }
|
||||
if( key == "r90" ) { Rotate(90) }
|
||||
if( key == "r180" ) { Rotate(180) }
|
||||
if( key == "r270" ) { Rotate(270) }
|
||||
if( key.startsWith("ai")) { RunAIOnSeln(key) }
|
||||
},
|
||||
items: item_list
|
||||
|
||||
Reference in New Issue
Block a user