1function find(arr, test, ctx) { 2 var result = null; 3 arr.some(function(el, i) { 4 return test.call(ctx, el, i, arr) ? ((result = el), true) : false; 5 }); 6 return result; 7}; 8 9function browser() { 10 if ( navigator.userAgent.indexOf("Edg") != -1 || navigator.appVersion.indexOf('Edg') > -1 ) { 11 return 'Edge'; 12 } 13 else if( navigator.userAgent.indexOf("Opera") != -1 || navigator.userAgent.indexOf('OPR') != -1 ) 14 { 15 return 'Opera'; 16 } 17 else if( navigator.userAgent.indexOf("Chrome") != -1 ) 18 { 19 return 'Chrome'; 20 } 21 else if( navigator.userAgent.indexOf("Safari") != -1) 22 { 23 return 'Safari'; 24 } 25 else if( navigator.userAgent.indexOf("Firefox") != -1 ) 26 { 27 return 'Firefox'; 28 } 29 else if( ( navigator.userAgent.indexOf("MSIE") != -1 ) || (!!document.documentMode == true ) ) //IF IE > 10 30 { 31 return 'IE'; 32 } 33 else 34 { 35 return 'unknown'; 36 }; 37 38}; 39 40//email obfuscator 41 42$('.obfuscate').click(function(event){ 43 var mail = $(this).children('.mail')[0]; 44 console.log(mail); 45 46 var unobfuscated = mail.firstChild.data.replace(/ +\[at\] +/g, '@'); 47 window.location.href='mailto:' + unobfuscated; 48}); 49 50//image resize 51 52var resizeId; 53 54function resizeFigures() { //TODO 55 //console.log('called: resizeFigures'); 56 $('.columns-2 .figure img').each(function(index) { 57 console.log('natural dimensions (WxH): ' + $(this)[0].naturalWidth + ' x ' + $(this)[0].naturalHeight); 58 var aspectRatio = $(this)[0].naturalWidth / $(this)[0].naturalHeight; 59 console.log('aspect ratio: ' + aspectRatio); 60 console.log('parent height: ' + $(this).parent().height()); 61 62 var parentWidth = $(this).parent().width(); 63 var aspectHeight = parentWidth / aspectRatio; 64 var remFactor = aspectHeight / 14.4; 65 console.log('remFactor: ' + remFactor); 66 var remFactorTrunc = Math.trunc(remFactor); 67 console.log('remFactorTrunc: ' + remFactorTrunc); 68 var remFactorRest =remFactor % 1; 69 console.log('remFactorRest: ' + remFactorRest); 70 71 /*new image dimensions*/ 72 var newHeight = remFactorTrunc * 14.4; 73 var newWidth = newHeight * aspectRatio; 74 console.log('new img height: ' + newHeight); 75 $(this).css('height', newHeight + 'px'); 76 //console.log('new img width: ' + newWidth); 77 $(this).css('width', newWidth + 'px'); 78 79 /*new parent dimensions*/ 80 var headLines = Math.round($(this).next().height() / 14.4); 81 console.log('headLines: ' + headLines); 82 var headLinesOdd = Math.round(headLines) % 2; 83 console.log('headLinesOdd: ' + headLinesOdd); 84 var headLinesRest = 1 - headLines % 1; 85 console.log('headLinesRest: ' + headLinesRest); 86 var parentHeightRest = 1 - ($(this).parent().outerHeight() / 14.4) % 1; 87 console.log('parentHeightRest: ' + parentHeightRest); 88 //var malus = (Math.round(headLines) === 1) ? 0.2 * 16 : 0; 89 //var newMargin = (Math.floor((headLinesRest) + (remFactorTrunc % 2)) + headLinesOdd) * 14.4 - 3.2; 90 91 //var newMargin = (((1 - ($(this).next().outerHeight(true) / 28.8)) % 1) + 1 + parentHeightRest) * 28.8; 92 var malus; 93 console.log('browser: ' + browser()); 94 switch(browser()) { 95 case 'Edge': 96 malus = -7; 97 break; 98 case 'Firefox': 99 malus = -8.2; 100 break; 101 case 'Chrome': 102 malus = -8.2; 103 break; 104 case 'Safari': 105 malus = -13; 106 break; 107 case 'Opera': 108 malus = -6.5; 109 break; 110 default: 111 malus = 0; 112 }; 113 console.log('malus: ' + malus); 114 var newMargin = headLinesRest * 14.4 + malus; 115 console.log('newMargin: ' + newMargin); 116 $(this).parent().css('margin-bottom', newMargin + 'px'); 117 118 /*var newParentMargin = (aspectHeight / 14.4) % 14.4; 119 var headHeight = $(this).next().outerHeight(true); 120 var headLines = Math.ceil($(this).next().height() / 14.4); 121 console.log('head hight: ' + parse.float(headHeight % 28.8));*/ 122 }); 123} 124 125function resizeActions() { 126 resizeFigures(); 127 scrollFunction(); 128} 129 130$(document).ready(function() { 131 console.log('document ready'); 132 clearTimeout(resizeId); 133 resizeId = setTimeout(resizeActions, 500); 134 135 /*rss*/ 136 var url = 'https://de.schott-music.com/shop/feed/composer/rss/ID_PERS/20992/feed.rss'; //Data in XML format 137 $.ajax({ 138 type: 'GET', 139 url: 'rss-feed.html?rss.url=' + url, //"https://api.rss2json.com/v1/api.json?rss_url=" + url For converting default format to JSON format 140 dataType: 'html', //jsonp for making cross domain call 141 success: function(data) { 142 console.log('RSS loaded successfully from: ' + url); 143 $("#rss").html(data); 144 } 145 }); 146}); 147 148$(window).resize(function() { 149 console.log('window resize'); 150 clearTimeout(resizeId); 151 resizeId = setTimeout(resizeActions, 500); 152}); 153 154$(window).scroll(function() { 155 scrollFunction(); 156}); 157 158 159$(function () { 160 $('[data-toggle="tooltip"]').tooltip() 161}); 162 163function scrollFunction() { 164 //Get the button: 165 mybutton = document.getElementById("toTop"); 166 if ($(window).scrollTop() > $('#content').offset().top +20) { 167 mybutton.style.opacity = "0.4"; 168 } else { 169 mybutton.style.opacity = "0"; 170 } 171 if($(window).scrollTop() + $(window).height() < $(document).height() - $('#footer').height() - $('#technical-footer').height()){ 172 $('#toTop').css("position",""); //resetting it 173 $('#toTop').css("bottom",""); //resetting it 174 $('#toTop').css("left", $('#content').offset().left + $('#content').width()); 175} 176else { 177 $('#toTop').css("position","relative"); 178 $('#toTop').css("left", "100%"); 179 $('#toTop').css("bottom", "0.45rem");/*1.35*/ 180 } 181}; 182 183// When the user clicks on the button, scroll to the top of the document
184function topFunction() { 185 //document.body.scrollTop = 0; // For Safari 186 //document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera 187 $('body,html').animate({ 188 scrollTop: $('#content').offset().top 189 }, 800); 190 return false; 191};
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.