1/** 2 * sf_public.js 3 * 4 * Includes code for the public pages using sfpublicjsp frame. 5 * 6 */ 7 8jQuery(document).ready(function($) { 9 10 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 11 // AdBlocker Handling - for logout ad 12 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 13 if ($(".logoutContainer").length > 0) { 14 setTimeout(function () { 15 var logoutAd = $(".logoutContainer").find('div[id^="div-gpt-ad-"]'); 16 if (logoutAd.height() < 50) { 17 $(".logoutContainer").show(); 18 $(".cmsSlotContainer").show(); 19 } 20 }, 3000); 21 } 22 // END AdBlocker Handling 23 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 24 25 if (typeof Modernizr !== "undefined") { 26 // MOBILE 27 Modernizr.addTest('mobile', function () { 28 return !!navigator.userAgent.match(/iPad|iPhone/); 29 }); 30 } 31 32 // VIEWPORT 33 var updateViewport = function() { 34 if (window.outerWidth > window.outerHeight) { 35 $("meta[name='viewport']").prop("content", "width=1024, initial-scale=1, maximum-scale=1, user-scalable=no"); 36 } else { 37 $("meta[name='viewport']").prop("content", "width=768, initial-scale=0.75, maximum-scale=0.75, user-scalable=no"); 38 } 39 }; 40 41 updateViewport(); 42 $(window).on('orientationchange, resize', updateViewport); 43 44 // Special GA tracking on federalstate 45 $('.foreign-countries-block ul li a, .feature-classreunion h3 a, .member-index-letter ul li a').on("click", function (event) { 46 event.preventDefault(); 47 var href = $(this).attr("href"); 48 var target = $(this).attr("target"); 49 50 setTimeout(function() { 51 window.open(href,(!target?"_self":target)); 52 },10); 53 }); 54 55}); 56 57 58/* 59 * ****************************************** 60 * Generates a bar of stars for the public 61 * schoolcheck snippet 62 * ****************************************** 63 */ 64function scRatingStars(ratingValue) { 65 66 var greyStar = '<img src="https://images.stayfriends.de/cms1/03c6a1ca.jpg" class="rateStar" alt="">'; 67 var halfStar = '<img src="https://images.stayfriends.de/cms1/03c2430e.jpg" class="rateStar" alt="">'; 68 var fullStar = '<img src="https://images.stayfriends.de/cms1/03c2430f.jpg" class="rateStar" alt="">'; 69 70 if (ratingValue < 0.3) { 71 // bis 0.2 => kein Stern 72 return greyStar + greyStar + greyStar + greyStar + greyStar; 73 } 74 else if (ratingValue < 0.7) { 75 // 0.3 bis 0.6 => 0.5 Stern 76 return halfStar + greyStar + greyStar + greyStar + greyStar; 77 } 78 79 else if (ratingValue < 1.3) { 80 // 0.7 bis 1.2 => 1 Stern 81 return fullStar + greyStar + greyStar + greyStar + greyStar; 82 } 83 84 else if (ratingValue < 1.7) { 85 // 1.3 bis 1.6 => 1.5 Sterne 86 return fullStar + halfStar + greyStar + greyStar + greyStar; 87 } 88 89 else if (ratingValue < 2.3) { 90 // 1.7 bis 2.2 => 2 Sterne 91 return fullStar + fullStar + greyStar + greyStar + greyStar; 92 } 93 94 else if (ratingValue < 2.7) { 95 // 2.3 bis 2.6 => 2.5 Sterne 96 return fullStar + fullStar + halfStar + greyStar + greyStar; 97 } 98 99 else if (ratingValue < 3.3) { 100 //2.7 bis 3.2 => 3 Sterne 101 return fullStar + fullStar + fullStar + greyStar + greyStar; 102 } 103 104 else if (ratingValue < 3.7) { 105 // 3.3 bis 3.6 => 3.5 Sterne 106 return fullStar + fullStar + fullStar + halfStar + greyStar; 107 } 108 109 else if (ratingValue < 4.3) { 110 // 3.7 bis 4.2 => 4 Sterne 111 return fullStar + fullStar + fullStar + fullStar + greyStar; 112 } 113 114 else if (ratingValue < 4.7) { 115 // 4.3 bis 4.6 => 4.5 Sterne 116 return fullStar + fullStar + fullStar + fullStar + halfStar; 117 } 118 119 else if (ratingValue >= 4.7) { 120 // ab 4.7 => 5 Sterne 121 return fullStar + fullStar + fullStar + fullStar + fullStar; 122 } 123} 124 125function empty(str) { 126 if (typeof str === 'undefined' || !str || str.length === 0 || str === "" || !/[^\s]/.test(str) || /^\s*$/.test(str) || str.replace(/\s/g,"") === "") { 127 return true; 128 } 129 else { 130 return false; 131 } 132}
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.