1(function($) { 2 3 window.site = { 4 5 init: function() { 6 7 window.site.homepage.init(); 8 window.site.filters.init(); 9 window.site.works.init(); 10 11 $('.records_list .image').animate({'color': 'black'}, 200, function() { 12 $(this).addClass('loaded'); 13 }); 14 15 16 $('a').each(function() { 17 if ($(this).attr('href')) { 18 if ($(this).attr('href').substr(-4) === '.pdf' || $(this).attr('href').substr(-4) === '.doc' || $(this).attr('href').substr(-5) === '.docx') { 19 $(this).attr('target', '_blank'); 20 } 21 } 22 }); 23 24 $("#container").fitVids(); 25 26 $('#mailchimp_signup input') 27 .val('Newsletter signup') 28 .focus(function() { 29 $(this).addClass('active'); 30 if ($(this).val() == 'Newsletter signup') { 31 $(this).val(''); 32 $(this).closest('#mailchimp_signup').find('#mailchimp_submit').animate({'width':'50px'}); 33 } 34 }) 35 .blur(function() { 36 if ($(this).val() == '') { 37 $(this).removeClass('active'); 38 $(this).val('Newsletter signup'); 39 $(this).closest('#mailchimp_signup').find('#mailchimp_submit').animate({'width': '0px'}); 40 } 41 }) 42 .keypress(function(event) { 43 if (event.keyCode == 13) { 44 var email = $('#mailchimp_signup input').val(); 45 if (email.indexOf('@') > -1 && email.split('@')[1].indexOf('.') > -1 && email.indexOf(' ') == -1) { 46 $(this).closest('form').submit(); 47 } else { 48 h.alert('Please enter a valid email address'); 49 return false; 50 } 51 } 52 }) 53 ; 54 $('#mailchimp_submit').css('width', '0px').click(function() { 55 var email = $('#mailchimp_signup input').val(); 56 if (email.indexOf('@') > -1 && email.split('@')[1].indexOf('.') > -1 && email.indexOf(' ') == -1) { 57 $(this).closest('form').submit(); 58 } else { 59 h.alert('Please enter a valid email address'); 60 } 61 return false; 62 }); 63 64 65 $(window).scroll(function() { 66 if ($(window).scrollTop() > 195) { 67 if (!$('body').hasClass('page-scroll-nav')) { 68 $('body').addClass('page-scroll-nav'); 69 } 70 } else { 71 if ($('body').hasClass('page-scroll-nav')) { 72 $('body').removeClass('page-scroll-nav'); 73 } 74 } 75 }); 76 77 $('body').append('<div id="scroll_header"><div class="inner"></div></div>'); 78 $('#scroll_header .inner').append('<div id="scroll_social">' + $('#header #social_links').html() + '</div>'); 79 $('#scroll_header .inner').append('<div id="scroll_nav" class="navigation"><div id="scroll_nav_reveal">Menu</div><div id="scroll_nav_content">' + $('#header #top_nav').html() + '</div></div>'); 80 $('#scroll_header .inner #scroll_social #mailchimp_signup').remove(); 81 82 $('#scroll_nav_reveal').click(function() { 83 if ($('#scroll_nav_content').css('display') == 'none') { 84 $('#scroll_nav_content').slideDown(); 85 $('#scroll_nav').addClass('responsive-nav-open'); 86 } else { 87 $('#scroll_nav_content').slideUp(function() { 88 $(this).attr('style', ''); 89 }); 90 $('#scroll_nav').removeClass('responsive-nav-open'); 91 } 92 return false; 93 }); 94 }, 95 96 homepage: { 97 98 init: function() { 99 100 if ($('.section-home #slideshow').size() > 0) { 101 102 $('#slideshow_prev') 103 .mouseover(function() { 104 $('#slideshow').addClass('slideshow-pagination-hover-left'); 105 }) 106 .mouseout(function() { 107 $('#slideshow').removeClass('slideshow-pagination-hover-left'); 108 }) 109 .click(function() { 110 $('#slideshow ul').cycle('pause').cycle('prev'); 111 }) 112 ; 113 $('#slideshow_next') 114 .mouseover(function() { 115 $('#slideshow').addClass('slideshow-pagination-hover-right'); 116 }) 117 .mouseout(function() { 118 $('#slideshow').removeClass('slideshow-pagination-hover-right'); 119 }) 120 .click(function() { 121 $('#slideshow ul').cycle('pause').cycle('next'); 122 }) 123 ; 124 125 $('#slideshow ul').on('cycle-before', function(event, optionHash, outgoingSlideEl, incomingSlideEl, forwardFlag) { 126 window.site.homepage.transition(incomingSlideEl); 127 }); 128 129 130 $(window).scroll(function() { 131 if ($(window).scrollTop() > 50) { 132 var element_opacity = 1 - ((($(window).scrollTop() - 100) / 100) / 7); 133 } else { 134 var element_opacity = 1; 135 } 136 if (element_opacity < 0.6) { 137 var element_opacity = 0.6; 138 } 139 if (element_opacity >= 0 && element_opacity <= 1) { 140 $('#slideshow .image').css({ 141 'opacity': element_opacity 142 }); 143 } 144 145 }); 146 } 147 }, 148 149 transition: function(element) { 150 var incoming_slide_caption = $('.content', element).html(); 151 $('#container').addClass('transitioning'); 152 $('#hero_slideshow_caption').clearQueue().animate({'display': 'block'}, 700, function() { 153 $('#container').removeClass('transitioning'); 154 $(this).animate({'bottom': '-25px'}, 0).html(incoming_slide_caption).animate({'bottom': '45px'}, 800); 155 }); 156 } 157 158 }, 159 160 filters: { 161 162 init: function() { 163 164 $('#records_list_filter .inner').fadeTo(0, 0); 165 $('#filter_menu_button').click(function() { 166 if ($('#records_list_filter').is(':visible')) { 167 $('#records_list_filter').clearQueue().slideUp(); 168 $('#records_list_filter .inner').fadeTo(500, 0); 169 $(this).removeClass('active'); 170 $('.records_list ul li').fadeIn(); 171 $('.records_list_divider').show(); 172 } else { 173 $('#records_list_filter').slideDown(); 174 $('#records_list_filter .inner').fadeTo(500, 1); 175 $(this).addClass('active'); 176 } 177 return false;
178 }); 179 180 $('#records_list_filter ul li a').click(function() { 181 if ($(this).attr('data-id')) { 182 $('#records_list_filter').addClass('active'); 183 $('#records_list_filter ul li a').removeClass('active'); 184 $(this).addClass('active'); 185 window.site.works.close_work($('.records_list')); 186 $('.records_list ul li').hide(); 187 $('.records_list_divider').hide(); 188 $('.records_list ul li[data-related-ids*="[' + $(this).attr('data-id') + ']"]').fadeIn(); 189 } 190 return false; 191 }); 192 193 } 194 195 }, 196 197 works: { 198 199 init: function() { 200 201 $('.records_list').prepend('<div id="list_expander"></div>'); 202 203 window.site.works.setup(); 204 window.galleries.responsive.tile_list_after_init = function() { 205 window.site.works.setup(); 206 }; 207 window.site.works.hash(); 208 209 var id; 210 $(window).resize(function() { 211 clearTimeout(id); 212 id = setTimeout(resize_finished, 500); 213 }); 214 function resize_finished(){ 215 $('.records_list').each(function() { 216 //window.site.works.close_work(this); 217 window.site.works.resize(this); 218 }); 219 } 220 221 }, 222 223 setup: function() { 224 var selectors = '.subsection-works .records_list .tile_list_formatted li a, .subsection-additional-shots .tile_list_formatted .records_list li a, .subsection-installation .tile_list_formatted .records_list li a, .artworks-page-artwork-list-container .records_list li a, .subsection-publications-grid .records_list li a, .subsection-video-grid .records_list li a'; 225 $(selectors) 226 .click(function() { 227 var wrapper = $(this).closest('.records_list'); 228 if (!$(this).hasClass('active')) { 229 if ($(this).attr('data-hash')) { 230 var hash = $(this).attr('data-hash'); 231 } else { 232 var hash = $(this).attr('href') 233 } 234 window.site.works.load_work(wrapper, $(this).attr('href'), hash, true); 235 } 236 return false; 237 }) 238 ; 239 if ($(selectors).length == 1) { 240 $(selectors).each(function() { 241 var wrapper = $(this).closest('.records_list'); 242 window.site.works.load_work(wrapper, $(this).attr('href'), '/', false); 243 $(this).closest('li').hide(); 244 }); 245 } 246 }, 247 248 load_work: function(wrapper, link, hash, animation) { 249 250 $(wrapper).find('li').removeClass('active'); 251 $(wrapper).find('a[href="' + link + '"]').closest('li').addClass('active').addClass('loading'); 252 253 $.ajax({ 254 url: link, 255 data: {'modal': '1'}, 256 cache: false, 257 success: function(data) { 258 $(wrapper).find('#list_expander').css('opacity', '0'); 259 $(wrapper).find('#list_expander').html(''); 260 $(wrapper).find('#list_expander').append(data); 261 window.galleries.contact_form_popup.init(); 262 $("#list_expander #image_container a").fancybox({ 263 'overlayShow': true, 264 'overlayOpacity': 0.7, 265 'overlayColor': '#d9d9d9', 266 'imageScale': 'true', 267 'zoomOpacity': 'true', 268 prevEffect: 'fade', 269 nextEffect: 'fade', 270 closeEffect: 'fade', 271 openEffect: 'fade', 272 helpers : { 273 title: { 274 type: 'inside' 275 } 276 } 277 }); 278 279 $('#list_expander #image_container a').each(function() { 280 $(this).zoom({url: $(this).attr('href'), duration: 220}); 281 }); 282 283 $('#list_expander').waitForImages({ 284 finished: function() { 285 window.setTimeout(function() { 286 $('#content, #content_module, #sidebar', wrapper).each(function() { 287 $(this).attr('id', $(this).attr('id') + '_ajax'); 288 }); 289 290 window.location.hash = hash; 291 window.galleries.contact_form_popup.init(); 292 window.galleries.sharing.init(
292); 293 if (typeof addthis === 'undefined') { } else { 294 addthis.toolbox('#social_sharing_links'); 295 addthis.update('share', 'url', $('#social_sharing_params').attr('data-url')); 296 //addthis.url = $('#social_sharing_params').attr('data-url'); 297 298 } 299 $("#list_expander").fitVids(); 300 301 $('#list_expander #expand_video_button a').click(function() { 302 if ($(this).closest('#content_ajax').hasClass('content-expand')) { 303 $(this).closest('#content_ajax').removeClass('content-expand'); 304 } else { 305 $(this).closest('#list_expander').css('height', 'auto'); 306 $(this).closest('#content_ajax').addClass('content-expand'); 307 } 308 return false 309 }); 310 311 var scroll_offset = $(wrapper).offset().top - $('.header_fixed').height() - 80; 312 if ($(window).width() <= 459) { 313 var scroll_offset = $(wrapper).offset().top - 70; 314 } 315 316 if (animation) { 317 var animation_speed = 500; 318 } else { 319 var animation_speed = 0; 320 } 321 322 $('#list_expander', wrapper).animate({ 323 'height': $('#list_expander #content_ajax', wrapper).outerHeight(true), 324 'opacity': '1' 325 }, animation_speed, function() { 326 327 }); 328 $('#list_expander #content_module_ajax', wrapper).append('<div class="close">Close</div>'); 329 $('#list_expander .close', wrapper).click(function() { 330 window.site.works.close_work(wrapper); 331 }); 332 333 $('html,body').animate( 334 {scrollTop: scroll_offset}, 335 400, 336 'easeInOutQuad' 337 ); 338 339 $(wrapper).find('li').removeClass('loading'); 340 341 }, 50); 342 343 }, 344 waitForAll: true 345 }); 346 } 347 }); 348 }, 349 350 close_work: function(wrapper) { 351 $('#list_expander', wrapper).animate({'height': '0', 'opacity': '0'}, function() { 352 $(this).html(''); 353 }); 354 $(wrapper).find('li').removeClass('active'); 355 }, 356 357 resize: function(wrapper) { 358 $('#list_expander', wrapper).each(function() { 359 var animation_speed = 500; 360 $('#list_expander', wrapper).animate({ 361 'height': $('#list_expander #content_ajax', wrapper).outerHeight(true), 362 'opacity': '1' 363 }, animation_speed, function() { 364 365 }); 366 }); 367 }, 368 369 hash: function() { 370 $(window).bind("load", function() { 371 if (window.location.hash && window.location.hash != '#') { 372 var hash_path = window.location.hash.split('#')[1]; 373 var sections = hash_path.split('/'); 374 var sections = jQuery.grep(sections, function(n){ return (n); }); 375 if (sections.length > 0) { 376 var section = sections[0]; 377 if (section != '') { 378 if ($('.tile_list').length > 0) { 379 var selector = '.tile_list .t
379ile_list_formatted'; 380 } else { 381 var selector = '.records_list'; 382 } 383 $(selector).find('li a[data-hash="' + hash_path + '"]').each(function() { 384 window.site.works.load_work($(this).closest('.records_list'), $(this).attr('href'), window.location.hash, true); 385 }); 386 } 387 } 388 } 389 }); 390 } 391 392 } 393 394 }; 395 396 $(document).ready(function() { 397 398 window.site.init(); 399 400 }); 401 402 403})(jQuery); 404
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.