blacklight-gallery 4.6.4 → 4.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3c321c62171cddbfec780d3b115999654af2926dd4a8a58bb9cf50db22e0a259
4
- data.tar.gz: fce3fadd3a887fc3744d515c30fe5b5aceb7d31b839e65498777a47ceaba5ed9
3
+ metadata.gz: 735864f7774b580439e9147a573b0835791cf2ea6444e04c409ecc8bed6911a1
4
+ data.tar.gz: '0670846bebf0ba98635f98467abe3ae2d2668eab1c7c542cc29a1a571a1d9851'
5
5
  SHA512:
6
- metadata.gz: b5e45e06dbc17f3e1c423396d6595a4bda8b7532027ac521bfed64624e2b374e55d51d6652762d53929787465dc41d2612c05c5de78638834abc698c18428227
7
- data.tar.gz: 2b84924c93724e48bb9294f9ed4d44f07bcb84ae4441a7e5f589a963c2e7332ba4ae914d226c2ddd6a8e9f1b9f7af46835ac31e827a143b7c92fd61016717600
6
+ metadata.gz: 6b1c5c76536fbfd5e6de38db58c905fa3c10497646f2779119b016776c14b40509baeecad64840493062b86c9534853ba38759a7eea859dd1716354dd70f92dd
7
+ data.tar.gz: 265e62fe308cb5aa49e3d51bfa00ff392dc66c93a443faeb7e1d19012f46b3980c697d3402219084ad348833d8dcd9a775a5282123bde9ba251c78760a2a5976
@@ -19,29 +19,7 @@ jobs:
19
19
  experimental: [false]
20
20
  additional_engine_cart_rails_options: [""]
21
21
  additional_name: [""]
22
- view_component_version: ["~> 3.12"]
23
22
  include:
24
- - ruby: "3.1"
25
- rails_version: 6.1.7
26
- blacklight_version: "~> 7.0"
27
- experimental: false
28
- additional_name: Rails 6.1, Ruby 3.1
29
- - ruby: "3.2"
30
- rails_version: "7.0.4"
31
- blacklight_version: "~> 8.0"
32
- experimental: false
33
- additional_name: Blacklight 8
34
- - ruby: "3.2"
35
- rails_version: "7.0.4"
36
- blacklight_version: "github"
37
- experimental: true
38
- additional_name: Blacklight main branch
39
- - ruby: "3.2"
40
- rails_version: "7.0.4"
41
- blacklight_version: "~> 7.0"
42
- experimental: false
43
- view_component_version: "~> 2.83"
44
- additional_name: "/ ViewComponent 2"
45
23
  - ruby: "3.3"
46
24
  rails_version: "8.0.0"
47
25
  blacklight_version: "~> 8.0"
@@ -57,7 +35,6 @@ jobs:
57
35
  env:
58
36
  RAILS_VERSION: ${{ matrix.rails_version }}
59
37
  BLACKLIGHT_VERSION: ${{ matrix.blacklight_version }}
60
- VIEW_COMPONENT_VERSION: ${{ matrix.view_component_version }}
61
38
  ENGINE_CART_RAILS_OPTIONS: "--skip-git --skip-listen --skip-spring --skip-keeps --skip-action-cable --skip-coffee --skip-test ${{ matrix.additional_engine_cart_rails_options }}"
62
39
  steps:
63
40
  - uses: actions/checkout@v4
data/README.md CHANGED
@@ -25,7 +25,7 @@ Run the gallery generator for Sprockets:
25
25
 
26
26
  Or for node based bundlers add `blacklight-gallery masonry-layout@v4` as a dependencies and add this to your entrypoint:
27
27
  ```js
28
- import 'blacklight-gallery/vendor/assets/javascripts/imagesloaded.min.js'
28
+ import 'blacklight-gallery/vendor/assets/javascripts/imagesloaded.pkgd.js'
29
29
  import 'blacklight-gallery/app/assets/javascripts/blacklight_gallery/slideshow'
30
30
  import 'blacklight-gallery/app/assets/javascripts/blacklight_gallery/masonry'
31
31
  ```
