diff --git a/vasl_templates/main_window.py b/vasl_templates/main_window.py index ab121f0..ec50cdb 100644 --- a/vasl_templates/main_window.py +++ b/vasl_templates/main_window.py @@ -334,3 +334,11 @@ class MainWindow( QWidget ): def on_snippet_image( self, img_data ): """Called when a snippet image has been generated.""" self._web_channel_handler.on_snippet_image( img_data ) + + @pyqtSlot( str, str, result=bool ) + @catch_exceptions( caption="SLOT EXCEPTION", retval=False ) + def save_downloaded_vsav( self, fname, data ): + """Called when a VASL scenario has been downloaded.""" + data = base64.b64decode( data ) + # NOTE: We handle this the same as saving an updated VSAV. + return self._web_channel_handler.save_updated_vsav( fname, data ) diff --git a/vasl_templates/webapp/__init__.py b/vasl_templates/webapp/__init__.py index e41a39f..23dc664 100644 --- a/vasl_templates/webapp/__init__.py +++ b/vasl_templates/webapp/__init__.py @@ -83,6 +83,9 @@ app = Flask( __name__ ) app.config[ "ASA_SCENARIO_URL" ] = "https://aslscenarioarchive.com/scenario.php?id={ID}" app.config[ "ASA_PUBLICATION_URL" ] = "https://aslscenarioarchive.com/viewPub.php?id={ID}" app.config[ "ASA_PUBLISHER_URL" ] = "https://aslscenarioarchive.com/viewPublisher.php?id={ID}" +app.config[ "ASA_GET_SCENARIO_URL" ] = "https://aslscenarioarchive.com/rest/scenario/list/{ID}" +app.config[ "ASA_MAX_VASL_SETUP_SIZE" ] = 200 # nb: KB +app.config[ "ASA_MAX_SCREENSHOT_SIZE" ] = 200 # nb: KB # load the application configuration config_dir = os.path.join( BASE_DIR, "config" ) diff --git a/vasl_templates/webapp/downloads.py b/vasl_templates/webapp/downloads.py index 473981b..0e7a4ce 100644 --- a/vasl_templates/webapp/downloads.py +++ b/vasl_templates/webapp/downloads.py @@ -46,14 +46,14 @@ class DownloadedFile: _registry.add( self ) # check if we have a cached copy of the file - self._cache_fname = os.path.join( tempfile.gettempdir(), "vasl-templates."+fname ) - if os.path.isfile( self._cache_fname ): + self.cache_fname = os.path.join( tempfile.gettempdir(), "vasl-templates."+fname ) + if os.path.isfile( self.cache_fname ): # yup - load it - _logger.info( "Using cached %s file: %s", key, self._cache_fname ) - self._set_data( self._cache_fname ) + _logger.info( "Using cached %s file: %s", key, self.cache_fname ) + self._set_data( self.cache_fname ) else: # nope - start with an empty data set - _logger.debug( "No cached %s file: %s", key, self._cache_fname ) + _logger.debug( "No cached %s file: %s", key, self.cache_fname ) def _set_data( self, data ): """Install a new data set.""" @@ -114,9 +114,9 @@ class DownloadedFile: _logger.info( "Download of the %s file has been disabled.", df.key ) continue ttl *= 60*60 - if os.path.isfile( df._cache_fname ): + if os.path.isfile( df.cache_fname ): # yup - check how long ago it was downloaded - mtime = os.path.getmtime( df._cache_fname ) + mtime = os.path.getmtime( df.cache_fname ) age = int( time.time() - mtime ) _logger.debug( "Checking the cached %s file: age=%s, ttl=%s (mtime=%s)", df.key, @@ -130,7 +130,10 @@ class DownloadedFile: # download the file _logger.info( "Downloading the %s file: %s", df.key, url ) try: - fp = urllib.request.urlopen( url ) + req = urllib.request.Request( url, + headers = { "Accept-Encoding": "gzip, deflate" } + ) + fp = urllib.request.urlopen( req ) data = fp.read().decode( "utf-8" ) except Exception as ex: #pylint: disable=broad-except msg = str( getattr(ex,"reason",None) or ex ) @@ -150,6 +153,6 @@ class DownloadedFile: # is performance-critical and we can probably live it. # save a cached copy of the data - _logger.debug( "Saving a cached copy of the %s file: %s", df.key, df._cache_fname ) - with open( df._cache_fname, "w", encoding="utf-8" ) as fp: + _logger.debug( "Saving a cached copy of the %s file: %s", df.key, df.cache_fname ) + with open( df.cache_fname, "w", encoding="utf-8" ) as fp: fp.write( data ) diff --git a/vasl_templates/webapp/main.py b/vasl_templates/webapp/main.py index 8ce22bf..17ba581 100644 --- a/vasl_templates/webapp/main.py +++ b/vasl_templates/webapp/main.py @@ -68,6 +68,7 @@ _APP_CONFIG_DEFAULTS = { # Bodhgaya, India (APR/19) # but VASSAL is already so slow to load images, and doing everything twice would make it that much worse :-/ "ONLINE_COUNTER_IMAGES_URL_TEMPLATE": "https://raw.githubusercontent.com/vasl-developers/vasl/develop/dist/images/{{PATH}}", #pylint: disable=line-too-long "ONLINE_EXTN_COUNTER_IMAGES_URL_TEMPLATE": "http://vasl-templates.org/services/counter/{{EXTN_ID}}/{{PATH}}", + "ASA_UPLOAD_URL": "https://aslscenarioarchive.com/rest/update/{ID}?user={USER}&token={TOKEN}", } @app.route( "/app-config" ) @@ -95,6 +96,10 @@ def get_app_config(): for key in ["APP_NAME","APP_VERSION","APP_DESCRIPTION","APP_HOME_URL"]: vals[ key ] = getattr( vasl_templates.webapp.config.constants, key ) + # include the ASL Scenario Archive config + for key in ["ASA_MAX_VASL_SETUP_SIZE","ASA_MAX_SCREENSHOT_SIZE"]: + vals[ key ] = app.config[ key ] + # include the dice hotness config vals[ "LFA_DICE_HOTNESS_WEIGHTS" ] = get_json_val( "LFA_DICE_HOTNESS_WEIGHTS", DEFAULT_LFA_DICE_HOTNESS_WEIGHTS diff --git a/vasl_templates/webapp/scenarios.py b/vasl_templates/webapp/scenarios.py index 4140278..32ca3a9 100644 --- a/vasl_templates/webapp/scenarios.py +++ b/vasl_templates/webapp/scenarios.py @@ -3,13 +3,24 @@ # NOTE: Disable "DownloadedFile has no 'index' member" warnings. #pylint: disable=no-member +import os +import json +import urllib.request +import base64 import re +import time +import math +import logging from flask import request, render_template, jsonify, abort +from PIL import Image, ImageOps from vasl_templates.webapp import app from vasl_templates.webapp.downloads import DownloadedFile -from vasl_templates.webapp.utils import get_month_name, make_formatted_day_of_month, friendly_fractions, parse_int +from vasl_templates.webapp.vassal import VassalShim +from vasl_templates.webapp.utils import TempFile, \ + get_month_name, make_formatted_day_of_month, friendly_fractions, parse_int, \ + trim_image, get_image_data, remove_alpha_from_image # --------------------------------------------------------------------- @@ -97,7 +108,7 @@ def get_scenario_index(): with _asa_scenarios: if _asa_scenarios.index is None: return _make_not_available_response( - "The scenario index is not available.", _asa_scenarios.error_msg + "Please wait, the scenario index is still downloading.", _asa_scenarios.error_msg ) return jsonify( [ make_entry( scenario ) @@ -110,13 +121,13 @@ def get_roar_scenario_index(): with _roar_scenarios: if _roar_scenarios.index is None: return _make_not_available_response( - "The ROAR scenarios are not available.", _roar_scenarios.error_msg + "Please wait, the ROAR scenarios are still downloading.", _roar_scenarios.error_msg ) return jsonify( _roar_scenarios.index ) def _make_not_available_response( msg, msg2 ): """Generate a "not available" response.""" - resp = { "error": msg } + resp = { "warning": msg } if msg2: resp[ "message" ] = msg2 return jsonify( resp ) @@ -124,7 +135,7 @@ def _make_not_available_response( msg, msg2 ): # --------------------------------------------------------------------- @app.route( "/scenario/" ) -def get_scenario( scenario_id ): +def get_scenario( scenario_id ): #pylint: disable=too-many-locals """Return a scenario.""" # get the parameters @@ -145,6 +156,43 @@ def get_scenario( scenario_id ): score = 100 * nWins / nGames return int( score + 0.5 ) + # get any files available for download + downloads = {} + keys = { "vt_setup": "vaslTemplates", "vasl_setup": "vaslTemplateSetups", "screenshot": "templateImages" } + for key in keys: + for entry in scenario.get( keys[key], [] ): + fname = os.path.basename( entry.get( "url", "" ) ) + pos = fname.find( "|" ) + if pos < 0: + continue + fkey = fname[:pos] + if fkey not in downloads: + downloads[ fkey ] = { + "user": entry.get( "user" ), + "timestamp": entry.get( "created" ), + } + downloads[ fkey ][ key ] = entry.get( "url" ) + downloads = sorted( downloads.values(), key=lambda u: u["timestamp"], reverse=True ) + if downloads: + args[ "downloads" ] = [ + d for d in downloads + if "vt_setup" in d or "vasl_setup" in d + ] + + # get the map previews + map_images = [] + for fgroup in downloads: + if "screenshot" in fgroup: + map_images.append( fgroup ) + for map_image in scenario.get( "mapImages", [] ): + map_images.append( { + "screenshot": map_image.get( "url" ), + "user": map_image.get( "user" ), + "timestamp": map_image.get( "created" ), + } ) + if map_images: + args[ "map_images" ] = map_images + # get the ASL Scenario Archive playings playings = scenario.get( "playings", [ {} ] )[ 0 ] nGames = parse_int( playings.get( "totalGames" ), 0 ) @@ -282,7 +330,6 @@ def get_scenario_card( scenario_id ): #pylint: disable=too-many-branches args[ "DEFENDER_NAME" ] = scenario.get( "defender" ) args[ "ATTACKER_NAME" ] = scenario.get( "attacker" ) args[ "BOARDS" ] = ", ".join( str(m) for m in scenario.get("maps",[]) ) - args[ "MAP_IMAGES" ] = scenario.get( "mapImages" ) overlays = ", ".join( str(o) for o in scenario.get("overlays",[]) ) if overlays.upper() == "NONE": overlays = None @@ -368,6 +415,197 @@ def _make_scenario_name( scenario ): # --------------------------------------------------------------------- +@app.route( "/prepare-asa-upload", methods=["POST"] ) +def prepare_asa_upload(): #pylint: disable=too-many-locals + """Prepare files for upload to the ASL Scenario Archive.""" + + # parse the request + vsav_data = request.json[ "vsav_data" ] + vsav_filename = request.json[ "filename" ] + + # initialize + start_time = time.time() + logger = logging.getLogger( "prepare_asa_upload" ) + + try: + + # get the VSAV data (we do this inside the try block so that the user gets shown + # a proper error dialog if there's a problem decoding the base64 data) + vsav_data = base64.b64decode( vsav_data ) + logger.info( "Preparing VSAV (#bytes=%d): %s", len(vsav_data), vsav_filename ) + + with TempFile() as input_file: + + # save the VSAV data in a temp file + input_file.write( vsav_data ) + input_file.close( delete=False ) + fname = app.config.get( "PREPARE_ASA_UPLOAD_INPUT" ) # nb: for diagnosing problems + if fname: + logger.debug( "Saving a copy of the VSAV data: %s", fname ) + with open( fname, "wb" ) as fp: + fp.write( vsav_data ) + + # prepare the files to be uploaded + with TempFile() as stripped_vsav_file, TempFile() as screenshot_file: + + # run the VASSAL shim to prepare the VSAV file + stripped_vsav_file.close( delete=False ) + screenshot_file.close( delete=False ) + vassal_shim = VassalShim() + vassal_shim.prepare_asa_upload( + input_file.name, stripped_vsav_file.name, screenshot_file.name + ) + + # read the stripped VSAV data + with open( stripped_vsav_file.name, "rb" ) as fp: + stripped_vsav = fp.read() + stripped_vsav_file.save_copy( + app.config.get( "PREPARE_ASA_UPLOAD_STRIPPED_VSAV" ), + logger, "stripped VSAV" + ) + + # read the screenshot image + screenshot_file.save_copy( + app.config.get( "PREPARE_ASA_UPLOAD_SCREENSHOT" ), + logger, "generated screenshot" + ) + if os.path.getsize( screenshot_file.name ) == 0: + # NOTE: The VASSAL shim sometimes crashes while trying to generate a screenshot :-( + screenshot_data = None + else: + # NOTE: These screenshots are used as map preview images on the ASL Scenario Archive + # web site (and by us, as well), so we want to optimize them for size. + # NOTE: I tried changing the PNG from 24-bit RGB to using a palette: + # img.convert( "P", palette=Image.ADAPTIVE/WEB ) + # but since PNG is a lossless format, the benefits are minimal. Also, weird things happen + # if we do this before shrinking the image, which makes calculating the ratio tricky. + # clean up the original screenshot + img = trim_image( screenshot_file.name ) + img = remove_alpha_from_image( img ) + # get the image data + def save_image( img ): #pylint: disable=missing-docstring + quality = parse_int( app.config.get( "ASA_SCREENSHOT_QUALITY" ), 50 ) + return get_image_data( img, format="JPEG", quality=quality, optimize=True, subsampling=0 ) + screenshot_data = save_image( img ) + # resize it to (roughly) the maximum allowed size + max_size = parse_int( app.config.get( "ASA_MAX_SCREENSHOT_SIZE" ), 200 ) * 1024 + if len(screenshot_data) > max_size: + ratio = math.sqrt( float(max_size) / len(screenshot_data) ) + img = img.resize( ( int(img.width * ratio), int(img.height * ratio) ), Image.ANTIALIAS ) + # add a border + border_size = parse_int( app.config.get( "ASA_SCREENSHOT_BORDER_SIZE" ), 5 ) + img = ImageOps.expand( img, border_size, (255,255,255,255) ) + # get the final image data + screenshot_data = save_image( img ) + + except Exception as ex: #pylint: disable=broad-except + + return VassalShim.translate_vassal_shim_exception( ex, logger ) + + # return the results + logger.info( "Prepared the VSAV file OK: elapsed=%.3fs", time.time()-start_time ) + results = { + "filename": vsav_filename, + "stripped_vsav": base64.b64encode( stripped_vsav ).decode( "utf-8" ), + } + if screenshot_data: + results[ "screenshot" ] = base64.b64encode( screenshot_data ).decode( "utf-8" ) + return jsonify( results ) + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +@app.route( "/on-successful-asa-upload/" ) +def on_successful_asa_upload( scenario_id ): + """Update the local scenario index after a successful upload.""" + + # download the specified scenario + url = app.config["ASA_GET_SCENARIO_URL"].replace( "{ID}", scenario_id ) + try: + fp = urllib.request.urlopen( url ) + new_scenario = json.loads( fp.read().decode( "utf-8" ) ) + except Exception as ex: #pylint: disable=broad-except + msg = str( getattr(ex,"reason",None) or ex ) + return jsonify( { "status": "error", "message": msg } ) + + # update the local index + if os.path.isfile( _asa_scenarios.cache_fname ) and not app.config.get( "DISABLE_LOCAL_ASA_INDEX_UPDATES" ): + # NOTE: Since the downloaded index file contains a *list* of scenarios, we append the new scenario info + # to the end of that list, and then the next time the program starts and reads the list into a dict, + # the most-recent version is the one that will ultimately be used. This lets us identify these temporary changes + # that have been made to the cached index file (which will be overwritten when we download a fresh copy). + # This is not particularly efficient, but it won't happen too often. + with open( _asa_scenarios.cache_fname, "r" ) as fp: + data = json.load( fp ) + data["scenarios"].append( new_scenario ) + with open( _asa_scenarios.cache_fname, "w" ) as fp: + json.dump( data, fp ) + + # update the in-memory scenario index + with _asa_scenarios: + _asa_scenarios.index[ scenario_id ] = new_scenario + + return jsonify( { "status": "ok" } ) + +# --------------------------------------------------------------------- + +_last_asa_upload = None + +@app.route( "/test-asa-upload/", methods=["POST"] ) +def test_asa_upload( scenario_id ): + """A test endpoint that can be used to simulate ASL Scenario Archive uploads.""" + + def save_file( key, asa_upload, convert=None ): + """Save a file that has been uploaded to us.""" + f = request.files.get( key ) + if not f: + print( "- {}: not present.".format( key ) ) + return + data = f.read() + asa_upload[ key ] = convert(data) if convert else data + print( "- {}: {} ({}) ; #bytes={}".format( key, f.filename, f.content_type, len(data) ) ) + fname = app.config.get( "SAVE_ASA_UPLOAD_" + key.upper() ) + if fname: + with open( fname, "wb" ) as fp: + fp.write( data ) + print( " - Saved to:", fname ) + + def make_response( fname ): + """Generate a response.""" + dname = os.path.join( os.path.dirname(__file__), "tests/fixtures/asa-responses/" ) + fname = os.path.join( dname, "{}.json".format( fname ) ) + resp = json.load( open( fname, "r" ) ) + return jsonify( resp ) + + # simulate a slow response + delay = parse_int( app.config.get( "ASA_UPLOAD_DELAY" ), 0 ) + if delay > 0: + time.sleep( delay ) + + # parse the request + user_name = request.args.get( "user" ) + if not user_name: + return make_response( "missing-user-name" ) + api_token = request.args.get( "token" ) + if not api_token: + return make_response( "missing-token" ) + if api_token == "incorrect-token": + return make_response( "incorrect-token" ) + + # process the request + print( "ASA upload: id={} ; user=\"{}\" ; token=\"{}\"".format( scenario_id, user_name,api_token ) ) + asa_upload = {} + save_file( "vasl_setup", asa_upload ) + save_file( "vt_setup", asa_upload, lambda v: json.loads(v) ) #pylint: disable=unnecessary-lambda + save_file( "screenshot", asa_upload ) + if asa_upload: + asa_upload.update( { "user": user_name, "token": api_token } ) + global _last_asa_upload + _last_asa_upload = asa_upload + + return make_response( "ok" ) + +# --------------------------------------------------------------------- + @app.route( "/scenario/nat-report" ) def scenario_nat_report(): """Generate the scenario nationalities report (for testing porpoises).""" @@ -402,4 +640,7 @@ def _split_date_parts( val ): return None if mo.group(1) == "1901": return None # nb: 1901-01-01 seems to be used as a "invalid date" marker - return [ int(mo.group(3)), int(mo.group(2)), int(mo.group(1)) ] + parts = [ int(mo.group(3)), int(mo.group(2)), int(mo.group(1)) ] + if parts == [ 0, 0, 0, ]: + return None # nb: 0000-00-00 also seems to be used as an "invalid date" marker + return parts diff --git a/vasl_templates/webapp/static/css/scenario-card.css b/vasl_templates/webapp/static/css/scenario-card.css index 695ee1a..fad02b1 100644 --- a/vasl_templates/webapp/static/css/scenario-card.css +++ b/vasl_templates/webapp/static/css/scenario-card.css @@ -68,20 +68,18 @@ .scenario-card .balance-graph .progressbar .score { position: absolute ; font-size: 70% ; font-style: italic ; color: #666 ; left: 35% ; } /* scenario card - misc */ -.scenario-card a.map-preview img { height: 0.75em ; margin-left: 0.25em ; } -.scenario-card a.map-preview:focus { outline: 0 ; } +.scenario-card .boards img.map-previews { height: 0.75em ; margin-left: 0.5em ; cursor: pointer ; } +.scenario-card .boards .map-preview-count { font-size: 80% ; font-style: italic ; color: #888 ; } .scenario-card .errata ul { margin-top: 0 ; } .scenario-card .errata .source { font-size: 90% ; font-style: italic ; color: #666 ; } /* scenario info dialog */ .ui-dialog.scenario-info { border-radius: 10px ; } .ui-dialog.scenario-info .ui-dialog-titlebar { display: none ; } -.ui-dialog.scenario-info .credit { float: left ; margin-right: 0.5em ; display: flex ; align-items: center ; } -.ui-dialog.scenario-info .credit img { height: 1.4em ; margin-right: 0.5em ; opacity: 0.7 ; } -.ui-dialog.scenario-info .credit .caption { font-size: 70% ; line-height: 1em ; margin-top: -4px ; } -.ui-dialog.scenario-info .credit a { text-decoration: none ; font-style: italic ; color: #666 ; } -.ui-dialog.scenario-info .credit a:focus { outline: 0 ; } #scenario-info-dialog .scenario-card { height: 100% ; overflow-y: hidden ; } #scenario-info-dialog .connect-roar { display: inline-block ; margin-top: 0.25em ; font-size: 80% ; color: #444 ; cursor: pointer ; } #scenario-info-dialog .connect-roar img { height: 0.75em ; Xmargin-right: 0.25em ; opacity: 0.7 ; } #scenario-info-dialog .disconnect-roar img { height: 0.5em ; margin-left: 0.5em ; cursor: pointer ; } + +/* lightgallery */ +.lg-backdrop.in { opacity: 0.85 ; } diff --git a/vasl_templates/webapp/static/css/scenario-downloads-dialog.css b/vasl_templates/webapp/static/css/scenario-downloads-dialog.css new file mode 100644 index 0000000..21c917c --- /dev/null +++ b/vasl_templates/webapp/static/css/scenario-downloads-dialog.css @@ -0,0 +1,20 @@ +.ui-dialog.scenario-downloads { border-radius: 5px ; } +.ui-dialog.scenario-downloads .ui-dialog-titlebar { background: none ; border: none ; cursor: auto ; } +.ui-dialog.scenario-downloads .ui-dialog-titlebar-close { display: none; } +#scenario-downloads-dialog { padding-top: 0 !important ; } + +#scenario-downloads-dialog .fgroups { margin: 0 ; } +#scenario-downloads-dialog .fgroup { + border: 1px solid #ccc ; border-radius: 5px ; + margin-bottom: 0.5em ; + padding: 0.5em ; + display: flex ; + list-style-type: none ; +} +#scenario-downloads-dialog .fgroup:last-of-type { margin-bottom: 0 ; } +#scenario-downloads-dialog .fgroup .screenshot { width: 5em ; max-height: 4em ; margin-right: 1em ; text-align: center ; } +#scenario-downloads-dialog .fgroup .screenshot img { max-width: 100% ; max-height: 4em ; } +#scenario-downloads-dialog .fgroup .user { font-style: italic ; } +#scenario-downloads-dialog .fgroup .timestamp { font-size: 80% ; font-style: italic ; color: #888 ; } +#scenario-downloads-dialog .fgroup button { float: left ; margin: 0.5em 0.5em 0 0 ; padding: 2px 5px ; display: flex ; align-items: center ; font-size: 80% ; } +#scenario-downloads-dialog .fgroup button img { height: 1em ; margin-right: 0.5em ; } diff --git a/vasl_templates/webapp/static/css/scenario-search-dialog.css b/vasl_templates/webapp/static/css/scenario-search-dialog.css index dac7853..877c5f1 100644 --- a/vasl_templates/webapp/static/css/scenario-search-dialog.css +++ b/vasl_templates/webapp/static/css/scenario-search-dialog.css @@ -55,6 +55,8 @@ #scenario-search .import-control .buttons button { float: right ; margin-left: 0.5em ; padding: 0.1em 0.5em ; } #scenario-search .import-control .buttons button.import { height: 2em ; display: flex ; align-items: center ; } #scenario-search .import-control .buttons button.import img { height: 1em ; margin-right: 0.5em ; } +#scenario-search .import-control .buttons button.downloads { height: 2em ; display: flex ; align-items: center ; } +#scenario-search .import-control .buttons button.downloads img { height: 1em ; margin-right: 0.5em ; } #scenario-search .import-control .buttons button.ok { background: #ddd ; } #scenario-search .import-control .buttons button.ok:hover { background: #ccc ; } #scenario-search .import-control .warnings { margin-bottom: 0.5em ; padding: 0.25em 0 0 10px ; font-size: 90% ; } diff --git a/vasl_templates/webapp/static/css/scenario-upload-dialog.css b/vasl_templates/webapp/static/css/scenario-upload-dialog.css new file mode 100644 index 0000000..8141a0d --- /dev/null +++ b/vasl_templates/webapp/static/css/scenario-upload-dialog.css @@ -0,0 +1,56 @@ +.ui-dialog.scenario-upload .ui-dialog-titlebar { background: #e0e0a0 ; } +#scenario-upload-dialog { display: flex ; flex-direction: column ; padding: 1em !important ; overflow-y: hidden ; } + +#scenario-upload-dialog label { display: inline-block ; width: 5.75em ; font-weight: bold ; } +#scenario-upload-dialog .row { margin-bottom: 2px ; } +#scenario-upload-dialog .hint { font-style: italic ; color: #888 ; } +#scenario-upload-dialog .row .hint { margin-left: 0.5em ; font-size: 80% ; font-style: italic ; color: #666 ; } +#scenario-upload-dialog .row .hint a { color: #666 ; } + +#scenario-upload-dialog .scenario-id { font-size: 80% ; font-style: italic ; color: #666 ; } +#scenario-upload-dialog .asa-id { font-size: 70% ; font-style: italic ; color: #666 ; } +#scenario-upload-dialog .auth { margin: 0.25em 0 1em 0 ; } +#scenario-upload-dialog .disclaimer { margin-top: 1em ; font-size: 80% ; font-style: italic ; color: #444 ; } + +#scenario-upload-dialog img.remove { height: 12px ; position: absolute ; top: 5px ; right: 5px ; z-index: 5 ; cursor: pointer ; } + +#scenario-upload-dialog .grid { flex: 1 ; display: flex ; } +#scenario-upload-dialog .grid .left { flex: 4 ; margin-right: 1em ; } +#scenario-upload-dialog .grid .right { flex: 6 ; } + +#scenario-upload-dialog .vsav-container { + position: relative ; + padding: 1em ; + border: 1px solid #888 ; border-radius: 5px ; + background: #f8f8f8 ; +} +#scenario-upload-dialog .vsav-container .hint { display: flex ; } +#scenario-upload-dialog .vsav-container .hint img { + margin-right: 0.5em ; height: 2em ; opacity: 0.7 ; +} +#scenario-upload-dialog .vsav-container .file-info { display: flex ; } +#scenario-upload-dialog .vsav-container .file-info img { + margin-right: 0.5em ; height: 2em ; opacity: 0.8 ; +} +#scenario-upload-dialog .vsav-container .file-info .name { font-size: 80% ; font-family: monospace ; color: #444 ; } + +#scenario-upload-dialog .screenshot-container { + display: flex ; flex-direction: column ; justify-content: center ; + height: 100% ; + border: 1px solid #888 ; border-radius: 5px ; + background: #f8f8f8 ; + position: relative ; +} +#scenario-upload-dialog .screenshot-container .hint { display: flex ; justify-content: center ; align-items: center ; } +#scenario-upload-dialog .screenshot-container .hint img { + float: left ; margin-right: 0.5em ; height: 2.5em ; opacity: 0.6 ; +} +#scenario-upload-dialog .screenshot-container .preview { + display: flex ; flex-direction: column ; align-items: center ; justify-content: center ; + height: calc( 100% - 10px ) ; + margin: 5px ; +} +#scenario-upload-dialog .screenshot-container .preview img { + object-fit: scale-down ; max-width: 100% ; max-height: 100% ; + border: 1px dotted #aaa ; +} diff --git a/vasl_templates/webapp/static/imageZoom/jquery.imageZoom.css b/vasl_templates/webapp/static/imageZoom/jquery.imageZoom.css deleted file mode 100644 index a730146..0000000 --- a/vasl_templates/webapp/static/imageZoom/jquery.imageZoom.css +++ /dev/null @@ -1,48 +0,0 @@ -div.jquery-image-zoom { - line-height: 0; - font-size: 0; - - z-index: 1000; - - border: 5px solid #fff; - background: #eee; /* TM 25jan15: Added this to make it easier to see images with transparent backgrounds. */ - margin: -5px; - - -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); - -moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); - box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); -} - - div.jquery-image-zoom a { - background: url(/static/imageZoom/jquery.imageZoom.png) no-repeat; - - display: block; - width: 25px; - height: 25px; - - position: absolute; - left: -17px; - top: -17px; - /* IE-users are prolly used to close-link in right-hand corner */ - *left: auto; - *right: -17px; - - text-decoration: none; - text-indent: -100000px; - outline: 0; - - z-index: 11; - } - - div.jquery-image-zoom a:hover { - background-position: left -25px; - } - - div.jquery-image-zoom img, - div.jquery-image-zoom embed, - div.jquery-image-zoom object, - div.jquery-image-zoom div { - width: 100%; - height: 100%; - margin: 0; - } diff --git a/vasl_templates/webapp/static/imageZoom/jquery.imageZoom.min.js b/vasl_templates/webapp/static/imageZoom/jquery.imageZoom.min.js deleted file mode 100644 index ccd572f..0000000 --- a/vasl_templates/webapp/static/imageZoom/jquery.imageZoom.min.js +++ /dev/null @@ -1 +0,0 @@ -jQuery.fn.imageZoom=function(c,b){var a=c.extend({speed:200,dontFadeIn:1,hideClicked:1,imageMargin:30,className:"jquery-image-zoom",loading:"Loading..."},b);a.doubleSpeed=a.speed/4;c(document).keydown(function(d){if(d.keyCode==27){c("div.jquery-image-zoom a").click()}});return this.click(function(k){var h=c(k.target);var g=h.is("a")?h:h.parents("a");g=(g&&g.is("a")&&g.attr("href").search(/(.*)\.(jpg|jpeg|gif|png|bmp|tif|tiff)$/gi)!=-1)?g:false;var i=(g&&g.find("img").length)?g.find("img"):false;c("div.jquery-image-zoom a").click();if(g){g.oldText=g.text();g.setLoadingImg=function(){if(i){i.css({opacity:"0.5"})}else{g.text(a.loading)}};g.setNotLoadingImg=function(){if(i){i.css({opacity:"1"})}else{g.text(g.oldText)}};var d=g.attr("href");if(c("div."+a.className+' img[src="'+d+'"]').length){return false}var j=function(l){g.setNotLoadingImg();var u=i?i:g;var q=i?a.hideClicked:0;var p=u.offset();var n={width:u.outerWidth(),height:u.outerHeight(),left:p.left,top:p.top};var o=c('
').css("position","absolute").appendTo(document.body);var m={width:l.width,height:l.height};var s={width:c(window).width(),height:c(window).height()};if(m.width>(s.width-a.imageMargin*2)){var r=s.width-a.imageMargin*2;m.height=(r/m.width)*m.height;m.width=r}if(m.height>(s.height-a.imageMargin*2)){var t=s.height-a.imageMargin*2;m.width=(t/m.height)*m.width;m.height=t}m.left=(s.width-m.width)/2+c(window).scrollLeft();m.top=(s.height-m.height)/2+c(window).scrollTop();var e=c('Close').appendTo(o).hide();if(q){g.css("visibility","hidden")}o.addClass(a.className).css(n).animate(m,a.speed,function(){e.fadeIn(a.doubleSpeed)});var v=function(){e.fadeOut(a.doubleSpeed,function(){o.animate(n,a.speed,function(){g.css("visibility","visible");o.remove()})});return false};o.click(v);e.click(v)};var f=new Image();f.src=d;if(f.complete){j(f)}else{g.setLoadingImg();f.onload=function(){j(f)}}return false}})}; \ No newline at end of file diff --git a/vasl_templates/webapp/static/imageZoom/jquery.imageZoom.png b/vasl_templates/webapp/static/imageZoom/jquery.imageZoom.png deleted file mode 100644 index 2f5a381..0000000 Binary files a/vasl_templates/webapp/static/imageZoom/jquery.imageZoom.png and /dev/null differ diff --git a/vasl_templates/webapp/static/images/download.png b/vasl_templates/webapp/static/images/download.png new file mode 100644 index 0000000..9e7ea54 Binary files /dev/null and b/vasl_templates/webapp/static/images/download.png differ diff --git a/vasl_templates/webapp/static/images/screenshot.png b/vasl_templates/webapp/static/images/screenshot.png new file mode 100644 index 0000000..515c7c5 Binary files /dev/null and b/vasl_templates/webapp/static/images/screenshot.png differ diff --git a/vasl_templates/webapp/static/images/upload.png b/vasl_templates/webapp/static/images/upload.png new file mode 100644 index 0000000..54b4cab Binary files /dev/null and b/vasl_templates/webapp/static/images/upload.png differ diff --git a/vasl_templates/webapp/static/images/vassal-screenshot-hint.png b/vasl_templates/webapp/static/images/vassal-screenshot-hint.png new file mode 100644 index 0000000..6d7fafd Binary files /dev/null and b/vasl_templates/webapp/static/images/vassal-screenshot-hint.png differ diff --git a/vasl_templates/webapp/static/lfa-upload.js b/vasl_templates/webapp/static/lfa-upload.js index 1028207..8d1aff9 100644 --- a/vasl_templates/webapp/static/lfa-upload.js +++ b/vasl_templates/webapp/static/lfa-upload.js @@ -160,9 +160,7 @@ function addFilesToUploadList( files ) var currFile = files[ currFileNo ] ; fileReader.onload = function() { // get the file data - vlog_data = fileReader.result ; - if ( vlog_data.substring(0,5) === "data:" ) - vlog_data = vlog_data.split( "," )[1] ; + vlog_data = removeBase64Prefix( fileReader.result ) ; // add the file to the list addFileToUploadList( currFile.name, vlog_data ) ; // read the next file diff --git a/vasl_templates/webapp/static/lightgallery/css/lightgallery.min.css b/vasl_templates/webapp/static/lightgallery/css/lightgallery.min.css new file mode 100644 index 0000000..e472f70 --- /dev/null +++ b/vasl_templates/webapp/static/lightgallery/css/lightgallery.min.css @@ -0,0 +1 @@ +@font-face{font-family:lg;src:url(../fonts/lg.ttf?22t19m) format("truetype"),url(../fonts/lg.woff?22t19m) format("woff"),url(../fonts/lg.svg?22t19m#lg) format("svg");font-weight:400;font-style:normal;font-display:block}.lg-icon{font-family:lg!important;speak:never;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.lg-actions .lg-next,.lg-actions .lg-prev{background-color:rgba(0,0,0,.45);border-radius:2px;color:#999;cursor:pointer;display:block;font-size:22px;margin-top:-10px;padding:8px 10px 9px;position:absolute;top:50%;z-index:1080;border:none;outline:0}.lg-actions .lg-next.disabled,.lg-actions .lg-prev.disabled{pointer-events:none;opacity:.5}.lg-actions .lg-next:hover,.lg-actions .lg-prev:hover{color:#FFF}.lg-actions .lg-next{right:20px}.lg-actions .lg-next:before{content:"\e095"}.lg-actions .lg-prev{left:20px}.lg-actions .lg-prev:after{content:"\e094"}@-webkit-keyframes lg-right-end{0%,100%{left:0}50%{left:-30px}}@-moz-keyframes lg-right-end{0%,100%{left:0}50%{left:-30px}}@-ms-keyframes lg-right-end{0%,100%{left:0}50%{left:-30px}}@keyframes lg-right-end{0%,100%{left:0}50%{left:-30px}}@-webkit-keyframes lg-left-end{0%,100%{left:0}50%{left:30px}}@-moz-keyframes lg-left-end{0%,100%{left:0}50%{left:30px}}@-ms-keyframes lg-left-end{0%,100%{left:0}50%{left:30px}}@keyframes lg-left-end{0%,100%{left:0}50%{left:30px}}.lg-outer.lg-right-end .lg-object{-webkit-animation:lg-right-end .3s;-o-animation:lg-right-end .3s;animation:lg-right-end .3s;position:relative}.lg-outer.lg-left-end .lg-object{-webkit-animation:lg-left-end .3s;-o-animation:lg-left-end .3s;animation:lg-left-end .3s;position:relative}.lg-toolbar{z-index:1082;left:0;position:absolute;top:0;width:100%;background-color:rgba(0,0,0,.45)}.lg-toolbar .lg-icon{color:#999;cursor:pointer;float:right;font-size:24px;height:47px;line-height:27px;padding:10px 0;text-align:center;width:50px;text-decoration:none!important;outline:0;background:0 0;border:none;box-shadow:none;-webkit-transition:color .2s linear;-o-transition:color .2s linear;transition:color .2s linear}.lg-toolbar .lg-icon:hover{color:#FFF}.lg-toolbar .lg-close:after{content:"\e070"}.lg-toolbar .lg-download:after{content:"\e0f2"}.lg-sub-html{background-color:rgba(0,0,0,.45);bottom:0;color:#EEE;font-size:16px;left:0;padding:10px 40px;position:fixed;right:0;text-align:center;z-index:1080}.lg-sub-html h4{margin:0;font-size:13px;font-weight:700}.lg-sub-html p{font-size:12px;margin:5px 0 0}#lg-counter{color:#999;display:inline-block;font-size:16px;padding-left:20px;padding-top:12px;vertical-align:middle}.lg-next,.lg-prev,.lg-toolbar{opacity:1;-webkit-transition:-webkit-transform .35s cubic-bezier(0,0,.25,1) 0s,opacity .35s cubic-bezier(0,0,.25,1) 0s,color .2s linear;-moz-transition:-moz-transform .35s cubic-bezier(0,0,.25,1) 0s,opacity .35s cubic-bezier(0,0,.25,1) 0s,color .2s linear;-o-transition:-o-transform .35s cubic-bezier(0,0,.25,1) 0s,opacity .35s cubic-bezier(0,0,.25,1) 0s,color .2s linear;transition:transform .35s cubic-bezier(0,0,.25,1) 0s,opacity .35s cubic-bezier(0,0,.25,1) 0s,color .2s linear}.lg-hide-items .lg-prev{opacity:0;-webkit-transform:translate3d(-10px,0,0);transform:translate3d(-10px,0,0)}.lg-hide-items .lg-next{opacity:0;-webkit-transform:translate3d(10px,0,0);transform:translate3d(10px,0,0)}.lg-hide-items .lg-toolbar{opacity:0;-webkit-transform:translate3d(0,-10px,0);transform:translate3d(0,-10px,0)}body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-object{-webkit-transform:scale3d(.5,.5,.5);transform:scale3d(.5,.5,.5);opacity:0;-webkit-transition:-webkit-transform 250ms cubic-bezier(0,0,.25,1) 0s,opacity 250ms cubic-bezier(0,0,.25,1)!important;-moz-transition:-moz-transform 250ms cubic-bezier(0,0,.25,1) 0s,opacity 250ms cubic-bezier(0,0,.25,1)!important;-o-transition:-o-transform 250ms cubic-bezier(0,0,.25,1) 0s,opacity 250ms cubic-bezier(0,0,.25,1)!important;transition:transform 250ms cubic-bezier(0,0,.25,1) 0s,opacity 250ms cubic-bezier(0,0,.25,1)!important;-webkit-transform-origin:50% 50%;-moz-transform-origin:50% 50%;-ms-transform-origin:50% 50%;transform-origin:50% 50%}body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item.lg-complete .lg-object{-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1);opacity:1}.lg-outer .lg-thumb-outer{background-color:#0D0A0A;bottom:0;position:absolute;width:100%;z-index:1080;max-height:350px;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0);-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1) 0s;-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1) 0s;-o-transition:-o-transform .25s cubic-bezier(0,0,.25,1) 0s;transition:transform .25s cubic-bezier(0,0,.25,1) 0s}.lg-outer .lg-thumb-outer.lg-grab .lg-thumb-item{cursor:-webkit-grab;cursor:-moz-grab;cursor:-o-grab;cursor:-ms-grab;cursor:grab}.lg-outer .lg-thumb-outer.lg-grabbing .lg-thumb-item{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:-o-grabbing;cursor:-ms-grabbing;cursor:grabbing}.lg-outer .lg-thumb-outer.lg-dragging .lg-thumb{-webkit-transition-duration:0s!important;transition-duration:0s!important}.lg-outer.lg-thumb-open .lg-thumb-outer{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.lg-outer .lg-thumb{padding:10px 0;height:100%;margin-bottom:-5px}.lg-outer .lg-thumb-item{cursor:pointer;float:left;overflow:hidden;height:100%;border:2px solid #FFF;border-radius:4px;margin-bottom:5px}@media (min-width:1025px){.lg-outer .lg-thumb-item{-webkit-transition:border-color .25s ease;-o-transition:border-color .25s ease;transition:border-color .25s ease}}.lg-outer .lg-thumb-item.active,.lg-outer .lg-thumb-item:hover{border-color:#a90707}.lg-outer .lg-thumb-item img{width:100%;height:100%;object-fit:cover}.lg-outer.lg-has-thumb .lg-item{padding-bottom:120px}.lg-outer.lg-can-toggle .lg-item{padding-bottom:0}.lg-outer.lg-pull-caption-up .lg-sub-html{-webkit-transition:bottom .25s ease;-o-transition:bottom .25s ease;transition:bottom .25s ease}.lg-outer.lg-pull-caption-up.lg-thumb-open .lg-sub-html{bottom:100px}.lg-outer .lg-toogle-thumb{background-color:#0D0A0A;border-radius:2px 2px 0 0;color:#999;cursor:pointer;font-size:24px;height:39px;line-height:27px;padding:5px 0;position:absolute;right:20px;text-align:center;top:-39px;width:50px;outline:0;border:none}.lg-outer .lg-toogle-thumb:after{content:"\e1ff"}.lg-outer .lg-toogle-thumb:hover{color:#FFF}.lg-outer .lg-video-cont{display:inline-block;vertical-align:middle;max-width:1140px;max-height:100%;width:100%;padding:0 5px}.lg-outer .lg-video{width:100%;height:0;padding-bottom:56.25%;overflow:hidden;position:relative}.lg-outer .lg-video .lg-object{display:inline-block;position:absolute;top:0;left:0;width:100%!important;height:100%!important}.lg-outer .lg-video .lg-video-play{width:84px;height:59px;position:absolute;left:50%;top:50%;margin-left:-42px;margin-top:-30px;z-index:1080;cursor:pointer}.lg-outer .lg-has-iframe .lg-video{-webkit-overflow-scrolling:touch;overflow:auto}.lg-outer .lg-has-vimeo .lg-video-play{background:url(../img/vimeo-play.png) no-repeat}.lg-outer .lg-has-vimeo:hover .lg-video-play{background:url(../img/vimeo-play.png) 0 -58px no-repeat}.lg-outer .lg-has-html5 .lg-video-play{background:url(../img/video-play.png) no-repeat;height:64px;margin-left:-32px;margin-top:-32px;width:64px;opacity:.8}.lg-outer .lg-has-html5:hover .lg-video-play{opacity:1}.lg-outer .lg-has-youtube .lg-video-play{background:url(../img/youtube-play.png) no-repeat}.lg-outer .lg-has-youtube:hover .lg-video-play{background:url(../img/youtube-play.png) 0 -60px no-repeat}.lg-outer .lg-video-object{width:100%!important;height:100%!important;position:absolute;top:0;left:0}.lg-outer .lg-has-video .lg-video-object{visibility:hidden}.lg-outer .lg-has-video.lg-video-playing .lg-object,.lg-outer .lg-has-video.lg-video-playing .lg-video-play{display:none}.lg-outer .lg-has-video.lg-video-playing .lg-video-object{visibility:visible}.lg-progress-bar{background-color:#333;height:5px;left:0;position:absolute;top:0;width:100%;z-index:1083;opacity:0;-webkit-transition:opacity 80ms ease 0s;-moz-transition:opacity 80ms ease 0s;-o-transition:opacity 80ms ease 0s;transition:opacity 80ms ease 0s}.lg-progress-bar .lg-progress{background-color:#a90707;height:5px;width:0}.lg-progress-bar.lg-start .lg-progress{width:100%}.lg-show-autoplay .lg-progress-bar{opacity:1}.lg-autoplay-button:after{content:"\e01d"}.lg-show-autoplay .lg-autoplay-button:after{content:"\e01a"}.lg-outer.lg-css3.lg-zoom-dragging .lg-item.lg-complete.lg-zoomable .lg-image,.lg-outer.lg-css3.lg-zoom-dragging .lg-item.lg-complete.lg-zoomable .lg-img-wrap{-webkit-transition-duration:0s;transition-duration:0s}.lg-outer.lg-use-transition-for-zoom .lg-item.lg-complete.lg-zoomable .lg-img-wrap{-webkit-transition:-webkit-transform .3s cubic-bezier(0,0,.25,1) 0s;-moz-transition:-moz-transform .3s cubic-bezier(0,0,.25,1) 0s;-o-transition:-o-transform .3s cubic-bezier(0,0,.25,1) 0s;transition:transform .3s cubic-bezier(0,0,.25,1) 0s}.lg-outer.lg-use-left-for-zoom .lg-item.lg-complete.lg-zoomable .lg-img-wrap{-webkit-transition:left .3s cubic-bezier(0,0,.25,1) 0s,top .3s cubic-bezier(0,0,.25,1) 0s;-moz-transition:left .3s cubic-bezier(0,0,.25,1) 0s,top .3s cubic-bezier(0,0,.25,1) 0s;-o-transition:left .3s cubic-bezier(0,0,.25,1) 0s,top .3s cubic-bezier(0,0,.25,1) 0s;transition:left .3s cubic-bezier(0,0,.25,1) 0s,top .3s cubic-bezier(0,0,.25,1) 0s}.lg-outer .lg-item.lg-complete.lg-zoomable .lg-img-wrap{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;backface-visibility:hidden}.lg-outer .lg-item.lg-complete.lg-zoomable .lg-image{-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1);-webkit-transition:-webkit-transform .3s cubic-bezier(0,0,.25,1) 0s,opacity .15s!important;-moz-transition:-moz-transform .3s cubic-bezier(0,0,.25,1) 0s,opacity .15s!important;-o-transition:-o-transform .3s cubic-bezier(0,0,.25,1) 0s,opacity .15s!important;transition:transform .3s cubic-bezier(0,0,.25,1) 0s,opacity .15s!important;-webkit-transform-origin:0 0;-moz-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;backface-visibility:hidden}#lg-zoom-in:after{content:"\e311"}#lg-actual-size{font-size:20px}#lg-actual-size:after{content:"\e033"}#lg-zoom-out{opacity:.5;pointer-events:none}#lg-zoom-out:after{content:"\e312"}.lg-zoomed #lg-zoom-out{opacity:1;pointer-events:auto}.lg-outer .lg-pager-outer{bottom:60px;left:0;position:absolute;right:0;text-align:center;z-index:1080;height:10px}.lg-outer .lg-pager-outer.lg-pager-hover .lg-pager-cont{overflow:visible}.lg-outer .lg-pager-cont{cursor:pointer;display:inline-block;overflow:hidden;position:relative;vertical-align:top;margin:0 5px}.lg-outer .lg-pager-cont:hover .lg-pager-thumb-cont{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.lg-outer .lg-pager-cont.lg-pager-active .lg-pager{box-shadow:0 0 0 2px #fff inset}.lg-outer .lg-pager-thumb-cont{background-color:#fff;color:#FFF;bottom:100%;height:83px;left:0;margin-bottom:20px;margin-left:-60px;opacity:0;padding:5px;position:absolute;width:120px;border-radius:3px;-webkit-transition:opacity .15s ease 0s,-webkit-transform .15s ease 0s;-moz-transition:opacity .15s ease 0s,-moz-transform .15s ease 0s;-o-transition:opacity .15s ease 0s,-o-transform .15s ease 0s;transition:opacity .15s ease 0s,transform .15s ease 0s;-webkit-transform:translate3d(0,5px,0);transform:translate3d(0,5px,0)}.lg-outer .lg-pager-thumb-cont img{width:100%;height:100%}.lg-outer .lg-pager{background-color:rgba(255,255,255,.5);border-radius:50%;box-shadow:0 0 0 8px rgba(255,255,255,.7) inset;display:block;height:12px;-webkit-transition:box-shadow .3s ease 0s;-o-transition:box-shadow .3s ease 0s;transition:box-shadow .3s ease 0s;width:12px}.lg-outer .lg-pager:focus,.lg-outer .lg-pager:hover{box-shadow:0 0 0 8px #fff inset}.lg-outer .lg-caret{border-left:10px solid transparent;border-right:10px solid transparent;border-top:10px dashed;bottom:-10px;display:inline-block;height:0;left:50%;margin-left:-5px;position:absolute;vertical-align:middle;width:0}.lg-fullscreen:after{content:"\e20c"}.lg-fullscreen-on .lg-fullscreen:after{content:"\e20d"}.lg-outer #lg-dropdown-overlay{background-color:rgba(0,0,0,.25);bottom:0;cursor:default;left:0;position:fixed;right:0;top:0;z-index:1081;opacity:0;visibility:hidden;-webkit-transition:visibility 0s linear .18s,opacity .18s linear 0s;-o-transition:visibility 0s linear .18s,opacity .18s linear 0s;transition:visibility 0s linear .18s,opacity .18s linear 0s}.lg-outer.lg-dropdown-active #lg-dropdown-overlay,.lg-outer.lg-dropdown-active .lg-dropdown{-webkit-transition-delay:0s;transition-delay:0s;-moz-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1;visibility:visible}.lg-outer.lg-dropdown-active #lg-share{color:#FFF}.lg-outer .lg-dropdown{background-color:#fff;border-radius:2px;font-size:14px;list-style-type:none;margin:0;padding:10px 0;position:absolute;right:0;text-align:left;top:50px;opacity:0;visibility:hidden;-moz-transform:translate3d(0,5px,0);-o-transform:translate3d(0,5px,0);-ms-transform:translate3d(0,5px,0);-webkit-transform:translate3d(0,5px,0);transform:translate3d(0,5px,0);-webkit-transition:-webkit-transform .18s linear 0s,visibility 0s linear .5s,opacity .18s linear 0s;-moz-transition:-moz-transform .18s linear 0s,visibility 0s linear .5s,opacity .18s linear 0s;-o-transition:-o-transform .18s linear 0s,visibility 0s linear .5s,opacity .18s linear 0s;transition:transform .18s linear 0s,visibility 0s linear .5s,opacity .18s linear 0s}.lg-outer .lg-dropdown:after{content:"";display:block;height:0;width:0;position:absolute;border:8px solid transparent;border-bottom-color:#FFF;right:16px;top:-16px}.lg-outer .lg-dropdown>li:last-child{margin-bottom:0}.lg-outer .lg-dropdown>li:hover .lg-icon,.lg-outer .lg-dropdown>li:hover a{color:#333}.lg-outer .lg-dropdown a{color:#333;display:block;white-space:pre;padding:4px 12px;font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px}.lg-outer .lg-dropdown a:hover{background-color:rgba(0,0,0,.07)}.lg-outer .lg-dropdown .lg-dropdown-text{display:inline-block;line-height:1;margin-top:-3px;vertical-align:middle}.lg-outer .lg-dropdown .lg-icon{color:#333;display:inline-block;float:none;font-size:20px;height:auto;line-height:1;margin-right:8px;padding:0;vertical-align:middle;width:auto}.lg-outer,.lg-outer .lg,.lg-outer .lg-inner{height:100%;width:100%}.lg-outer #lg-share{position:relative}.lg-outer #lg-share:after{content:"\e80d"}.lg-outer #lg-share-facebook .lg-icon{color:#3b5998}.lg-outer #lg-share-facebook .lg-icon:after{content:"\e904"}.lg-outer #lg-share-twitter .lg-icon{color:#00aced}.lg-outer #lg-share-twitter .lg-icon:after{content:"\e907"}.lg-outer #lg-share-googleplus .lg-icon{color:#dd4b39}.lg-outer #lg-share-googleplus .lg-icon:after{content:"\e905"}.lg-outer #lg-share-pinterest .lg-icon{color:#cb2027}.lg-outer #lg-share-pinterest .lg-icon:after{content:"\e906"}.lg-outer .lg-img-rotate{position:absolute;padding:0 5px;left:0;right:0;top:0;bottom:0;-webkit-transition:-webkit-transform .3s cubic-bezier(.32,0,.67,0) 0s;-moz-transition:-moz-transform .3s cubic-bezier(.32,0,.67,0) 0s;-o-transition:-o-transform .3s cubic-bezier(.32,0,.67,0) 0s;transition:transform .3s cubic-bezier(.32,0,.67,0) 0s}.lg-rotate-left:after{content:"\e900"}.lg-rotate-right:after{content:"\e901"}.lg-icon.lg-flip-hor,.lg-icon.lg-flip-ver{font-size:26px}.lg-flip-ver:after{content:"\e903"}.lg-flip-hor:after{content:"\e902"}.lg-group:after{content:"";display:table;clear:both}.lg-outer{position:fixed;top:0;left:0;z-index:1050;text-align:left;opacity:0;outline:0;-webkit-transition:opacity .15s ease 0s;-o-transition:opacity .15s ease 0s;transition:opacity .15s ease 0s}.lg-outer *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.lg-outer.lg-visible{opacity:1}.lg-outer.lg-css3 .lg-item.lg-current,.lg-outer.lg-css3 .lg-item.lg-next-slide,.lg-outer.lg-css3 .lg-item.lg-prev-slide{-webkit-transition-duration:inherit!important;transition-duration:inherit!important;-webkit-transition-timing-function:inherit!important;transition-timing-function:inherit!important}.lg-outer.lg-css3.lg-dragging .lg-item.lg-current,.lg-outer.lg-css3.lg-dragging .lg-item.lg-next-slide,.lg-outer.lg-css3.lg-dragging .lg-item.lg-prev-slide{-webkit-transition-duration:0s!important;transition-duration:0s!important;opacity:1}.lg-outer.lg-grab img.lg-object{cursor:-webkit-grab;cursor:-moz-grab;cursor:-o-grab;cursor:-ms-grab;cursor:grab}.lg-outer.lg-grabbing img.lg-object{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:-o-grabbing;cursor:-ms-grabbing;cursor:grabbing}.lg-outer .lg{position:relative;overflow:hidden;margin-left:auto;margin-right:auto;max-width:100%;max-height:100%}.lg-outer .lg-inner{position:absolute;left:0;top:0;white-space:nowrap}.lg-outer .lg-item{background:url(../img/loading.gif) center center no-repeat;display:none!important}.lg-outer.lg-css .lg-current,.lg-outer.lg-css3 .lg-current,.lg-outer.lg-css3 .lg-next-slide,.lg-outer.lg-css3 .lg-prev-slide{display:inline-block!important}.lg-outer .lg-img-wrap,.lg-outer .lg-item{display:inline-block;text-align:center;position:absolute;width:100%;height:100%}.lg-outer .lg-img-wrap:before,.lg-outer .lg-item:before{content:"";display:inline-block;height:50%;width:1px;margin-right:-1px}.lg-outer .lg-img-wrap{position:absolute;padding:0 5px;left:0;right:0;top:0;bottom:0}.lg-outer .lg-item.lg-complete{background-image:none}.lg-outer .lg-item.lg-current{z-index:1060}.lg-outer .lg-image{display:inline-block;vertical-align:middle;max-width:100%;max-height:100%;width:auto!important;height:auto!important}.lg-outer.lg-show-after-load .lg-item .lg-object,.lg-outer.lg-show-after-load .lg-item .lg-video-play{opacity:0;-webkit-transition:opacity .15s ease 0s;-o-transition:opacity .15s ease 0s;transition:opacity .15s ease 0s}.lg-outer.lg-show-after-load .lg-item.lg-complete .lg-object,.lg-outer.lg-show-after-load .lg-item.lg-complete .lg-video-play{opacity:1}.lg-outer .lg-empty-html,.lg-outer.lg-hide-download #lg-download{display:none}.lg-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;z-index:1040;background-color:#000;opacity:0;-webkit-transition:opacity .15s ease 0s;-o-transition:opacity .15s ease 0s;transition:opacity .15s ease 0s}.lg-backdrop.in{opacity:1}.lg-css3.lg-no-trans .lg-current,.lg-css3.lg-no-trans .lg-next-slide,.lg-css3.lg-no-trans .lg-prev-slide{-webkit-transition:none 0s ease 0s!important;-moz-transition:none 0s ease 0s!important;-o-transition:none 0s ease 0s!important;transition:none 0s ease 0s!important}.lg-css3.lg-use-css3 .lg-item,.lg-css3.lg-use-left .lg-item{-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;backface-visibility:hidden}.lg-css3.lg-fade .lg-item{opacity:0}.lg-css3.lg-fade .lg-item.lg-current{opacity:1}.lg-css3.lg-fade .lg-item.lg-current,.lg-css3.lg-fade .lg-item.lg-next-slide,.lg-css3.lg-fade .lg-item.lg-prev-slide{-webkit-transition:opacity .1s ease 0s;-moz-transition:opacity .1s ease 0s;-o-transition:opacity .1s ease 0s;transition:opacity .1s ease 0s}.lg-css3.lg-slide.lg-use-css3 .lg-item{opacity:0}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-prev-slide{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-next-slide{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-current{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-current,.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-next-slide,.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-prev-slide{-webkit-transition:-webkit-transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;-moz-transition:-moz-transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;-o-transition:-o-transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;transition:transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s}.lg-css3.lg-slide.lg-use-left .lg-item{opacity:0;position:absolute;left:0}.lg-css3.lg-slide.lg-use-left .lg-item.lg-prev-slide{left:-100%}.lg-css3.lg-slide.lg-use-left .lg-item.lg-next-slide{left:100%}.lg-css3.lg-slide.lg-use-left .lg-item.lg-current{left:0;opacity:1}.lg-css3.lg-slide.lg-use-left .lg-item.lg-current,.lg-css3.lg-slide.lg-use-left .lg-item.lg-next-slide,.lg-css3.lg-slide.lg-use-left .lg-item.lg-prev-slide{-webkit-transition:left 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;-moz-transition:left 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;-o-transition:left 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;transition:left 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s} \ No newline at end of file diff --git a/vasl_templates/webapp/static/lightgallery/fonts/lg.svg b/vasl_templates/webapp/static/lightgallery/fonts/lg.svg new file mode 100644 index 0000000..6fffe1b --- /dev/null +++ b/vasl_templates/webapp/static/lightgallery/fonts/lg.svg @@ -0,0 +1,51 @@ + + + + + + +{ + "fontFamily": "lg", + "majorVersion": 1, + "minorVersion": 0, + "fontURL": "https://github.com/sachinchoolur/lightGallery", + "copyright": "sachin", + "license": "MLT", + "licenseURL": "http://opensource.org/licenses/MIT", + "description": "Font generated by IcoMoon.", + "version": "Version 1.0", + "fontId": "lg", + "psName": "lg", + "subFamily": "Regular", + "fullName": "lg" +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/vasl_templates/webapp/static/lightgallery/fonts/lg.ttf b/vasl_templates/webapp/static/lightgallery/fonts/lg.ttf new file mode 100644 index 0000000..213afec Binary files /dev/null and b/vasl_templates/webapp/static/lightgallery/fonts/lg.ttf differ diff --git a/vasl_templates/webapp/static/lightgallery/fonts/lg.woff b/vasl_templates/webapp/static/lightgallery/fonts/lg.woff new file mode 100644 index 0000000..27a2b8e Binary files /dev/null and b/vasl_templates/webapp/static/lightgallery/fonts/lg.woff differ diff --git a/vasl_templates/webapp/static/lightgallery/img/loading.gif b/vasl_templates/webapp/static/lightgallery/img/loading.gif new file mode 100644 index 0000000..4744c45 Binary files /dev/null and b/vasl_templates/webapp/static/lightgallery/img/loading.gif differ diff --git a/vasl_templates/webapp/static/lightgallery/js/lg-rotate.min.js b/vasl_templates/webapp/static/lightgallery/js/lg-rotate.min.js new file mode 100644 index 0000000..6138b2b --- /dev/null +++ b/vasl_templates/webapp/static/lightgallery/js/lg-rotate.min.js @@ -0,0 +1,4 @@ +/*! lg-rotate - v1.2.0 - 2020-09-19 +* http://sachinchoolur.github.io/lightGallery +* Copyright (c) 2020 Sachin N; Licensed GPLv3 */ +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(){"use strict";var b={rotate:!0,rotateLeft:!0,rotateRight:!0,flipHorizontal:!0,flipVertical:!0},c=function(c){return this.core=a(c).data("lightGallery"),this.core.s=a.extend({},b,this.core.s),this.core.s.rotate&&this.core.doCss()&&this.init(),this};c.prototype.buildTemplates=function(){var a="";this.core.s.flipVertical&&(a+=''),this.core.s.flipHorizontal&&(a+=''),this.core.s.rotateLeft&&(a+=''),this.core.s.rotateRight&&(a+=''),this.core.$outer.find(".lg-toolbar").append(a)},c.prototype.init=function(){var a=this;this.buildTemplates(),this.rotateValuesList={},this.core.$el.on("onAferAppendSlide.lg.tm.rotate",function(b,c){a.core.$slide.eq(c).find(".lg-img-wrap").wrap('
')}),this.core.$outer.find(".lg-rotate-left").on("click.lg",this.rotateLeft.bind(this)),this.core.$outer.find(".lg-rotate-right").on("click.lg",this.rotateRight.bind(this)),this.core.$outer.find(".lg-flip-hor").on("click.lg",this.flipHorizontal.bind(this)),this.core.$outer.find(".lg-flip-ver").on("click.lg",this.flipVertical.bind(this)),this.core.$el.on("onBeforeSlide.lg.tm.rotate",function(b,c,d){a.rotateValuesList[d]||(a.rotateValuesList[d]={rotate:0,flipHorizontal:1,flipVertical:1})})},c.prototype.applyStyles=function(){this.core.$slide.eq(this.core.index).find(".lg-img-rotate").css("transform","rotate("+this.rotateValuesList[this.core.index].rotate+"deg) scale3d("+this.rotateValuesList[this.core.index].flipVertical+", "+this.rotateValuesList[this.core.index].flipHorizontal+", 1)")},c.prototype.rotateLeft=function(){this.rotateValuesList[this.core.index].rotate-=90,this.applyStyles()},c.prototype.rotateRight=function(){this.rotateValuesList[this.core.index].rotate+=90,this.applyStyles()},c.prototype.flipHorizontal=function(){this.rotateValuesList[this.core.index].flipVertical*=-1,this.applyStyles()},c.prototype.flipVertical=function(){this.rotateValuesList[this.core.index].flipHorizontal*=-1,this.applyStyles()},c.prototype.destroy=function(){this.core.$el.off(".lg.tm.rotate"),this.rotateValuesList={}},a.fn.lightGallery.modules.rotate=c}()}); \ No newline at end of file diff --git a/vasl_templates/webapp/static/lightgallery/js/lg-thumbnail.min.js b/vasl_templates/webapp/static/lightgallery/js/lg-thumbnail.min.js new file mode 100644 index 0000000..657349b --- /dev/null +++ b/vasl_templates/webapp/static/lightgallery/js/lg-thumbnail.min.js @@ -0,0 +1,4 @@ +/*! lg-thumbnail - v1.2.1 - 2020-06-13 +* http://sachinchoolur.github.io/lightGallery +* Copyright (c) 2020 Sachin N; Licensed GPLv3 */ +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(){"use strict";var b={thumbnail:!0,animateThumb:!0,currentPagerPosition:"middle",thumbWidth:100,thumbHeight:"80px",thumbContHeight:100,thumbMargin:5,exThumbImage:!1,showThumbByDefault:!0,toogleThumb:!0,pullCaptionUp:!0,enableThumbDrag:!0,enableThumbSwipe:!0,swipeThreshold:50,loadYoutubeThumbnail:!0,youtubeThumbSize:1,loadVimeoThumbnail:!0,vimeoThumbSize:"thumbnail_small",loadDailymotionThumbnail:!0},c=function(c){return this.core=a(c).data("lightGallery"),this.core.s=a.extend({},b,this.core.s),this.$el=a(c),this.$thumbOuter=null,this.thumbOuterWidth=0,this.thumbTotalWidth=this.core.$items.length*(this.core.s.thumbWidth+this.core.s.thumbMargin),this.thumbIndex=this.core.index,this.core.s.animateThumb&&(this.core.s.thumbHeight="100%"),this.left=0,this.init(),this};c.prototype.init=function(){var a=this;this.core.s.thumbnail&&this.core.$items.length>1&&(this.core.s.showThumbByDefault&&setTimeout(function(){a.core.$outer.addClass("lg-thumb-open")},700),this.core.s.pullCaptionUp&&this.core.$outer.addClass("lg-pull-caption-up"),this.build(),this.core.s.animateThumb&&this.core.doCss()?(this.core.s.enableThumbDrag&&this.enableThumbDrag(),this.core.s.enableThumbSwipe&&this.enableThumbSwipe(),this.thumbClickable=!1):this.thumbClickable=!0,this.toogle(),this.thumbkeyPress())},c.prototype.build=function(){function b(a,b,c){var g,h=d.core.isVideo(a,c)||{},i="";h.youtube||h.vimeo||h.dailymotion?h.youtube?g=d.core.s.loadYoutubeThumbnail?"//img.youtube.com/vi/"+h.youtube[1]+"/"+d.core.s.youtubeThumbSize+".jpg":b:h.vimeo?d.core.s.loadVimeoThumbnail?(g="//i.vimeocdn.com/video/error_"+f+".jpg",i=h.vimeo[1]):g=b:h.dailymotion&&(g=d.core.s.loadDailymotionThumbnail?"//www.dailymotion.com/thumbnail/video/"+h.dailymotion[1]:b):g=b,e+='
',i=""}var c,d=this,e="",f="",g='
';switch(this.core.s.vimeoThumbSize){case"thumbnail_large":f="640";break;case"thumbnail_medium":f="200x150";break;case"thumbnail_small":f="100x75"}if(d.core.$outer.addClass("lg-has-thumb"),d.core.$outer.find(".lg").append(g),d.$thumbOuter=d.core.$outer.find(".lg-thumb-outer"),d.thumbOuterWidth=d.$thumbOuter.width(),d.core.s.animateThumb&&d.core.$outer.find(".lg-thumb").css({width:d.thumbTotalWidth+"px",position:"relative"}),this.core.s.animateThumb&&d.$thumbOuter.css("height",d.core.s.thumbContHeight+"px"),d.core.s.dynamic)for(var h=0;hthis.thumbTotalWidth-this.thumbOuterWidth&&(this.left=this.thumbTotalWidth-this.thumbOuterWidth),this.left<0&&(this.left=0),this.core.lGalleryOn?(b.hasClass("on")||this.core.$outer.find(".lg-thumb").css("transition-duration",this.core.s.speed+"ms"),this.core.doCss()||b.animate({left:-this.left+"px"},this.core.s.speed)):this.core.doCss()||b.css("left",-this.left+"px"),this.setTranslate(this.left)}},c.prototype.enableThumbDrag=function(){var b=this,c=0,d=0,e=!1,f=!1,g=0;b.$thumbOuter.addClass("lg-grab"),b.core.$outer.find(".lg-thumb").on("mousedown.lg.thumb",function(a){b.thumbTotalWidth>b.thumbOuterWidth&&(a.preventDefault(),c=a.pageX,e=!0,b.core.$outer.scrollLeft+=1,b.core.$outer.scrollLeft-=1,b.thumbClickable=!1,b.$thumbOuter.removeClass("lg-grab").addClass("lg-grabbing"))}),a(window).on("mousemove.lg.thumb",function(a){e&&(g=b.left,f=!0,d=a.pageX,b.$thumbOuter.addClass("lg-dragging"),g-=d-c,g>b.thumbTotalWidth-b.thumbOuterWidth&&(g=b.thumbTotalWidth-b.thumbOuterWidth),g<0&&(g=0),b.setTranslate(g))}),a(window).on("mouseup.lg.thumb",function(){f?(f=!1,b.$thumbOuter.removeClass("lg-dragging"),b.left=g,Math.abs(d-c)a.thumbOuterWidth&&(c.preventDefault(),b=c.originalEvent.targetTouches[0].pageX,a.thumbClickable=!1)}),a.core.$outer.find(".lg-thumb").on("touchmove.lg",function(f){a.thumbTotalWidth>a.thumbOuterWidth&&(f.preventDefault(),c=f.originalEvent.targetTouches[0].pageX,d=!0,a.$thumbOuter.addClass("lg-dragging"),e=a.left,e-=c-b,e>a.thumbTotalWidth-a.thumbOuterWidth&&(e=a.thumbTotalWidth-a.thumbOuterWidth),e<0&&(e=0),a.setTranslate(e))}),a.core.$outer.find(".lg-thumb").on("touchend.lg",function(){a.thumbTotalWidth>a.thumbOuterWidth&&d?(d=!1,a.$thumbOuter.removeClass("lg-dragging"),Math.abs(c-b)'),a.core.$outer.find(".lg-toogle-thumb").on("click.lg",function(){a.core.$outer.toggleClass("lg-thumb-open")}))},c.prototype.thumbkeyPress=function(){var b=this;a(window).on("keydown.lg.thumb",function(a){38===a.keyCode?(a.preventDefault(),b.core.$outer.addClass("lg-thumb-open")):40===a.keyCode&&(a.preventDefault(),b.core.$outer.removeClass("lg-thumb-open"))})},c.prototype.destroy=function(){this.core.s.thumbnail&&this.core.$items.length>1&&(a(window).off("resize.lg.thumb orientationchange.lg.thumb keydown.lg.thumb"),this.$thumbOuter.remove(),this.core.$outer.removeClass("lg-has-thumb"))},a.fn.lightGallery.modules.Thumbnail=c}()}); \ No newline at end of file diff --git a/vasl_templates/webapp/static/lightgallery/js/lg-zoom.min.js b/vasl_templates/webapp/static/lightgallery/js/lg-zoom.min.js new file mode 100644 index 0000000..57ff4a0 --- /dev/null +++ b/vasl_templates/webapp/static/lightgallery/js/lg-zoom.min.js @@ -0,0 +1,4 @@ +/*! lg-zoom - v1.2.1 - 2020-06-13 +* http://sachinchoolur.github.io/lightGallery +* Copyright (c) 2020 Sachin N; Licensed GPLv3 */ +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(){"use strict";var b=function(){var a=!1,b=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);return b&&parseInt(b[2],10)<54&&(a=!0),a},c={scale:1,zoom:!0,actualSize:!0,enableZoomAfter:300,useLeftForZoom:b()},d=function(b){return this.core=a(b).data("lightGallery"),this.core.s=a.extend({},c,this.core.s),this.core.s.zoom&&this.core.doCss()&&(this.init(),this.zoomabletimeout=!1,this.pageX=a(window).width()/2,this.pageY=a(window).height()/2+a(window).scrollTop()),this};d.prototype.init=function(){var b=this,c='';b.core.s.actualSize&&(c+=''),b.core.s.useLeftForZoom?b.core.$outer.addClass("lg-use-left-for-zoom"):b.core.$outer.addClass("lg-use-transition-for-zoom"),this.core.$outer.find(".lg-toolbar").append(c),b.core.$el.on("onSlideItemLoad.lg.tm.zoom",function(c,d,e){var f=b.core.s.enableZoomAfter+e;a("body").hasClass("lg-from-hash")&&e?f=0:a("body").removeClass("lg-from-hash"),b.zoomabletimeout=setTimeout(function(){b.core.$slide.eq(d).addClass("lg-zoomable")},f+30)});var d=1,e=function(c){var d,e,f=b.core.$outer.find(".lg-current .lg-image"),g=(a(window).width()-f.prop("offsetWidth"))/2,h=(a(window).height()-f.prop("offsetHeight"))/2+a(window).scrollTop();d=b.pageX-g,e=b.pageY-h;var i=(c-1)*d,j=(c-1)*e;f.css("transform","scale3d("+c+", "+c+", 1)").attr("data-scale",c),b.core.s.useLeftForZoom?f.parent().css({left:-i+"px",top:-j+"px"}).attr("data-x",i).attr("data-y",j):f.parent().css("transform","translate3d(-"+i+"px, -"+j+"px, 0)").attr("data-x",i).attr("data-y",j)},f=function(){d>1?b.core.$outer.addClass("lg-zoomed"):b.resetZoom(),d<1&&(d=1),e(d)},g=function(c,e,g,h){var i,j=e.prop("offsetWidth");i=b.core.s.dynamic?b.core.s.dynamicEl[g].width||e[0].naturalWidth||j:b.core.$items.eq(g).attr("data-width")||e[0].naturalWidth||j;var k;b.core.$outer.hasClass("lg-zoomed")?d=1:i>j&&(k=i/j,d=k||2),h?(b.pageX=a(window).width()/2,b.pageY=a(window).height()/2+a(window).scrollTop()):(b.pageX=c.pageX||c.originalEvent.targetTouches[0].pageX,b.pageY=c.pageY||c.originalEvent.targetTouches[0].pageY),f(),setTimeout(function(){b.core.$outer.removeClass("lg-grabbing").addClass("lg-grab")},10)},h=!1;b.core.$el.on("onAferAppendSlide.lg.tm.zoom",function(a,c){var d=b.core.$slide.eq(c).find(".lg-image");d.on("dblclick",function(a){g(a,d,c)}),d.on("touchstart",function(a){h?(clearTimeout(h),h=null,g(a,d,c)):h=setTimeout(function(){h=null},300),a.preventDefault()})}),a(window).on("resize.lg.zoom scroll.lg.zoom orientationchange.lg.zoom",function(){b.pageX=a(window).width()/2,b.pageY=a(window).height()/2+a(window).scrollTop(),e(d)}),a("#lg-zoom-out").on("click.lg",function(){b.core.$outer.find(".lg-current .lg-image").length&&(d-=b.core.s.scale,f())}),a("#lg-zoom-in").on("click.lg",function(){b.core.$outer.find(".lg-current .lg-image").length&&(d+=b.core.s.scale,f())}),a("#lg-actual-size").on("click.lg",function(a){g(a,b.core.$slide.eq(b.core.index).find(".lg-image"),b.core.index,!0)}),b.core.$el.on("onBeforeSlide.lg.tm",function(){d=1,b.resetZoom()}),b.zoomDrag(),b.zoomSwipe()},d.prototype.resetZoom=function(){this.core.$outer.removeClass("lg-zoomed"),this.core.$slide.find(".lg-img-wrap").removeAttr("style data-x data-y"),this.core.$slide.find(".lg-image").removeAttr("style data-scale"),this.pageX=a(window).width()/2,this.pageY=a(window).height()/2+a(window).scrollTop()},d.prototype.zoomSwipe=function(){var a=this,b={},c={},d=!1,e=!1,f=!1;a.core.$slide.on("touchstart.lg",function(c){if(a.core.$outer.hasClass("lg-zoomed")){var d=a.core.$slide.eq(a.core.index).find(".lg-object");f=d.prop("offsetHeight")*d.attr("data-scale")>a.core.$outer.find(".lg").height(),e=d.prop("offsetWidth")*d.attr("data-scale")>a.core.$outer.find(".lg").width(),(e||f)&&(c.preventDefault(),b={x:c.originalEvent.targetTouches[0].pageX,y:c.originalEvent.targetTouches[0].pageY})}}),a.core.$slide.on("touchmove.lg",function(g){if(a.core.$outer.hasClass("lg-zoomed")){var h,i,j=a.core.$slide.eq(a.core.index).find(".lg-img-wrap");g.preventDefault(),d=!0,c={x:g.originalEvent.targetTouches[0].pageX,y:g.originalEvent.targetTouches[0].pageY},a.core.$outer.addClass("lg-zoom-dragging"),i=f?-Math.abs(j.attr("data-y"))+(c.y-b.y):-Math.abs(j.attr("data-y")),h=e?-Math.abs(j.attr("data-x"))+(c.x-b.x):-Math.abs(j.attr("data-x")),(Math.abs(c.x-b.x)>15||Math.abs(c.y-b.y)>15)&&(a.core.s.useLeftForZoom?j.css({left:h+"px",top:i+"px"}):j.css("transform","translate3d("+h+"px, "+i+"px, 0)"))}}),a.core.$slide.on("touchend.lg",function(){a.core.$outer.hasClass("lg-zoomed")&&d&&(d=!1,a.core.$outer.removeClass("lg-zoom-dragging"),a.touchendZoom(b,c,e,f))})},d.prototype.zoomDrag=function(){var b=this,c={},d={},e=!1,f=!1,g=!1,h=!1;b.core.$slide.on("mousedown.lg.zoom",function(d){var f=b.core.$slide.eq(b.core.index).find(".lg-object");h=f.prop("offsetHeight")*f.attr("data-scale")>b.core.$outer.find(".lg").height(),g=f.prop("offsetWidth")*f.attr("data-scale")>b.core.$outer.find(".lg").width(),b.core.$outer.hasClass("lg-zoomed")&&a(d.target).hasClass("lg-object")&&(g||h)&&(d.preventDefault(),c={x:d.pageX,y:d.pageY},e=!0,b.core.$outer.scrollLeft+=1,b.core.$outer.scrollLeft-=1,b.core.$outer.removeClass("lg-grab").addClass("lg-grabbing"))}),a(window).on("mousemove.lg.zoom",function(a){if(e){var i,j,k=b.core.$slide.eq(b.core.index).find(".lg-img-wrap");f=!0,d={x:a.pageX,y:a.pageY},b.core.$outer.addClass("lg-zoom-dragging"),j=h?-Math.abs(k.attr("data-y"))+(d.y-c.y):-Math.abs(k.attr("data-y")),i=g?-Math.abs(k.attr("data-x"))+(d.x-c.x):-Math.abs(k.attr("data-x")),b.core.s.useLeftForZoom?k.css({left:i+"px",top:j+"px"}):k.css("transform","translate3d("+i+"px, "+j+"px, 0)")}}),a(window).on("mouseup.lg.zoom",function(a){e&&(e=!1,b.core.$outer.removeClass("lg-zoom-dragging"),!f||c.x===d.x&&c.y===d.y||(d={x:a.pageX,y:a.pageY},b.touchendZoom(c,d,g,h)),f=!1),b.core.$outer.removeClass("lg-grabbing").addClass("lg-grab")})},d.prototype.touchendZoom=function(a,b,c,d){var e=this,f=e.core.$slide.eq(e.core.index).find(".lg-img-wrap"),g=e.core.$slide.eq(e.core.index).find(".lg-object"),h=-Math.abs(f.attr("data-x"))+(b.x-a.x),i=-Math.abs(f.attr("data-y"))+(b.y-a.y),j=(e.core.$outer.find(".lg").height()-g.prop("offsetHeight"))/2,k=Math.abs(g.prop("offsetHeight")*Math.abs(g.attr("data-scale"))-e.core.$outer.find(".lg").height()+j),l=(e.core.$outer.find(".lg").width()-g.prop("offsetWidth"))/2,m=Math.abs(g.prop("offsetWidth")*Math.abs(g.attr("data-scale"))-e.core.$outer.find(".lg").width()+l);(Math.abs(b.x-a.x)>15||Math.abs(b.y-a.y)>15)&&(d&&(i<=-k?i=-k:i>=-j&&(i=-j)),c&&(h<=-m?h=-m:h>=-l&&(h=-l)),d?f.attr("data-y",Math.abs(i)):i=-Math.abs(f.attr("data-y")),c?f.attr("data-x",Math.abs(h)):h=-Math.abs(f.attr("data-x")),e.core.s.useLeftForZoom?f.css({left:h+"px",top:i+"px"}):f.css("transform","translate3d("+h+"px, "+i+"px, 0)"))},d.prototype.destroy=function(){var b=this;b.core.$el.off(".lg.zoom"),a(window).off(".lg.zoom"),b.core.$slide.off(".lg.zoom"),b.core.$el.off(".lg.tm.zoom"),b.resetZoom(),clearTimeout(b.zoomabletimeout),b.zoomabletimeout=!1},a.fn.lightGallery.modules.zoom=d}()}); \ No newline at end of file diff --git a/vasl_templates/webapp/static/lightgallery/js/lightgallery.min.js b/vasl_templates/webapp/static/lightgallery/js/lightgallery.min.js new file mode 100644 index 0000000..d3fa786 --- /dev/null +++ b/vasl_templates/webapp/static/lightgallery/js/lightgallery.min.js @@ -0,0 +1,4 @@ +/*! lightgallery - v1.8.3 - 2020-09-19 +* http://sachinchoolur.github.io/lightGallery/ +* Copyright (c) 2020 Sachin N; Licensed GPLv3 */ +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(){"use strict";function b(b,d){if(this.el=b,this.$el=a(b),this.s=a.extend({},c,d),this.s.dynamic&&"undefined"!==this.s.dynamicEl&&this.s.dynamicEl.constructor===Array&&!this.s.dynamicEl.length)throw"When using dynamic mode, you must also define dynamicEl as an Array.";return this.modules={},this.lGalleryOn=!1,this.lgBusy=!1,this.hideBartimeout=!1,this.isTouch="ontouchstart"in document.documentElement,this.s.slideEndAnimatoin&&(this.s.hideControlOnEnd=!1),this.s.dynamic?this.$items=this.s.dynamicEl:"this"===this.s.selector?this.$items=this.$el:""!==this.s.selector?this.s.selectWithin?this.$items=a(this.s.selectWithin).find(this.s.selector):this.$items=this.$el.find(a(this.s.selector)):this.$items=this.$el.children(),this.$slide="",this.$outer="",this.init(),this}var c={mode:"lg-slide",cssEasing:"ease",easing:"linear",speed:600,height:"100%",width:"100%",addClass:"",startClass:"lg-start-zoom",backdropDuration:150,hideBarsDelay:6e3,useLeft:!1,ariaLabelledby:"",ariaDescribedby:"",closable:!0,loop:!0,escKey:!0,keyPress:!0,controls:!0,slideEndAnimatoin:!0,hideControlOnEnd:!1,mousewheel:!0,getCaptionFromTitleOrAlt:!0,appendSubHtmlTo:".lg-sub-html",subHtmlSelectorRelative:!1,preload:1,showAfterLoad:!0,selector:"",selectWithin:"",nextHtml:"",prevHtml:"",index:!1,iframeMaxWidth:"100%",download:!0,counter:!0,appendCounterTo:".lg-toolbar",swipeThreshold:50,enableSwipe:!0,enableDrag:!0,dynamic:!1,dynamicEl:[],galleryId:1};b.prototype.init=function(){var b=this;b.s.preload>b.$items.length&&(b.s.preload=b.$items.length);var c=window.location.hash;c.indexOf("lg="+this.s.galleryId)>0&&(b.index=parseInt(c.split("&slide=")[1],10),a("body").addClass("lg-from-hash"),a("body").hasClass("lg-on")||(setTimeout(function(){b.build(b.index)}),a("body").addClass("lg-on"))),b.s.dynamic?(b.$el.trigger("onBeforeOpen.lg"),b.index=b.s.index||0,a("body").hasClass("lg-on")||setTimeout(function(){b.build(b.index),a("body").addClass("lg-on")})):b.$items.on("click.lgcustom",function(c){try{c.preventDefault(),c.preventDefault()}catch(a){c.returnValue=!1}b.$el.trigger("onBeforeOpen.lg"),b.index=b.s.index||b.$items.index(this),a("body").hasClass("lg-on")||(b.build(b.index),a("body").addClass("lg-on"))})},b.prototype.build=function(b){var c=this;c.structure(),a.each(a.fn.lightGallery.modules,function(b){c.modules[b]=new a.fn.lightGallery.modules[b](c.el)}),c.slide(b,!1,!1,!1),c.s.keyPress&&c.keyPress(),c.$items.length>1?(c.arrow(),setTimeout(function(){c.enableDrag(),c.enableSwipe()},50),c.s.mousewheel&&c.mousewheel()):c.$slide.on("click.lg",function(){c.$el.trigger("onSlideClick.lg")}),c.counter(),c.closeGallery(),c.$el.trigger("onAfterOpen.lg"),c.$outer.on("mousemove.lg click.lg touchstart.lg",function(){c.$outer.removeClass("lg-hide-items"),clearTimeout(c.hideBartimeout),c.hideBartimeout=setTimeout(function(){c.$outer.addClass("lg-hide-items")},c.s.hideBarsDelay)}),c.$outer.trigger("mousemove.lg")},b.prototype.structure=function(){var b,c="",d="",e=0,f="",g=this;for(a("body").append('
'),a(".lg-backdrop").css("transition-duration",this.s.backdropDuration+"ms"),e=0;e';if(this.s.controls&&this.$items.length>1&&(d='
"),".lg-sub-html"===this.s.appendSubHtmlTo&&(f='
'),b='",a("body").append(b),this.$outer=a(".lg-outer"),this.$outer.focus(),this.$slide=this.$outer.find(".lg-item"),this.s.useLeft?(this.$outer.addClass("lg-use-left"),this.s.mode="lg-slide"):this.$outer.addClass("lg-use-css3"),g.setTop(),a(window).on("resize.lg orientationchange.lg",function(){setTimeout(function(){g.setTop()},100)}),this.$slide.eq(this.index).addClass("lg-current"),this.doCss()?this.$outer.addClass("lg-css3"):(this.$outer.addClass("lg-css"),this.s.speed=0),this.$outer.addClass(this.s.mode),this.s.enableDrag&&this.$items.length>1&&this.$outer.addClass("lg-grab"),this.s.showAfterLoad&&this.$outer.addClass("lg-show-after-load"),this.doCss()){var h=this.$outer.find(".lg-inner");h.css("transition-timing-function",this.s.cssEasing),h.css("transition-duration",this.s.speed+"ms")}setTimeout(function(){a(".lg-backdrop").addClass("in")}),setTimeout(function(){g.$outer.addClass("lg-visible")},this.s.backdropDuration),this.s.download&&this.$outer.find(".lg-toolbar").append(''),this.prevScrollTop=a(window).scrollTop()},b.prototype.setTop=function(){if("100%"!==this.s.height){var b=a(window).height(),c=(b-parseInt(this.s.height,10))/2,d=this.$outer.find(".lg");b>=parseInt(this.s.height,10)?d.css("top",c+"px"):d.css("top","0px")}},b.prototype.doCss=function(){return!!function(){var a=["transition","MozTransition","WebkitTransition","OTransition","msTransition","KhtmlTransition"],b=document.documentElement,c=0;for(c=0;c'+(parseInt(this.index,10)+1)+' / '+this.$items.length+"")},b.prototype.addHtml=function(b){var c,d,e=null;if(this.s.dynamic?this.s.dynamicEl[b].subHtmlUrl?c=this.s.dynamicEl[b].subHtmlUrl:e=this.s.dynamicEl[b].subHtml:(d=this.$items.eq(b),d.attr("data-sub-html-url")?c=d.attr("data-sub-html-url"):(e=d.attr("data-sub-html"),this.s.getCaptionFromTitleOrAlt&&!e&&(e=d.attr("title")||d.find("img").first().attr("alt")))),!c)if(void 0!==e&&null!==e){var f=e.substring(0,1);"."!==f&&"#"!==f||(e=this.s.subHtmlSelectorRelative&&!this.s.dynamic?d.find(e).html():a(e).html())}else e="";".lg-sub-html"===this.s.appendSubHtmlTo?c?this.$outer.find(this.s.appendSubHtmlTo).load(c):this.$outer.find(this.s.appendSubHtmlTo).html(e):c?this.$slide.eq(b).load(c):this.$slide.eq(b).append(e),void 0!==e&&null!==e&&(""===e?this.$outer.find(this.s.appendSubHtmlTo).addClass("lg-empty-html"):this.$outer.find(this.s.appendSubHtmlTo).removeClass("lg-empty-html")),this.$el.trigger("onAfterAppendSubHtml.lg",[b])},b.prototype.preload=function(a){var b=1,c=1;for(b=1;b<=this.s.preload&&!(b>=this.$items.length-a);b++)this.loadContent(a+b,!1,0);for(c=1;c<=this.s.preload&&!(a-c<0);c++)this.loadContent(a-c,!1,0)},b.prototype.loadContent=function(b,c,d){var e,f,g,h,i,j,k,l=this,m=!1,n=function(b){for(var c=[],d=[],e=0;eh){f=d[i];break}};if(l.s.dynamic){if(l.s.dynamicEl[b].poster&&(m=!0,g=l.s.dynamicEl[b].poster),j=l.s.dynamicEl[b].html,f=l.s.dynamicEl[b].src,k=l.s.dynamicEl[b].alt,l.s.dynamicEl[b].responsive){n(l.s.dynamicEl[b].responsive.split(","))}h=l.s.dynamicEl[b].srcset,i=l.s.dynamicEl[b].sizes}else{var o=l.$items.eq(b);if(o.attr("data-poster")&&(m=!0,g=o.attr("data-poster")),j=o.attr("data-html"),f=o.attr("href")||o.attr("data-src"),k=o.attr("title")||o.find("img").first().attr("alt"),o.attr("data-responsive")){n(o.attr("data-responsive").split(","))}h=o.attr("data-srcset"),i=o.attr("data-sizes")}var p=!1;l.s.dynamic?l.s.dynamicEl[b].iframe&&(p=!0):"true"===l.$items.eq(b).attr("data-iframe")&&(p=!0);var q=l.isVideo(f,b);if(!l.$slide.eq(b).hasClass("lg-loaded")){if(p)l.$slide.eq(b).prepend('
');else if(m){var r="";r=q&&q.youtube?"lg-has-youtube":q&&q.vimeo?"lg-has-vimeo":"lg-has-html5",l.$slide.eq(b).prepend('
')}else q?(l.$slide.eq(b).prepend('
'),l.$el.trigger("hasVideo.lg",[b,f,j])):(k=k?'alt="'+k+'"':"",l.$slide.eq(b).prepend('
'));if(l.$el.trigger("onAferAppendSlide.lg",[b]),e=l.$slide.eq(b).find(".lg-object"),i&&e.attr("sizes",i),h){e.attr("srcset",h);try{picturefill({elements:[e[0]]})}catch(a){console.warn("lightGallery :- If you want srcset to be supported for older browser please include picturefil version 2 javascript library in your document.")}}".lg-sub-html"!==this.s.appendSubHtmlTo&&l.addHtml(b),l.$slide.eq(b).addClass("lg-loaded")}l.$slide.eq(b).find(".lg-object").on("load.lg error.lg",function(){var c=0;d&&!a("body").hasClass("lg-from-hash")&&(c=d),setTimeout(function(){l.$slide.eq(b).addClass("lg-complete"),l.$el.trigger("onSlideItemLoad.lg",[b,d||0])},c)}),q&&q.html5&&!m&&l.$slide.eq(b).addClass("lg-complete"),!0===c&&(l.$slide.eq(b).hasClass("lg-complete")?l.preload(b):l.$slide.eq(b).find(".lg-object").on("load.lg error.lg",function(){l.preload(b)}))},b.prototype.slide=function(b,c,d,e){var f=this.$outer.find(".lg-current").index(),g=this;if(!g.lGalleryOn||f!==b){var h=this.$slide.length,i=g.lGalleryOn?this.s.speed:0;if(!g.lgBusy){if(this.s.download){var j;j=g.s.dynamic?!1!==g.s.dynamicEl[b].downloadUrl&&(g.s.dynamicEl[b].downloadUrl||g.s.dynamicEl[b].src):"false"!==g.$items.eq(b).attr("data-download-url")&&(g.$items.eq(b).attr("data-download-url")||g.$items.eq(b).attr("href")||g.$items.eq(b).attr("data-src")),j?(a("#lg-download").attr("href",j),g.$outer.removeClass("lg-hide-download")):g.$outer.addClass("lg-hide-download")}if(this.$el.trigger("onBeforeSlide.lg",[f,b,c,d]),g.lgBusy=!0,clearTimeout(g.hideBartimeout),".lg-sub-html"===this.s.appendSubHtmlTo&&setTimeout(function(){g.addHtml(b)},i),this.arrowDisable(b),e||(bf&&(e="next")),c){this.$slide.removeClass("lg-prev-slide lg-current lg-next-slide");var k,l;h>2?(k=b-1,l=b+1,0===b&&f===h-1?(l=0,k=h-1):b===h-1&&0===f&&(l=0,k=h-1)):(k=0,l=1),"prev"===e?g.$slide.eq(l).addClass("lg-next-slide"):g.$slide.eq(k).addClass("lg-prev-slide"),g.$slide.eq(b).addClass("lg-current")}else g.$outer.addClass("lg-no-trans"),this.$slide.removeClass("lg-prev-slide lg-next-slide"),"prev"===e?(this.$slide.eq(b).addClass("lg-prev-slide"),this.$slide.eq(f).addClass("lg-next-slide")):(this.$slide.eq(b).addClass("lg-next-slide"),this.$slide.eq(f).addClass("lg-prev-slide")),setTimeout(function(){g.$slide.removeClass("lg-current"),g.$slide.eq(b).addClass("lg-current"),g.$outer.removeClass("lg-no-trans")},50);g.lGalleryOn?(setTimeout(function(){g.loadContent(b,!0,0)},this.s.speed+50),setTimeout(function(){g.lgBusy=!1,g.$el.trigger("onAfterSlide.lg",[f,b,c,d])},this.s.speed)):(g.loadContent(b,!0,g.s.backdropDuration),g.lgBusy=!1,g.$el.trigger("onAfterSlide.lg",[f,b,c,d])),g.lGalleryOn=!0,this.s.counter&&a("#lg-counter-current").text(b+1)}g.index=b}},b.prototype.goToNextSlide=function(a){var b=this,c=b.s.loop;a&&b.$slide.length<3&&(c=!1),b.lgBusy||(b.index+10?(b.index--,b.$el.trigger("onBeforePrevSlide.lg",[b.index,a]),b.slide(b.index,a,!1,"prev")):c?(b.index=b.$items.length-1,b.$el.trigger("onBeforePrevSlide.lg",[b.index,a]),b.slide(b.index,a,!1,"prev")):b.s.slideEndAnimatoin&&!a&&(b.$outer.addClass("lg-left-end"),setTimeout(function(){b.$outer.removeClass("lg-left-end")},400)))},b.prototype.keyPress=function(){var b=this;this.$items.length>1&&a(window).on("keyup.lg",function(a){b.$items.length>1&&(37===a.keyCode&&(a.preventDefault(),b.goToPrevSlide()),39===a.keyCode&&(a.preventDefault(),b.goToNextSlide()))}),a(window).on("keydown.lg",function(a){!0===b.s.escKey&&27===a.keyCode&&(a.preventDefault(),b.$outer.hasClass("lg-thumb-open")?b.$outer.removeClass("lg-thumb-open"):b.destroy())})},b.prototype.arrow=function(){var a=this;this.$outer.find(".lg-prev").on("click.lg",function(){a.goToPrevSlide()}),this.$outer.find(".lg-next").on("click.lg",function(){a.goToNextSlide()})},b.prototype.arrowDisable=function(a){!this.s.loop&&this.s.hideControlOnEnd&&(a+10?this.$outer.find(".lg-prev").removeAttr("disabled").removeClass("disabled"):this.$outer.find(".lg-prev").attr("disabled","disabled").addClass("disabled"))},b.prototype.setTranslate=function(a,b,c){this.s.useLeft?a.css("left",b):a.css({transform:"translate3d("+b+"px, "+c+"px, 0px)"})},b.prototype.touchMove=function(b,c){var d=c-b;Math.abs(d)>15&&(this.$outer.addClass("lg-dragging"),this.setTranslate(this.$slide.eq(this.index),d,0),this.setTranslate(a(".lg-prev-slide"),-this.$slide.eq(this.index).width()+d,0),this.setTranslate(a(".lg-next-slide"),this.$slide.eq(this.index).width()+d,0))},b.prototype.touchEnd=function(a){var b=this;"lg-slide"!==b.s.mode&&b.$outer.addClass("lg-slide"),this.$slide.not(".lg-current, .lg-prev-slide, .lg-next-slide").css("opacity","0"),setTimeout(function(){b.$outer.removeClass("lg-dragging"),a<0&&Math.abs(a)>b.s.swipeThreshold?b.goToNextSlide(!0):a>0&&Math.abs(a)>b.s.swipeThreshold?b.goToPrevSlide(!0):Math.abs(a)<5&&b.$el.trigger("onSlideClick.lg"),b.$slide.removeAttr("style")}),setTimeout(function(){b.$outer.hasClass("lg-dragging")||"lg-slide"===b.s.mode||b.$outer.removeClass("lg-slide")},b.s.speed+100)},b.prototype.enableSwipe=function(){var a=this,b=0,c=0,d=!1;a.s.enableSwipe&&a.doCss()&&(a.$slide.on("touchstart.lg",function(c){a.$outer.hasClass("lg-zoomed")||a.lgBusy||(c.preventDefault(),a.manageSwipeClass(),b=c.originalEvent.targetTouches[0].pageX)}),a.$slide.on("touchmove.lg",function(e){a.$outer.hasClass("lg-zoomed")||(e.preventDefault(),c=e.originalEvent.targetTouches[0].pageX,a.touchMove(b,c),d=!0)}),a.$slide.on("touchend.lg",function(){a.$outer.hasClass("lg-zoomed")||(d?(d=!1,a.touchEnd(c-b)):a.$el.trigger("onSlideClick.lg"))}))},b.prototype.enableDrag=function(){var b=this,c=0,d=0,e=!1,f=!1;b.s.enableDrag&&b.doCss()&&(b.$slide.on("mousedown.lg",function(d){b.$outer.hasClass("lg-zoomed")||b.lgBusy||a(d.target).text().trim()||(d.preventDefault(),b.manageSwipeClass(),c=d.pageX,e=!0,b.$outer.scrollLeft+=1,b.$outer.scrollLeft-=1,b.$outer.removeClass("lg-grab").addClass("lg-grabbing"),b.$el.trigger("onDragstart.lg"))}),a(window).on("mousemove.lg",function(a){e&&(f=!0,d=a.pageX,b.touchMove(c,d),b.$el.trigger("onDragmove.lg"))}),a(window).on("mouseup.lg",function(g){f?(f=!1,b.touchEnd(d-c),b.$el.trigger("onDragend.lg")):(a(g.target).hasClass("lg-object")||a(g.target).hasClass("lg-video-play"))&&b.$el.trigger("onSlideClick.lg"),e&&(e=!1,b.$outer.removeClass("lg-grabbing").addClass("lg-grab"))}))},b.prototype.manageSwipeClass=function(){var a=this.index+1,b=this.index-1;this.s.loop&&this.$slide.length>2&&(0===this.index?b=this.$slide.length-1:this.index===this.$slide.length-1&&(a=0)),this.$slide.removeClass("lg-next-slide lg-prev-slide"),b>-1&&this.$slide.eq(b).addClass("lg-prev-slide"),this.$slide.eq(a).addClass("lg-next-slide")},b.prototype.mousewheel=function(){var a=this;a.$outer.on("mousewheel.lg",function(b){b.deltaY&&(b.deltaY>0?a.goToPrevSlide():a.goToNextSlide(),b.preventDefault())})},b.prototype.closeGallery=function(){var b=this,c=!1;this.$outer.find(".lg-close").on("click.lg",function(){b.destroy()}),b.s.closable&&(b.$outer.on("mousedown.lg",function(b){c=!!(a(b.target).is(".lg-outer")||a(b.target).is(".lg-item ")||a(b.target).is(".lg-img-wrap"))}),b.$outer.on("mousemove.lg",function(){c=!1}),b.$outer.on("mouseup.lg",function(d){(a(d.target).is(".lg-outer")||a(d.target).is(".lg-item ")||a(d.target).is(".lg-img-wrap")&&c)&&(b.$outer.hasClass("lg-dragging")||b.destroy())}))},b.prototype.destroy=function(b){var c=this;b||(c.$el.trigger("onBeforeClose.lg"),a(window).scrollTop(c.prevScrollTop)),b&&(c.s.dynamic||this.$items.off("click.lg click.lgcustom"),a.removeData(c.el,"lightGallery")),this.$el.off(".lg.tm"),a.each(a.fn.lightGallery.modules,function(a){c.modules[a]&&c.modules[a].destroy()}),this.lGalleryOn=!1,clearTimeout(c.hideBartimeout),this.hideBartimeout=!1,a(window).off(".lg"),a("body").removeClass("lg-on lg-from-hash"),c.$outer&&c.$outer.removeClass("lg-visible"),a(".lg-backdrop").removeClass("in"),setTimeout(function(){c.$outer&&c.$outer.remove(),a(".lg-backdrop").remove(),b||c.$el.trigger("onCloseAfter.lg"),c.$el.focus()},c.s.backdropDuration+50)},a.fn.lightGallery=function(c){return this.each(function(){if(a.data(this,"lightGallery"))try{a(this).data("lightGallery").init()}catch(a){console.error("lightGallery has not initiated properly")}else a.data(this,"lightGallery",new b(this,c))})},a.fn.lightGallery.modules={}}()}); \ No newline at end of file diff --git a/vasl_templates/webapp/static/roar.js b/vasl_templates/webapp/static/roar.js index e2e7c58..bab3b46 100644 --- a/vasl_templates/webapp/static/roar.js +++ b/vasl_templates/webapp/static/roar.js @@ -174,11 +174,11 @@ function getRoarScenarioIndex( onReady ) // nope - download it $.getJSON( gGetRoarScenarioIndexUrl, function( resp ) { - if ( resp.error ) { - var msg = resp.error ; + if ( resp.warning ) { + var msg = resp.warning ; if ( resp.message ) msg += "
" + escapeHTML(resp.message) + "
" ; - showErrorMsg( msg ) ; + showWarningMsg( msg ) ; return ; } _roarScenarioIndex = resp ; diff --git a/vasl_templates/webapp/static/scenario-upload.js b/vasl_templates/webapp/static/scenario-upload.js new file mode 100644 index 0000000..d46ca01 --- /dev/null +++ b/vasl_templates/webapp/static/scenario-upload.js @@ -0,0 +1,454 @@ +/* jshint esnext: true */ + +( function() { // nb: put the entire file into its own local namespace, global stuff gets added to window. + +var gVsavData, gScreenshotData ; +var $gDialog, $gVsavContainer, $gScreenshotContainer ; + +// -------------------------------------------------------------------- + +window.uploadScenario = function() { + + // initialize + var asaScenarioId = $( "input[name='ASA_ID']" ).val() ; + + function onAddVsavFile() { + if ( ! canAddVsavFile() ) + return ; + if ( getUrlParam( "vsav_persistence" ) ) { + // FOR TESTING PORPOISES! We can't control a file upload from Selenium (since + // the browser will use native controls), so we get the data from a