1/** 2 * @file 3 * Attaches the behaviors for the Juicebox module. 4 */ 5 6(function ($, Drupal) { 7 Drupal.behaviors.juicebox = { 8 attach: function (context, settings) { 9 if (typeof settings['juicebox'] !== 'undefined') { 10 var galleries = settings['juicebox']; 11 // Loop-through galleries that were added during this request. 12 for (var key in galleries) { 13 if (galleries.hasOwnProperty(key) && document.getElementById(key)) { 14 // Instantiate each new gallery via the library. Take a copy to be 15 // safe as we will delete the original settings reference after. 16 var newGallery = $.extend({}, galleries[key]); 17 new juicebox(newGallery); 18 // We only want to hold on to the settings for this gallery long 19 // enough to pass it on as a proper Juicebox object. In fact, 20 // holding on longer can cause problems on sequential AJAX updates 21 // of the same gallery, so it's probably best to delete it. 22 delete galleries[key]; 23 } 24 } 25 } 26 } 27 }; 28})(jQuery, Drupal);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.