diff --git a/files.py b/files.py index fc66f97..45da43f 100644 --- a/files.py +++ b/files.py @@ -18,6 +18,7 @@ import time import re import json from flask_login import login_required, current_user +from options import Options ################################################################################ # Local Class imports @@ -170,85 +171,20 @@ def ClearJM_Message(id): db.session.commit() return -################################################################################ -# SetViewingOptions: defines set of default values for viewing (order/size, etc.) -# and if a request object (from a POST) is passed in, it returns those instead -# it also handles the cwd appropriately -################################################################################ -def SetViewingOptions( request ): - OPT={} - OPT['noo']="Oldest" - OPT['grouping']="None" - OPT['how_many']="50" - OPT['offset']="0" - OPT['size']="128" - settings=Settings.query.first() - if 'orig_url' in request.form: - print("okay, this has come from a viewer.html and needs next/prev how_many, recreate orig critiera...") - url = request.form['orig_url'] - else: - url = request.path - if 'files_sp' in url: - OPT['noo']="A to Z" - OPT['folders']=True - OPT['path_type'] = 'Storage' - OPT['cwd']='static/Storage' - OPT['paths'] = settings.storage_path.split("#") - elif 'files_rbp' in url: - OPT['folders']=True - OPT['path_type'] = 'Bin' - OPT['cwd']='static/Bin' - OPT['paths'] = settings.recycle_bin_path.split("#") - else: - OPT['folders']=False - OPT['path_type'] = 'Import' - OPT['cwd']='static/Import' - OPT['paths'] = settings.import_path.split("#") - OPT['root']=OPT['cwd'] - - # the above are defaults, if we are here, then we have current values, use them instead - if request.method=="POST": - OPT['noo']=request.form['noo'] - OPT['how_many']=request.form['how_many'] - OPT['offset']=int(request.form['offset']) - OPT['grouping']=request.form['grouping'] - OPT['size'] = request.form['size'] - # seems html cant do boolean, but uses strings so convert - if request.form['folders'] == "False": - OPT['folders']=False - if request.form['folders'] == "True": - OPT['folders']=True - # have to force grouping to None if we flick to folders from a flat - # view with grouping (otherwise we print out group headings for - # child content that is not in the CWD) - OPT['grouping']=None - - OPT['cwd'] = request.form['cwd'] - if 'fullscreen' in request.form: - OPT['fullscreen']=request.form['fullscreen'] - if 'prev' in request.form: - OPT['offset'] -= int(OPT['how_many']) - if OPT['offset'] < 0: - OPT['offset']=0 - if 'next' in request.form: - OPT['offset'] += int(OPT['how_many']) - - return OPT - ################################################################################ # GetEntriesInFlatView: func. to retrieve DB entries appropriate for flat view ################################################################################ def GetEntriesInFlatView( OPT, prefix ): entries=[] - if OPT['noo'] == "Oldest": - entries+=Entry.query.join(File).join(EntryDirLink).join(Dir).join(PathDirLink).join(Path).filter(Path.path_prefix==prefix).order_by(File.year,File.month,File.day,Entry.name).offset(OPT['offset']).limit(OPT['how_many']).all() - elif OPT['noo'] == "Newest": - entries+=Entry.query.join(File).join(EntryDirLink).join(Dir).join(PathDirLink).join(Path).filter(Path.path_prefix==prefix).order_by(File.year.desc(),File.month.desc(),File.day.desc(),Entry.name).offset(OPT['offset']).limit(OPT['how_many']).all() - elif OPT['noo'] == "Z to A": - entries+=Entry.query.join(File).join(EntryDirLink).join(Dir).join(PathDirLink).join(Path).filter(Path.path_prefix==prefix).order_by(Entry.name.desc()).offset(OPT['offset']).limit(OPT['how_many']).all() + if OPT.noo == "Oldest": + entries+=Entry.query.join(File).join(EntryDirLink).join(Dir).join(PathDirLink).join(Path).filter(Path.path_prefix==prefix).order_by(File.year,File.month,File.day,Entry.name).offset(OPT.offset).limit(OPT.how_many).all() + elif OPT.noo == "Newest": + entries+=Entry.query.join(File).join(EntryDirLink).join(Dir).join(PathDirLink).join(Path).filter(Path.path_prefix==prefix).order_by(File.year.desc(),File.month.desc(),File.day.desc(),Entry.name).offset(OPT.offset).limit(OPT.how_many).all() + elif OPT.noo == "Z to A": + entries+=Entry.query.join(File).join(EntryDirLink).join(Dir).join(PathDirLink).join(Path).filter(Path.path_prefix==prefix).order_by(Entry.name.desc()).offset(OPT.offset).limit(OPT.how_many).all() else: - entries+=Entry.query.join(File).join(EntryDirLink).join(Dir).join(PathDirLink).join(Path).filter(Path.path_prefix==prefix).order_by(Entry.name).offset(OPT['offset']).limit(OPT['how_many']).all() + entries+=Entry.query.join(File).join(EntryDirLink).join(Dir).join(PathDirLink).join(Path).filter(Path.path_prefix==prefix).order_by(Entry.name).offset(OPT.offset).limit(OPT.how_many).all() return entries ################################################################################ @@ -258,7 +194,7 @@ def GetEntriesInFlatView( OPT, prefix ): def GetEntriesInFolderView( OPT, prefix ): entries=[] # okay the root cwd is fake, so treat it specially - its Dir can be found by path with dir.rel_path='' - if os.path.dirname(OPT['cwd']) == 'static': + if os.path.dirname(OPT.cwd) == 'static': dir=Entry.query.join(Dir).join(PathDirLink).join(Path).filter(Dir.rel_path=='').filter(Path.path_prefix==prefix).order_by(Entry.name).first() # this can occur if the path in settings does not exist as it wont be in # the DB if not dir: @@ -266,7 +202,7 @@ def GetEntriesInFolderView( OPT, prefix ): # although this is 1 entry, needs to come back via all() to be iterable entries+= Entry.query.filter(Entry.id==dir.id).all() else: - rp = OPT['cwd'].replace( prefix, '' ) + rp = OPT.cwd.replace( prefix, '' ) # when in subdirs, replacing prefix will leave the first char as /, get rid of it if len(rp) and rp[0] == '/': rp=rp[1:] @@ -274,22 +210,22 @@ def GetEntriesInFolderView( OPT, prefix ): # this can occur if the path in settings does not exist as it wont be in # the DB if not dir: return entries - if OPT['noo'] == "Z to A" or "Newest": + if OPT.noo == "Z to A" or "Newest": entries+= Entry.query.join(EntryDirLink).join(FileType).filter(EntryDirLink.dir_eid==dir.id).filter(FileType.name=='Directory').order_by(Entry.name.desc()).all() # just do A to Z / Oldest by default or if no valid option else: entries+= Entry.query.join(EntryDirLink).join(FileType).filter(EntryDirLink.dir_eid==dir.id).filter(FileType.name=='Directory').order_by(Entry.name).all() # add any files at the current CWD (based on dir_eid in DB) - if OPT['noo'] == "Oldest": - entries+=Entry.query.join(File).join(EntryDirLink).filter(EntryDirLink.dir_eid==dir.id).order_by(File.year,File.month,File.day,Entry.name).offset(OPT['offset']).limit(OPT['how_many']).all() - elif OPT['noo'] == "Newest": - entries+=Entry.query.join(File).join(EntryDirLink).filter(EntryDirLink.dir_eid==dir.id).order_by(File.year.desc(),File.month.desc(),File.day.desc(),Entry.name).offset(OPT['offset']).limit(OPT['how_many']).all() - elif OPT['noo'] == "Z to A": - entries+=Entry.query.join(File).join(EntryDirLink).filter(EntryDirLink.dir_eid==dir.id).order_by(Entry.name.desc()).offset(OPT['offset']).limit(OPT['how_many']).all() + if OPT.noo == "Oldest": + entries+=Entry.query.join(File).join(EntryDirLink).filter(EntryDirLink.dir_eid==dir.id).order_by(File.year,File.month,File.day,Entry.name).offset(OPT.offset).limit(OPT.how_many).all() + elif OPT.noo == "Newest": + entries+=Entry.query.join(File).join(EntryDirLink).filter(EntryDirLink.dir_eid==dir.id).order_by(File.year.desc(),File.month.desc(),File.day.desc(),Entry.name).offset(OPT.offset).limit(OPT.how_many).all() + elif OPT.noo == "Z to A": + entries+=Entry.query.join(File).join(EntryDirLink).filter(EntryDirLink.dir_eid==dir.id).order_by(Entry.name.desc()).offset(OPT.offset).limit(OPT.how_many).all() # just do A to Z by default or if no valid option else: - entries+=Entry.query.join(File).join(EntryDirLink).filter(EntryDirLink.dir_eid==dir.id).order_by(Entry.name).offset(OPT['offset']).limit(OPT['how_many']).all() + entries+=Entry.query.join(File).join(EntryDirLink).filter(EntryDirLink.dir_eid==dir.id).order_by(Entry.name).offset(OPT.offset).limit(OPT.how_many).all() return entries @@ -303,19 +239,19 @@ def GetEntries( OPT ): search_term=request.form['search_term'] if 'AI:' in search_term: search_term = search_term.replace('AI:','') - all_entries = Entry.query.join(File).join(FaceFileLink).join(Face).join(FaceRefimgLink).join(Refimg).join(PersonRefimgLink).join(Person).filter(Person.tag.ilike(f"%{search_term}%")).order_by(File.year.desc(),File.month.desc(),File.day.desc(),Entry.name).offset(OPT['offset']).limit(OPT['how_many']).all() + all_entries = Entry.query.join(File).join(FaceFileLink).join(Face).join(FaceRefimgLink).join(Refimg).join(PersonRefimgLink).join(Person).filter(Person.tag.ilike(f"%{search_term}%")).order_by(File.year.desc(),File.month.desc(),File.day.desc(),Entry.name).offset(OPT.offset).limit(OPT.how_many).all() else: - file_data=Entry.query.join(File).filter(Entry.name.ilike(f"%{search_term}%")).order_by(File.year.desc(),File.month.desc(),File.day.desc(),Entry.name).offset(OPT['offset']).limit(OPT['how_many']).all() - dir_data=Entry.query.join(File).join(EntryDirLink).join(Dir).filter(Dir.rel_path.ilike(f"%{search_term}%")).order_by(File.year.desc(),File.month.desc(),File.day.desc(),Entry.name).offset(OPT['offset']).limit(OPT['how_many']).all() - ai_data=Entry.query.join(File).join(FaceFileLink).join(Face).join(FaceRefimgLink).join(Refimg).join(PersonRefimgLink).join(Person).filter(Person.tag.ilike(f"%{search_term}%")).order_by(File.year.desc(),File.month.desc(),File.day.desc(),Entry.name).offset(OPT['offset']).limit(OPT['how_many']).all() + file_data=Entry.query.join(File).filter(Entry.name.ilike(f"%{search_term}%")).order_by(File.year.desc(),File.month.desc(),File.day.desc(),Entry.name).offset(OPT.offset).limit(OPT.how_many).all() + dir_data=Entry.query.join(File).join(EntryDirLink).join(Dir).filter(Dir.rel_path.ilike(f"%{search_term}%")).order_by(File.year.desc(),File.month.desc(),File.day.desc(),Entry.name).offset(OPT.offset).limit(OPT.how_many).all() + ai_data=Entry.query.join(File).join(FaceFileLink).join(Face).join(FaceRefimgLink).join(Refimg).join(PersonRefimgLink).join(Person).filter(Person.tag.ilike(f"%{search_term}%")).order_by(File.year.desc(),File.month.desc(),File.day.desc(),Entry.name).offset(OPT.offset).limit(OPT.how_many).all() all_entries = file_data + dir_data + ai_data return all_entries - for path in OPT['paths']: + for path in OPT.paths: if not os.path.exists(path): continue - prefix = SymlinkName(OPT['path_type'],path,path+'/') - if OPT['folders']: + prefix = SymlinkName(OPT.path_type,path,path+'/') + if OPT.folders: entries+=GetEntriesInFolderView( OPT, prefix ) else: entries+=GetEntriesInFlatView( OPT, prefix ) @@ -327,7 +263,7 @@ def GetEntries( OPT ): @app.route("/file_list_ip", methods=["GET","POST"]) @login_required def file_list_ip(): - OPT=SetViewingOptions( request ) + OPT=Options( request ) entries=GetEntries( OPT ) return render_template("file_list.html", page_title='View File Details (Import Path)', entry_data=entries, OPT=OPT ) @@ -337,10 +273,10 @@ def file_list_ip(): @app.route("/files_ip", methods=["GET", "POST"]) @login_required def files_ip(): - OPT=SetViewingOptions( request ) + OPT=Options( request ) entries=GetEntries( OPT ) people = Person.query.all() - return render_template("files.html", page_title=f"View Files ({OPT['path_type']} Path)", entry_data=entries, OPT=OPT, people=people ) + return render_template("files.html", page_title=f"View Files ({OPT.path_type} Path)", entry_data=entries, OPT=OPT, people=people ) ################################################################################ # /files -> show thumbnail view of files from storage_path @@ -348,10 +284,10 @@ def files_ip(): @app.route("/files_sp", methods=["GET", "POST"]) @login_required def files_sp(): - OPT=SetViewingOptions( request ) + OPT=Options( request ) entries=GetEntries( OPT ) people = Person.query.all() - return render_template("files.html", page_title=f"View Files ({OPT['path_type']} Path)", entry_data=entries, OPT=OPT, people=people ) + return render_template("files.html", page_title=f"View Files ({OPT.path_type} Path)", entry_data=entries, OPT=OPT, people=people ) ################################################################################ @@ -360,10 +296,10 @@ def files_sp(): @app.route("/files_rbp", methods=["GET", "POST"]) @login_required def files_rbp(): - OPT=SetViewingOptions( request ) + OPT=Options( request ) entries=GetEntries( OPT ) people = Person.query.all() - return render_template("files.html", page_title=f"View Files ({OPT['path_type']} Path)", entry_data=entries, OPT=OPT ) + return render_template("files.html", page_title=f"View Files ({OPT.path_type} Path)", entry_data=entries, OPT=OPT ) ################################################################################ @@ -372,9 +308,9 @@ def files_rbp(): @app.route("/search", methods=["GET","POST"]) @login_required def search(): - OPT=SetViewingOptions( request ) + OPT=Options( request ) # always show flat results for search to start with - OPT['folders']=False + OPT.folders=False entries=GetEntries( OPT ) return render_template("files.html", page_title='View Files', search_term=request.form['search_term'], entry_data=entries, OPT=OPT ) @@ -522,7 +458,7 @@ def move_files(): @app.route("/viewlist", methods=["POST"]) @login_required def viewlist(): - OPT=SetViewingOptions( request ) + OPT=Options( request ) # Get next/prev set of data - e.g. if next set, then it will use orig_url # to go forward how_many from offset and then use viewer.html to show that # first obj of the new list of entries @@ -531,10 +467,10 @@ def viewlist(): # it) and it just happened to also be the last in the DB... if not entries: # undo the skip by how_many and getentries again - OPT['offset'] -= int(OPT['how_many']) + OPT.offset -= int(OPT.how_many) entries=GetEntries( OPT ) # now flag we are at the last in db, to reset current below - OPT['last_entry_in_db']=1 + OPT.last_entry_in_db=1 objs = {} eids="" for e in entries: @@ -550,10 +486,10 @@ def viewlist(): current = int(lst[0]) if 'prev' in request.form: current = int(lst[-1]) - if 'last_entry_in_db' in OPT: + if hasattr( OPT, 'last_entry_in_db' ): # force this back to the last image of the last page - its the last in the DB, so set OPT for it current = int(lst[-1]) - OPT['last_entry_in_db']=current + OPT.last_entry_in_db=current return render_template("viewer.html", current=current, eids=eids, objs=objs, OPT=OPT ) @@ -563,7 +499,7 @@ def viewlist(): @app.route("/view/", methods=["POST"]) @login_required def view_img(id): - OPT=SetViewingOptions( request ) + OPT=Options( request ) eids=request.form['eids'].rstrip(',') objs = {} lst = eids.split(',') @@ -638,7 +574,7 @@ def custom_static(filename): ############################################################################### # This func creates a new filter in jinja2 to test to see if the Dir being -# checked, is a top-level folder of 'OPT['cwd']' +# checked, is a top-level folder of 'OPT.cwd' ################################################################################ @app.template_filter('TopLevelFolderOf') def _jinja2_filter_toplevelfolderof(path, cwd): diff --git a/internal/js/view_support.js b/internal/js/view_support.js new file mode 100644 index 0000000..1eb782a --- /dev/null +++ b/internal/js/view_support.js @@ -0,0 +1,161 @@ + function NewWidth() + { + w_r=im.width/(window.innerWidth*gap) + h_r=im.height/(window.innerHeight*gap) + if( w_r > h_r ) + return window.innerWidth*gap + else + return im.width*gap / (im.height/window.innerHeight) + } + + function NewHeight() + { + w_r=im.width/(window.innerWidth*gap) + h_r=im.height/(window.innerHeight*gap) + if( h_r > w_r ) + return window.innerHeight*gap + else + return im.height*gap / (im.width/window.innerWidth) + } + + // Define this once and before it will be called, hence at the top of this file + function DrawImg() + { + // another call to this func will occur on load, so skip this one + if( im.width == 0 ) + return + + canvas.width=NewWidth(im) + canvas.height=NewHeight(im) + + // actually draw the pixel images to the canvas at the right size + if( grayscale ) + context.filter='grayscale(1)' + context.drawImage(im, 0, 0, canvas.width, canvas.height ) + // -50 is a straight up hack, no idea why this works, but its good enough for me + if( throbber ) + $('#throbber').attr('style', 'display:show; position:absolute; left:'+canvas.width/2+'px; top:'+(canvas.height/2-50)+'px' ) + else + $('#throbber').hide(); + + + // show (or not) the whole figcaption with fname in it - based on state of fname_toggle + if( $('#fname_toggle').prop('checked' ) ) + { + $('.figcaption').attr('style', 'display:show' ) + // reset fname for new image (if navigated left/right to get here) + $('#fname').html(objs[current].name) + } + else + $('.figcaption').attr('style', 'display:none' ) + + // if we have faces, the enable the toggles, otherwise disable them + // and reset model select too + if( objs[current].faces.length ) + { + $('#faces').attr('disabled', false) + $('#distance').attr('disabled', false) + $('#model').val( Number(objs[current].face_model) ) + } + else + { + $('#faces').attr('disabled', true) + $('#distance').attr('disabled', true) + // if no faces, then model is N/A (always 1st element - or 0 in select) + $('#model').val(0) + } + + // okay, we want faces drawn so lets do it + if( $('#faces').prop('checked') ) + { + // draw rect on each face + for( i=0; i" + return str + + hostname = socket.gethostname() PROD_HOST="pa_web" diff --git a/templates/file_list.html b/templates/file_list.html index 6f356cd..44b6577 100644 --- a/templates/file_list.html +++ b/templates/file_list.html @@ -2,26 +2,26 @@