@@ -1,4 +1,4 @@
1
- //= require imagesloaded.min.js
1
+ //= require imagesloaded.pkgd.js
2
2
  //= require masonry.min.js
3
3
  //= require blacklight_gallery/slideshow
4
4
  //= require blacklight_gallery/masonry
@@ -1 +1,2 @@
1
- //= require openseadragon/rails
1
+ //= require openseadragon-rails/dom
2
+ //= require openseadragon-rails/rails
@@ -1,5 +1,5 @@
1
1
  module Blacklight
2
2
  module Gallery
3
- VERSION = "4.6.4"
3
+ VERSION = "4.7.0"
4
4
  end
5
5
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blacklight-gallery",
3
- "version": "4.6.4",
3
+ "version": "4.7.0",
4
4
  "description": "Gallery views for Blacklight search results",
5
5
  "main": "app/assets/javascripts/blacklight_gallery/default.js",
6
6
  "files": [
@@ -18,7 +18,7 @@
18
18
  "url": "https://github.com/projectblacklight/blacklight-gallery/issues"
19
19
  },
20
20
  "homepage": "https://github.com/projectblacklight/blacklight-gallery#readme",
21
- "devDependencies": { },
21
+ "devDependencies": {},
22
22
  "dependencies": {
23
23
  "blacklight-frontend": ">=7.1.0 <9",
24
24
  "jquery": ">=3.0"
@@ -52,11 +52,7 @@ RSpec.describe Blacklight::Gallery::SlideshowPreviewComponent, type: :component
52
52
  end
53
53
 
54
54
  it 'renders the correct slide number' do
55
- if VIEW_COMPONENT_VERSION < 3
56
- expect(rendered).to have_css '[data-slide-to=\"4\"][data-bs-slide-to=\"4\"]'
57
- else
58
- expect(rendered).to have_css '[data-slide-to=\"5\"][data-bs-slide-to=\"5\"]'
59
- end
55
+ expect(rendered).to have_css '[data-slide-to=\"5\"][data-bs-slide-to=\"5\"]'
60
56
  end
61
57
 
62
58
  context 'when the presenter returns nothing' do
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.describe "Gallery view", :type => :feature do
3
+ RSpec.describe "Gallery view" do
4
4
  before { visit search_catalog_path :q => 'medicine', :view => 'gallery' }
5
5
 
6
6
  it "displays results in a galley view" do
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe "Masonry view", :type => :feature do
3
+ RSpec.describe "Masonry view" do
4
4
  before { visit search_catalog_path :q => 'medicine', :view => 'masonry' }
5
5
 
6
6
  it "should display results in a galley view" do
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.describe 'Slideshow', default_max_wait_time: 20, js: true do
4
-
3
+ RSpec.describe 'Slideshow', js: true do
5
4
  it 'opens when one of the grid panes is clicked' do
6
5
  visit search_catalog_path( q: 'medicine', view: 'slideshow' )
7
6
  expect(page).to have_content 'You searched for:'
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Blacklight::Gallery::OpenseadragonSolrDocument do
3
+ RSpec.describe Blacklight::Gallery::OpenseadragonSolrDocument do
4
4
  subject { SolrDocument.new(fields).to_openseadragon(view_config) }
5
5
 
6
6
  context 'when configured for the view' do
data/spec/spec_helper.rb CHANGED
@@ -7,7 +7,6 @@ require 'rspec/collection_matchers'
7
7
  require 'rspec/its'
8
8
  require 'rspec/rails'
9
9
  require 'rspec/active_model/mocks'
10
- require 'view_component_v2_test_helpers'
11
10
 
12
11
  require 'selenium-webdriver'
13
12
 
@@ -19,10 +18,6 @@ require 'blacklight/gallery'
19
18
 
20
19
  RSpec.configure do |c|
21
20
  c.infer_spec_type_from_file_location!
21
+ c.disable_monkey_patching!
22
22
  c.include ViewComponent::TestHelpers, type: :component
23
- view_component_version = Gem.loaded_specs['view_component'].version
24
- VIEW_COMPONENT_VERSION = view_component_version.segments.first
25
- if VIEW_COMPONENT_VERSION < 3
26
- c.include ViewComponentV2TestHelpers, type: :component
27
- end
28
23
  end
@@ -3,7 +3,3 @@ if ENV['BLACKLIGHT_VERSION'] == 'github'
3
3
  elsif ENV['BLACKLIGHT_VERSION'] && !ENV['BLACKLIGHT_VERSION'].empty?
4
4
  gem 'blacklight', ENV['BLACKLIGHT_VERSION']
5
5
  end
6
-
7
- unless ENV['VIEW_COMPONENT_VERSION'].to_s == ""
8
- gem 'view_component', ENV.fetch('VIEW_COMPONENT_VERSION')
9
- end
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe "catalog/openseadragon_default" do
3
+ RSpec.describe "catalog/openseadragon_default" do
4
4
  let(:document) { SolrDocument.new }
5
5
  let(:blacklight_config) { Blacklight::Configuration.new }
6
6
  let(:p) { "catalog/openseadragon_default" }
@@ -0,0 +1,441 @@
1
+ /*!
2
+ * imagesLoaded PACKAGED v5.0.0
3
+ * JavaScript is all like "You images are done yet or what?"
4
+ * MIT License
5
+ */
6
+
7
+ /**
8
+ * EvEmitter v2.1.1
9
+ * Lil' event emitter
10
+ * MIT License
11
+ */
12
+
13
+ ( function( global, factory ) {
14
+ // universal module definition
15
+ if ( typeof module == 'object' && module.exports ) {
16
+ // CommonJS - Browserify, Webpack
17
+ module.exports = factory();
18
+ } else {
19
+ // Browser globals
20
+ global.EvEmitter = factory();
21
+ }
22
+
23
+ }( typeof window != 'undefined' ? window : this, function() {
24
+
25
+ function EvEmitter() {}
26
+
27
+ let proto = EvEmitter.prototype;
28
+
29
+ proto.on = function( eventName, listener ) {
30
+ if ( !eventName || !listener ) return this;
31
+
32
+ // set events hash
33
+ let events = this._events = this._events || {};
34
+ // set listeners array
35
+ let listeners = events[ eventName ] = events[ eventName ] || [];
36
+ // only add once
37
+ if ( !listeners.includes( listener ) ) {
38
+ listeners.push( listener );
39
+ }
40
+
41
+ return this;
42
+ };
43
+
44
+ proto.once = function( eventName, listener ) {
45
+ if ( !eventName || !listener ) return this;
46
+
47
+ // add event
48
+ this.on( eventName, listener );
49
+ // set once flag
50
+ // set onceEvents hash
51
+ let onceEvents = this._onceEvents = this._onceEvents || {};
52
+ // set onceListeners object
53
+ let onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {};
54
+ // set flag
55
+ onceListeners[ listener ] = true;
56
+
57
+ return this;
58
+ };
59
+
60
+ proto.off = function( eventName, listener ) {
61
+ let listeners = this._events && this._events[ eventName ];
62
+ if ( !listeners || !listeners.length ) return this;
63
+
64
+ let index = listeners.indexOf( listener );
65
+ if ( index != -1 ) {
66
+ listeners.splice( index, 1 );
67
+ }
68
+
69
+ return this;
70
+ };
71
+
72
+ proto.emitEvent = function( eventName, args ) {
73
+ let listeners = this._events && this._events[ eventName ];
74
+ if ( !listeners || !listeners.length ) return this;
75
+
76
+ // copy over to avoid interference if .off() in listener
77
+ listeners = listeners.slice( 0 );
78
+ args = args || [];
79
+ // once stuff
80
+ let onceListeners = this._onceEvents && this._onceEvents[ eventName ];
81
+
82
+ for ( let listener of listeners ) {
83
+ let isOnce = onceListeners && onceListeners[ listener ];
84
+ if ( isOnce ) {
85
+ // remove listener
86
+ // remove before trigger to prevent recursion
87
+ this.off( eventName, listener );
88
+ // unset once flag
89
+ delete onceListeners[ listener ];
90
+ }
91
+ // trigger listener
92
+ listener.apply( this, args );
93
+ }
94
+
95
+ return this;
96
+ };
97
+
98
+ proto.allOff = function() {
99
+ delete this._events;
100
+ delete this._onceEvents;
101
+ return this;
102
+ };
103
+
104
+ return EvEmitter;
105
+
106
+ } ) );
107
+ /*!
108
+ * imagesLoaded v5.0.0
109
+ * JavaScript is all like "You images are done yet or what?"
110
+ * MIT License
111
+ */
112
+
113
+ ( function( window, factory ) {
114
+ // universal module definition
115
+ if ( typeof module == 'object' && module.exports ) {
116
+ // CommonJS
117
+ module.exports = factory( window, require('ev-emitter') );
118
+ } else {
119
+ // browser global
120
+ window.imagesLoaded = factory( window, window.EvEmitter );
121
+ }
122
+
123
+ } )( typeof window !== 'undefined' ? window : this,
124
+ function factory( window, EvEmitter ) {
125
+
126
+ let $ = window.jQuery;
127
+ let console = window.console;
128
+
129
+ // -------------------------- helpers -------------------------- //
130
+
131
+ // turn element or nodeList into an array
132
+ function makeArray( obj ) {
133
+ // use object if already an array
134
+ if ( Array.isArray( obj ) ) return obj;
135
+
136
+ let isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';
137
+ // convert nodeList to array
138
+ if ( isArrayLike ) return [ ...obj ];
139
+
140
+ // array of single index
141
+ return [ obj ];
142
+ }
143
+
144
+ // -------------------------- imagesLoaded -------------------------- //
145
+
146
+ /**
147
+ * @param {[Array, Element, NodeList, String]} elem
148
+ * @param {[Object, Function]} options - if function, use as callback
149
+ * @param {Function} onAlways - callback function
150
+ * @returns {ImagesLoaded}
151
+ */
152
+ function ImagesLoaded( elem, options, onAlways ) {
153
+ // coerce ImagesLoaded() without new, to be new ImagesLoaded()
154
+ if ( !( this instanceof ImagesLoaded ) ) {
155
+ return new ImagesLoaded( elem, options, onAlways );
156
+ }
157
+ // use elem as selector string
158
+ let queryElem = elem;
159
+ if ( typeof elem == 'string' ) {
160
+ queryElem = document.querySelectorAll( elem );
161
+ }
162
+ // bail if bad element
163
+ if ( !queryElem ) {
164
+ console.error(`Bad element for imagesLoaded ${queryElem || elem}`);
165
+ return;
166
+ }
167
+
168
+ this.elements = makeArray( queryElem );
169
+ this.options = {};
170
+ // shift arguments if no options set
171
+ if ( typeof options == 'function' ) {
172
+ onAlways = options;
173
+ } else {
174
+ Object.assign( this.options, options );
175
+ }
176
+
177
+ if ( onAlways ) this.on( 'always', onAlways );
178
+
179
+ this.getImages();
180
+ // add jQuery Deferred object
181
+ if ( $ ) this.jqDeferred = new $.Deferred();
182
+
183
+ // HACK check async to allow time to bind listeners
184
+ setTimeout( this.check.bind( this ) );
185
+ }
186
+
187
+ ImagesLoaded.prototype = Object.create( EvEmitter.prototype );
188
+
189
+ ImagesLoaded.prototype.getImages = function() {
190
+ this.images = [];
191
+
192
+ // filter & find items if we have an item selector
193
+ this.elements.forEach( this.addElementImages, this );
194
+ };
195
+
196
+ const elementNodeTypes = [ 1, 9, 11 ];
197
+
198
+ /**
199
+ * @param {Node} elem
200
+ */
201
+ ImagesLoaded.prototype.addElementImages = function( elem ) {
202
+ // filter siblings
203
+ if ( elem.nodeName === 'IMG' ) {
204
+ this.addImage( elem );
205
+ }
206
+ // get background image on element
207
+ if ( this.options.background === true ) {
208
+ this.addElementBackgroundImages( elem );
209
+ }
210
+
211
+ // find children
212
+ // no non-element nodes, #143
213
+ let { nodeType } = elem;
214
+ if ( !nodeType || !elementNodeTypes.includes( nodeType ) ) return;
215
+
216
+ let childImgs = elem.querySelectorAll('img');
217
+ // concat childElems to filterFound array
218
+ for ( let img of childImgs ) {
219
+ this.addImage( img );
220
+ }
221
+
222
+ // get child background images
223
+ if ( typeof this.options.background == 'string' ) {
224
+ let children = elem.querySelectorAll( this.options.background );
225
+ for ( let child of children ) {
226
+ this.addElementBackgroundImages( child );
227
+ }
228
+ }
229
+ };
230
+
231
+ const reURL = /url\((['"])?(.*?)\1\)/gi;
232
+
233
+ ImagesLoaded.prototype.addElementBackgroundImages = function( elem ) {
234
+ let style = getComputedStyle( elem );
235
+ // Firefox returns null if in a hidden iframe https://bugzil.la/548397
236
+ if ( !style ) return;
237
+
238
+ // get url inside url("...")
239
+ let matches = reURL.exec( style.backgroundImage );
240
+ while ( matches !== null ) {
241
+ let url = matches && matches[2];
242
+ if ( url ) {
243
+ this.addBackground( url, elem );
244
+ }
245
+ matches = reURL.exec( style.backgroundImage );
246
+ }
247
+ };
248
+
249
+ /**
250
+ * @param {Image} img
251
+ */
252
+ ImagesLoaded.prototype.addImage = function( img ) {
253
+ let loadingImage = new LoadingImage( img );
254
+ this.images.push( loadingImage );
255
+ };
256
+
257
+ ImagesLoaded.prototype.addBackground = function( url, elem ) {
258
+ let background = new Background( url, elem );
259
+ this.images.push( background );
260
+ };
261
+
262
+ ImagesLoaded.prototype.check = function() {
263
+ this.progressedCount = 0;
264
+ this.hasAnyBroken = false;
265
+ // complete if no images
266
+ if ( !this.images.length ) {
267
+ this.complete();
268
+ return;
269
+ }
270
+
271
+ /* eslint-disable-next-line func-style */
272
+ let onProgress = ( image, elem, message ) => {
273
+ // HACK - Chrome triggers event before object properties have changed. #83
274
+ setTimeout( () => {
275
+ this.progress( image, elem, message );
276
+ } );
277
+ };
278
+
279
+ this.images.forEach( function( loadingImage ) {
280
+ loadingImage.once( 'progress', onProgress );
281
+ loadingImage.check();
282
+ } );
283
+ };
284
+
285
+ ImagesLoaded.prototype.progress = function( image, elem, message ) {
286
+ this.progressedCount++;
287
+ this.hasAnyBroken = this.hasAnyBroken || !image.isLoaded;
288
+ // progress event
289
+ this.emitEvent( 'progress', [ this, image, elem ] );
290
+ if ( this.jqDeferred && this.jqDeferred.notify ) {
291
+ this.jqDeferred.notify( this, image );
292
+ }
293
+ // check if completed
294
+ if ( this.progressedCount === this.images.length ) {
295
+ this.complete();
296
+ }
297
+
298
+ if ( this.options.debug && console ) {
299
+ console.log( `progress: ${message}`, image, elem );
300
+ }
301
+ };
302
+
303
+ ImagesLoaded.prototype.complete = function() {
304
+ let eventName = this.hasAnyBroken ? 'fail' : 'done';
305
+ this.isComplete = true;
306
+ this.emitEvent( eventName, [ this ] );
307
+ this.emitEvent( 'always', [ this ] );
308
+ if ( this.jqDeferred ) {
309
+ let jqMethod = this.hasAnyBroken ? 'reject' : 'resolve';
310
+ this.jqDeferred[ jqMethod ]( this );
311
+ }
312
+ };
313
+
314
+ // -------------------------- -------------------------- //
315
+
316
+ function LoadingImage( img ) {
317
+ this.img = img;
318
+ }
319
+
320
+ LoadingImage.prototype = Object.create( EvEmitter.prototype );
321
+
322
+ LoadingImage.prototype.check = function() {
323
+ // If complete is true and browser supports natural sizes,
324
+ // try to check for image status manually.
325
+ let isComplete = this.getIsImageComplete();
326
+ if ( isComplete ) {
327
+ // report based on naturalWidth
328
+ this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' );
329
+ return;
330
+ }
331
+
332
+ // If none of the checks above matched, simulate loading on detached element.
333
+ this.proxyImage = new Image();
334
+ // add crossOrigin attribute. #204
335
+ if ( this.img.crossOrigin ) {
336
+ this.proxyImage.crossOrigin = this.img.crossOrigin;
337
+ }
338
+ this.proxyImage.addEventListener( 'load', this );
339
+ this.proxyImage.addEventListener( 'error', this );
340
+ // bind to image as well for Firefox. #191
341
+ this.img.addEventListener( 'load', this );
342
+ this.img.addEventListener( 'error', this );
343
+ this.proxyImage.src = this.img.currentSrc || this.img.src;
344
+ };
345
+
346
+ LoadingImage.prototype.getIsImageComplete = function() {
347
+ // check for non-zero, non-undefined naturalWidth
348
+ // fixes Safari+InfiniteScroll+Masonry bug infinite-scroll#671
349
+ return this.img.complete && this.img.naturalWidth;
350
+ };
351
+
352
+ LoadingImage.prototype.confirm = function( isLoaded, message ) {
353
+ this.isLoaded = isLoaded;
354
+ let { parentNode } = this.img;
355
+ // emit progress with parent <picture> or self <img>
356
+ let elem = parentNode.nodeName === 'PICTURE' ? parentNode : this.img;
357
+ this.emitEvent( 'progress', [ this, elem, message ] );
358
+ };
359
+
360
+ // ----- events ----- //
361
+
362
+ // trigger specified handler for event type
363
+ LoadingImage.prototype.handleEvent = function( event ) {
364
+ let method = 'on' + event.type;
365
+ if ( this[ method ] ) {
366
+ this[ method ]( event );
367
+ }
368
+ };
369
+
370
+ LoadingImage.prototype.onload = function() {
371
+ this.confirm( true, 'onload' );
372
+ this.unbindEvents();
373
+ };
374
+
375
+ LoadingImage.prototype.onerror = function() {
376
+ this.confirm( false, 'onerror' );
377
+ this.unbindEvents();
378
+ };
379
+
380
+ LoadingImage.prototype.unbindEvents = function() {
381
+ this.proxyImage.removeEventListener( 'load', this );
382
+ this.proxyImage.removeEventListener( 'error', this );
383
+ this.img.removeEventListener( 'load', this );
384
+ this.img.removeEventListener( 'error', this );
385
+ };
386
+
387
+ // -------------------------- Background -------------------------- //
388
+
389
+ function Background( url, element ) {
390
+ this.url = url;
391
+ this.element = element;
392
+ this.img = new Image();
393
+ }
394
+
395
+ // inherit LoadingImage prototype
396
+ Background.prototype = Object.create( LoadingImage.prototype );
397
+
398
+ Background.prototype.check = function() {
399
+ this.img.addEventListener( 'load', this );
400
+ this.img.addEventListener( 'error', this );
401
+ this.img.src = this.url;
402
+ // check if image is already complete
403
+ let isComplete = this.getIsImageComplete();
404
+ if ( isComplete ) {
405
+ this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' );
406
+ this.unbindEvents();
407
+ }
408
+ };
409
+
410
+ Background.prototype.unbindEvents = function() {
411
+ this.img.removeEventListener( 'load', this );
412
+ this.img.removeEventListener( 'error', this );
413
+ };
414
+
415
+ Background.prototype.confirm = function( isLoaded, message ) {
416
+ this.isLoaded = isLoaded;
417
+ this.emitEvent( 'progress', [ this, this.element, message ] );
418
+ };
419
+
420
+ // -------------------------- jQuery -------------------------- //
421
+
422
+ ImagesLoaded.makeJQueryPlugin = function( jQuery ) {
423
+ jQuery = jQuery || window.jQuery;
424
+ if ( !jQuery ) return;
425
+
426
+ // set local variable
427
+ $ = jQuery;
428
+ // $().imagesLoaded()
429
+ $.fn.imagesLoaded = function( options, onAlways ) {
430
+ let instance = new ImagesLoaded( this, options, onAlways );
431
+ return instance.jqDeferred.promise( $( this ) );
432
+ };
433
+ };
434
+ // try making plugin
435
+ ImagesLoaded.makeJQueryPlugin();
436
+
437
+ // -------------------------- -------------------------- //
438
+
439
+ return ImagesLoaded;
440
+
441
+ } );
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight-gallery
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.6.4
4
+ version: 4.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-16 00:00:00.000000000 Z
11
+ date: 2024-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -299,10 +299,9 @@ files:
299
299
  - spec/spec_helper.rb
300
300
  - spec/test_app_templates/Gemfile.extra
301
301
  - spec/test_app_templates/lib/generators/test_app_generator.rb
302
- - spec/view_component_v2_test_helpers.rb
303
302
  - spec/views/catalog/_document_slideshow.html.erb_spec.rb
304
303
  - spec/views/catalog/_openseadragon_default.html.erb_spec.rb
305
- - vendor/assets/javascripts/imagesloaded.min.js
304
+ - vendor/assets/javascripts/imagesloaded.pkgd.js
306
305
  - vendor/assets/javascripts/masonry.min.js
307
306
  homepage: https://github.com/projectblacklight/blacklight-gallery
308
307
  licenses:
@@ -323,7 +322,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
323
322
  - !ruby/object:Gem::Version
324
323
  version: '0'
325
324
  requirements: []
326
- rubygems_version: 3.4.19
325
+ rubygems_version: 3.5.23
327
326
  signing_key:
328
327
  specification_version: 4
329
328
  summary: Gallery display for Blacklight
@@ -340,6 +339,5 @@ test_files:
340
339
  - spec/spec_helper.rb
341
340
  - spec/test_app_templates/Gemfile.extra
342
341
  - spec/test_app_templates/lib/generators/test_app_generator.rb
343
- - spec/view_component_v2_test_helpers.rb
344
342
  - spec/views/catalog/_document_slideshow.html.erb_spec.rb
345
343
  - spec/views/catalog/_openseadragon_default.html.erb_spec.rb
@@ -1,20 +0,0 @@
1
- module ViewComponentV2TestHelpers
2
- def vc_test_controller
3
- @vc_test_controller ||= __vc_test_helpers_build_controller(ViewComponent::Base.test_controller.constantize)
4
- end
5
-
6
- def __vc_test_helpers_build_controller(klass)
7
- klass.new.tap { |c| c.request = vc_test_request }.extend(Rails.application.routes.url_helpers)
8
- end
9
-
10
- def vc_test_request
11
- require "action_controller/test_case"
12
-
13
- @vc_test_request ||=
14
- begin
15
- out = ActionDispatch::TestRequest.create
16
- out.session = ActionController::TestSession.new
17
- out
18
- end
19
- end
20
- end
@@ -1,7 +0,0 @@
1
- /*!
2
- * imagesLoaded PACKAGED v4.1.4
3
- * JavaScript is all like "You images are done yet or what?"
4
- * MIT License
5
- */
6
-
7
- !function(e,t){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",t):"object"==typeof module&&module.exports?module.exports=t():e.EvEmitter=t()}("undefined"!=typeof window?window:this,function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var i=this._events=this._events||{},n=i[e]=i[e]||[];return n.indexOf(t)==-1&&n.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var i=this._onceEvents=this._onceEvents||{},n=i[e]=i[e]||{};return n[t]=!0,this}},t.off=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){var n=i.indexOf(t);return n!=-1&&i.splice(n,1),this}},t.emitEvent=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){i=i.slice(0),t=t||[];for(var n=this._onceEvents&&this._onceEvents[e],o=0;o<i.length;o++){var r=i[o],s=n&&n[r];s&&(this.off(e,r),delete n[r]),r.apply(this,t)}return this}},t.allOff=function(){delete this._events,delete this._onceEvents},e}),function(e,t){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(i){return t(e,i)}):"object"==typeof module&&module.exports?module.exports=t(e,require("ev-emitter")):e.imagesLoaded=t(e,e.EvEmitter)}("undefined"!=typeof window?window:this,function(e,t){function i(e,t){for(var i in t)e[i]=t[i];return e}function n(e){if(Array.isArray(e))return e;var t="object"==typeof e&&"number"==typeof e.length;return t?d.call(e):[e]}function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);var s=e;return"string"==typeof e&&(s=document.querySelectorAll(e)),s?(this.elements=n(s),this.options=i({},this.options),"function"==typeof t?r=t:i(this.options,t),r&&this.on("always",r),this.getImages(),h&&(this.jqDeferred=new h.Deferred),void setTimeout(this.check.bind(this))):void a.error("Bad element for imagesLoaded "+(s||e))}function r(e){this.img=e}function s(e,t){this.url=e,this.element=t,this.img=new Image}var h=e.jQuery,a=e.console,d=Array.prototype.slice;o.prototype=Object.create(t.prototype),o.prototype.options={},o.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},o.prototype.addElementImages=function(e){"IMG"==e.nodeName&&this.addImage(e),this.options.background===!0&&this.addElementBackgroundImages(e);var t=e.nodeType;if(t&&u[t]){for(var i=e.querySelectorAll("img"),n=0;n<i.length;n++){var o=i[n];this.addImage(o)}if("string"==typeof this.options.background){var r=e.querySelectorAll(this.options.background);for(n=0;n<r.length;n++){var s=r[n];this.addElementBackgroundImages(s)}}}};var u={1:!0,9:!0,11:!0};return o.prototype.addElementBackgroundImages=function(e){var t=getComputedStyle(e);if(t)for(var i=/url\((['"])?(.*?)\1\)/gi,n=i.exec(t.backgroundImage);null!==n;){var o=n&&n[2];o&&this.addBackground(o,e),n=i.exec(t.backgroundImage)}},o.prototype.addImage=function(e){var t=new r(e);this.images.push(t)},o.prototype.addBackground=function(e,t){var i=new s(e,t);this.images.push(i)},o.prototype.check=function(){function e(e,i,n){setTimeout(function(){t.progress(e,i,n)})}var t=this;return this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?void this.images.forEach(function(t){t.once("progress",e),t.check()}):void this.complete()},o.prototype.progress=function(e,t,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded,this.emitEvent("progress",[this,e,t]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,e),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&a&&a.log("progress: "+i,e,t)},o.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(e,[this]),this.emitEvent("always",[this]),this.jqDeferred){var t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},r.prototype=Object.create(t.prototype),r.prototype.check=function(){var e=this.getIsImageComplete();return e?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),void(this.proxyImage.src=this.img.src))},r.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},r.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.img,t])},r.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},r.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},r.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},r.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},s.prototype=Object.create(r.prototype),s.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url;var e=this.getIsImageComplete();e&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},s.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},s.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.element,t])},o.makeJQueryPlugin=function(t){t=t||e.jQuery,t&&(h=t,h.fn.imagesLoaded=function(e,t){var i=new o(this,e,t);return i.jqDeferred.promise(h(this))})},o.makeJQueryPlugin(),o});