clean up includes, double up of fullscreen var, and use of current still
This commit is contained in:
@@ -1,14 +1,17 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% block main_content %}
|
{% block main_content %}
|
||||||
|
|
||||||
<script src="{{ url_for( 'internal', filename='js/files_support.js')}}"></script>
|
|
||||||
<script src="{{ url_for( 'internal', filename='js/files_transform.js')}}"></script>
|
<script src="{{ url_for( 'internal', filename='js/files_transform.js')}}"></script>
|
||||||
|
<script src="{{ url_for( 'internal', filename='js/files_support.js')}}"></script>
|
||||||
|
<script src="{{ url_for( 'internal', filename='js/view_support.js')}}"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// FIXME: used by viewer code - should probably get rid of this?
|
// FIXME: why is this script block at the top? and not at the bottom
|
||||||
var fullscreen=false;
|
|
||||||
document.fake_shift=0
|
document.fake_shift=0
|
||||||
document.fake_ctrl=0
|
document.fake_ctrl=0
|
||||||
|
// FIXME: used by viewer code - should probably get rid of this?
|
||||||
|
var fullscreen=false;
|
||||||
|
// FIXME: doco / and convert to json
|
||||||
var move_paths=[]
|
var move_paths=[]
|
||||||
{% for p in move_paths %}
|
{% for p in move_paths %}
|
||||||
p = new Object()
|
p = new Object()
|
||||||
@@ -19,8 +22,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
// GLOBALS
|
// GLOBALS
|
||||||
// this is which eid we are viewing an image/video (when we dbl-click & then next/prev)
|
// this is the current entry (object) we are viewing - an image/video (used when we dbl-click to view & then in next/prev in view)
|
||||||
document.viewing_eid=null;
|
|
||||||
document.viewing=null;
|
document.viewing=null;
|
||||||
|
|
||||||
var OPT = {{ OPT.to_dict()|tojson }};
|
var OPT = {{ OPT.to_dict()|tojson }};
|
||||||
@@ -34,6 +36,7 @@
|
|||||||
// force pageList to set pageList for & render the first page
|
// force pageList to set pageList for & render the first page
|
||||||
getPage(1,getPageFigures)
|
getPage(1,getPageFigures)
|
||||||
|
|
||||||
|
// FIXME: MOVE to file_support.js
|
||||||
function changeSize()
|
function changeSize()
|
||||||
{
|
{
|
||||||
sz=$('input[name="size"]:checked').val();
|
sz=$('input[name="size"]:checked').val();
|
||||||
@@ -78,6 +81,7 @@
|
|||||||
<span class="alert alert-primary p-2">Searched for: '{{search_term}}'</span>
|
<span class="alert alert-primary p-2">Searched for: '{{search_term}}'</span>
|
||||||
</div class="col my-auto">
|
</div class="col my-auto">
|
||||||
<script>
|
<script>
|
||||||
|
// FIXME: need to move this into getPage (or similar), so its picked up always not just on first load
|
||||||
$('#folders').prop('disabled', 'disabled').removeClass('border-info').addClass('border-secondary').removeClass('text-info').addClass('text-secondary');
|
$('#folders').prop('disabled', 'disabled').removeClass('border-info').addClass('border-secondary').removeClass('text-info').addClass('text-secondary');
|
||||||
</script>
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -158,10 +162,9 @@
|
|||||||
#tst90:hover,#tst90:focus { filter: invert(73%) sepia(27%) saturate(3970%) hue-rotate(146deg) brightness(94%) contrast(100%); }
|
#tst90:hover,#tst90:focus { filter: invert(73%) sepia(27%) saturate(3970%) hue-rotate(146deg) brightness(94%) contrast(100%); }
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script src="{{ url_for( 'internal', filename='js/view_transform.js')}}"></script>
|
|
||||||
<script src="{{ url_for( 'internal', filename='js/view_support.js')}}"></script>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
// FIXME: doco, but also gather all globals together, many make them all document. to be obviously global (and add fullscreen)
|
||||||
var gap=0.8
|
var gap=0.8
|
||||||
var grayscale=0
|
var grayscale=0
|
||||||
var throbber=0
|
var throbber=0
|
||||||
@@ -172,6 +175,7 @@
|
|||||||
var st_path="static/Storage/{{st_path}}"
|
var st_path="static/Storage/{{st_path}}"
|
||||||
var bin_path="static/Bin/{{bin_path}}"
|
var bin_path="static/Bin/{{bin_path}}"
|
||||||
|
|
||||||
|
// FIXME: MOVE these functions to file_support.js
|
||||||
function PrettyFname(fname)
|
function PrettyFname(fname)
|
||||||
{
|
{
|
||||||
s='<span class="alert alert-secondary py-2">'
|
s='<span class="alert alert-secondary py-2">'
|
||||||
@@ -352,7 +356,7 @@
|
|||||||
<svg width="32" height="32" fill="currentColor"><use xlink:href="{{url_for('internal', filename='icons.svg')}}#download"/></svg>
|
<svg width="32" height="32" fill="currentColor"><use xlink:href="{{url_for('internal', filename='icons.svg')}}#download"/></svg>
|
||||||
</button>
|
</button>
|
||||||
<button id="del" class="btn btn-outline-danger p-1" title="Delete (hotkey: Del)"
|
<button id="del" class="btn btn-outline-danger p-1" title="Delete (hotkey: Del)"
|
||||||
onClick="$.ajax({ type: 'POST', data: '&eid-0={{current}}', url: '/delete_files', success: function(data){ window.location='/'; return false; } })">
|
onClick="$.ajax({ type: 'POST', data: '&eid-0='+document.viewing.id, url: '/delete_files', success: function(data){ window.location='/'; return false; } })">
|
||||||
<svg width="32" height="32" fill="currentColor"><use xlink:href="{{url_for('internal', filename='icons.svg')}}#trash"/></svg>
|
<svg width="32" height="32" fill="currentColor"><use xlink:href="{{url_for('internal', filename='icons.svg')}}#trash"/></svg>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -363,6 +367,7 @@
|
|||||||
|
|
||||||
{% block script_content %}
|
{% block script_content %}
|
||||||
<script>
|
<script>
|
||||||
|
// FIXME: MOVE the majorty of below to files_support/view_support. MIGHT help to have urls go into a global too, and then can ignore many of the above items needing url_for
|
||||||
$( document ).keydown(function(event) {
|
$( document ).keydown(function(event) {
|
||||||
// if dbox is visible, dont process this hot-key, we are inputting text
|
// if dbox is visible, dont process this hot-key, we are inputting text
|
||||||
// into inputs instead
|
// into inputs instead
|
||||||
@@ -403,8 +408,6 @@ $( document ).keydown(function(event) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var fullscreen=false;
|
|
||||||
|
|
||||||
$(document).on('click', function(e) { $('.highlight').removeClass('highlight') ; SetButtonState() });
|
$(document).on('click', function(e) { $('.highlight').removeClass('highlight') ; SetButtonState() });
|
||||||
|
|
||||||
function dblClickToViewEntry(id) {
|
function dblClickToViewEntry(id) {
|
||||||
|
|||||||
Reference in New Issue
Block a user