diff -r 231ea5ea7de4 -r 92cb33eb7a75 src/widgets/AnnotationsList.js --- a/src/widgets/AnnotationsList.js Fri Oct 18 10:24:57 2024 +0200 +++ b/src/widgets/AnnotationsList.js Sat Oct 19 01:34:55 2024 +0200 @@ -4,7 +4,29 @@ import _ from "lodash"; import jQuery from "jquery"; +const IsImageOk = function (img) { + // During the onload event, IE correctly identifies any images that + // weren’t downloaded as not complete. Others should too. Gecko-based + // browsers act like NS4 in that they report this incorrectly. + if (!img.complete) { + return false; + } + + // However, they do have two very useful properties: naturalWidth and + // naturalHeight. These give the true size of the image. If it failed + // to load, either of these should be zero. + if (img.naturalWidth === 0) { + return false; + } + + // No other way of checking: assume it’s ok. + return true; +} + const AnnotationsList = function (ns) { + + const thumbnailBuffer = {}; + return class extends ns.Widgets.Widget { constructor(player, config) { super(player, config); @@ -278,7 +300,7 @@ '
  • ' + '
    ' + '' + - '' + + '' + '{{#external}}
    {{/external}}' + "
    " + "
    " + @@ -386,10 +408,10 @@ importAnnotations() { var widget = this; var $ = jQuery; - var textarea = $("