diff --git a/misc/ext_bottom_line_test_data.py b/misc/ext_bottom_line_test_data.py index 8c2609b47b3c7caba5537a5eedd2eb2b7c9981ab..628465fb25393f7b780187f1f51402d4b448c976 100755 --- a/misc/ext_bottom_line_test_data.py +++ b/misc/ext_bottom_line_test_data.py @@ -22,10 +22,15 @@ # # ** end header +import os import caosdb import random +import wget - +filename = "small.webm" +if not os.path.isfile(filename): + filename = wget.download("http://techslides.com/demos/sample-videos/small.webm") +caosdb.configure_connection(ssl_insecure=True) # clean old = caosdb.execute_query("FIND Test*") @@ -47,14 +52,19 @@ testdata = caosdb.Container() ## record with references refrec = caosdb.Record("TestPreviewRecord-references").add_parent("TestPreviewRecordType") testdata.append(refrec) + +video = caosdb.File(name="TestFile", file=filename, path="testfile.webm") for i in ["load-forever", "fall-back", "error", "success", "success-2"]: rec = caosdb.Record("TestPreviewRecord-{}".format(i)).add_parent("TestPreviewRecordType") testdata.append(rec) refrec.add_property("TestPreviewRecordType", rec) +#testdate.append(image) +testdata.append(video) testdata.insert(); +os.remove(filename) diff --git a/src/core/js/ext_bottom_line.js b/src/core/js/ext_bottom_line.js index 39c2f3b237a5cc33134df528c8d948915d6603d7..1de8525c01aa5f7a5426202fafbac3d836cf3848 100644 --- a/src/core/js/ext_bottom_line.js +++ b/src/core/js/ext_bottom_line.js @@ -86,7 +86,7 @@ var ext_bottom_line = function ($, logger, is_in_view_port, load_config, getEnti const _path_has_file_extension = function (entity, extensions) { const path = getEntityPath(entity); if (path) { - for (var ext in extensions) { + for (var ext of extensions) { if(path.toLowerCase().endsWith(ext)) { return true; } diff --git a/src/core/xsl/entity.xsl b/src/core/xsl/entity.xsl index 2a4a803f95dd22f942d1f2d7ea9ee4b3303bf53a..7187c6b7d183b340a8eaee4cbdcead7ada44d433 100644 --- a/src/core/xsl/entity.xsl +++ b/src/core/xsl/entity.xsl @@ -181,15 +181,6 @@ <xsl:apply-templates mode="entity-body" select="Property"/> </xsl:if> </ul> - <!-- Thumbnail --> - <xsl:if test="@path"> - <xsl:call-template name="entity-body-thumbnail"> - <xsl:with-param name="path" select="@path"/> - </xsl:call-template> - <xsl:call-template name="entity-body-video"> - <xsl:with-param name="path" select="@path"/> - </xsl:call-template> - </xsl:if> </div> <!-- Annotations --> <xsl:call-template name="annotation-section"> @@ -198,38 +189,6 @@ </xsl:call-template> </div> </xsl:template> - <!-- Thumbnails of images --> - <xsl:template name="entity-body-thumbnail"> - <xsl:param name="path"/> - <xsl:if test="contains('.jpg.gif.png.svg',translate(substring($path, string-length($path) - 3), 'JPGIFNSV', 'jpgifnsv'))"> - <div class="row"> - <div class="col-sm-12"> - <img class="entity-image-preview" style="max-width: 200px; max-height: 140px;"> - <xsl:attribute name="src"> - <xsl:value-of select="concat($filesystempath,$path)"/> - </xsl:attribute> - </img> - </div> - </div> - </xsl:if> - </xsl:template> - <!-- Video display --> - <xsl:template name="entity-body-video"> - <xsl:param name="path"/> - <xsl:if test="contains('.mp4.mov.webm',translate(substring($path, string-length($path) - 3), 'MPOVWEB', 'mpovweb'))"> - <div class="row"> - <div class="col-sm-12"> - <video controls="controls"> - <source> - <xsl:attribute name="src"> - <xsl:value-of select="concat($filesystempath,$path)"/> - </xsl:attribute> - </source> - </video> - </div> - </div> - </xsl:if> - </xsl:template> <!-- PROPERTIES --> <xsl:template match="Property" mode="entity-body"> <li class="list-group-item caosdb-v-property-row caosdb-f-entity-property">