{{page_title}}

- +
- {{CreateSelect( "noo", OPT['noo'], ["Oldest", "Newest","A to Z", "Z to A"], "$('#offset').val(0)", "rounded-start py-1 my-1")|safe }} - {{CreateSelect( "how_many", OPT['how_many'], ["10", "25", "50", "75", "100", "150", "200", "500"], "", "rounded-end py-1 my-1" )|safe }} + {{CreateSelect( "noo", OPT.noo, ["Oldest", "Newest","A to Z", "Z to A"], "$('#offset').val(0)", "rounded-start py-1 my-1")|safe }} + {{CreateSelect( "how_many", OPT.how_many, ["10", "25", "50", "75", "100", "150", "200", "500"], "", "rounded-end py-1 my-1" )|safe }}
{% set prv_disabled="" %} - {% if OPT['offset']|int == 0 %} + {% if OPT.offset|int == 0 %} {% set prv_disabled="disabled" %} {% endif %} -  {{OPT['how_many']}} files  +  {{OPT.how_many}} files  {% set nxt_disabled="" %} - {% if entry_data|length < OPT['how_many']|int %} + {% if entry_data|length < OPT.how_many|int %} {% set nxt_disabled="disabled" %} {% endif %} -  {{OPT['how_many']}} files  +  {{OPT.how_many}} files  {% set nxt_disabled="" %} - {% if entry_data|length < OPT['how_many']|int %} + {% if entry_data|length < OPT.how_many|int %} {% set nxt_disabled="disabled" %} {% endif %}
- {% if OPT['size'] == "64" %} + {% if OPT.size == "64" %} {% set bt="btn-info text-white" %} {% else %} {% set bt="btn-outline-info" %} {% endif %} - {% if OPT['size'] == "96" %} + {% if OPT.size == "96" %} {% set bt="btn-info text-white" %} {% else %} {% set bt="btn-outline-info" %} {% endif %} - {% if OPT['size'] == "128" %} + {% if OPT.size == "128" %} {% set bt="btn-info text-white" %} {% else %} {% set bt="btn-outline-info" %} {% endif %} - {% if OPT['size'] == "192" %} + {% if OPT.size == "192" %} {% set bt="btn-info text-white" %} {% else %} {% set bt="btn-outline-info" %} {% endif %} - {% if OPT['size'] == "256" %} + {% if OPT.size == "256" %} {% set bt="btn-info text-white" %} {% else %} {% set bt="btn-outline-info" %} @@ -104,8 +104,8 @@
- - + +
{% set eids=namespace( str="" ) %} {# gather all the file eids and collect them in case we go gallery mode #} @@ -120,59 +120,59 @@
{% set last = namespace(printed=0) %} {# rare event of empty folder, still need to show back button #} - {% if OPT['folders'] and entry_data|length == 0 %} - {% if OPT['cwd'] != OPT['root'] %} -
- + {% if OPT.folders and entry_data|length == 0 %} + {% if OPT.cwd != OPT.root %} +
+
Back
{% else %}
- +
{% endif %} {% endif %} {% for obj in entry_data %} - {% if loop.index==1 and OPT['folders'] %} - {% if OPT['cwd'] != OPT['root'] %} -
- + {% if loop.index==1 and OPT.folders %} + {% if OPT.cwd != OPT.root %} +
+
Back
{% else %} {# create an even lighter-grey, unclickable back button - so folders dont jump around when you go into them #}
- +
{% endif %} {% endif %} - {% if not OPT['folders'] and obj.type.name == "Directory" %} + {% if not OPT.folders and obj.type.name == "Directory" %} {% continue %} {% endif %} - {% if OPT['grouping'] == "Day" %} + {% if OPT.grouping == "Day" %} {% if last.printed != obj.file_details.day %}
Day: {{obj.file_details.day}} of {{obj.file_details.month}}/{{obj.file_details.year}}
{% set last.printed = obj.file_details.day %} {% endif %} - {% elif OPT['grouping'] == "Week" %} + {% elif OPT.grouping == "Week" %} {% if last.printed != obj.file_details.woy %}
Week #: {{obj.file_details.woy}} of {{obj.file_details.year}}
{% set last.printed = obj.file_details.woy %} {% endif %} - {% elif OPT['grouping'] == "Month" %} + {% elif OPT.grouping == "Month" %} {% if last.printed != obj.file_details.month %}
Month: {{obj.file_details.month}} of {{obj.file_details.year}}
{% set last.printed = obj.file_details.month %} {% endif %} {% endif %} {% if obj.type.name != "Directory" %} - {% if (not OPT['folders']) or ((obj.in_dir.in_path.path_prefix+'/'+obj.in_dir.rel_path+'/'+obj.name) | TopLevelFolderOf(OPT['cwd'])) %} + {% if (not OPT.folders) or ((obj.in_dir.in_path.path_prefix+'/'+obj.in_dir.rel_path+'/'+obj.name) | TopLevelFolderOf(OPT.cwd)) %}
{% if obj.type.name=="Image" %}
- + {% if search_term is defined %}
@@ -184,7 +184,7 @@
{% elif obj.type.name == "Video" %}
- +
@@ -198,16 +198,16 @@
{% endif %} {% else %} - {% if OPT['folders'] %} + {% if OPT.folders %} {% if obj.dir_details.rel_path | length %} {% set dirname=obj.dir_details.in_path.path_prefix+'/'+obj.dir_details.rel_path %} {% else %} {% set dirname=obj.dir_details.in_path.path_prefix %} {% endif %} {# if this dir is the toplevel of the cwd, show the folder icon #} - {% if dirname| TopLevelFolderOf(OPT['cwd']) %} + {% if dirname| TopLevelFolderOf(OPT.cwd) %}
- +
{{obj.name}}
@@ -220,13 +220,13 @@
- +
-  {{OPT['how_many']}} files  +  {{OPT.how_many}} files  @@ -251,14 +251,14 @@ function CallViewRoute(id) { s='' s+='' - s+='' - s+='' - s+='' - s+='' - s+='' - s+='' - s+='' - s+='' + s+='' + s+='' + s+='' + s+='' + s+='' + s+='' + s+='' + s+='' s+='' {% if search_term is defined %} s+='' @@ -344,7 +344,7 @@ $.contextMenu({ $(document).ready(function() { - if( {{OPT['offset']}} == 0 ) + if( {{OPT.offset}} == 0 ) { $('.prev').addClass('disabled') $('.prev').prop('disabled', true) diff --git a/templates/viewer.html b/templates/viewer.html index 68d771c..8631829 100644 --- a/templates/viewer.html +++ b/templates/viewer.html @@ -54,14 +54,14 @@ { s='' s+='' - s+='' - s+='' - s+='' - s+='' - s+='' - s+='' - s+='' - s+='' + s+='' + s+='' + s+='' + s+='' + s+='' + s+='' + s+='' + s+='' s+='' s+='' {% if search_term is defined %} @@ -80,7 +80,7 @@