Sha256: 9e96bd24a8c2b26d053913572a13543d74aede1bf3094687bc7c6c5f7d5aa04d

Contents?: true

Size: 1020 Bytes

Versions: 12

Compression:

Stored size: 1020 Bytes

Contents

(function($) {
  $.fn.openseadragon = function() {
    var __osd_counter = 0;
    function generateOsdId() {
      __osd_counter++;
      
      return "Openseadragon" + __osd_counter;
    }

    $(this).each(function() {
      var $picture = $(this);
      $picture.addClass('openseadragon-viewer');
      
      if (typeof $picture.attr('id') === "undefined") {
        $picture.attr('id', generateOsdId());
      }

      var collectionOptions = $picture.data('openseadragon');
      
      var sources = $picture.find('source[media="openseadragon"]');

      var tilesources = $.map(sources, function(e) {
        if ($(e).data('openseadragon')) {
          return $(e).data('openseadragon');
        } else {
          return $(e).attr('src');
        }
      });

      $picture.css('height', $picture.css('height'));

      $picture.data('osdViewer', OpenSeadragon(
        $.extend({ id: $picture.attr('id') }, collectionOptions, { tileSources: tilesources })
      ));
    });

    return this;
  };
})(jQuery);

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
openseadragon-0.8.0 app/assets/javascripts/openseadragon/jquery.js
openseadragon-0.7.0 app/assets/javascripts/openseadragon/jquery.js
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/openseadragon-0.6.0/app/assets/javascripts/openseadragon/jquery.js
openseadragon-0.6.0 app/assets/javascripts/openseadragon/jquery.js
openseadragon-0.5.0 app/assets/javascripts/openseadragon/jquery.js
openseadragon-0.4.0 app/assets/javascripts/openseadragon/jquery.js
openseadragon-0.3.3 app/assets/javascripts/openseadragon/jquery.js
openseadragon-0.3.2 app/assets/javascripts/openseadragon/jquery.js
openseadragon-0.3.1 app/assets/javascripts/openseadragon/jquery.js
openseadragon-0.3.0 app/assets/javascripts/openseadragon/jquery.js
openseadragon-0.2.1 app/assets/javascripts/openseadragon/jquery.js
openseadragon-0.2.0 app/assets/javascripts/openseadragon/jquery.js