1String.prototype.hashCode = function() { 2 var hash = 0; 3 if (this.length === 0) { 4 return hash; 5 } 6 for (var i = 0; i < this.length; i++) { 7 var char = this.charCodeAt(i); 8 hash = ((hash<<5)-hash)+char; 9 hash = hash & hash; // Convert to 32bit integer 10 } 11 return hash; 12} 13 14addEvent("load", window, initVideo); 15 16 17function initVideo(){ 18 var vidlinks = document.querySelectorAll("img.videoIcon, button.videobutton, a.cmevideo, button.cmevideo"); 19 for(i=0; i<vidlinks.length; i++){ 20 vidlinks[i].title="Video anschauen"; 21 vidlinks[i].dataset.videoId="vid" + vidlinks[i].dataset.videoUrl.hashCode(); 22 addEvent("click", vidlinks[i], showVideo); 23 } 24} 25 26 27function showVideo(e){ 28 var vidid = this.dataset.videoId; 29 if(!_id(vidid)){ 30 var d = document.body.appendChild(document.createElement("div")); 31 d.id = vidid; 32 d.className = "closed filmPop"; 33 var w = parseInt( (this.dataset.videoWidth ? this.dataset.videoWidth : 850), 10); 34 if(w > window.innerWidth) w = window.innerWidth -30 35 var h = parseInt((this.dataset.videoHeight ? this.dataset.videoHeight : 505), 10); 36 if(h > window.innerHeight) h = window.innerHeight -30 37 d.dataset.h = h; 38 d.dataset.w = w; 39 40 d.innerHTML = '<span onclick="hideFilm(\'' + vidid + '\')" class="closeButton">schliessen</span>' 41 + '<iframe data-src="' + this.dataset.videoUrl + '" src="" allow="' + (this.dataset.videoOpts ? this.dataset.videoOpts : "autoplay; encrypted-media") + '"' 42 + (this.dataset.videoFullscreen ? " allowfullscreen " : '') 43 + ' class="youtubeiframe" width="' + w + '" height=' + h + ' frameborder="0"></iframe>'; 44 } 45 setTimeout(function(){runFilm(vidid);},100); 46} 47 48 49 50 51 52window.currentVideoSet=null; 53 54function runFilm(id){ 55 if(window.currentVideoSet && window.currentVideoSet != id){ 56 hideFilm(window.currentVideoSet); 57 window.currentVideoSet=null; 58 } 59 window.currentVideoSet=id; 60 var block = document.getElementById(id); 61 block.className=block.className.replace(/closed/,"open"); 62 block.style.width=block.dataset.w + "px"; 63 block.style.width="100%"; 64 block.style.height=block.dataset.h + "px"; 65 block.style.height="100%"; 66 var player=block.getElementsByTagName("iframe")[0]; 67 var nSrc = player.dataset.src; 68 if(nSrc != player.src) player.src=player.dataset.src; 69} 70 71 72 73function hideFilm(celm){ 74 if(typeof celm === "string") block = document.getElementById(celm); 75 else block = celm.parentNode; 76 block.className=block.className.replace(/open/,"closed"); 77 block.style.width=0; 78 block.style.height=0; 79 80 setTimeout(function(){ 81 block.getElementsByTagName("iframe")[0].src=''; 82 }, 400); 83} 84 85 86 87function toggleMaxWidth(elm, minwid){ 88 if(elm.style.maxWidth == "100%"){ 89 elm.style.maxWidth=minwid + "px"; 90 elm.className = elm.oldClass; 91 } 92 else { 93 elm.style.maxWidth="100%"; 94 elm.oldClass = elm.className; 95 elm.className = ''; 96 } 97}
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.