PageSourceSearch

https://jamescohan.com/scripts.6325be6a5aa703708040524db1b17d47.js

js jamescohan.com collected 2026-10-02 03:26:29 UTC 28,975 bytes, 827 lines download raw bytes

1// document.querySelectorAll('a[href^="#biography"]').forEach(anchor => {
2//     anchor.addEventListener('click', function (e) {
3//         e.preventDefault();
4
5//         document.querySelector(this.getAttribute('href')).scrollIntoView({
6//             behavior: 'smooth'
7//         });
8//     });
9// });
10
11
12
13
14
15
16//------------------------------------------------------------------------------
17// DOC READY + AJAX COMPLETE
18$( document ).bind("ready ajaxComplete",function() {
19
20    //--------------------------------------------------------------------------
21    // REMOVE CKEDITOR FRONTEND INLINE STYLES
22    $('[class*=ee-editor]').removeAttr("style");
23
24
25});
26
27
28
29
30
31
32
33
34$( window ).resize(function() {
35    
36    
37    //------------------------------------------------------------------------------
38    // MOVE HOMEPAGE IMAGES TO THE TOP
39    var extramenu = $('.main-header').outerHeight(true);
40    $(".s-home .custom_page").css("margin-top", -(extramenu) );
41
42
43
44
45});
46
47
48
49
50
51
52
53
54
55
56$( document ).bind("ready ajaxComplete",function() {
57    
58// create gradient for fullscreen if supersized homepage
59    if($(".s-home.detail-page #wrapper-full").length > 0){
60        $('<div />', { id: 'homefader' }).insertAfter('body');
61        $("#homefader").css({
62            top: 0, 
63            left: 0,
64            height: '100%',
65            width: '100%',
66            zIndex:50,
67            position:'absolute'
68        });
69    }
70
71
72// MOVE TITLES ON HOMEPAGE BANNERS
73    $("div#home-banners .titles").each(function(){
74        $(this).appendTo($(this).prev(".placeholder"));
75        $(this).css({'position':'absolute','top':'50%','left':'40px','transform':'translateY(-50%)'});
76    });
77    
78    //  $("div#home-banners .summary").each(function(){
79    //     $(this).appendTo($(this).prev(".placeholder"));
80    //     $(this).css({'position':'absolute','top':'50%','left':'40px','transform':'translateY(-50%)'});
81    // });
82
83
84    
85    
86    // MOVE FULL WIDTH VIDEO HEADERS
87    $(".full-width-video .text-wrapper").appendTo("#screen-video-background");
88    
89
90    // HIDE EXTRA QUICKLINKS
91    $('.quicklinks > span > a.qlink:contains("Video Background")').hide();
92
93
94// Find AND REPLACE TEXT
95    $(".s-home.detail-page #related-news header h1").text(function () {
96        return $(this).text().replace("News", "Recent News / Events"); 
97    });
98    
99// Find AND REPLACE TEXT
100    $(".s-home.detail-page #related-video-items header h1").text(function () {
101        return $(this).text().replace("Features-Items", "Features"); 
102    });
103
104
105// Find AND REPLACE TEXT
106    $(".s-home.detail-page #related-exhibitions header h1").text(function () {
107        return $(this).text().replace("Exhibitions", "Upcoming Exhibitions"); 
108    });
109
110
111// Find AND REPLACE TEXT
112    $("a.qlink").text(function () {
113        return $(this).text().replace("Features-Items", "Features"); 
114    });
115    
116    $("#video-items-grid h4").text(function () {
117        return $(this).text().replace("Features-Items", "Features"); 
118    });
119
120
121
122
123
124// REORDER HOME ASSOCIATIONS
125    if($('.s-home.detail-page').length){
126    
127        $("#wrapper-full" ).appendTo(".custom_page"); 
128
129            $("#related-home-banners").appendTo(".custom_page");
130            $("#related-home-2up").appendTo(".custom_page");
131        
132        $("#wrapper-video").appendTo(".custom_page");  
133            
134            $("#related-exhibitions").appendTo(".custom_page");
135            $("#related-video-items").appendTo(".custom_page");
136            $("#related-news").appendTo(".custom_page");
137    }
138
139
140
141
142
143
144
145   
146
147});
148
149
150
151
152
153
154
155$( document ).bind("ready",function() {
156
157
158
159// ADD QUICKLINKS TO INDEX PAGES
160   //public exhibitions - current
161    $('<a class="custom-link-1"></a>').insertBefore(".s-museum-exhibitions section.exhibitions.home header.section-header.divider .item-header h1");
162
163    if($(".s-museum-exhibitions #large").length){
164        $('.custom-link-1').text("Current");
165        $('.custom-link-1').attr("href", "#large");    
166    }
167    
168   //public exhibitions - upcoming
169    $('<a class="custom-link-2"></a>').insertAfter(".s-museum-exhibitions section.exhibitions.home header.section-header.divider .item-header h1");
170
171    if($(".s-museum-exhibitions #medium").length){
172        $('.custom-link-2').text("Upcoming");
173        $('.custom-link-2').attr("href", "#medium");        
174    }
175    
176    //public exhibitions - past
177    $('<a class="custom-link-3"></a>').insertAfter(".s-museum-exhibitions .custom-link-2");
178    $('<div id="past-link"></div>').insertBefore(".s-museum-exhibitions .past");
179
180    if($(".s-museum-exhibitions #past-link").length){
181        $('.custom-link-3').text("Past");
182        $('.custom-link-3').attr("href", "#past-link");        
183    }
184    
185
186
187
188});
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206$( document ).bind("ready ajaxComplete",function() {
207    
208    // Find AND REPLACE VIDEO-ITEMS TEXT
209    $("a.qlink").text(function () {
210        return $(this).text().replace("Video-Items", "Video"); 
211    });
212    
213    $("#video-items-grid h4").text(function () {
214        return $(this).text().replace("Video-Items", "Video"); 
215    });
216    
217    
218    //--------------------------------------------------------------------------
219    // REMOVE PASTED STYLES
220    $( "#press-release .text.paragraph-styling *" ).removeAttr("style");
221    $( "#biography .text.paragraph-styling *" ).removeAttr("style");
222    $( "figcaption *" ).removeAttr("style");
223    $( ".caption *" ).removeAttr("style");
224    
225    //--------------------------------------------------------------------------
226    // REMOVE BACK BUTTONS
227    $( ".back" ).remove();
228    
229    
230    //--------------------------------------------------------------------------
231    // MOVE VIEWING ROOM LINK - EXHIBITION DETAIL PAGE
232    $(".s-exhibitions.detail-page a.external-link").insertAfter(".s-exhibitions.detail-page #multiple-slider-container .slider-features a:first-of-type");
233    
234    
235    //--------------------------------------------------------------------------
236    // MOVE VIEWING ROOM LINK - THE CAMPUS DETAIL PAGE
237    $(".s-the-campus.detail-page a.external-link").insertAfter(".s-the-campus.detail-page #multiple-slider-container .slider-features a:first-of-type");
238    
239        
240    //--------------------------------------------------------------------------
241    // CHANGE TEXT
242    $('.s-art-fairs .home .past header h4').text('Art Fairs'); 
243    $('.s-artists.detail-page .qlinks a[href*="#related-exhibitions"]').text('Gallery Exhibitions'); 
244    $('.s-artists.detail-page #associations #related-exhibitions header h4').text('Gallery Exhibitions');
245    
246    
247    //--------------------------------------------------------------------------
248    // HOMEPAGE WORK AROUND
249    $('<div />', { id: 'hp-entry-text' }).appendTo('.s-homepage #images .entry .placeholder');
250    
251    $(".s-homepage .entry.large .title").each(function(){
252        $(this).appendTo($(this).prev(".placeholder"));
253        $(this).appendTo($(this).prev("#hp-entry-text"));
254    });   
255    $(".s-homepage .entry .subtitle").each(function(){
256        $(this).appendTo($(this).prev(".placeholder"));
257        $(this).appendTo($(this).prev("#hp-entry-text"));
258    });  
259    $(".s-homepage .entry .summary").each(function(){
260        $(this).appendTo($(this).prev(".placeholder"));
261        $(this).appendTo($(this).prev("#hp-entry-text"));
262    });  
263
264    // hide image and set as background      
265    $('.s-homepage .large .image').find('img').each(function(n, img) {
266    img = $(img);
267    var imgUrl = $(this).attr('src');
268    img.css({
269        'visibility': 'hidden'
270        });
271    img.parents('.image').css({
272        'background': '#fff url(' + imgUrl + ') center center no-repeat',
273        'background-size': 'cover'
274        });
275    });    
276
277    // set text below image for mobile view
278    if($(".s-homepage").length){
279        $( window ).resize(function() {
280            if ($(window).width() < 700){
281                $(".s-homepage .entry #hp-entry-text").each(function(){
282                    var extraspace = $(this).outerHeight();
283                    $(this).parent().css("margin-bottom", extraspace+20 );
284                });
285            } else {
286                $(".s-homepage .entry #hp-entry-text").each(function(){
287                    $(this).parent().css("margin-bottom", "7px" );
288                });
289            }
290        });
291    } 
292
293    // hp new header
294    $('<h4>Recent News / Events</h4>').prependTo('.homepage #homepage-grid');
295    
296    //--------------------------------------------------------------------------
297    // SPLIT "DOUBLE SPACE" WORKAROUND ON H2 SUBTITLE
298    $('.s-homepage .subtitle:contains("  ")').each(function () {
299        var str = $(this).text();
300        var aTxt = str.split('  ')[0];
301        var bTxt = str.split('  ')[1];
302        $(this).replaceWith("<span class='subtitle'>"+aTxt+"</span><span class='subtitle'>"+bTxt+"</span>");
303    });
304    
305    //--------------------------------------------------------------------------
306    // SPLIT "DOUBLE SPACE" SUBTITLE2 AND ADD URL
307    $('h2.subtitle2, .subtitle.subtitle2').each(function () {
308            $(this).appendTo($(this).parent());
309            if($(this).is(':contains("  ")')){
310                var str = $(this).text();
311                var aTxt = str.split('  ')[0];
312                var bTxt = str.split('  ')[1];
313                var regex = /(https?:\/\/([-\w\.]+)+(:\d+)?(\/([\w\/_\.]*(\?\S+)?)?)?)/ig
314                    if($(this).is('h2')){
315                        var replaced_text = bTxt.replace(regex, "<h2 class='subtitle2'>"+aTxt+"</h2><h2 class='subtitle2' style='padding-top:25px!important;'><a href='$1' target='_blank'>VIEW EXTERNAL LINK</a></h2>");
316                    }else{
317                        var replaced_text = bTxt.replace(regex, "<span class='subtitle subtitle2'>"+aTxt+"</span><span class='subtitle subtitle2' style='padding-top:25px!important;'><a href='$1' target='_blank'>VIEW EXTERNAL LINK</a></span>");
318                    }    
319                $(this).replaceWith(replaced_text);
320            }
321    });
322
323
324
325    //--------------------------------------------------------------------------   
326    // REDUCE SIZE SQUARE PUBLICATIONS
327    $('.custom-grid-publications img, .custom-grid-editions img').each(
328        function(){
329            $(this).load(
330            function(){
331                var theWidth = $(this).width();
332                var theHeight = $(this).height();
333                if (theWidth < theHeight ) {
334                    var theRatio = theWidth/theHeight;
335                }else{
336                    var theRatio = theHeight/theWidth;   
337                }
338                if(theRatio >= .88){
339                // if image square or close to square, make smaller
340                    $(this).css({'max-width': '85%','max-height': '85%'});
341                }else{
342                //change for horizontal
343                    $(this).css({'max-width': '90%'});
344                }
345            });
346        });
347
348
349    //--------------------------------------------------------------------------
350    // Extended module KEEP 4-UP WORKAROUND - also see CSS
351    if($(".image-module.extended").length > 0){
352            $('<div />', { id: 'extra-x' }).appendTo('#wrapper-4-up-mod .image-module.extended');
353            $("#extra-x").css({width: '23%', height: '1px'});
354            $('<div />', { id: 'extra-y' }).appendTo('#wrapper-4-up-mod .image-module.extended');
355            $("#extra-y").css({width: '23%', height: '1px'});
356            $('<div />', { id: 'extra-z' }).appendTo('#wrapper-4-up-mod .image-module.extended');
357            $("#extra-z").css({width: '23%', height: '1px'});
358        }
359        
360        
361        
362    //--------------------------------------------------------------------------    
363    // REMOVE LEFT COL IF EMPTY ON TWO COL TEXT
364    $(".text-one-column-with-image .caption").each(function(){
365        if($(this).has('iframe').length > 0){
366            // $(this).hide();
367            $(this).prev("img").hide();
368            $(this).css("margin-top", "-15px");
369        }
370    });    
371    
372
373});
374
375
376
377
378
379$( document ).bind("ready",function() {
380    //--------------------------------------------------------------------------  
381    // FOOTER
382    $('footer span.container').append('<div class="col-custom"><span>© James Cohan Gallery</span></div>');
383    $('footer .footer-siteindex').parent('span').appendTo('.col-custom');
384    $('footer .credit').appendTo('.col-custom');
385
386
387    //-------------------------------------------------------------------------
388    // SITE INDEX CONTAINER WRAP
389    $( "#site-index-urls" ).wrap( "<div class='container'></div>" );
390    $( "#site-index-urls" ).css({
391      "width": "auto",
392      "margin": "0"
393    });    
394    
395});
396
397
398
399
400
401
402
403
404
405// ------------------------------------------------------------------------------
406// -----------------------------------------------------------------------------
407// -----------------------------------------------------------------------------
408// XL
409$( document ).bind('ready ajaxComplete', function() {
410
411
412
413    
414    // -------------------------------------------------------------------------
415    // CURRENT EXHIBITIONS (FIT OR CROP) - REPLACED WITH JSON
416    // if ($("#large img").length) {
417    //     $("#large img[src*='_fit']").each(function() {
418    //         var match = $(this).attr('src').match(/([a-f0-9]{24}\/[a-f0-9]{32}\.\w{3,4})$/);
419    //         if (!match) {
420    //             return;
421    //         }
422
423    //         var imgPath = match[1];
424    //         var src = getResolveUrl(imgPath, '1300x600_fit');
425
426    //         $(this).attr('src', src);
427
428    //         if (typeof $(this).attr('srcset') !== 'undefined') {
429    //             var srcset = getResolveUrl(imgPath, '1300x600_fit') + ' 1x, ' + getResolveUrl(imgPath, '2600x1200_fit') + ' 2x';
430    //             $(this).attr('srcset', srcset);
431    //         }
432    //     });
433    //     $("#large img:not([src*='_fit'])").each(function() {
434    //         var match = $(this).attr('src').match(/([a-f0-9]{24}\/[a-f0-9]{32}\.\w{3,4})$/);
435    //         if (!match) {
436    //             return;
437    //         }
438
439    //         var imgPath = match[1];
440    //         var src = getResolveUrl(imgPath, '1300x600');
441
442    //         $(this).attr('src', src);
443
444    //         if (typeof $(this).attr('srcset') !== 'undefined') {
445    //             var srcset = getResolveUrl(imgPath, '1300x600') + ' 1x, ' + getResolveUrl(imgPath, '2600x1200') + ' 2x';
446    //             $(this).attr('srcset', srcset);
447    //         }
448    //     });        
449    // } 
450  
451  
452  
453    // -------------------------------------------------------------------------
454    // CURRENT EXHIBITIONS - 2UP (FIT OR CROP) - REPLACED WITH JSON
455    // if ($("#large .entry.half img").length) {
456    //     $("#large .entry.half img[src*='_fit']").each(function() {
457    //         var match = $(this).attr('src').match(/([a-f0-9]{24}\/[a-f0-9]{32}\.\w{3,4})$/);
458    //         if (!match) {
459    //             return;
460    //         }
461
462    //         var imgPath = match[1];
463    //         var src = getResolveUrl(imgPath, '785x630_fit');
464
465    //         $(this).attr('src', src);
466
467    //         if (typeof $(this).attr('srcset') !== 'undefined') {
468    //             var srcset = getResolveUrl(imgPath, '785x630_fit') + ' 1x, ' + getResolveUrl(imgPath, '1570x1260_fit') + ' 2x';
469    //             $(this).attr('srcset', srcset);
470    //         }
471    //     });
472    //     $("#large .entry.half img:not([src*='_fit'])").each(function() {
473    //         var match = $(this).attr('src').match(/([a-f0-9]{24}\/[a-f0-9]{32}\.\w{3,4})$/);
474    //         if (!match) {
475    //             return;
476    //         }
477
478    //         var imgPath = match[1];
479    //         var src = getResolveUrl(imgPath, '785x630');
480
481    //         $(this).attr('src', src);
482
483    //         if (typeof $(this).attr('srcset') !== 'undefined') {
484    //             var srcset = getResolveUrl(imgPath, '785x630') + ' 1x, ' + getResolveUrl(imgPath, '1570x1260') + ' 2x';
485    //             $(this).attr('srcset', srcset);
486    //         }
487    //     });        
488    // }   
489    
490    
491    // -------------------------------------------------------------------------
492    // UPCOMING EXHIBITIONS (FIT OR CROP)
493    // if ($("#medium img").length) {
494    //     $("#medium img[src*='_fit']").each(function() {
495    //         var match = $(this).attr('src').match(/([a-f0-9]{24}\/[a-f0-9]{32}\.\w{3,4})$/);
496    //         if (!match) {
497    //             return;
498    //         }
499
500    //         var imgPath = match[1];
501    //         var src = getResolveUrl(imgPath, '410x290_fit');
502
503    //         $(this).attr('src', src);
504
505    //         if (typeof $(this).attr('srcset') !== 'undefined') {
506    //             var srcset = getResolveUrl(imgPath, '513x420_fit') + ' 1x, ' + getResolveUrl(imgPath, '1026x840_fit') + ' 2x';
507    //             $(this).attr('srcset', srcset);
508    //         }
509    //     });
510    //     $("#medium img:not([src*='_fit'])").each(function() {
511    //         var match = $(this).attr('src').match(/([a-f0-9]{24}\/[a-f0-9]{32}\.\w{3,4})$/);
512    //         if (!match) {
513    //             return;
514    //         }
515
516    //         var imgPath = match[1];
517    //         var src = getResolveUrl(imgPath, '513x420');
518
519    //         $(this).attr('src', src);
520
521    //         if (typeof $(this).attr('srcset') !== 'undefined') {
522    //             var srcset = getResolveUrl(imgPath, '513x420') + ' 1x, ' + getResolveUrl(imgPath, '1026x840') + ' 2x';
523    //             $(this).attr('srcset', srcset);
524    //         }
525    //     });        
526    // } 
527
528    
529
530    // -------------------------------------------------------------------------
531    // TEXT WITH IMAGE (FIT OR CROP) REPLACED WITH JSON
532    // if ($(".text-one-column-with-image img").length) {
533    //     $(".text-one-column-with-image img[src*='_fit']").each(function() {
534    //         var match = $(this).attr('src').match(/([a-f0-9]{24}\/[a-f0-9]{32}\.\w{3,4})$/);
535    //         if (!match) {
536    //             return;
537    //         }
538
539    //         var imgPath = match[1];
540    //         var src = getResolveUrl(imgPath, '273x273_fit');
541
542    //         $(this).attr('src', src);
543
544    //         if (typeof $(this).attr('srcset') !== 'undefined') {
545    //             var srcset = getResolveUrl(imgPath, '273x273_fit') + ' 1x, ' + getResolveUrl(imgPath, '546x546_fit') + ' 2x';
546    //             $(this).attr('srcset', srcset);
547    //         }
548    //     });
549    //     $(".text-one-column-with-image img:not([src*='_fit'])").each(function() {
550    //         var match = $(this).attr('src').match(/([a-f0-9]{24}\/[a-f0-9]{32}\.\w{3,4})$/);
551    //         if (!match) {
552    //             return;
553    //         }
554
555    //         var imgPath = match[1];
556    //         var src = getResolveUrl(imgPath, '273x273');
557
558    //         $(this).attr('src', src);
559
560    //         if (typeof $(this).attr('srcset') !== 'undefined') {
561    //             var srcset = getResolveUrl(imgPath, '273x273') + ' 1x, ' + getResolveUrl(imgPath, '546x546') + ' 2x';
562    //             $(this).attr('srcset', srcset);
563    //         }
564    //     });        
565    // }   
566
567
568
569
570
571
572
573
574    // -------------------------------------------------------------------------
575    // TEXT OR IMAGE (FIT OR CROP)
576    if ($(".text-or-image-two-columns img").length) {
577        $(".text-or-image-two-columns img[src*='_fit']").each(function() {
578            var match = $(this).attr('src').match(/([a-f0-9]{24}\/[a-f0-9]{32}\.\w{3,4})$/);
579            if (!match) {
580                return;
581            }
582
583            var imgPath = match[1];
584            var src = getResolveUrl(imgPath, '630x630_fit');
585
586            $(this).attr('src', src);
587
588            if (typeof $(this).attr('srcset') !== 'undefined') {
589                var srcset = getResolveUrl(imgPath, '630x630_fit') + ' 1x, ' + getResolveUrl(imgPath, '1260x1260_fit') + ' 2x';
590                $(this).attr('srcset', srcset);
591            }
592        });
593        $(".text-or-image-two-columns img:not([src*='_fit'])").each(function() {
594            var match = $(this).attr('src').match(/([a-f0-9]{24}\/[a-f0-9]{32}\.\w{3,4})$/);
595            if (!match) {
596                return;
597            }
598
599            var imgPath = match[1];
600            var src = getResolveUrl(imgPath, '630x630');
601
602            $(this).attr('src', src);
603
604            if (typeof $(this).attr('srcset') !== 'undefined') {
605                var srcset = getResolveUrl(imgPath, '630x630') + ' 1x, ' + getResolveUrl(imgPath, '1260x1260') + ' 2x';
606                $(this).attr('srcset', srcset);
607            }
608        });        
609    }   
610
611    // -------------------------------------------------------------------------
612    // AUTO ROTATING BANNER (FIT OR CROP)
613    // MUST SET PADDING-TOP RATIO (IN THIS EXAMPLE [1280 x 800 = 62%] )
614    $(".banner .slide figure").css({'padding-top':'62%'});
615    
616    if ($(".auto-rotating img").length) {
617        $(".auto-rotating img[src*='_fit']").each(function() {
618            var match = $(this).attr('src').match(/([a-f0-9]{24}\/[a-f0-9]{32}\.\w{3,4})$/);
619            if (!match) {
620                return;
621            }
622
623            var imgPath = match[1];
624            var src = getResolveUrl(imgPath, '1300x600_fit');
625
626            $(this).attr('src', src);
627
628            if (typeof $(this).attr('srcset') !== 'undefined') {
629                var srcset = getResolveUrl(imgPath, '1300x600_fit') + ' 1x, ' + getResolveUrl(imgPath, '2600x1200_fit') + ' 2x';
630                $(this).attr('srcset', srcset);
631            }
632        });
633        $(".auto-rotating img:not([src*='_fit'])").each(function() {
634            var match = $(this).attr('src').match(/([a-f0-9]{24}\/[a-f0-9]{32}\.\w{3,4})$/);
635            if (!match) {
636                return;
637            }
638
639            var imgPath = match[1];
640            var src = getResolveUrl(imgPath, '1300x600');
641
642            $(this).attr('src', src);
643
644            if (typeof $(this).attr('srcset') !== 'undefined') {
645                var srcset = getResolveUrl(imgPath, '1300x600') + ' 1x, ' + getResolveUrl(imgPath, '2600x1200') + ' 2x';
646                $(this).attr('srcset', srcset);
647            }
648        });        
649    }       
650
651    // -------------------------------------------------------------------------
652    // NEWS (FIT OR CROP)
653    if ($("#news-list .entry img").length) {
654        $("#news-list .entry img[src*='_fit']").each(function() {
655            var match = $(this).attr('src').match(/([a-f0-9]{24}\/[a-f0-9]{32}\.\w{3,4})$/);
656            if (!match) {
657                return;
658            }
659
660            var imgPath = match[1];
661            var src = getResolveUrl(imgPath, '358x274_fit');
662
663            $(this).attr('src', src);
664
665            if (typeof $(this).attr('srcset') !== 'undefined') {
666                var srcset = getResolveUrl(imgPath, '358x274_fit') + ' 1x, ' + getResolveUrl(imgPath, '716x548_fit') + ' 2x';
667                $(this).attr('srcset', srcset);
668            }
669        });
670        $("#news-list .entry img:not([src*='_fit'])").each(function() {
671            var match = $(this).attr('src').match(/([a-f0-9]{24}\/[a-f0-9]{32}\.\w{3,4})$/);
672            if (!match) {
673                return;
674            }
675
676            var imgPath = match[1];
677            var src = getResolveUrl(imgPath, '358x274');
678
679            $(this).attr('src', src);
680
681            if (typeof $(this).attr('srcset') !== 'undefined') {
682                var srcset = getResolveUrl(imgPath, '358x274') + ' 1x, ' + getResolveUrl(imgPath, '716x548') + ' 2x';
683                $(this).attr('srcset', srcset);
684            }
685        });        
686    }  
687    
688    
689    
690    
691    
692    // -------------------------------------------------------------------------
693    // MODULAR EXTENDED - 2UP (FIT OR CROP)
694    if ($(".image-module.extended img").length) {
695        $(".image-module.extended img[src*='_fit']").each(function() {
696            var match = $(this).attr('src').match(/([a-f0-9]{24}\/[a-f0-9]{32}\.\w{3,4})$/);
697            if (!match) {
698                return;
699            }
700
701            var imgPath = match[1];
702            var src = getResolveUrl(imgPath, '780x630_fit');
703
704            $(this).attr('src', src);
705
706            if (typeof $(this).attr('srcset') !== 'undefined') {
707                var srcset = getResolveUrl(imgPath, '780x630_fit') + ' 1x, ' + getResolveUrl(imgPath, '1560x1260_fit') + ' 2x';
708                $(this).attr('srcset', srcset);
709            }
710        });
711        $(".image-module.extended img:not([src*='_fit'])").each(function() {
712            var match = $(this).attr('src').match(/([a-f0-9]{24}\/[a-f0-9]{32}\.\w{3,4})$/);
713            if (!match) {
714                return;
715            }
716
717            var imgPath = match[1];
718            var src = getResolveUrl(imgPath, '780x630');
719
720            $(this).attr('src', src);
721
722            if (typeof $(this).attr('srcset') !== 'undefined') {
723                var srcset = getResolveUrl(imgPath, '780x630') + ' 1x, ' + getResolveUrl(imgPath, '1560x1260') + ' 2x';
724                $(this).attr('srcset', srcset);
725            }
726        });        
727    }  
728    
729    
730    
731    
732    
733    
734    
735
736});
737
738
739// ------------------------------------------------------------------------------
740// ------------------------------------------------------------------------------
741// ------------------------------------------------------------------------------
742// XL
743function getResolveUrl(file, filter) {
744    return '/custom/media/cache/resolve/' + filter + '/' + file;
745}
746
747
748
749
750
751
752
753
754
755
756
757
758
759// ------------------------------------------------------------------------------
760// ------------------------------------------------------------------------------
761// ------------------------------------------------------------------------------
762// XL SLIDESHOW - REPLACED WITH JSON
763// function getResolveUrl(file, filter) {
764//     return '/media/cache/resolve/' + filter + '/' + file;
765// }
766
767// collageDispatcher.on('bxslider.beforePreload', function(config) {
768//     if ($(".slider figure img").length) {
769//         $('.slider figure img').each(function() {
770//             var match = $(this).data('src').match(/([a-f0-9]{24}\/[a-f0-9]{32}\.\w{3,4})$/);
771//             if (!match) {
772//                 return;
773//             }
774
775//             var imgPath = match[1];
776//             var src = getResolveUrl(imgPath, 'enlarge');
777
778//             $(this).data('src', src).attr('data-src', src).attr('src', src);
779
780//             if (typeof $(this).data('srcset') !== 'undefined') {
781//                 var srcset = getResolveUrl(imgPath, 'enlarge') + ' 1x, ' + getResolveUrl(imgPath, 'enlarge_2x') + ' 2x';
782//                 $(this).data('srcset', srcset).attr('data-srcset', srcset).attr('srcset', srcset);
783//             }
784//         });
785//     }
786// });
787
788
789
790
791
792
793
794
795
796$( document ).bind("ready",function() {
797    var linkText = document.createTextNode("View more");
798    var elementA = document.createElement('a');
799    elementA.appendChild(linkText);
800    elementA.setAttribute('href', "#");
801    elementA.setAttribute('class', "showPRMore");
802    let uniName = window.location.pathname.replace(/ +/g, "");
803    $(elementA).appendTo($("#biography"));
804    $(".showPRMore").wrap('<div class="container artist-view-more-container" id="'+uniName.replace(/[^a-zA-Z ]/g, "")+'"></div>');
805
806    var lineHeight = parseInt($("#screen-biography .text.paragraph-styling").css("line-height"));
807    $("#screen-biography").css('height', (lineHeight*14.5) - (lineHeight / 2));
808    $("#screen-biography").css('overflow', 'hidden');
809
810    $('body').on('click', '.showPRMore', function() {
811        if($(".showPRMore").text() === 'View more'){
812            $("#screen-biography").css('overflow', 'none');
813            $("#screen-biography").css('height', 'auto');
814            $("#biography").addClass('biography-open');
815            $(".showPRMore").text("View Less");
816        }else{
817            var lineHeight = parseInt($("#screen-biography .text.paragraph-styling").css("line-height"));
818            $("#screen-biography").css('height', (lineHeight*14.5) - (lineHeight / 2));
819            $("#screen-biography").css('overflow', 'hidden');
820            $("#biography").removeClass('biography-open');
821            $(".showPRMore").text("View more");
822        }
823
824    return false;
825    });
826});
827   

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.