1 2 3$(document).ready(function() { 4 5 // Newsletter 6 // Mobile 7 if (/Mobi|Android/i.test(navigator.userAgent)) { 8 if (localStorage.getItem('MCmodal') != 'true') { 9 setTimeout(showNLModal,10*1000); // 10 sec 10 } 11 } 12 13 // Desktop 14 $( 'html' ).mouseleave(function() { 15 if (localStorage.getItem('MCmodal') != 'true') { 16 showNLModal(); 17 } 18 }); 19 20 function showNLModal(a) { 21 $('#MCmodal').foundation({reveal: { 22 close_on_esc: true, 23 close_on_background_click: true 24 }}); 25 $('#MCmodal').foundation('reveal','open'); 26 localStorage.setItem('MCmodal','true'); 27 } 28 29 $('#MCmodal a.close-reveal-modal').on('click', function() { 30 $('#MCmodal').foundation('reveal', 'close'); 31 }); 32 33 // this converts images in the bodycopy to have captions under them 34 $("#bodycopy p img[alt]").each(function() { 35 var $img = $(this); 36 var width = $img.width(); 37 var imgClass = $img.attr('class'); 38 var $div = $("<div />") 39 .attr('class', 'image_caption ' + imgClass) 40 .css('width', width + 'px'); 41 $img.wrap($div).removeClass(imgClass); 42 $div.append($("<small>" + $img.attr('alt') + "</small>")); 43 }); 44 45 $(document).on('opened', '#kpModal[data-reveal]', function () { 46 setTimeout(function() { 47 google.maps.event.trigger(mgmap1, 'resize'); 48 mgmap1.map.setCenter(mgmap1.options.center); 49 }, 350); 50 }); 51 52 $('.gallery').magnificPopup({ 53 type: 'image', 54 gallery:{ 55 enabled:true, 56 preload: [0,2], 57 tCounter: '%curr% / %total%' 58 }, 59 image: { 60 titleSrc: 'info' 61 } 62 }); 63 64// $('.info').hide(); 65// $('.close_box').hide(); 66// $('.secondary').hide(); 67// $('.edit_info').hide(); 68 69 $(document).on('click','.show_info',function(){ 70// $('.arr').toggle(); 71 $('.close_box').toggle(); 72 $('.basic').toggle(); 73 $('.secondary').toggle(); 74 $('.edit_info').toggle(); 75 }); 76 77 // Piilota kaikki info-kentät aluksi 78 $('.arr').hide(); 79 80 // vaihda info-kentän tilaa 81 $(document).on('click','.close_box',function(){ 82 $(this).nextAll('.arr').toggle(); 83 }); 84 $(document).on('click','.show_arr',function(){ 85 $('.arr').toggle(); 86 }); 87 $(document).on('click','.show_all',function(){ 88 $('.fibo_d').show(); 89 $('.storia_d').show(); 90 $('.sisainen_d').show(); 91 $('.collegium_d').show(); 92 $('.collegium_tapahtuma_d').show(); 93 $('.svenska_d').show(); 94 }); 95 $(document).on('click','.show_fibo',function(){ 96 $('.fibo_d').show(); 97 $('.storia_d').hide(); 98 $('.sisainen_d').hide(); 99 $('.collegium_d').hide(); 100 $('.collegium_tapahtuma_d').hide(); 101 $('.svenska_d').hide(); 102 103 }); 104 $(document).on('click','.show_storia',function(){ 105 $('.fibo_d').hide(); 106 $('.storia_d').show(); 107 $('.sisainen_d').hide(); 108 $('.collegium_d').hide(); 109 $('.collegium_tapahtuma_d').hide(); 110 $('.svenska_d').hide(); 111 }); 112 $(document).on('click','.show_sisainen',function(){ 113 $('.fibo_d').hide(); 114 $('.storia_d').hide(); 115 $('.sisainen_d').show(); 116 $('.collegium_d').hide(); 117 $('.collegium_tapahtuma_d').hide(); 118 $('.svenska_d').hide(); 119 }); 120 $(document).on('click','.show_collegium',function(){ 121 $('.fibo_d').hide(); 122 $('.storia_d').hide(); 123 $('.sisainen_d').hide(); 124 $('.collegium_d').show(); 125 $('.collegium_tapahtuma_d').hide(); 126 $('.svenska_d').hide(); 127 }); 128 $(document).on('click','.show_collegium_tapahtuma',function(){ 129 $('.fibo_d').hide(); 130 $('.storia_d').hide(); 131 $('.sisainen_d').hide(); 132 $('.collegium_d').hide(); 133 $('.collegium_tapahtuma_d').show(); 134 $('.svenska_d').hide(); 135 }); 136 137 138 var $sfinput = "<input type='hidden' name='security_field' value='1' />"; 139 $("#CommentForm form").append($sfinput).parent().show(); 140 $("#palauteLomake form").append($sfinput).parent().show(); 141 142 // Default for fibo -user 143 if(document.getElementById('selite') !== null) { 144 if ($('#selite').data('user') == 'fibo' || 145 $('#selite').data('user') == 'fibokeikka') { 146 $('.fibo_d').show(); 147 $('.storia_d').hide(); 148 $('.sisainen_d').hide(); 149 $('.collegium_d').hide(); 150 $('.collegium_tapahtuma_d').hide(); 151 $('.svenska_d').hide(); 152 } 153 } 154 // if($("a>img").length) { 155// Modernizr.load([{ 156// load: ['/fibo2014/wire/modules/Jquery/JqueryMagnific/JqueryMagnific.js', 157// '/fibo2014/wire/modules/Jquery/JqueryMagnific/JqueryMagnific.css'], 158// complete: function () { 159// $("a>img").parent().append("<div class='pop-up'><i 160// class='icon-popup'></i></div>").addClass("magnific"); 161// $(".magnific").magnificPopup({ 162// type: 'image', 163// gallery: { enabled: true }, 164// removalDelay: 300, 165// mainClass: 'popup-slide' 166// }); 167// } 168// }]); 169// } 170 171}); 172
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.